/* ============================================================================
   RankMaster — rankmaster.12f.dk
   Tokens transcribed from DESIGN.md §2–§4, token for token. Values are the
   app's shipped tokens (DesignTokens.swift). Do not re-derive, re-tint or
   "adjust for screens", and do not add a colour that is not in this block.
   ========================================================================= */

:root {
  color-scheme: dark; /* one room. Not a media query. */

  /* Neutrals — named for the role they play, not for what they look like */
  --ground: #0a1130; /* page ground; the logo's disc at its outer stop */
  --surface: #111c48; /* raised: panels, the reveal card, sheets */
  --sunken: #05081a; /* recessed: footer, wells, the unfilled rail track */
  --line: #1e2a5c; /* hairlines, minor ticks, dividers. 1px. */

  --text-primary: #edf1ff;
  --text-secondary: #abb5dc; /* body copy */
  --text-tertiary: #808cbe; /* eyebrows, scale labels, footnotes */

  /* The two meaning colours — nothing else may use these */
  --guess-ink: #f4c24a; /* YOUR GUESS, as a mark. 11.2:1 on ground. */
  --guess-fill: #f4c24a; /* top stop of a gold surface */
  --guess-fill-deep: #e3a22e; /* bottom stop — the logo's gold at 72% */
  --on-guess: #14102e; /* label ON gold. 8.3:1 on the deep stop. */
  --truth: #45e3b8; /* THE CORRECT ANSWER. A mark only, never a surface. */
  --miss: #e0705f; /* zero points. Warm terracotta. */

  /* The villain's red cross, and nothing else on the site. A quotation of a
     right/wrong buzzer, in the one panel where one is shown to be rejected —
     a third as saturated as --miss so the app's own token keeps its single
     meaning (DESIGN.md §2). 5.08:1 on --surface. */
  --villain: #b08581;

  /* Channel values, so a token can be used at partial alpha without a
     second, drifting hex. Only for scrims and glows — never a new colour. */
  --ground-rgb: 10 17 48;
  --guess-ink-rgb: 244 194 74;
  --truth-rgb: 69 227 184;
  --line-rgb: 30 42 92;

  /* The stage scrim. DESIGN.md §2: the asset ships at 0.70 exposure, and text
     is measured against the brightest pixel *under it*, which is #2B3450. A
     0.40 --ground scrim takes that to #1E2643, where --text-secondary clears
     the 7:1 body floor at 7.34:1 and --text-tertiary clears 4.5:1 at 4.54:1.
     Solved, not chosen — see DESIGN.md §2. */
  --stage-scrim: 0.4;

  /* ---- Typography (DESIGN.md §3) ------------------------------------- */
  /* New York on every Apple device. ui-serif resolves to it in Safari 13.1+. */
  --font-display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    serif;
  /* SF Pro on Apple, the platform UI face elsewhere. */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  --size-h1: clamp(2.5rem, 7vw, 4.5rem);
  --size-h2: clamp(1.75rem, 4vw, 2.75rem);
  --size-numeral: clamp(3rem, 9vw, 5rem);
  --size-lede: clamp(1.125rem, 2vw, 1.375rem);
  --size-body: 1.0625rem; /* 17px */
  --size-small: 0.8125rem; /* 13px */
  --size-eyebrow: 0.6875rem; /* 11px */

  /* ---- Space, grid, shape (DESIGN.md §4) ----------------------------- */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-section: clamp(64px, 10vw, 128px);

  --gutter: 20px; /* the app's 20pt, deliberately wider than 16 */
  --measure: 34rem; /* body text column, ≈60–66 characters */
  --content: 72rem;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;

  --tap: 44px; /* minimum hit target, no exceptions */
}

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

@media (min-width: 1024px) {
  :root {
    --gutter: 48px;
  }
}

/* ============================================================================
   Base
   ========================================================================= */

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

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

body {
  background: var(--ground);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--size-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Every numeral on this site is tabular. In the app this is a correctness
   requirement, not a nicety: proportional digits jitter under a moving
   thumb and make the instrument feel cheap (DESIGN.md §3). */
h1,
h2,
h3,
.numeral,
table,
time,
[data-numeral] {
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--size-h1);
  max-width: 20ch; /* past this it stops reading as a statement */
}

