/* Polycross site: mobile first, light and dark, the app's palette and fonts (self-hosted). */

@font-face {
  font-family: 'Baloo 2';
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/baloo2-800extrabold.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/figtree-400regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/figtree-700bold.woff2') format('woff2');
}

:root {
  /* Brand, from app/src/theme/tokens.ts */
  --navy: #12263f;
  --teal: #17545c;
  --sun: #f4b740;
  --sun-deep: #c98f1f;
  --masc: #2a6fc9;
  --fem: #b8512b;
  --neut: #7a5bd1;
  --band: linear-gradient(160deg, var(--navy) 0%, #143a4f 55%, var(--teal) 100%);
  --on-band: #f2f5f9;
  --on-band-soft: #c9d6e4;

  /* Page */
  --paper: #f2f5f9;
  --surface: #ffffff;
  --ink: #132033;
  --ink-soft: #4b5d73;
  --rule: #d6dee8;
  --link: #1d559e;
  --focus: var(--sun-deep);
  --bezel: #1b2433;

  --display: 'Baloo 2', 'Figtree', system-ui, sans-serif;
  --text: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 20px;
  --wide: 72rem;
  --measure: 40rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1a2b;
    --surface: #132840;
    --ink: #eef3f8;
    --ink-soft: #aab9cb;
    --rule: #233c59;
    --link: #f4b740;
    --focus: var(--sun);
    --bezel: #2b3a50;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 5.5vw, 2.5rem);
}

h3 {
  font-size: 1.3rem;
}

p,
ul,
ol {
  margin: 0.75rem 0 0;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

strong {
  font-weight: 700;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--sun);
  color: var(--navy);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

/* Header bar, shared by every page */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-weight: 700;
  font-size: 0.95rem;
}

.site-nav a {
  color: inherit;
  opacity: 0.8;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--sun);
  text-decoration-thickness: 3px;
}

/* The band: the app's own navy-to-teal background, with a faint crossword grid */

.band {
  position: relative;
  background:
    linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--band);
  color: var(--on-band);
}

.band a:focus-visible {
  outline-color: var(--sun);
}

.hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 4px var(--gutter) 128px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 10.5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  max-width: 11ch;
}

.lead {
  color: var(--on-band-soft);
  font-size: 1.15rem;
  max-width: 30rem;
  margin-top: 16px;
}

.lockup {
  order: -1;
  width: min(46vw, 190px);
  height: auto;
  overflow: visible;
}

.lockup path {
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lockup .accent path {
  stroke-width: 15;
}

/* One orchestrated moment: the tiles drop into the grid, POLY across, then CROSS down. */
@media (prefers-reduced-motion: no-preference) {
  .lockup .tile,
  .lockup .accent {
    animation: drop 560ms cubic-bezier(0.34, 1.45, 0.55, 1) both;
  }

  .lockup .t2 {
    animation-delay: 90ms;
  }
  .lockup .t3 {
    animation-delay: 180ms;
  }
  .lockup .t4 {
    animation-delay: 270ms;
  }
  .lockup .t5 {
    animation-delay: 380ms;
  }
  .lockup .t6 {
    animation-delay: 460ms;
  }
  .lockup .t7 {
    animation-delay: 540ms;
  }
  .lockup .t8 {
    animation-delay: 620ms;
  }
  .lockup .accent {
    animation-delay: 820ms;
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-70px);
  }
  40% {
    opacity: 1;
  }
  to {
    transform: none;
  }
}

/* Store badges */

.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.badge-apple {
  display: block;
  border-radius: 10px;
  line-height: 0;
}

.badge-apple img {
  width: 160px;
  height: 53px;
}

.badge-soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  height: 53px;
  min-width: 160px;
  padding: 0 18px;
  border: 1.5px dashed rgb(242 245 249 / 0.45);
  border-radius: 10px;
  color: var(--on-band-soft);
  line-height: 1.15;
  cursor: not-allowed;
  user-select: none;
}

.badge-soon span {
  font-weight: 700;
}

.badge-soon small {
  font-size: 0.8rem;
}

/* Phones */

main {
  display: block;
}

.shelf {
  margin-top: -104px;
  position: relative;
}

.phones {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0 var(--gutter) 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.phones::-webkit-scrollbar {
  display: none;
}

.phones li {
  flex: 0 0 220px;
  scroll-snap-align: start;
}

.phones figure {
  margin: 0;
}

.phone {
  display: block;
  border: 7px solid var(--bezel);
  border-radius: 38px;
  overflow: hidden;
  background: var(--navy);
  box-shadow:
    0 1px 0 1px rgb(255 255 255 / 0.08) inset,
    0 24px 40px -22px rgb(10 22 38 / 0.55);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
}

.phones figcaption {
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

/* Sections */

.section {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 64px var(--gutter) 0;
}

.section > p,
.section dd,
.faq details {
  max-width: var(--measure);
}

.steps ol {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 28px;
  margin-top: 28px;
  padding: 0;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-content: start;
  column-gap: 16px;
}

.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--sun);
  box-shadow: 0 4px 0 var(--sun-deep);
  color: var(--navy);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
}

