/* RapidRebus site: design system and home page.
   Mirrors the app: warm white surfaces, forest-green actions, cream answer
   tiles in Roboto Mono, Inter headings over Open Sans body, gold coins, and
   the illustration palette (blue, gold, brick, sage, ink) for category tints. */

:root {
  --paper: #FBF8F2;
  --surface: #FFFFFF;
  --surface-2: #F5F2EA;
  --cream: #FDF7E4;
  --cream-edge: #F3E9C9;
  --line: #E8E2D5;
  --line-strong: #D9D1C0;

  --ink: #1D2227;
  --text: #2C3E50;
  --muted: #5A6C7D;
  --faint: #8B9AAB;

  --forest: #2D5A3D;
  --forest-hover: #24492F;
  --forest-tint: #EAF2EC;
  --orange: #FF6B35;
  --orange-ink: #C2410C;
  --orange-tint: #FFF1EA;
  --gold: #D4A84B;
  --gold-ink: #8A6516;
  --gold-tint: #FBF3E0;
  --success: #27AE60;
  --success-tint: #E7F6EE;
  --error: #E74C3C;

  --c-blue: #4A7BB5;
  --c-gold: #D4A84B;
  --c-brick: #C45C4A;
  --c-sage: #5A9A6A;
  --c-ink: #2A2A2A;
  --c-pink: #E8A0A8;

  --brand-gradient: linear-gradient(135deg, #2D7A4F 0%, #8A9A3A 50%, #FF6B35 100%);

  --font-display: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Open Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(29, 34, 39, 0.06), 0 2px 8px rgba(29, 34, 39, 0.04);
  --shadow: 0 1px 2px rgba(29, 34, 39, 0.05), 0 14px 34px -14px rgba(29, 34, 39, 0.20);
  --shadow-lg: 0 2px 4px rgba(29, 34, 39, 0.05), 0 36px 72px -28px rgba(29, 34, 39, 0.32);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(72px, 9vw, 128px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121513;
    --surface: #1B1F1C;
    --surface-2: #222723;
    --cream: #2B2A22;
    --cream-edge: #3A3729;
    --line: #2C332E;
    --line-strong: #3A433C;
    --ink: #F3F1EB;
    --text: #DEDBD3;
    --muted: #A6AFA9;
    --faint: #7E8983;
    --forest: #3E8E5A;
    --forest-hover: #4CAF50;
    --forest-tint: #1E2D23;
    --orange-ink: #FF8A5C;
    --orange-tint: #2E201A;
    --gold-ink: #E2BD6B;
    --gold-tint: #2B2618;
    --success-tint: #17301F;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 40px 80px -30px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121513;
  --surface: #1B1F1C;
  --surface-2: #222723;
  --cream: #2B2A22;
  --cream-edge: #3A3729;
  --line: #2C332E;
  --line-strong: #3A433C;
  --ink: #F3F1EB;
  --text: #DEDBD3;
  --muted: #A6AFA9;
  --faint: #7E8983;
  --forest: #3E8E5A;
  --forest-hover: #4CAF50;
  --forest-tint: #1E2D23;
  --orange-ink: #FF8A5C;
  --orange-tint: #2E201A;
  --gold-ink: #E2BD6B;
  --gold-tint: #2B2618;
  --success-tint: #17301F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 40px 80px -30px rgba(0, 0, 0, 0.85);
  color-scheme: dark;
}

/* ------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
::selection { background: var(--forest); color: #fff; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-xs);
  font-family: var(--font-display); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--forest);
}
:root[data-theme="dark"] .eyebrow { color: #7BC793; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #7BC793; } }

.section-head { max-width: 680px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 {
  margin-top: 12px;
  font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em;
}
.section-head p { margin-top: 16px; font-size: clamp(17px, 1.4vw, 19px); color: var(--muted); }

/* ---------------------------------------------------------- buttons */

.btn {
  --btn-bg: var(--forest); --btn-fg: #fff; --btn-edge: var(--forest-hover);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), var(--shadow-sm);
  transition: transform 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:hover { background: var(--forest-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--ghost {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.store-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.store-badges a {
  display: block; border-radius: 10px; transition: transform 160ms var(--ease);
}
.store-badges a:hover { transform: translateY(-2px); }
.store-badges img { height: 48px; width: auto; }

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; color: var(--ink);
}
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 12px; border-radius: var(--r-pill); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted);
  transition: color 160ms, background 160ms;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-header .btn { margin-left: 8px; }
@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header .btn { margin-left: auto; }
}

/* --------------------------------------------------------------- hero */

.hero { position: relative; padding-block: clamp(40px, 6vw, 88px) clamp(56px, 8vw, 112px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 50% 45% at 78% 28%, rgba(255, 107, 53, 0.11), transparent 70%),
    radial-gradient(ellipse 45% 50% at 62% 78%, rgba(45, 90, 61, 0.10), transparent 70%);
}
.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero__copy { max-width: 600px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px;
  border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--muted);
}
.pill__dot {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold-tint); color: var(--gold-ink); font-size: 12px;
}
.hero h1 {
  margin-top: 22px;
  font-size: clamp(46px, 6.2vw, 84px); line-height: 0.98; font-weight: 800; letter-spacing: -0.045em;
}
.hero h1 .line { display: block; }
.mark {
  position: relative; white-space: nowrap; color: var(--ink);
  background: linear-gradient(transparent 62%, rgba(255, 107, 53, 0.32) 62%, rgba(255, 107, 53, 0.32) 92%, transparent 92%);
  padding-inline: 0.04em;
}
.hero__lede { margin-top: 24px; font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 520px; }
.hero__actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero__facts {
  margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--muted);
}
.hero__facts li { display: inline-flex; align-items: center; gap: 7px; }
.hero__facts svg { width: 16px; height: 16px; color: var(--success); }