h2 {
  font-size: var(--size-h2);
}

h3 {
  /* Sub-headings inside a section are chrome, not the subject — UI face.
     The serif stops at section headings (DESIGN.md §3, W-001). */
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

p {
  max-width: var(--measure);
}

a {
  color: var(--text-primary);
  text-decoration-color: rgb(var(--line-rgb) / 1);
  text-underline-offset: 3px;
  transition: opacity 120ms ease-out;
}

a:hover {
  opacity: 0.75;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

/* Every interactive element has a visible focus ring — 2px gold, 2px offset.
   Gold is the one meaning colour a focus ring may use, because focus *is*
   "where you are", which is what gold means (DESIGN.md §8). */
:focus-visible {
  outline: 2px solid var(--guess-ink);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: rgb(var(--guess-ink-rgb) / 0.3);
  color: var(--text-primary);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--text-primary);
  padding: 12px 20px;
  text-decoration: none;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============================================================================
   Layout primitives
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--tight {
  padding-block: calc(var(--space-section) * 0.6);
}

/* A raised surface is raised by being --surface against --ground plus a 1px
   --line stroke. Not by a shadow — there are no drop shadows on this site
   except the instrument's own glow (DESIGN.md §4). */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: var(--space-l);
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
}

.lede {
  font-size: var(--size-lede);
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: var(--measure);
}

.small {
  font-size: var(--size-small);
  color: var(--text-tertiary);
  line-height: 1.5;
}

.numeral {
  font-family: var(--font-display);
  font-size: var(--size-numeral);
  font-weight: 700;
  line-height: 1;
}

/* ============================================================================
   Components (DESIGN.md §6)
   ========================================================================= */

/* The eyebrow — a 5px gold dot, 8px gap, then the uppercase tracked label.
   This is the site's section marker; not an <h6>, not a coloured chip. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  font-family: var(--font-ui);
  font-size: var(--size-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-m);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--guess-ink);
}

/* The one gold thing on the page. Full width on phone, auto on desktop.
   Gold as a filled surface is always the gradient, never a flat slab — a
   flat slab of the same yellow reads as a different material (D-084). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  width: 100%;
  min-height: 56px;
  padding: 0 var(--space-xl);
  border: 0;
  border-radius: var(--radius-l);
  font-family: var(--font-ui);
  font-size: var(--size-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 90ms ease-out,
    box-shadow 120ms ease-out,
    opacity 120ms ease-out;
}

.btn--primary {
  background: linear-gradient(to bottom, var(--guess-fill), var(--guess-fill-deep));
  color: var(--on-guess);
  box-shadow: 0 0 24px rgb(var(--guess-ink-rgb) / 0.18);
}

/* Hover: no colour change — it is already the brightest thing on the page.
   Lift the glow by 10% instead (DESIGN.md §6). */
.btn--primary:hover {
  opacity: 1;
  box-shadow: 0 0 28px rgb(var(--guess-ink-rgb) / 0.28);
}

.btn--secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-primary);
}

.btn:active {
  transform: scale(0.97);
}

@media (min-width: 560px) {
  .btn {
    width: auto;
  }
}

/* The Apple badge sits *beside* the gold button, never as a second gold
   button. It counts as a gold surface for the one-per-viewport rule. */
.badge-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.badge-link img {
  height: 54px;
  width: auto;
}

/* The wordmark: the emblem at 2× the wordmark's font size, then RANK in
   --text-primary and MASTER in --guess-ink. One link, one accessible name —
   the emblem and the letters are the same word said twice. */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-s);
  min-height: var(--tap);
  text-decoration: none;
}

.wordmark:hover {
  opacity: 1;
}

.wordmark img {
  width: 26px;
  height: 26px;
  flex: none;
}

.wordmark span {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1;
  color: var(--text-primary);
  white-space: nowrap;
}

.wordmark span b {
  font-weight: 700;
  color: var(--guess-ink);
}

/* Source citation. Where the site shows a sample question it must show its
   citation — "every fact is sourced" is one of the five authority claims
   (MESSAGING.md §3) and a sample without one undercuts it. */
