/* QuizFire · quizfire.app
   Paper, ink, ember. One page. No framework. */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/poppins-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-variable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --paper: #FFF9F1;
  --paper-deep: #FFE6C7;
  --raised: rgba(255, 255, 255, 0.86);
  --ink: #262D35;
  --ink-rgb: 38, 45, 53;
  --ink-muted: rgba(38, 45, 53, 0.72);
  --hair: rgba(38, 45, 53, 0.16);
  --hair-strong: rgba(38, 45, 53, 0.32);
  --ember: #FC6B07;
  --ember-deep: #D95F00;
  --ember-soft: rgba(252, 107, 7, 0.12);
  --correct: #1E9E6A;
  --wrong: #E5484D;
  --gold: #FDB23E;
  --rival: #238C86;
  --on-fill: #FFF9F1;
  --bezel: #262D35;
  --shadow: 0 30px 60px -30px rgba(120, 70, 20, 0.35), 0 10px 24px -14px rgba(120, 70, 20, 0.25);
  --grain-opacity: 0.5;

  /* The app's palette (app/flutter/lib/design/tokens.dart), used inside the phone only. */
  --app-paper: #FFF9F1;
  --app-raised: rgba(255, 255, 255, 0.86);
  --app-ink: #262D35;
  --app-ink-muted: rgba(38, 45, 53, 0.62);
  --app-hair: rgba(38, 45, 53, 0.16);
  --app-correct: #1E9E6A;
  --app-wrong: #E5484D;
  --app-ember-deep: #D95F00;
  --app-accent: #EADCC6;            /* History category tint (topics.json accent) */
  --you: #1896AE;                   /* avatar a03's duel colour (avatars/manifest.json) */
  --you-tint: #FBE1D4;              /* avatar a03's paper tint */
  --kofi: #238C86;                  /* rivals.json */

  --font-display: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-1: 0.75rem;
  --t0: 0.875rem;
  --t1: 1.0625rem;
  --t2: 1.3125rem;
  --t3: 1.75rem;
  --t4: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
  --t-display: clamp(3rem, 1.6rem + 7.2vw, 7.25rem);

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 62ch;
  --radius: 14px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1F26;
    --paper-deep: #13161B;
    --raised: #1E242C;
    --ink: #F7F5F2;
    --ink-rgb: 247, 245, 242;
    --ink-muted: rgba(247, 245, 242, 0.66);
    --hair: rgba(253, 178, 62, 0.26);
    --hair-strong: rgba(253, 178, 62, 0.45);
    --ember-deep: #FDB23E;
    --ember-soft: rgba(252, 107, 7, 0.18);
    --correct: #3FD69B;
    --wrong: #FF5A52;
    --rival: #5CC4BD;
    --on-fill: #13161B;
    --bezel: #2B333C;
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), 0 10px 24px -14px rgba(0, 0, 0, 0.5);
    --grain-opacity: 0.25;

    --app-paper: #1C2128;
    --app-raised: #1E242C;
    --app-ink: #F7F5F2;
    --app-ink-muted: rgba(247, 245, 242, 0.60);
    --app-hair: rgba(253, 178, 62, 0.26);
    --app-correct: #3FD69B;
    --app-wrong: #FF5A52;
    --app-ember-deep: #FDB23E;
    --app-accent: #3A3128;          /* History accentDark */
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--t1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain: a single tiny SVG noise tile, fixed behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--hair-strong); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--ember); }
h1, h2, h3, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute; top: -100px; left: var(--gutter);
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 8px; z-index: 50;
  font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t-display);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.display--small { font-size: var(--t4); line-height: 1; letter-spacing: -0.03em; }
.ember { color: var(--ember); }