.hero__stage { position: relative; min-height: 600px; display: grid; place-items: center; }
.phone.hero__phone { position: absolute; right: 0; top: 50%; transform: translateY(-50%) rotate(3deg); width: 280px; }
.hero__stage .play-card {
  position: relative; z-index: 2; width: min(100%, 400px); margin-right: 150px;
  transform: rotate(-1.5deg);
}
@media (max-width: 1060px) {
  .phone.hero__phone { width: 240px; }
  .hero__stage .play-card { margin-right: 110px; }
}
@media (max-width: 920px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { max-width: none; }
  .hero__stage { min-height: 0; }
  .phone.hero__phone { display: none; }
  .hero__stage .play-card { margin-right: 0; transform: none; width: min(100%, 460px); }
}

/* ------------------------------------------------------------- phone */

.phone {
  position: relative; aspect-ratio: 720 / 1564; padding: 9px;
  border-radius: 46px; background: #0E0F10;
  box-shadow: 0 0 0 1.5px #3A3D40, var(--shadow-lg);
}
.phone::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06); pointer-events: none;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 38px; background: #fff; }

/* -------------------------------------------------------- play card */

.play-card {
  background: var(--surface); border-radius: var(--r-lg); padding: 18px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg);
}
.play-card__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: var(--r-pill);
  background: var(--surface-2); font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--ink);
}
.chip__glyph {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px;
}
.clock {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums;
}
.clock svg { width: 16px; height: 16px; }
.play-card__art {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 1;
  background: #F6F3EC; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.play-card__art img { width: 100%; height: 100%; object-fit: cover; }
.play-card__art::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 3px transparent; transition: box-shadow 300ms var(--ease);
}
.play-card.is-solved .play-card__art::after { box-shadow: inset 0 0 0 3px var(--success); }

.tiles {
  position: relative; margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 18px; cursor: text;
}
.tiles__word { display: flex; gap: 6px; }
.tile {
  --t: clamp(30px, 8.6vw, 40px);
  width: var(--t); height: calc(var(--t) * 1.12); border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: calc(var(--t) * 0.52); color: var(--ink);
  background: linear-gradient(var(--surface-2) 0 52%, #E7ECE6 52% 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), inset 0 0 0 1px var(--line);
  transition: background 160ms, box-shadow 160ms, transform 160ms var(--ease);
}
:root[data-theme="dark"] .tile { background: linear-gradient(var(--surface-2) 0 52%, #262B27 52% 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile { background: linear-gradient(var(--surface-2) 0 52%, #262B27 52% 100%); } }
.tile.is-filled { background: linear-gradient(var(--surface) 0 52%, var(--cream) 52% 100%); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), inset 0 0 0 1px var(--cream-edge); }
.tile.is-active { box-shadow: inset 0 0 0 2.5px var(--forest); }
.play-card.is-solved .tile {
  background: var(--success); color: #fff; box-shadow: none;
  animation: tile-pop 420ms var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
}
.play-card.is-wrong .tiles { animation: shake 360ms var(--ease); }
@keyframes tile-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14) translateY(-3px); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.tiles__input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0;
  font-size: 16px; color: transparent; background: transparent; caret-color: transparent; cursor: text;
}