.citation {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--size-small);
  line-height: 1.45;
  color: var(--text-tertiary);
}

.citation svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

/* Hand-drawn inline SVG at SF Symbols .medium weight: 1.5px stroke, round
   caps and joins, on a 24px box. Never an icon font, never emoji. */
.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================================
   The stage (DESIGN.md §2) — the hero section's background, not the page's.
   Top-anchored cover: the beams converge at the very top edge and that
   convergence is the image. Centring crops it off.
   The 0.70 exposure is baked into the asset; never filter:brightness here.
   ========================================================================= */

.stage {
  position: relative;
  isolation: isolate;
  background-color: var(--ground);
}

.stage__art,
.stage__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.stage__art {
  background-image: image-set(
    url("/images/stage-mobile.avif") type("image/avif"),
    url("/images/stage-mobile.webp") type("image/webp"),
    url("/images/stage-mobile.jpg") type("image/jpeg")
  );
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
}

@media (min-width: 800px) {
  .stage__art {
    background-image: image-set(
      url("/images/stage.avif") type("image/avif"),
      url("/images/stage.webp") type("image/webp"),
      url("/images/stage.jpg") type("image/jpeg")
    );
  }
}

/* Holds body copy over the beams' apex at 7.34:1, and blends the hero into
   the flat --ground below it so the image has no hard bottom edge. */
.stage__scrim {
  background: linear-gradient(
    to bottom,
    rgb(var(--ground-rgb) / var(--stage-scrim)) 0%,
    rgb(var(--ground-rgb) / var(--stage-scrim)) 55%,
    var(--ground) 100%
  );
}

/* ============================================================================
   Motion (DESIGN.md §7)
   Direct manipulation is instant; consequence is animated. Nothing on this
   site loops, pulses, floats, parallaxes or bursts.
   ========================================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 400ms ease-out,
    transform 400ms ease-out;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Not "reduced" — replaced. Scroll reveals do not move, they are simply
   already visible; springs become a 150ms linear cross-fade. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
    transition-timing-function: linear !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}

/* ============================================================================
   The rank rail (DESIGN.md §5) — the signature component.
   The one element allowed to span the full text column.
   ========================================================================= */

.rail {
  /* Enough to clear the thumb's 30px glow at rank 1 and rank max, so the
     instrument never looks clipped against the page gutter. */
  --rail-inset: 32px;
  /* The colour cut out of the thumb and the truth pin. It must be whatever is
     actually behind the rail — override it to --surface inside a panel. */
  --rail-ring: var(--ground);
  width: 100%;
}

.rail__readout,
.rail__track {
  margin-inline: var(--rail-inset);
}

/* The big readout above the rail, centred on the thumb and tied to it by the
   blade. Gold while you are guessing; once the truth is on the rail it steps
   back to --text-secondary, because it is no longer the live answer. */
.rail__readout {
  position: relative;
  height: var(--size-numeral);
  margin-bottom: var(--space-xs);
}

.rail__readout-inner {
  position: absolute;
  bottom: 0;
  left: var(--pos);
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.rail__readout-prefix {
  font-family: var(--font-ui);
  font-size: var(--size-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--guess-ink);
}

.rail__readout-value {
  font-family: var(--font-display);
  font-size: var(--size-numeral);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--guess-ink);
}

.rail--revealed .rail__readout-prefix,
.rail--revealed .rail__readout-value {
  color: var(--text-secondary);
}

.rail__track {
  position: relative;
}

/* Overflow is visible on purpose: the glow, the blade and the labels all hang
   outside the SVG's own box. */
.rail__svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.rail__baseline {
  /* --line, not --sunken. §2 calls --sunken "the unfilled rail track", but §5
     specifies the baseline as --line and the app draws it that way: at
     1.36:1 --line is already a hairline, and --sunken (#05081A) on --ground
     is 1.26:1 the other way — a track you cannot see is not a scale. */
  fill: var(--line);
}

.rail__tick {
  stroke: var(--line);
  stroke-width: 1;
}

/* Major ticks sit at the first rank, the last rank and every multiple of
   five, in gold at 25% — a scale marking, not a second accent. */