.eyebrow {
  font-size: var(--t-1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lede {
  font-size: var(--t2);
  line-height: 1.45;
  max-width: 34ch;
  color: var(--ink);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--t4);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.section-lede {
  font-size: var(--t1);
  color: var(--ink-muted);
  max-width: 48ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--spring), background-color 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--ember);
  color: #262D35;
}
.btn--primary:hover { background: #FF7A1F; }
.btn--ghost {
  background: transparent;
  border-color: var(--hair-strong);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn__arrow { font-family: var(--font-body); font-weight: 600; opacity: 0.7; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem var(--gutter) 0;
  max-width: 1320px; margin: 0 auto;
}
.top__brand img { width: 128px; height: auto; }
.top__nav { display: flex; align-items: center; gap: 1.5rem; font-size: var(--t0); font-weight: 600; }
.top__nav a { text-decoration: none; color: var(--ink-muted); }
.top__nav a:hover { color: var(--ink); }
.top__cta {
  color: var(--ink) !important;
  border-bottom: 2px solid var(--ember);
  padding-bottom: 2px;
}
@media (max-width: 599px) {
  .top__nav a:not(.top__cta) { display: none; }
}

/* ---------- Layout ---------- */
main { display: block; }
section { padding-inline: var(--gutter); }
.hero, .pillars, .channel, .android, .waitlist__inner, .screens { max-width: 1320px; margin-inline: auto; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  gap: 2rem;
  padding-block: clamp(1.5rem, 4vh, 4rem) clamp(3rem, 8vh, 6rem);
  align-items: center;
}
.hero__head { display: grid; gap: 1.1rem; }
.hero__head .display { max-width: 9ch; }
.hero__more { display: grid; gap: 1.25rem; }
.hero__promise {
  font-size: var(--t0);
  font-weight: 600;
  color: var(--ink-muted);
  max-width: 40ch;
  padding-left: 0.9rem;
  border-left: 2px solid var(--ember);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; }
.hero__demo { margin: 0; display: grid; gap: 1rem; justify-items: center; }
.hero__hint { font-size: var(--t0); color: var(--ink-muted); text-align: center; max-width: 30ch; }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-areas: "head demo" "more demo";
    grid-template-rows: auto auto;
    align-content: center;
    min-height: calc(100vh - 6rem);
    gap: 2.25rem 3rem;
  }
  .hero__head { grid-area: head; align-self: end; }
  .hero__more { grid-area: more; align-self: start; }
  .hero__demo { grid-area: demo; justify-items: end; align-self: center; padding-right: clamp(0px, 3vw, 3rem); }
  .hero__hint { text-align: right; }
}

/* =========================================================
   Phone + duel. A 1:1 copy of the app's DuelView.
   --u is one app logical pixel: the app lays out at 390 wide,
   the phone screen here is 390 * --u wide. Every size below is
   the app's value multiplied by --u, so the proportions hold.
   ========================================================= */
