/* Name Game website.
   Colors and spacing mirror name-game-app/src/constants/theme.ts.
   --text-muted and --link are adjusted from the app's textSecondary /
   accentSecondary so body text passes WCAG AA on every surface: the app's
   #7A7268 passes on the page background but not on --surface, where the
   steps and cards put secondary text. Amber is a fill only; text and focus
   rings on cream use terracotta or ink. */

/* Gabarito (SIL Open Font License, fonts/OFL.txt) for headings and names.
   The Content-Security-Policy in nginx.conf allows fonts from 'self'. */

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/gabarito-600SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Gabarito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/gabarito-700Bold.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --bg: #FFFCF7;
  --surface: #F5F0E8;
  --surface-strong: #EBE4D8;
  --card: #FFFFFF;
  --text: #2D2A26;
  --text-muted: #6B645B;
  --accent: #E8A838;
  --accent-soft: #FFF3DB;
  --on-accent: #2D2A26;
  --link: #B04E2D;
  --divider: rgba(45, 42, 38, 0.10);
  --shadow: 0 1px 2px rgba(45, 42, 38, 0.06), 0 10px 28px rgba(45, 42, 38, 0.07);
  --selection: rgba(232, 168, 56, 0.35);

  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 64px;

  --radius: 20px;
  --radius-lg: 32px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Gabarito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* A soft neutral charcoal rather than brown-black; the warmth comes from amber and coral. */
    --bg: #232427;
    --surface: #2E3034;
    --surface-strong: #393B40;
    --card: #393B40;
    --text: #F4F2EE;
    --text-muted: #B4B2AD;
    --accent: #F0B848;
    --accent-soft: #34363B;
    --on-accent: #232427;
    --link: #F09A78;
    --divider: rgba(255, 255, 255, 0.10);
    --shadow: none;
    --selection: rgba(240, 184, 72, 0.3);
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  caret-color: var(--link);
  /* Short pages keep the footer at the bottom of the window. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  flex: 1 0 auto;
}

::selection {
  background: var(--selection);
  color: var(--text);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h3 {
  font-weight: 600;
}

p {
  text-wrap: pretty;
}

p,
ul,
ol {
  margin: 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

svg {
  display: block;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: var(--s4);
}

.skip-link {
  position: absolute;
  left: var(--s3);
  top: -100px;
  z-index: 10;
  padding: var(--s2) var(--s3);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: var(--s3);
}

/* Header */

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  padding-block: var(--s3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-decoration: none;
}