.play-card__actions { margin-top: 16px; display: flex; gap: 10px; }
.play-card__actions .btn { flex: 1; }
.play-card__note {
  margin-top: 12px; min-height: 24px; text-align: center;
  font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--muted);
}
.play-card__note strong { color: var(--ink); }
.play-card__note.is-good { color: var(--success); }
.play-card__note.is-bad { color: var(--error); }
.play-card__hint {
  margin-top: 10px; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--gold-tint); color: var(--gold-ink); font-size: 15px; display: flex; gap: 10px; align-items: flex-start;
}
.play-card__hint[hidden] { display: none; }
.play-card__done { margin-top: 14px; display: grid; gap: 10px; }
.play-card__done[hidden] { display: none; }

/* ----------------------------------------------------------- facts */

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line);
}
.fact { background: var(--surface); padding: 24px 22px; }
.fact__value { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; color: var(--ink); }
.fact__label { margin-top: 4px; font-size: 15px; color: var(--muted); }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --------------------------------------------------------- grammar */

.grammar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grammar-card {
  background: var(--surface); border-radius: var(--r); padding: 14px 14px 22px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}
.grammar-card img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.grammar-card__step {
  margin: 18px 8px 0; font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-ink);
}
.grammar-card h3 { margin: 6px 8px 0; font-size: 22px; font-weight: 750; }
.grammar-card p { margin: 8px 8px 0; color: var(--muted); font-size: 16px; }
.answer-line { margin: 16px 8px 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.answer-line .tiles__word { gap: 4px; }
.answer-line .tile { --t: 28px; border-radius: 7px; background: var(--success-tint); box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.25); color: var(--ink); }
@media (max-width: 900px) { .grammar { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; } }

/* --------------------------------------------------------- warm-up */