.phone {
  --u: 0.846px;                       /* 330 px screen */
  width: calc(390 * var(--u) + 20px);
  background: var(--bezel);
  border-radius: 44px;
  padding: 10px;
  box-shadow: var(--shadow);
  position: relative;
  max-width: 100%;
}
@media (min-width: 1200px) {
  .phone { --u: 0.9px; }              /* 351 px screen */
}
.phone__screen {
  width: calc(390 * var(--u));
  height: calc(800 * var(--u));
  max-width: 100%;
  background: var(--app-paper);
  color: var(--app-ink);
  border-radius: 34px;
  overflow: hidden;
  position: relative;
}
.phone__screen::before { /* screen grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.6; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.duel {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

/* Header strip: category tint, MatchHeaderRow, score row, momentum, pips */
.duel__strip {
  background: var(--app-accent);
  padding: 0 calc(20 * var(--u)) calc(16 * var(--u));
  display: grid;
  gap: 0;
}
.duel__bar {
  height: calc(44 * var(--u));
  display: grid;
  grid-template-columns: calc(40 * var(--u)) 1fr calc(40 * var(--u));
  align-items: center;
  margin-bottom: calc(4 * var(--u));
}
.duel__close {
  position: relative;
  width: calc(20 * var(--u)); height: calc(20 * var(--u));
  justify-self: start;
}
.duel__close::before, .duel__close::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: calc(14 * var(--u)); height: calc(2 * var(--u));
  background: var(--app-ink-muted); border-radius: 1px;
}
.duel__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.duel__close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.duel__caption {
  grid-column: 2;
  text-align: center;
  font-size: calc(12 * var(--u)); line-height: 1.3; font-weight: 500;
  color: var(--app-ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.score {
  display: flex; align-items: center; justify-content: space-between;
}
.score__side { display: flex; align-items: center; gap: calc(6 * var(--u)); min-width: 0; }
.score__name {
  font-size: calc(15 * var(--u)); line-height: 1.35; font-weight: 600;
  white-space: nowrap;
}
.score__name--you { color: var(--you); }
.score__name--rival { color: var(--kofi); }
.score__num {
  font-family: var(--font-display); font-weight: 800;
  font-size: calc(20 * var(--u)); line-height: 1.1; letter-spacing: calc(-0.2 * var(--u));
  font-variant-numeric: tabular-nums;
  color: var(--app-ink);
}

/* PresenceAvatar: 32 px avatar, 2 px ring 2 px out, check badge bottom-right */
.presence {
  --pc: var(--you);
  position: relative;
  width: calc(40 * var(--u)); height: calc(40 * var(--u));
  flex: none;
}
.presence--rival { --pc: var(--kofi); }
.presence__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: calc(2 * var(--u)) solid var(--pc);
  opacity: 0;
  transition: opacity 0.18s, border-color 0.18s;
}
.presence.is-thinking .presence__ring { opacity: 0.5; animation: breathe 1.6s ease-in-out infinite alternate; }
.presence.is-answered .presence__ring { opacity: 1; animation: none; }
.presence.is-correct .presence__ring { opacity: 1; animation: verdict-correct 0.6s ease-in both; }
.presence.is-wrong .presence__ring { opacity: 1; animation: verdict-wrong 0.6s ease-in both; }
@keyframes breathe { from { opacity: 0.25; } to { opacity: 0.70; } }
@keyframes verdict-correct { from { border-color: var(--app-correct); } to { border-color: var(--pc); } }
@keyframes verdict-wrong { from { border-color: var(--app-wrong); } to { border-color: var(--pc); } }
.presence__img {
  position: absolute; left: calc(4 * var(--u)); top: calc(4 * var(--u));
  width: calc(32 * var(--u)); height: calc(32 * var(--u));
  border-radius: 50%;
  background: var(--you-tint);
  object-fit: cover;
}
.presence--rival .presence__img { background: var(--kofi); }
.presence__check {
  position: absolute; right: calc(-1 * var(--u)); bottom: calc(-1 * var(--u));
  width: calc(14 * var(--u)); height: calc(14 * var(--u));
  border-radius: 50%;
  background: var(--pc);
  border: calc(1.5 * var(--u)) solid var(--app-paper);
  transform: scale(0);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.presence__check::after { /* the check mark */
  content: ""; position: absolute;
  left: 50%; top: 45%;
  width: calc(3.5 * var(--u)); height: calc(6.5 * var(--u));
  border: solid var(--app-paper); border-width: 0 calc(1.6 * var(--u)) calc(1.6 * var(--u)) 0;
  transform: translate(-50%, -55%) rotate(45deg);
}
.presence.is-answered .presence__check, .presence.is-correct .presence__check, .presence.is-wrong .presence__check { transform: scale(1); }

/* MomentumBar: player colour from the left, rival's from the right, a paper notch at the split */
.momentum {
  position: relative;
  margin-top: calc(12 * var(--u));
  height: calc(8 * var(--u)); border-radius: calc(4 * var(--u));
  background: var(--kofi);
  overflow: hidden;
}
.momentum__split {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 50%;
  background: var(--you);
  border-right: 2px solid var(--app-paper);
  transition: width 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* RoundPips: 10 px, gap 10 */
.pips {
  display: flex; justify-content: center; gap: calc(10 * var(--u));
  margin-top: calc(12 * var(--u));
}
.pip {
  width: calc(10 * var(--u)); height: calc(10 * var(--u));
  border-radius: 50%;
  border: calc(1.5 * var(--u)) solid var(--app-hair);
  transition: background-color 0.3s, border-color 0.3s;
}
.pip.is-current { border: calc(2 * var(--u)) solid var(--ember); }
.pip.is-correct { background: var(--app-correct); border-color: var(--app-correct); }
.pip.is-wrong { background: var(--app-wrong); border-color: var(--app-wrong); }

.duel__hairline { height: 1px; background: var(--app-hair); }

/* The round body: question on the paper, then two rows of tiles */
.duel__body {
  min-height: 0;
  padding: 0 calc(20 * var(--u));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
.duel__body.is-leaving { transform: translateX(calc(-31 * var(--u))); opacity: 0; }
.duel__body.is-entering { transform: translateX(calc(31 * var(--u))); opacity: 0; transition: none; }
.duel__qwrap {
  display: flex; align-items: center;
  padding: calc(24 * var(--u)) 0 calc(16 * var(--u));
  min-height: 0; overflow: hidden;
}
.duel__q {
  font-family: var(--font-body);
  font-size: calc(21 * var(--u)); line-height: 1.3; font-weight: 600;
  letter-spacing: calc(-0.2 * var(--u));
  color: var(--app-ink);
}

.tiles {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: calc(12 * var(--u));
  padding-bottom: calc(24 * var(--u));
}
.tile__wrap { position: relative; display: grid; }
/* RevealFx bloom: a flat ink disc in the player's colour at 12%, spreading from the tile's centre */
.tile__wrap::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: calc(100% + 48 * var(--u)); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--you);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35);
  pointer-events: none;
}
.tile__wrap.is-bloom::before { animation: bloom 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes bloom {
  from { opacity: 0.12; transform: translate(-50%, -50%) scale(0.35); }
  to   { opacity: 0;    transform: translate(-50%, -50%) scale(1); }
}
.tile__wrap.is-shake .tile { animation: shake 0.12s linear both; }
@keyframes shake {
  0% { transform: translateX(0); } 25% { transform: translateX(2px); } 50% { transform: translateX(0); }
  75% { transform: translateX(-1px); } 100% { transform: translateX(0); }
}

/* AnswerTile */
.tile {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: calc(8 * var(--u));
  min-height: calc(76 * var(--u));
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  border-radius: calc(14 * var(--u));
  border: calc(1 * var(--u)) solid var(--app-hair);
  background: var(--app-raised);
  color: var(--app-ink);
  font-size: calc(16 * var(--u)); line-height: 1.25; font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.42s var(--spring), background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(0.97); transition-duration: 0.09s; }
.tile__label { flex: 1 1 auto; min-width: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile__mark { flex: none; width: calc(22 * var(--u)); height: calc(22 * var(--u)); position: relative; display: none; }
.tile__dot {
  flex: none; display: none;
  width: calc(12 * var(--u)); height: calc(12 * var(--u)); border-radius: 50%;
  background: var(--kofi); border: calc(2 * var(--u)) solid var(--app-paper);
}
/* 2 px borders are drawn as an inset ring so the tile does not grow */
.tile.is-selected { border-color: var(--you); box-shadow: inset 0 0 0 calc(1 * var(--u)) var(--you); background: color-mix(in srgb, var(--you) 14%, var(--app-raised)); }
.tile.is-correct { border-color: var(--app-correct); box-shadow: inset 0 0 0 calc(1 * var(--u)) var(--app-correct); background: color-mix(in srgb, var(--app-correct) 16%, var(--app-raised)); }
.tile.is-wrong { border-color: var(--app-wrong); box-shadow: inset 0 0 0 calc(1 * var(--u)) var(--app-wrong); background: color-mix(in srgb, var(--app-wrong) 14%, var(--app-raised)); }
.tile.is-opponent { border-color: var(--kofi); box-shadow: inset 0 0 0 calc(1 * var(--u)) var(--kofi); }
.tile.is-correct .tile__mark, .tile.is-wrong .tile__mark { display: block; }
.tile.is-opponent .tile__dot, .tile.is-marked .tile__dot { display: block; }
.tile.is-correct .tile__mark::after { /* check */
  content: ""; position: absolute; left: 50%; top: 46%;
  width: calc(6 * var(--u)); height: calc(11 * var(--u));
  border: solid var(--app-correct); border-width: 0 calc(2.2 * var(--u)) calc(2.2 * var(--u)) 0;
  border-radius: 1px;
  transform: translate(-50%, -55%) rotate(45deg);
}
.tile.is-wrong .tile__mark::before, .tile.is-wrong .tile__mark::after { /* cross */
  content: ""; position: absolute; left: 50%; top: 50%;
  width: calc(13 * var(--u)); height: calc(2.2 * var(--u));
  background: var(--app-wrong); border-radius: 1px;
}
.tile.is-wrong .tile__mark::before { transform: translate(-50%, -50%) rotate(45deg); }
.tile.is-wrong .tile__mark::after { transform: translate(-50%, -50%) rotate(-45deg); }
.tile[disabled] { cursor: default; }

/* Timer row: "3.6s", the fuse, the rival's "Answered" dot */
.duel__foot {
  padding: 0 calc(20 * var(--u)) calc(12 * var(--u));
  display: grid; gap: calc(8 * var(--u));
}
.timer {
  display: flex; align-items: center;
  height: calc(16 * var(--u));
}
.timer__secs {
  flex: none; width: calc(44 * var(--u));
  font-size: calc(12 * var(--u)); line-height: 1.3; color: var(--app-ink-muted);
  font-variant-numeric: tabular-nums;
}
/* FuseTimer: 6 px track in hairline, ember burn from the left, gold tip with an ember core */
.fuse { position: relative; flex: 1 1 auto; height: calc(12 * var(--u)); }
.fuse::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  height: calc(6 * var(--u)); border-radius: calc(3 * var(--u));
  background: var(--app-hair);
}
.fuse__burn {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: calc(6 * var(--u)); border-radius: calc(3 * var(--u));
  width: 100%;
  background: var(--ember);
}
.fuse__tip {
  position: absolute; top: 50%; left: 100%;
  width: calc(12 * var(--u)); height: calc(12 * var(--u));
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
}
.fuse__tip::after {
  content: ""; position: absolute; inset: 27.5%;
  border-radius: 50%; background: var(--ember);
}
.fuse.is-out .fuse__burn, .fuse.is-out .fuse__tip { opacity: 0; }
.timer__answered {
  flex: none;
  display: flex; align-items: center; gap: calc(6 * var(--u));
  margin-left: calc(12 * var(--u));
  font-size: calc(12 * var(--u)); line-height: 1.3; color: var(--app-ink-muted);
  opacity: 0;
  transition: opacity 0.18s;
}
.timer__answered.is-on { opacity: 1; }
.timer__dot { width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 50%; background: var(--kofi); }

/* The rival's banter line; at reveal it carries the one-line explanation */
.duel__line {
  height: calc(40 * var(--u));
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-size: calc(13 * var(--u)); line-height: 1.35; font-weight: 500;
  color: var(--app-ink-muted);
  padding: 0 calc(4 * var(--u));
  transition: opacity 0.3s;
}
.duel__line.is-why { color: var(--app-ink); font-weight: 500; }
.duel__line.is-swap { opacity: 0; transition: none; }

/* Result overlay, in the shape of the app's result screen */
.result {
  position: absolute; inset: 0; z-index: 2;
  padding: calc(44 * var(--u)) calc(20 * var(--u)) calc(24 * var(--u));
  display: grid; align-content: center; justify-items: center;
  gap: calc(14 * var(--u));
  text-align: center;
  background: var(--app-paper);
  color: var(--app-ink);
}
.result[hidden] { display: none; }
.result__caption { font-size: calc(12 * var(--u)); color: var(--app-ink-muted); }
.result__verdict {
  font-family: var(--font-display); font-weight: 800;
  font-size: calc(32 * var(--u)); line-height: 1; letter-spacing: calc(-0.8 * var(--u));
  text-transform: uppercase;
  color: var(--app-ember-deep);
}
.result__verdict.is-loss { color: var(--app-ink); }
.result__score { display: flex; align-items: center; gap: calc(16 * var(--u)); margin-top: calc(6 * var(--u)); }
.result__avatar { width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: 50%; object-fit: cover; background: var(--you-tint); }
.result__avatar--rival { background: var(--kofi); }
.result__num {
  font-family: var(--font-display); font-weight: 800;
  font-size: calc(24 * var(--u)); line-height: 1.1; letter-spacing: calc(-0.4 * var(--u));
  font-variant-numeric: tabular-nums;
}
.result__num--you { color: var(--you); }
.result__num--rival { color: var(--kofi); }
.result__rule { width: 1px; height: calc(32 * var(--u)); background: var(--app-ink-muted); }
.result__hairline { width: 100%; height: 1px; background: var(--app-hair); margin-top: calc(10 * var(--u)); }
.result__btn {
  width: 100%;
  min-height: calc(52 * var(--u));
  border: 0; border-radius: calc(14 * var(--u));
  background: var(--ember); color: #FFF9F1;
  font-size: calc(17 * var(--u)); font-weight: 600;
  cursor: pointer;
  transition: transform 0.42s var(--spring);
}
.result__btn:active { transform: scale(0.97); }
.result__line { font-size: calc(13 * var(--u)); color: var(--app-ink-muted); }

/* ---------- Real screens ---------- */
.screens {
  border-top: 1px solid var(--hair);
  padding-block: clamp(3rem, 7vh, 5.5rem) clamp(2rem, 5vh, 4rem);
  display: grid; gap: 2rem;
}
.screens__head { display: grid; gap: 0.75rem; }
.shots {
  display: flex; gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--hair-strong) transparent;
  /* let the row bleed into the gutters on small screens so the last frame can reach the edge */
  margin-inline: calc(-1 * var(--gutter));
  padding: 0.5rem var(--gutter) 1.25rem;
}
.shot { flex: 0 0 min(62vw, 240px); scroll-snap-align: start; }
.shot figure { display: grid; gap: 0.8rem; justify-items: center; }
.shot__frame {
  width: 100%;
  background: var(--bezel);
  border-radius: 26px;
  padding: 6px;
  box-shadow: var(--shadow);
}
.shot__frame img { width: 100%; border-radius: 20px; background: var(--paper); }
.shot__caption { font-size: var(--t0); font-weight: 600; color: var(--ink-muted); }
@media (min-width: 1100px) {
  .shots { justify-content: space-between; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .shot { flex: 1 1 0; max-width: 244px; }
}

/* ---------- Pillars ---------- */
.pillars {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hair);
  padding-block: clamp(3rem, 7vh, 5.5rem) clamp(3rem, 8vh, 6rem);
}
.pillar {
  display: grid; gap: 0.9rem; align-content: start;
  padding-block: 1.75rem;
  border-top: 1px solid var(--hair);
}
.pillar:first-of-type { border-top: 0; }
.pillar__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--t3); line-height: 1.05; letter-spacing: -0.03em;
  text-wrap: balance; max-width: 16ch;
}
.pillar__body { color: var(--ink-muted); max-width: 30ch; }