.rail__tick--major {
  stroke: rgb(var(--guess-ink-rgb) / 0.25);
}

.rail__cutout {
  stroke: var(--rail-ring);
}

.rail__thumb-edge {
  stroke: var(--guess-ink);
}

.rail__pin {
  fill: var(--truth);
}

.rail__pin-edge {
  stroke: var(--truth);
}

.rail__blade {
  stroke: var(--guess-ink);
  stroke-width: 1;
}

/* Neutral on purpose. The bridge measures the error; it belongs to neither
   the guess nor the truth, so it may not be drawn in either meaning colour. */
.rail__bridge,
.rail__bridge-casing {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 3 7;
}

.rail__bridge {
  stroke: var(--text-secondary);
  opacity: 0.3;
}

/* Cuts each dash's own notch out of the gold fill, so the bridge looks the
   same whether the guess undershot the truth or ran past it. */
.rail__bridge-casing {
  stroke: var(--rail-ring);
}

.rail__label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rail__label--guess {
  fill: var(--guess-ink);
}

.rail__label--truth {
  fill: var(--truth);
}

.rail__end {
  font-family: var(--font-ui);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  fill: var(--text-tertiary);
}

/* The interactive band is 64px tall even though the rail draws 3px of line:
   drag anywhere in it and the rank under the pointer is selected. The thumb
   does not have to be grabbed. */
.rail--interactive .rail__track {
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.rail--interactive .rail__track::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-inset) * -1);
  right: calc(var(--rail-inset) * -1);
  top: 2px;
  height: 64px;
}

.rail--interactive .rail__track:focus-visible {
  outline: 2px solid var(--guess-ink);
  outline-offset: 6px;
  border-radius: var(--radius-s);
}

/* Focus moved by a finger or a mouse, not by the keyboard: the element is
   focused so the arrow keys work afterwards, but the ring stays off until a
   key is actually pressed. :focus-visible alone does not cover this — the
   focus here is programmatic, and browsers disagree about what that means. */
.rail--interactive .rail__track[data-pointer-focus]:focus-visible {
  outline: none;
}

.rail--interactive[aria-disabled="true"] .rail__track,
.rail--locked .rail__track {
  cursor: default;
}

.rail__end.is-hidden {
  visibility: hidden;
}

/* ============================================================================
   The one-question demo (MESSAGING.md §5)
   ========================================================================= */

.try {
  max-width: var(--measure);
}

.try__subject {
  margin-top: var(--space-s);
}

.try__prompt {
  font-size: var(--size-lede);
  line-height: 1.45;
  margin-top: var(--space-s);
}

/* The blank is the slot the guess goes in, so it is gold. */
.try__blank {
  color: var(--guess-ink);
  letter-spacing: 0.04em;
}

.try .rail {
  margin-top: var(--space-xxl);
}

.try__actions {
  margin-top: var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-m);
}

/* Only true once the demo is wired, so it is added by JavaScript. */
.try__hint {
  display: none;
}