.steps p {
  margin-top: 6px;
  color: var(--ink-soft);
}

/* Languages */

.flag-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.languages-intro p {
  max-width: var(--measure);
  color: var(--ink-soft);
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 20px;
  padding: 0;
}

.flags li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 8px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 0 var(--rule);
  font-weight: 700;
}

.flags svg,
.words th svg {
  width: 27px;
  height: 18px;
  border-radius: 4px;
  flex: none;
}

.words {
  margin: 32px 0 0;
  max-width: 34rem;
}

.words table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(1rem, 4.2vw, 1.15rem);
}

.words caption {
  text-align: left;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding-bottom: 8px;
}

.words th,
.words td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.words thead th {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.words tbody th {
  font-weight: 400;
  font-size: 0.95rem;
  white-space: nowrap;
}

.words tbody th svg {
  vertical-align: -3px;
  margin-right: 8px;
}

.words td {
  font-family: var(--display);
  font-weight: 800;
  white-space: nowrap;
}

.words b {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 4px;
  padding: 0 6px;
  border-radius: 6px;
  color: #fff;
  font-family: var(--text);
  font-weight: 700;
  font-size: 0.8em;
  line-height: 1.55;
  text-align: center;
}

.words b.m {
  background: var(--masc);
}

.words b.f {
  background: var(--fem);
}

.words b.n {
  background: var(--neut);
}

.words figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Features */

.features dl {
  display: grid;
  gap: 26px;
  margin: 28px 0 0;
}

.features dt {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.2;
  padding-top: 12px;
  border-top: 4px solid var(--sun);
  width: fit-content;
}

.features div:nth-child(3n + 2) dt {
  border-top-color: var(--masc);
}

.features div:nth-child(3n) dt {
  border-top-color: var(--fem);
}

.features dd {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

/* FAQ */

.faq h2 {
  margin-bottom: 16px;
}

details {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
}

details p {
  margin-top: 8px;
  color: var(--ink-soft);
}

/* Closing call to action */

.finale {
  margin: 72px var(--gutter) 0;
  padding: 40px var(--gutter);
  border-radius: 28px;
  background: var(--band);
  color: var(--on-band);
  text-align: center;
}

.finale h2 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
}

/* Footer */

.site-footer {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 36px var(--gutter) 40px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
}

.site-footer p {
  margin-top: 10px;
}

/* Documents (privacy, support) */

.doc-head .bar {
  max-width: calc(var(--measure) + 2 * var(--gutter));
}

.doc {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 36px var(--gutter) 24px;
}

.doc h1 {
  font-size: clamp(2.2rem, 8vw, 3rem);
}

.doc h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
}

.doc h3 {
  font-size: 1.2rem;
  margin-top: 1.6rem;
}

.doc ul,
.doc ol {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.35rem;
}

.meta {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.summary {
  margin-top: 24px;
  padding: 6px 20px 18px;
  border-radius: 20px;
  background: var(--surface);
  border-top: 6px solid var(--sun);
}

.summary h2 {
  margin-top: 14px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.doc table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px;
  border-bottom: 1px solid var(--rule);
}

.contact {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Wider screens */

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }

  .steps ol {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps li {
    grid-template-columns: 1fr;
  }

  .steps li::before {
    grid-row: auto;
    margin-bottom: 16px;
  }

  .features dl {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 40px;
  }

  .phones {
    justify-content: safe center;
  }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    gap: 48px;
    padding-top: 24px;
    padding-bottom: 168px;
    text-align: left;
  }

  .hero h1 {
    max-width: 12ch;
  }

  .lockup {
    order: 0;
    width: 300px;
    margin-right: 40px;
  }

  .stores {
    justify-content: flex-start;
  }

  .shelf {
    margin-top: -136px;
  }

  .phones {
    gap: 28px;
    overflow: visible;
  }

  .phones li {
    flex-basis: 210px;
  }

  /* A gentle stagger, like letters set into a grid. */
  .phones li:nth-child(even) {
    margin-top: 40px;
  }

  .languages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
  }

  .words {
    margin-top: 8px;
  }

  .features dl {
    grid-template-columns: repeat(3, 1fr);
  }

  .finale {
    max-width: var(--wide);
    margin: 88px auto 0;
    padding: 56px 40px;
  }

  .finale .stores {
    justify-content: center;
  }
}