.specimen {
  margin-top: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--hair);
  font-size: var(--t0);
}
.specimen--rank { display: flex; align-items: baseline; gap: 0.7rem; }
.specimen__big {
  font-family: var(--font-display); font-weight: 800;
  font-size: 4rem; line-height: 0.9; letter-spacing: -0.05em;
  color: var(--ink);
}
.specimen__small { line-height: 1.25; font-weight: 600; color: var(--ink-muted); }
.specimen--why { line-height: 1.5; color: var(--ink-muted); }
.specimen--why strong { color: var(--ink); }
.specimen__x { color: var(--wrong); font-weight: 600; }
.specimen__arrow { color: var(--ink-muted); }
.specimen--record { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-weight: 600; }
.specimen__name { display: inline-flex; align-items: center; gap: 0.4rem; }
.specimen__name::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--you); }
.specimen__name--rival::before { background: var(--rival); }
.specimen__score { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.03em; line-height: 1; }
.specimen__tag { margin-left: auto; padding: 0.35rem 0.75rem; border: 1.5px solid var(--hair-strong); border-radius: 999px; font-size: var(--t-1); }

@media (min-width: 820px) {
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .pillar { border-top: 0; padding-block: 0; padding-inline: 2rem; border-left: 1px solid var(--hair); }
  .pillar:first-of-type { padding-left: 0; border-left: 0; }
  .pillar:last-child { padding-right: 0; }
}