.warmup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.warmup .play-card { box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.warmup .tile { --t: clamp(28px, 2.6vw, 34px); }
.difficulty { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.difficulty--1 { color: var(--success); }
.difficulty--2 { color: var(--gold-ink); }
.difficulty--3 { color: var(--orange-ink); }
@media (max-width: 1000px) { .warmup { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }

/* ---------------------------------------------------------- split */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.split--flip > :first-child { order: 2; }
.split h2 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; }
.split p.lede { margin-top: 16px; font-size: clamp(17px, 1.4vw, 19px); color: var(--muted); }
@media (max-width: 920px) {
  .split { grid-template-columns: 1fr; }
  .split--flip > :first-child { order: 0; }
}

.ticks { margin-top: 28px; display: grid; gap: 16px; }
.ticks li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.ticks__icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--forest-tint); color: var(--forest);
}
:root[data-theme="dark"] .ticks__icon { color: #7BC793; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ticks__icon { color: #7BC793; } }
.ticks__icon svg { width: 19px; height: 19px; }
.ticks strong { display: block; font-family: var(--font-display); color: var(--ink); font-size: 17px; }
.ticks span { color: var(--muted); font-size: 16px; }

/* daily visual */
.daily-visual { position: relative; display: grid; place-items: center; min-height: 560px; }
.daily-visual .phone { width: 270px; transform: rotate(-2deg); }
.share-bubble {
  position: absolute; left: 0; bottom: 48px; z-index: 2; width: min(330px, 88%);
  background: var(--surface); border-radius: 22px 22px 22px 6px; padding: 16px 18px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg);
  font-family: var(--font-display); font-size: 15px; color: var(--ink); transform: rotate(1.5deg);
}
.share-bubble__title { font-weight: 700; }
.share-grid { margin: 10px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.share-grid span { display: flex; gap: 3px; }
.share-grid i { width: 20px; height: 20px; border-radius: 4px; background: var(--success); display: block; }
.share-bubble__meta { color: var(--muted); font-family: var(--font-mono); font-size: 14px; }
.share-bubble__link { margin-top: 4px; color: var(--forest); font-size: 14px; word-break: break-all; }
:root[data-theme="dark"] .share-bubble__link { color: #7BC793; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .share-bubble__link { color: #7BC793; } }
@media (max-width: 920px) {
  .daily-visual { min-height: 0; padding-bottom: 120px; }
  .share-bubble { left: 50%; bottom: 0; transform: translateX(-50%) rotate(1deg); }
}

/* ---------------------------------------------------------- friends */

.friends { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.friend-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 36px);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  display: flex; flex-direction: column;
}
.friend-card--duel { background: linear-gradient(180deg, var(--orange-tint), var(--surface) 70%); }
.friend-card--race { background: linear-gradient(180deg, var(--forest-tint), var(--surface) 70%); }
.friend-card h3 { margin-top: 12px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -0.025em; }
.friend-card p { margin-top: 10px; color: var(--muted); }
.friend-card__visual { margin-top: 28px; display: grid; gap: 10px; }
.notif {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  backdrop-filter: blur(8px);
}
.notif img { width: 40px; height: 40px; border-radius: 10px; }
.notif__app { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.notif__title { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.3; }
.notif__body { font-size: 14px; color: var(--muted); line-height: 1.4; }
.notif__time { font-size: 12px; color: var(--faint); font-family: var(--font-display); }
.notif--muted { opacity: 0.72; transform: scale(0.97); }
.board { border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); padding: 8px; }
.board__row {
  display: grid; grid-template-columns: 28px 34px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 10px; border-radius: 12px; font-family: var(--font-display);
}
.board__row + .board__row { margin-top: 2px; }
.board__row--you { background: var(--forest-tint); }
.board__rank { font-weight: 800; color: var(--faint); text-align: center; }
.board__row:first-child .board__rank { color: var(--gold); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.board__name { font-weight: 650; color: var(--ink); }
.board__score { font-family: var(--font-mono); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.room-code {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
  padding: 10px 14px; border-radius: 14px; background: var(--surface-2);
  font-family: var(--font-display); font-size: 14px; color: var(--muted);
}
.room-code b { font-family: var(--font-mono); font-size: 18px; letter-spacing: 0.18em; color: var(--ink); }
@media (max-width: 920px) { .friends { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- library */

.library { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.cat {
  --tint: var(--c-blue);
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 14px;
  border-radius: var(--r); text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--tint) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 22%, var(--line));
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.cat:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 40%, var(--line)), var(--shadow); }
.cat img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; width: 100%; background: #F6F3EC; }
.cat__name { padding-inline: 4px; font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.25; }
.cat__count { padding-inline: 4px; margin-top: -8px; font-size: 13px; color: var(--muted); }
.cat--blue { --tint: var(--c-blue); }
.cat--gold { --tint: var(--c-gold); }
.cat--brick { --tint: var(--c-brick); }
.cat--sage { --tint: var(--c-sage); }
.cat--ink { --tint: #6B6B6B; }
.cat--pink { --tint: #D9808A; }
@media (max-width: 1080px) { .library { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 820px) { .library { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .library { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------------------------------------------------------- screens */

.screens {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px);
  align-items: start; max-width: 980px; margin-inline: auto;
}
.screen { text-align: center; }
.screen:nth-child(2) { margin-top: 48px; }
.screen .phone { width: min(100%, 290px); margin-inline: auto; }
.screen figcaption { margin-top: 22px; }
.screen figcaption strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.screen figcaption span { color: var(--muted); font-size: 15px; }
@media (max-width: 820px) {
  .screens {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px;
    padding: 4px var(--gutter) 24px; margin-inline: calc(-1 * var(--gutter)); max-width: none;
    scrollbar-width: none;
  }
  .screens::-webkit-scrollbar { display: none; }
  .screen { flex: 0 0 72%; scroll-snap-align: center; }
  .screen:nth-child(2) { margin-top: 0; }
}

/* -------------------------------------------------------------- faq */

.faq { max-width: 780px; margin-inline: auto; display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 200ms var(--ease);
}
.faq details[open] { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform 200ms var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq details p { padding: 0 22px 22px; color: var(--muted); }

/* -------------------------------------------------------------- cta */

.cta {
  position: relative; overflow: hidden; border-radius: 36px;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 6vw, 72px);
  background: #1F3F2B; color: #F3EFE4;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 40px; align-items: center;
}
.cta::before {
  content: ""; position: absolute; inset: auto -120px -160px auto; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 107, 53, 0.35), transparent);
}
.cta h2 { color: #fff; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.04; font-weight: 800; letter-spacing: -0.035em; }
.cta p { margin-top: 16px; color: rgba(243, 239, 228, 0.78); font-size: 18px; max-width: 520px; }
.cta .store-badges { margin-top: 28px; position: relative; z-index: 1; }
.scan-link { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; margin-top: 14px; color: var(--forest); font-size: 14px; font-weight: 600; text-underline-offset: 4px; }
.download-qr { position: relative; z-index: 1; justify-self: center; text-align: center; }
.download-qr__eyebrow { display: block; margin-bottom: 18px; color: #E4D2A6; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.download-qr__code { display: block; width: 246px; padding: 12px; margin-inline: auto; background: #fff; border-radius: 24px; box-shadow: 0 18px 40px -16px #0D231B; }
.download-qr__code img { display: block; width: 100%; height: auto; }
.download-qr h3 { color: #fff; font-size: 21px; margin-top: 22px; }
@media (max-width: 860px) {
  .cta { grid-template-columns: 1fr; }
  .download-qr { width: 100%; border-top: 1px solid #ffffff26; padding-top: 32px; }
}
.download-page { min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; }
.download-page__card { max-width: 540px; padding: clamp(24px, 6vw, 48px); border: 1px solid var(--line); border-radius: 28px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.download-page__card > img { margin: 0 auto 24px; border-radius: 20px; }
.download-page h1 { font-size: clamp(28px, 6vw, 38px); line-height: 1.15; }
.download-page p { margin-top: 16px; color: var(--muted); }
.download-page .store-badges { justify-content: center; margin-top: 28px; }
.download-page__home { display: inline-block; margin-top: 28px; color: var(--forest); text-underline-offset: 4px; }

/* ----------------------------------------------------------- footer */

.site-footer { padding-block: 56px 40px; border-top: 1px solid var(--line); margin-top: var(--section); }
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.site-footer__brand p { margin-top: 12px; color: var(--muted); font-size: 15px; max-width: 300px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 40px; }
.footer-links h4 { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.footer-links ul { margin-top: 12px; display: grid; gap: 8px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--ink); }
.site-footer__legal { margin-top: 40px; color: var(--faint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ------------------------------------------------------------ motion */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .play-card.is-solved .tile, .play-card.is-wrong .tiles { animation: none; }
  .btn, .cat, .store-badges a { transition: none; }
}

/* ----------------------------------------------------------- prose */

.prose { max-width: 760px; margin-inline: auto; padding-block: clamp(40px, 6vw, 80px); }
.prose h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.prose h2 { margin-top: 44px; font-size: 26px; font-weight: 750; }
.prose h3 { margin-top: 28px; font-size: 20px; font-weight: 700; }
.prose p, .prose li { margin-top: 12px; color: var(--text); }
.prose ul { list-style: disc; padding-left: 22px; }
.prose ol { list-style: decimal; padding-left: 22px; }
.prose a { color: var(--forest); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose .muted { color: var(--muted); }

/* privacy and other legal pages */
.privacy .lede { font-size: 19px; color: var(--muted); }
.privacy .last-updated { margin-top: 24px; display: inline-block; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 14px; color: var(--muted); }
.privacy-section { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line); }
.privacy-section h2 { margin-top: 24px; }
.privacy-section h4 { margin-top: 20px; font-size: 17px; }
.privacy-highlight, .privacy-contact {
  margin-top: 20px; padding: 18px 20px; border-radius: var(--r); background: var(--forest-tint);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--forest) 20%, transparent);
}
.privacy-highlight p:first-child, .privacy-contact p:first-child { margin-top: 0; }