.try--ready .try__hint:not([hidden]) {
  display: block;
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.try__reveal {
  margin-top: var(--space-xl);
}

/* The reveal panel carries a 4px banded edge on its leading side, in the
   result band's colour (DESIGN.md §2, §6). A mark, never a fill. */
.try__panel {
  --band: var(--text-secondary);
  display: flex;
  gap: var(--space-l);
  align-items: flex-start;
  border-inline-start: 4px solid var(--band);
}

.try__panel[data-band="truth"] {
  --band: var(--truth);
}

.try__panel[data-band="guess"] {
  --band: var(--guess-ink);
}

.try__panel[data-band="secondary"] {
  --band: var(--text-secondary);
}

.try__panel[data-band="miss"] {
  --band: var(--miss);
}

.try__score {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: none;
}

.try__points {
  color: var(--band);
}

.try__points-unit {
  font-variant-numeric: tabular-nums;
  font-size: var(--size-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--band);
  padding-top: 0.5em;
}

.try__points-of {
  color: var(--text-tertiary);
}

.try__verdict-line {
  color: var(--band);
  font-size: 1.25rem;
}

.try__verdict-detail {
  margin-top: var(--space-xs);
}

.try__verdict-detail b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.try__said {
  color: var(--guess-ink);
}

.try__truth {
  color: var(--truth);
}

.try__verdict .citation {
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  border-top: 1px solid var(--line);
}

.try__after {
  margin-top: var(--space-l);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

.try__after .lede {
  flex: 1 1 18rem;
}

@media (max-width: 480px) {
  .try__panel {
    flex-direction: column;
    gap: var(--space-m);
  }
}

/* ---- The reveal's motion (DESIGN.md §7) ---------------------------------
   The pin lands; the bridge fades in with it. Everything else is still. */

[data-rail-truth] {
  transition: opacity 200ms ease-out;
}

[data-rail-truth].is-pending,
.rail__bridge.is-pending,
.rail__bridge-casing.is-pending {
  opacity: 0;
}

.rail__bridge,
.rail__bridge-casing {
  transition: opacity 350ms ease-out;
}

@keyframes rm-pin-land {
  from {
    transform: scale(0);
  }
  70% {
    transform: scale(1.16);
  }
  to {
    transform: scale(1);
  }
}

[data-rail-truth-pin].is-landing {
  transform-box: fill-box;
  transform-origin: center;
  animation: rm-pin-land 320ms cubic-bezier(0.2, 0.8, 0.3, 1) 60ms both;
}

/* Replaced, not reduced: the pin appears without scaling and the count-up is
   skipped — main.js shows the final value immediately. */
@media (prefers-reduced-motion: reduce) {
  [data-rail-truth-pin].is-landing {
    animation: none;
  }
}

/* ============================================================================
   Homepage sections (MESSAGING.md §9)
   ========================================================================= */

/* ---- Navbar --------------------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-l);
  padding-block: var(--space-m);
}

.nav__links {
  display: none;
  gap: var(--space-s);
  margin-inline-start: auto;
}

.nav__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding-inline: var(--space-s);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--size-body);
}

.nav__links a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.nav__cta {
  display: none;
  margin-inline-start: auto;
  min-height: var(--tap);
  width: auto;
  padding-inline: var(--space-l);
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }

  .nav__cta {
    display: inline-flex;
    margin-inline-start: 0;
  }
}

/* ---- Hero ----------------------------------------------------------- */

.hero__grid {
  display: grid;
  gap: var(--space-xxl);
  padding-block: clamp(48px, 8vw, 96px) var(--space-section);
}

.hero__lede {
  margin-top: var(--space-l);
}

.hero__trust {
  margin-top: var(--space-m);
  /* Not --text-tertiary. These are four claims, not a footnote, and tertiary
     lands at 4.54:1 over the beams' apex — the weakest text on the page.
     --text-secondary takes it to 7.34:1 there (DESIGN.md §2). */
  color: var(--text-secondary);
}

.hero__transitional {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-top: var(--space-l);
  color: var(--text-primary);
  font-size: var(--size-body);
  text-decoration-color: currentColor;
  text-underline-offset: 4px;
}

.hero__phone {
  justify-self: center;
  width: min(280px, 70vw);
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-section);
  }

  .hero__phone {
    width: 300px;
  }
}

/* The CTA lockup: the gold button, then the Apple badge beside it. */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-m);
  margin-top: var(--space-xl);
  max-width: none;
}

/* ---- Phones --------------------------------------------------------- */

.phone {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--sunken);
  line-height: 0;
}

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

/* ---- Stakes --------------------------------------------------------- */

.stakes__line {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  max-width: 30ch;
}

/* ---- The villain ---------------------------------------------------- */

.villain__heading {
  max-width: 22ch;
}

.villain__pair {
  display: grid;
  gap: var(--space-l);
  margin-top: var(--space-xl);
}

@media (min-width: 768px) {
  .villain__pair {
    grid-template-columns: 1fr 1.35fr;
    align-items: stretch;
  }
}

.villain__panel {
  --rail-ring: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.villain__eyebrow {
  margin-bottom: 0;
}

.villain__cross {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--villain);
  stroke-width: 3;
  stroke-linecap: round;
}