/* ---------- Channel ---------- */
.channel {
  border-top: 1px solid var(--hair);
  padding-block: clamp(3rem, 7vh, 5.5rem);
  display: grid; gap: 2.5rem;
}
.channel__head { display: grid; gap: 1rem; justify-items: start; }
.channel__head .btn { margin-top: 0.5rem; }
.videos {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.video a { display: grid; gap: 0.7rem; text-decoration: none; }
.video__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--hair);
  background: var(--paper-deep);
  overflow: hidden;
  display: grid; place-items: center;
}
.video__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video__thumb img[hidden] { display: none; }
.video__play {
  position: absolute; z-index: 1;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ember);
  display: grid; place-items: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s var(--ease-out), transform 0.3s var(--spring);
}
.video__play::after {
  content: ""; width: 0; height: 0; margin-left: 4px;
  border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #262D35;
}
.video a:hover .video__play, .video a:focus-visible .video__play { opacity: 1; transform: scale(1); }
.video__thumb img { transition: transform 0.6s var(--ease-out); }
.video a:hover .video__thumb img { transform: scale(1.03); }
.video__title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1.25; letter-spacing: -0.015em; }
.video__meta { font-size: var(--t-1); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- Platforms ---------- */
.android {
  border-top: 1px solid var(--hair);
  padding-block: clamp(3rem, 7vh, 5.5rem);
  display: grid; gap: 1.5rem;
  grid-template-columns: auto 1fr;
  align-items: start;
}
.android > div:last-child { display: grid; gap: 1rem; justify-items: start; }
.android__mark { padding-top: 0.2rem; }
.android__mark img { width: 22px; height: auto; }
@media (min-width: 820px) {
  .android { grid-template-columns: 1fr 2fr; }
  .android__mark img { width: 34px; }
}
.badges { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.badge {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.1rem;
  border: 1.5px solid var(--hair-strong);
  border-radius: 12px;
  line-height: 1;
}
.badge__os { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.badge__state { font-size: var(--t0); font-weight: 600; color: var(--ink-muted); }
.badge__state::before { content: "· "; color: var(--hair-strong); }
.badge--live { border-color: var(--ember); }
.badge--live .badge__state { color: var(--ember-deep); }

/* ---------- Waitlist ---------- */
.waitlist {
  background: var(--paper-deep);
  border-top: 1px solid var(--hair);
  padding-block: clamp(3.5rem, 9vh, 6.5rem);
}
.waitlist__inner { display: grid; gap: 1.5rem; max-width: 720px; }
.form { display: grid; gap: 0.75rem; }
.form__row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.form__input {
  flex: 1 1 240px;
  min-height: 3.25rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--hair-strong);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--t1);
}
.form__input::placeholder { color: var(--ink-muted); }
.form__input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.form__input[aria-invalid="true"] { border-color: var(--wrong); }
.form__submit { flex: 0 0 auto; }
.form__submit[disabled] { opacity: 0.7; cursor: progress; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__msg { font-size: var(--t0); color: var(--ink-muted); min-height: 1.5em; }
.form__msg.is-error { color: var(--wrong); }
.form__msg.is-success { color: var(--correct); font-weight: 600; }
.form__msg a { color: var(--ink); }
.form__msg .form__retry {
  background: none; border: 0; padding: 0;
  color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--hair-strong);
  cursor: pointer;
}
.form__msg .form__retry:hover { text-decoration-color: var(--ember); }
.waitlist__privacy { font-size: var(--t0); color: var(--ink-muted); }

/* ---------- Footer ---------- */
.foot {
  max-width: 1320px; margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
  display: grid; gap: 1.75rem;
  border-top: 1px solid var(--hair);
  font-size: var(--t0);
}
.foot__row { display: grid; gap: 1.25rem; }
.foot__brand img { width: 96px; height: auto; }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.25rem; font-weight: 600; }
.foot__links a { text-decoration: none; color: var(--ink-muted); }
.foot__links a:hover { color: var(--ink); }
.foot__legal { color: var(--ink-muted); }
.foot__promise {
  font-size: var(--t-1);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 88ch;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
}
.foot__promise strong { color: var(--ink); font-weight: 600; }
@media (min-width: 820px) {
  .foot__row { grid-template-columns: auto 1fr auto; align-items: center; }
  .foot__links { justify-content: center; }
}