.brand svg {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.site-nav {
  display: flex;
  gap: var(--s4);
  font-size: 0.9375rem;
  font-weight: 600;
}

.site-nav a {
  padding-block: 10px;
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.4em;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: var(--s2) 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn--quiet {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--text);
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* Hero */

.hero {
  display: grid;
  gap: var(--s6) var(--s5);
  align-items: center;
  padding-block: var(--s5) var(--s6);
}

.eyebrow {
  margin-bottom: var(--s3);
  color: var(--link);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.375rem, 7vw, 3.875rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34em;
  margin-block: var(--s4) var(--s5);
  color: var(--text-muted);
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
}

.note {
  margin-top: var(--s3);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Head-to-head illustration */

.duel {
  margin: 0;
  padding: var(--s4) var(--s3) var(--s5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.pill {
  display: inline-block;
  padding: var(--s1) 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.duel__ring {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s2);
  max-width: 440px;
  margin: var(--s4) auto 0;
}

.duel__card {
  position: relative;
  padding: var(--s4) var(--s2) var(--s3);
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.duel__card + .duel__vs + .duel__card {
  transform: rotate(2deg);
}

.duel__card--champion {
  border-color: var(--accent);
}

.duel__card svg {
  width: 100%;
  max-width: 140px;
  height: auto;
  margin-inline: auto;
}

.duel__crown {
  position: absolute;
  top: -15px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  margin-left: -17px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
}

.duel__crown svg {
  width: 20px;
}

.duel__name {
  display: inline-block;
  margin-top: var(--s2);
  padding: var(--s1) 14px;
  border-radius: 12px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.duel__vs {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-strong);
  font-size: 0.8125rem;
  font-weight: 800;
}

/* Sections */

.section {
  padding-block: var(--s6);
}

.section h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  letter-spacing: -0.015em;
}

.section__intro {
  max-width: 36em;
  margin-top: var(--s3);
  color: var(--text-muted);
}

.steps {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: var(--s3);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  margin-bottom: var(--s2);
  font-size: 1.25rem;
}

.step p {
  color: var(--text-muted);
}

/* Partner section */

.split {
  display: grid;
  gap: var(--s5);
  align-items: center;
}

.checks {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s4);
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 36px;
}

.checks li::before {
  content: "\2713";
  content: "\2713" / "";
  position: absolute;
  left: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}

.matches {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: var(--s4);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.matches__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.matches__sub {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.matches__list {
  display: grid;
  gap: var(--s2);
  margin-top: var(--s3);
  padding: 0;
  list-style: none;
}

.matches__list li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

.matches__list svg:first-child {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.matches__list svg:last-child {
  width: 22px;
  margin-left: auto;
  fill: #D97B5A;
}

/* Free vs Premium */

.plans {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
}

.plan {
  padding: var(--s5) var(--s4);
  border: 2px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.plan--premium {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.plan h3 {
  font-size: 1.5rem;
}

.plan__kind {
  margin-top: var(--s1);
  color: var(--text-muted);
  font-weight: 600;
}

/* Download band */

.cta {
  display: grid;
  justify-items: center;
  gap: var(--s3);
  margin-block: var(--s5) var(--s6);
  padding: var(--s5) var(--s4) 40px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  text-align: center;
}

.cta svg {
  width: 112px;
  height: 112px;
}

.cta h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  letter-spacing: -0.015em;
}

.cta p {
  color: var(--text-muted);
}

.cta .store-buttons {
  justify-content: center;
  margin-top: var(--s3);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--divider);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: var(--s3);
  padding-block: var(--s5);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
}

.site-footer a {
  color: var(--text);
  font-weight: 600;
}

.fineprint {
  font-size: 0.8125rem;
}

/* Text pages: privacy, terms, support */

.page {
  padding-block: var(--s5) var(--s6);
}

.page h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.02em;
}

.page__head {
  max-width: 68ch;
}

.page > h1 + p {
  max-width: 68ch;
  margin-top: var(--s3);
}

.page__body {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
}

/* Contents of a reading page: a fold on small screens, a sticky list beside
   the text on wide ones. */

.toc {
  font-size: 0.9375rem;
}

.toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 6px 0;
  color: var(--text-muted);
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--link);
  text-decoration: underline;
}

.toc__title {
  margin-bottom: var(--s2);
  font-family: var(--font-display);
  font-weight: 600;
}

.toc--side {
  display: none;
}

.toc--fold {
  border-radius: var(--radius);
  background: var(--surface);
}

.toc--fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: var(--s2) var(--s4);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  list-style: none;
}

.toc--fold summary::-webkit-details-marker {
  display: none;
}

.toc--fold summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.toc--fold[open] summary svg {
  transform: rotate(90deg);
}

.toc--fold ol {
  padding: 0 var(--s4) var(--s3);
}

.prose {
  max-width: 68ch;
  min-width: 0;
}

.page__meta {
  margin-top: var(--s3);
  color: var(--text-muted);
}

.prose > * + * {
  margin-top: var(--s3);
}

.prose h2 {
  margin-top: 48px;
  font-size: 1.5rem;
  scroll-margin-top: var(--s4);
}

.prose > h2:first-child,
.prose > .callout:first-child,
.prose > .contact:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: var(--s5);
  font-size: 1.1875rem;
  letter-spacing: 0;
  scroll-margin-top: var(--s4);
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: var(--s2);
}

.prose li::marker {
  color: var(--link);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.callout {
  margin-top: var(--s5);
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.callout h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.panel {
  margin-top: 48px;
  padding: var(--s4);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card);
}

.panel h2 {
  margin-top: 0;
}

.callout > * + *,
.panel > * + * {
  margin-top: var(--s3);
}

.panel {
  scroll-margin-top: var(--s3);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  margin-top: var(--s5);
  padding: var(--s4);
  border-radius: var(--radius);
  background: var(--surface);
}

.contact p {
  flex: 1 1 240px;
  margin: 0;
}

/* 404 */

.notfound {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--s3);
  padding-block: var(--s6);
  text-align: center;
}

.notfound svg {
  width: 160px;
  height: 160px;
}

.notfound h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.02em;
}

.notfound p {
  max-width: 28em;
  margin-bottom: var(--s3);
  color: var(--text-muted);
}

/* Wider screens */

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .plans {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .fineprint {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1080px) {
  .page__body {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--s6);
  }

  .toc--side {
    display: block;
    position: sticky;
    top: var(--s4);
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }

  .toc--fold {
    display: none;
  }
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding-block: var(--s6) 96px;
  }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: var(--s6);
  }

  .duel {
    padding: var(--s5) var(--s4) 40px;
  }

  .duel__ring {
    gap: var(--s3);
  }
}

/* Small phones */

@media (max-width: 420px) {
  .wrap {
    padding-inline: var(--s3);
  }

  /* Brand and links share one row on a phone. */
  .site-header__inner {
    flex-wrap: nowrap;
    gap: var(--s3);
    padding-block: var(--s2);
  }

  .brand {
    font-size: 1.0625rem;
    white-space: nowrap;
  }

  .brand svg {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .site-nav {
    gap: 14px;
    font-size: 0.875rem;
  }

  .store-buttons .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .toc--fold summary svg {
    transition: none;
  }
}