.villain__verdict {
  font-family: var(--font-ui);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--villain);
}

.villain__detail {
  margin-top: auto;
  color: var(--text-secondary);
  /* Ranks and points are measurements, so they are tabular even in a
     sentence — these two panels are read side by side and the figures have
     to line up (DESIGN.md §3). */
  font-variant-numeric: tabular-nums;
}

.villain__detail b {
  color: var(--text-primary);
  font-weight: 600;
}

.villain__detail b.is-guess {
  color: var(--guess-ink);
}

.villain__detail b.is-truth {
  color: var(--truth);
}

.villain__rail {
  padding-block: var(--space-s);
}

/* ---- Benefits ------------------------------------------------------- */

.benefits__grid {
  display: grid;
  gap: var(--space-xl);
}

.benefits__item {
  border-top: 1px solid var(--line);
  padding-top: var(--space-m);
}

.benefits__item h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
}

.benefits__item p {
  margin-top: var(--space-s);
}

@media (min-width: 768px) {
  .benefits__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

/* ---- Guide ---------------------------------------------------------- */

.guide__empathy {
  margin-top: var(--space-l);
}

.guide__points {
  display: grid;
  gap: var(--space-l);
  margin-top: var(--space-xxl);
  counter-reset: authority;
}

.guide__point {
  border-top: 1px solid var(--line);
  padding-top: var(--space-m);
}

.guide__point h3 {
  color: var(--text-primary);
}

.guide__point p {
  margin-top: var(--space-xs);
}

@media (min-width: 768px) {
  .guide__points {
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--space-xl);
  }
}

/* ---- How it works --------------------------------------------------- */

.how__steps {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--space-xxl);
  counter-reset: step;
}

.how__step {
  display: flex;
  gap: var(--space-m);
}

.how__step-number {
  flex: none;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--guess-ink);
  width: 1.4em;
}

.how__step h3 {
  color: var(--text-primary);
  font-size: 1.125rem;
}

.how__step p {
  margin-top: var(--space-xs);
}

.how__example {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-primary);
  margin-top: var(--space-s);
}

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

.how__scoring {
  margin-top: var(--space-xxl);
  overflow-x: auto;
}

.scoring {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  width: 100%;
  max-width: 30rem;
}

.scoring th,
.scoring td {
  border: 1px solid var(--line);
  padding: var(--space-s);
  text-align: center;
  font-weight: 400;
}

@media (min-width: 480px) {
  .scoring th,
  .scoring td {
    padding: var(--space-s) var(--space-m);
  }
}