/* ---------- Reveal on load / scroll ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .presence.is-thinking .presence__ring { animation: none; opacity: 0.5; }
  .presence.is-correct .presence__ring { animation: none; border-color: var(--app-correct); }
  .presence.is-wrong .presence__ring { animation: none; border-color: var(--app-wrong); }
  .tile__wrap.is-bloom::before, .tile__wrap.is-shake .tile { animation: none; }
  .btn, .tile, .momentum__split, .duel__body, .pip, .presence__check, .video__play, .video__thumb img, .result__btn { transition: none; }
  .video a:hover .video__thumb img { transform: none; }
}

/* ---------- Deep-link landing (404.html) ---------- */
body.land {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
/* Grid items with auto margins shrink to fit; the header and footer must stay full width. */
body.land > .top, body.land > .foot { width: 100%; }
.land__main {
  display: grid;
  align-content: center;
  padding: clamp(2rem, 7vh, 5rem) var(--gutter) clamp(3rem, 9vh, 6rem);
  max-width: 1320px;
  width: 100%;
  margin-inline: auto;
}
.land__card {
  padding-inline: 0; /* it is a <section>; the gutter is on .land__main */
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  max-width: 680px;
  min-height: 18rem;
  align-content: start;
}
.land__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 1.3rem + 4.2vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 14ch;
}
.land__avatar {
  --av: var(--ember);
  width: 88px; height: 88px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1;
  color: var(--av);
  background: var(--paper-deep);
  background: color-mix(in srgb, var(--av) 16%, var(--paper));
  border: 1.5px solid var(--hair);
  margin-bottom: 0.25rem;
}
.land__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.6rem;
  font-size: var(--t1); font-weight: 600; color: var(--ink-muted);
}
.land__meta strong { color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.35em; letter-spacing: -0.02em; }
.land__sep { color: var(--hair-strong); }
.land__body { font-size: var(--t1); line-height: 1.55; color: var(--ink-muted); max-width: 46ch; }
.land__body a { color: var(--ink); }
.land__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.land__fallback {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
  display: grid; gap: 0.75rem; justify-items: start;
}
.land__fallback[hidden] { display: none; }
.land__fallback-title { font-family: var(--font-display); font-weight: 800; font-size: var(--t2); letter-spacing: -0.02em; }
.land__expiry { font-size: var(--t0); color: var(--ink-muted); padding-top: 0.5rem; }
.land__code {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
}
.land__expiry .land__code { color: var(--ink); letter-spacing: 0.1em; }

/* Loading: a short fuse burning down, then it starts again. */
.land__fuse { position: relative; width: min(280px, 100%); height: 22px; margin-top: 0.5rem; }
.land__fuse-track {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%);
  background: repeating-linear-gradient(to right, var(--hair) 0 4px, transparent 4px 7px);
  border-radius: 2px;
}
.land__fuse-flame {
  position: absolute; top: 50%; left: 100%;
  width: 13px; height: auto;
  transform: translate(-50%, -78%);
  transform-origin: 50% 90%;
  filter: drop-shadow(0 0 5px rgba(252, 107, 7, 0.5));
  animation: land-burn 2.4s linear infinite;
}
@keyframes land-burn {
  from { left: 100%; }
  to   { left: 0%; }
}

.foot--slim { grid-template-columns: 1fr auto; }
.foot--slim .foot__links { justify-content: start; }
@media (max-width: 819px) { .foot--slim { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .land__fuse-flame { animation: none; left: 50%; }
}