.scoring th[scope="row"] {
  text-align: left;
  color: var(--text-tertiary);
  font-size: clamp(0.6875rem, 2.6vw, 0.8125rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.scoring thead td {
  color: var(--text-secondary);
}

.scoring__points {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 700;
  color: var(--text-primary);
}

/* Ten is the exact hit, so it takes the 8–10 result band (DESIGN.md §2). */
.scoring__points.is-exact {
  color: var(--truth);
}

.how__caption {
  margin-top: var(--space-m);
}

.how__cta {
  margin-top: var(--space-xxl);
}

/* ---- Screenshots ---------------------------------------------------- */

/* Phone: the reveal on its own, then the other four two-up. One screenshot
   per row would put 3,500px of phone on a 375px screen, which is a scroll,
   not a section. The reveal still leads and still gets the most space. */
.shots__row {
  display: grid;
  gap: var(--space-xl) var(--space-l);
  margin-top: var(--space-xl);
  grid-template-columns: repeat(2, 1fr);
}

.shots__item--lead {
  grid-column: 1 / -1;
  max-width: 220px;
  margin-inline: auto;
  text-align: center;
}

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

  .shots__item--lead {
    grid-column: auto;
    max-width: none;
    margin-inline: 0;
    text-align: start;
  }
}

.shots__item h3 {
  color: var(--text-primary);
  margin-top: var(--space-m);
}

.shots__item p {
  margin-top: var(--space-xs);
}

/* The reveal is the argument, so it gets the most space. */
@media (min-width: 900px) {
  .shots__row {
    grid-template-columns: 1.35fr repeat(4, 1fr);
    align-items: start;
    gap: var(--space-xl);
  }
}

/* ---- Modes ---------------------------------------------------------- */

.modes__list {
  display: grid;
  gap: var(--space-l);
  margin-top: var(--space-xl);
}

.modes__item {
  border-top: 1px solid var(--line);
  padding-top: var(--space-m);
}

.modes__item h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modes__item p {
  margin-top: var(--space-xs);
}

@media (min-width: 768px) {
  .modes__list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

/* ---- Commitments ---------------------------------------------------- */

.commitments__list {
  display: grid;
  gap: var(--space-m);
  margin-top: var(--space-xl);
  max-width: var(--measure);
}

.commitments__list li {
  border-top: 1px solid var(--line);
  padding-top: var(--space-m);
  color: var(--text-secondary);
}

.commitments__more {
  margin-top: var(--space-l);
}

/* ---- FAQ ------------------------------------------------------------ */

.faq__list {
  margin-top: var(--space-xl);
  max-width: var(--measure);
  border-top: 1px solid var(--line);
}

.faq__item {
  border-bottom: 1px solid var(--line);
}

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: var(--tap);
  padding-block: var(--space-m);
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  list-style: none;
}

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

.faq__chevron {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform 120ms ease-out;
}

.faq__item[open] .faq__chevron {
  transform: rotate(180deg);
}

.faq__item p {
  padding-bottom: var(--space-l);
}

.faq__more {
  margin-top: var(--space-l);
}

/* ---- Final CTA ------------------------------------------------------ */

.final {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.final__phone {
  width: min(240px, 55vw);
  justify-self: start;
}

.final__copy .lede {
  margin-top: var(--space-m);
}

.try-section__heading {
  margin-bottom: var(--space-xxl);
}

@media (min-width: 768px) {
  .final {
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-section);
  }

  .final__phone {
    width: 260px;
  }
}

/* ---- Footer --------------------------------------------------------- */

.footer {
  background: var(--sunken);
  border-top: 1px solid var(--line);
  padding-block: var(--space-xxl);
  margin-top: var(--space-section);
}

.footer__inner {
  display: grid;
  gap: var(--space-l);
}

.footer__oneliner {
  color: var(--text-secondary);
  max-width: var(--measure);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m) var(--space-l);
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--text-secondary);
  text-decoration-color: var(--line);
}

.footer__links a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.footer__legal a {
  color: inherit;
}

/* ============================================================================
   The text pages — /privacy-policy.html and /support.html
   ========================================================================= */

.prose-page {
  padding-block: var(--space-xxl) var(--space-section);
}

.prose-page__head {
  max-width: var(--measure);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--line);
}

.prose-page__head .lede {
  margin-top: var(--space-l);
}

.prose-page__updated {
  margin-top: var(--space-l);
}

.prose {
  max-width: var(--measure);
  margin-top: var(--space-xl);
}

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

.prose h2 {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  margin-top: var(--space-xxl);
}

.prose h3 {
  color: var(--text-primary);
  font-size: 1.0625rem;
  margin-top: var(--space-xl);
}

.prose h2 + *,
.prose h3 + * {
  margin-top: var(--space-s);
}

.prose h2 + h3 {
  margin-top: var(--space-l);
}

/* A list item that is nothing but a link is a standalone link, not an inline
   one, so the 44px rule applies to it (DESIGN.md §4). */
.prose li > a:only-child {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.prose ul {
  display: grid;
  gap: var(--space-s);
  padding-inline-start: var(--space-l);
  list-style: disc;
}

.prose li::marker {
  color: var(--text-tertiary);
}

.prose li {
  max-width: var(--measure);
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose a {
  color: var(--text-primary);
  text-decoration-color: var(--text-tertiary);
}

/* A short summary block at the top of the privacy policy. Not a card for the
   sake of one — it is a different kind of statement from the sections below,
   and the hairline is what says so. */
.prose .summary {
  border-inline-start: 1px solid var(--line);
  padding-inline-start: var(--space-l);
  margin-top: var(--space-l);
}

.prose .summary ul {
  padding-inline-start: var(--space-l);
}

.prose__contact {
  margin-top: var(--space-xxl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--line);
}
