/* Doddy landing page, v3 "light editorial notebook" (light-only by owner request).
   Layout: one 1200px column; hero split copy/device; numbered three-step row; receipt card; inverted ink privacy panel.
   Colours come only from tokens.css (generated from the app's CandidateTokens.swift).
   Type: Bricolage Grotesque for headings (the brand speaking), Caveat only for Doddy's own voice and the wordmark,
   system UI for reading text (matches the native app's Dynamic Type). */

:root {
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  /* A brighter paper for cards, derived from the app's canvas so it stays on-brand. */
  --paper: color-mix(in srgb, var(--canvas) 35%, #fff);
  --rule: color-mix(in srgb, var(--separator) 60%, transparent);
  --lift: 0 1px 2px rgb(60 40 10 / 6%), 0 16px 36px -20px rgb(60 40 10 / 28%);
  --lift-strong: 0 2px 4px rgb(60 40 10 / 8%), 0 40px 80px -32px rgb(60 40 10 / 40%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--reading-ink);
  background: var(--canvas);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0 0 16px; }

:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 20;
  padding: 10px 16px; border-radius: 12px;
  background: var(--reading-ink); color: var(--canvas);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Type ---------- */

.display {
  font-family: var(--display);
  font-weight: 760;
  font-variation-settings: "opsz" 96;
  font-size: clamp(3rem, 1.6rem + 6vw, 6.25rem);
  line-height: 0.94;
  letter-spacing: -0.022em;
  margin: 0 0 24px;
}
.display-m {
  font-family: var(--display);
  font-weight: 750;
  font-variation-settings: "opsz" 72;
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}
h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 8px;
}
.lede { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem); line-height: 1.55; max-width: 32rem; }
.fineprint { font-size: 0.875rem; color: var(--secondary-text); max-width: 34rem; }
.caption { font-size: 0.75rem; color: var(--secondary-text); text-align: center; margin: 12px 0 0; }
.caption.left { text-align: left; }

/* Doddy's own voice: handwriting with a drawn underline. */
.says, .says-small {
  font-family: var(--hand);
  font-weight: 700;
  color: var(--reading-ink);
  line-height: 1;
}
.says-small { font-size: 1.6rem; color: var(--accent-text); margin: 10px 0 0; transform: rotate(-2deg); transform-origin: left; }

.scribble { position: absolute; left: 0; bottom: -0.18em; width: 100%; height: 0.24em; overflow: visible; }
.scribble path { fill: none; stroke: var(--orange-cue); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.js .scribble { clip-path: inset(-50% 100% -50% 0); transition: clip-path 650ms cubic-bezier(.3,.7,.2,1) 700ms; }
.js .loaded .scribble { clip-path: inset(-50% 0 -50% 0); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 22px; padding: 5px 14px 6px;
  border: 1px solid var(--separator); border-radius: 999px;
  background: color-mix(in srgb, var(--quiet-surface) 70%, transparent);
  font-size: 0.875rem; font-weight: 600; color: var(--secondary-text);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-cue); }
.pill.warn { border-color: var(--accent-text); color: var(--accent-text); background: transparent; }

/* ---------- Controls ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 26px;
  border: 0; border-radius: 18px;
  background: var(--reading-ink); color: var(--canvas);
  font: 650 1rem/1 var(--text);
  text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--orange-cue) 85%, transparent);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.button:hover { transform: translateY(-1px); box-shadow: inset 0 -5px 0 var(--orange-cue); }
.button:active { transform: translateY(0); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.button.small { min-height: 44px; padding: 0 18px; border-radius: 14px; font-size: 0.9375rem; }

.text-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600;
  text-decoration-line: underline; text-decoration-thickness: 2px;
  text-underline-offset: 6px; text-decoration-color: var(--orange-cue);
}
.text-link:hover { text-decoration-thickness: 3px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 32px 0 20px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
          backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--separator) 60%, transparent);
}
.nav-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.wordmark {
  font-family: var(--hand); font-weight: 700; font-size: 2.2rem; line-height: 1;
  text-decoration: none; margin: 0 auto 0 0;
}
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: 28px; }
.nav-links a { text-decoration: none; font-size: 0.9375rem; font-weight: 550; color: var(--secondary-text); display: inline-flex; min-height: 44px; align-items: center; }
.nav-links a:hover { color: var(--reading-ink); }
@media (min-width: 820px) { .nav-links { display: flex; } }

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

.hero { position: relative; isolation: isolate; padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 112px); overflow: hidden; }
/* Faint ruled paper, fading out: the notebook, quietly. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px);
  -webkit-mask: linear-gradient(to bottom, #000 30%, transparent 95%);
          mask: linear-gradient(to bottom, #000 30%, transparent 95%);
}
.hero-grid { display: grid; gap: 56px; align-items: center; }
.hero-copy { min-width: 0; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); } }

.hero-stage { position: relative; display: grid; justify-items: center; padding-left: clamp(60px, 14vw, 140px); }
.device {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 390 / 845;
  border-radius: 48px;
  padding: 9px;
  background: var(--reading-ink);
  box-shadow: var(--lift-strong);
}
.device img { width: 100%; height: 100%; object-fit: cover; border-radius: 39px; background: var(--canvas); }
.device.tilt { transform: rotate(3deg); }
.device.small { width: min(100%, 220px); border-radius: 36px; padding: 7px; box-shadow: var(--lift); }
.device.small img { border-radius: 29px; }

.hero-doddy { position: absolute; z-index: 2; left: 0; bottom: 4%; width: clamp(150px, 22vw, 230px); }
.hero-pose img { width: 100%; }
.says {
  position: absolute; right: 62%; top: -6%;
  font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.6rem);
  white-space: nowrap; transform: rotate(-4deg);
  margin: 0;
}
.hero-stage .caption { margin-top: 20px; }

/* One orchestrated arrival: Doddy settles in, then the greeting underlines itself. */
.js .hero-pose { display: block; transition: transform 420ms cubic-bezier(.2,.8,.2,1); }
.js .hero:not(.loaded) .hero-pose { transform: translate(-14px, 6px); }

/* ---------- Film ---------- */
/* The film is taped onto a paper card that straightens as it scrolls in.
   Doddy dribbles in at the corner, and the chapters reuse the problem section's scraps. */
.film { padding: 0 0 clamp(56px, 8vw, 104px); }
.film-stage { position: relative; padding-left: clamp(0px, 9vw, 120px); }
.film-card {
  position: relative; padding: 12px;
  background: var(--paper); border: 1px solid var(--separator); border-radius: 30px;
  box-shadow: var(--lift-strong);
}
.js .film-card { transform: rotate(-1.2deg); transition: transform 900ms cubic-bezier(.2,.8,.2,1); }
.js .film.loaded .film-card { transform: rotate(0); }
.tape {
  position: absolute; z-index: 2; top: -13px; width: 110px; height: 28px;
  background: color-mix(in srgb, var(--quiet-surface) 75%, transparent);
  border: 1px solid color-mix(in srgb, var(--separator) 70%, transparent);
  box-shadow: 0 2px 6px rgb(60 40 10 / 8%);
}
.tape.t1 { left: 9%; transform: rotate(-5deg); }
.tape.t2 { right: 9%; transform: rotate(4deg); }

.player { position: relative; overflow: hidden; border-radius: 20px; background: #0f0f0e; }
.player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.preview-tag, .player .cover { display: none; }
.js .player .cover {
  position: absolute; inset: 0; display: grid; place-items: center;
  border: 0; padding: 0; cursor: pointer; color: inherit;
  background: linear-gradient(180deg, transparent 50%, rgb(15 15 14 / 55%));
}
.js .preview-tag {
  position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 5px; border-radius: 999px;
  background: rgb(15 15 14 / 62%); color: var(--canvas);
  font-size: 0.75rem; font-weight: 600; pointer-events: none;
}
.preview-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange-cue); }
.js .player.playing .cover, .js .player.playing .preview-tag, .js .player.still .preview-tag { display: none; }
.play-dot {
  width: clamp(68px, 8vw, 92px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--reading-ink);
  box-shadow: inset 0 -5px 0 var(--orange-cue), 0 12px 30px -8px rgb(0 0 0 / 50%);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.play-dot svg { width: 34%; margin-left: 8%; fill: var(--canvas); }
.player .cover:hover .play-dot { transform: translateY(-2px) scale(1.04); box-shadow: inset 0 -7px 0 var(--orange-cue), 0 16px 34px -8px rgb(0 0 0 / 55%); }
.cover-label {
  position: absolute; left: clamp(14px, 2.4vw, 26px); bottom: clamp(12px, 2vw, 22px);
  color: var(--canvas); text-align: left; font-size: 0.875rem; font-weight: 600; line-height: 1.25;
}
.cover-title { display: block; font-family: var(--hand); font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.3rem); line-height: 1; }

.film-doddy { position: absolute; z-index: 3; left: 0; bottom: -10px; width: clamp(120px, 15vw, 190px); }
.film-doddy .says {
  position: absolute; right: 58%; top: -30%;
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.2rem);
  white-space: nowrap; transform: rotate(-5deg); margin: 0;
}

.chapters { display: none; }
.js .chapters { list-style: none; margin: 28px 0 0; padding: 0 0 0 clamp(0px, 9vw, 120px); display: flex; flex-wrap: wrap; gap: 10px; }
.chapters button {
  display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px;
  padding: 8px 14px 9px; cursor: pointer; color: var(--reading-ink);
  background: var(--paper); border: 1px solid var(--separator); border-radius: 4px 14px 4px 14px;
  font-family: var(--hand); font-weight: 600; font-size: 1.35rem; line-height: 1.1;
  transition: border-color 150ms, box-shadow 150ms;
}
.chapters li:nth-child(odd) button { transform: rotate(-1.2deg); }
.chapters li:nth-child(even) button { transform: rotate(1deg); }
.chapters button:hover { border-color: var(--orange-cue); }
.chapters .t { font-family: var(--text); font-size: 0.75rem; font-weight: 600; color: var(--secondary-text); font-variant-numeric: tabular-nums; }
.chapters button[aria-current="true"] { border-color: var(--orange-cue); box-shadow: inset 0 -3px 0 var(--orange-cue); }
.film-caption { text-align: left; padding-left: clamp(0px, 9vw, 120px); margin-top: 18px; }

@media (max-width: 700px) {
  .film-stage, .js .chapters, .film-caption { padding-left: 0; }
  .film-card { padding: 7px; border-radius: 20px; }
  .player { border-radius: 14px; }
  /* Bottom-right on phones, clear of the "Watch the film" label; the note would run off-screen. */
  .film-doddy { width: 84px; left: auto; right: -4px; bottom: -50px; }
  .film-doddy .says { display: none; }
  .js .chapters { margin-top: 44px; flex-wrap: nowrap; overflow-x: auto; padding: 6px 2px 10px; scroll-snap-type: x mandatory; }
  .chapters li { flex: none; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .js .film-card, .play-dot, .chapters button { transition: none; }
}

/* ---------- Problem ---------- */

.problem { padding: 0 0 clamp(56px, 8vw, 104px); }
.problem-grid { display: grid; gap: 24px 64px; align-items: start; }
@media (min-width: 900px) { .problem-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.problem .display-m { max-width: 14ch; margin: 0; }
.scraps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; align-content: start; }
.scraps li {
  padding: 10px 16px;
  background: var(--paper); border: 1px solid var(--separator);
  border-radius: 4px 14px 4px 14px;
  font-family: var(--hand); font-weight: 600; font-size: 1.5rem; line-height: 1.1;
}
.scraps li:nth-child(odd) { transform: rotate(-1.5deg); }
.scraps li:nth-child(even) { transform: rotate(1.2deg); }

/* ---------- Section heads ---------- */

.section-head { display: grid; gap: 8px 64px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .display-m { margin: 0; }
.section-head p { color: var(--secondary-text); max-width: 34rem; margin: 0; align-self: end; }
@media (min-width: 900px) { .section-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

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

.how { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--separator); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 48px 32px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { min-width: 0; }
.step-visual {
  position: relative; display: grid; justify-items: center;
  padding: 32px 0 28px; margin-bottom: 24px;
  background: linear-gradient(to bottom, var(--paper), var(--quiet-surface));
  border: 1px solid var(--separator); border-radius: 28px;
  overflow: hidden;
}
.step-pose { position: absolute; left: 4%; bottom: 10px; width: 34%; max-width: 130px; }
.step-num {
  font-family: var(--display); font-weight: 800;
  font-size: 1rem; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 0 14px;
  background: var(--reading-ink); color: var(--canvas);
}
.step > p:not(.step-num):not(.says-small) { color: var(--secondary-text); max-width: 30rem; }

/* ---------- Receipt ---------- */

.receipt-section { padding: clamp(56px, 8vw, 104px) 0; }
.receipt-grid { display: grid; gap: 56px; align-items: center; }
.receipt-grid > div { min-width: 0; }
.receipt-grid > div > p { max-width: 32rem; }
@media (min-width: 900px) { .receipt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.no-match { display: flex; align-items: flex-end; gap: 4px; margin-top: 28px; }
.no-match-pose { width: 110px; flex: none; }
.no-match blockquote {
  margin: 0 0 40px; padding: 14px 18px;
  background: var(--paper); border: 1px solid var(--separator); border-radius: 18px 18px 18px 4px;
  max-width: 18rem;
}
.no-match blockquote p { font-family: var(--hand); font-weight: 700; font-size: 1.7rem; line-height: 1.05; margin: 0; }

.receipt {
  margin: 0; justify-self: center; width: min(100%, 440px);
  padding: 32px 30px 34px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px) 0 22px / 100% calc(100% - 44px) no-repeat,
    var(--quiet-surface);
  border-radius: 6px 6px 0 0;
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 18px 24px color-mix(in srgb, #000 18%, transparent));
  /* torn bottom edge */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, radial-gradient(circle at 8px 0, #000 7px, transparent 7.5px) bottom / 16px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, radial-gradient(circle at 8px 0, #000 7px, transparent 7.5px) bottom / 16px 10px repeat-x;
}
.receipt-text { font-family: var(--display); font-weight: 650; font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 22px; }
.receipt-meta { display: grid; gap: 8px; margin: 0 0 22px; padding: 16px 0; border-block: 1px dashed var(--separator); }
.receipt-meta div { display: flex; justify-content: space-between; gap: 16px; font-size: 0.9375rem; }
.receipt-meta dt { color: var(--secondary-text); }
.receipt-meta dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.receipt-label { font-size: 0.8125rem; font-weight: 650; color: var(--confirmed); margin: 0 0 4px; }
.receipt-original p:last-child { color: var(--secondary-text); margin: 0; }
.receipt .caption { margin-top: 18px; }

/* ---------- Voice ---------- */

.voice { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--separator); }
.voice-grid { display: grid; gap: 48px; align-items: center; }
.voice-grid > div { min-width: 0; }
.voice-grid > div > p:not(.pill) { max-width: 32rem; }
@media (min-width: 900px) { .voice-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.voice-art { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; align-items: end; }
.voice-pose { grid-row: span 2; align-self: end; }
.voice-states { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.voice-states li {
  padding: 6px 12px; border-radius: 999px; font-size: 0.875rem; font-weight: 600;
  border: 1px solid var(--separator); color: var(--secondary-text);
  transition: background 250ms ease, color 250ms ease, border-color 250ms ease;
}
.voice-states li.now { background: var(--reading-ink); border-color: var(--reading-ink); color: var(--canvas); }
.voice-card { padding: 18px; background: var(--paper); border: 1px solid var(--separator); border-radius: 22px; box-shadow: var(--lift); }
.voice-q { font-weight: 700; margin: 0 0 4px; }
.voice-quote { color: var(--secondary-text); margin: 0 0 14px; }
.voice-btn { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 14px; font-weight: 600; font-size: 0.9375rem; }
.voice-btn.primary { background: var(--reading-ink); color: var(--canvas); margin-bottom: 4px; }

/* ---------- Privacy (light paper panel) ---------- */

.privacy { padding: clamp(24px, 4vw, 48px) 0; }
.privacy-panel {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(36px, 6vw, 72px);
  border-radius: 36px;
  background: var(--paper);
  border: 1px solid var(--separator);
  box-shadow: var(--lift);
}
.privacy-panel::after {
  /* a soft warm corner, echoing the hero glow */
  content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--orange-cue) 16%, transparent), transparent);
  pointer-events: none; z-index: -1;
}
.privacy-panel .display-m { max-width: 14ch; }
.facts { list-style: none; margin: 40px 0 36px; padding: 0; display: grid; gap: 32px; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.facts svg {
  width: 52px; height: 52px; padding: 12px; margin-bottom: 16px; border-radius: 16px;
  background: var(--quiet-surface);
  fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.facts p { color: var(--secondary-text); margin: 0; font-size: 0.9375rem; }
.privacy-note {
  margin: 0; padding-top: 24px; font-size: 0.875rem; max-width: 46rem;
  border-top: 1px solid var(--separator);
  color: var(--secondary-text);
}

/* ---------- Meet ---------- */

.meet { padding: clamp(56px, 8vw, 104px) 0; }
.sketches { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .sketches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sketch { text-align: center; min-width: 0; }
.sketch img { width: 100%; max-width: 200px; margin: 0 auto; }
.sketch p { font-family: var(--hand); font-weight: 700; font-size: 1.65rem; line-height: 1.05; margin: 6px auto 0; max-width: 12ch; }

/* ---------- Join ---------- */

.join { padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 96px); }
.join-panel {
  display: grid; gap: 24px; align-items: end;
  padding: clamp(32px, 6vw, 64px);
  background:
    radial-gradient(60% 80% at 100% 100%, color-mix(in srgb, var(--orange-cue) 14%, transparent), transparent),
    var(--paper);
  border-radius: 36px;
  border: 1px solid var(--separator);
  box-shadow: var(--lift);
}
.join-copy { min-width: 0; }
.join-copy > p { max-width: 32rem; }
@media (min-width: 860px) { .join-panel { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.join-pose { display: block; max-width: 280px; justify-self: center; }

.waitlist { margin: 28px 0 24px; max-width: 34rem; }
.waitlist label { display: block; font-weight: 650; margin-bottom: 8px; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.field-row input {
  flex: 1 1 220px; min-width: 0; min-height: 54px; padding: 0 18px;
  border: 1.5px solid var(--secondary-text); border-radius: 16px;
  background: var(--canvas); color: var(--reading-ink); font: inherit;
}
.field-row input::placeholder { color: var(--secondary-text); opacity: 1; }
.field-row input[aria-invalid="true"] { border-color: var(--error); }
.form-note { margin: 12px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.status { min-height: 1.6em; margin: 10px 0 0; font-size: 0.9375rem; }
.status:empty { min-height: 0; margin: 0; }
.status.ok { color: var(--confirmed); }
.status.err { color: var(--error); }
.status.ok::before { content: "✓ "; }
.status.err::before { content: "! "; font-weight: 700; }
.open-app p { margin: 0; color: var(--secondary-text); }
.open-app .text-link { color: var(--reading-ink); margin-left: 4px; }

.later { display: grid; gap: 4px 64px; margin-top: 40px; color: var(--secondary-text); }
.later p { margin: 0; max-width: 40rem; }
.later-title { font-family: var(--display); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; color: var(--secondary-text); margin: 0; }
@media (min-width: 900px) { .later { grid-template-columns: 200px minmax(0, 1fr); } }

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

.foot { border-top: 1px solid var(--separator); padding: 40px 0 48px; font-size: 0.875rem; color: var(--secondary-text); }
.foot-inner { display: grid; gap: 8px; }
.foot .wordmark { color: var(--reading-ink); font-size: 2rem; margin: 0 0 4px; }
.foot p { max-width: 46rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .scribble { clip-path: none; }
  .js .hero:not(.loaded) .hero-pose { transform: none; }
}

/* Where Doddy overlaps a phone screen, a thin canvas-coloured halo keeps his lines readable in both themes. */
.hero-pose img, .step-pose img { filter: drop-shadow(0 0 1.5px var(--canvas)) drop-shadow(0 0 1.5px var(--canvas)) drop-shadow(0 0 1px var(--canvas)); }

/* On narrow screens the greeting would sit on the phone's text; the hero copy already introduces Doddy. */
@media (max-width: 959px) {
  .says { display: none; }
}

/* ---------- v3 additions ---------- */

/* Warm light behind the hero phone. */
.hero-glow {
  position: absolute; z-index: -1; left: 50%; top: 46%; width: 130%; aspect-ratio: 1; translate: -42% -50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--orange-cue) 22%, transparent), color-mix(in srgb, var(--orange-cue) 6%, transparent) 60%, transparent);
  pointer-events: none;
}
.hero-stage { isolation: isolate; }

/* A floating save receipt, the moment the app is built around. */
.hero-chip {
  position: absolute; z-index: 3; right: -6%; top: 66%;
  display: flex; align-items: flex-start; gap: 10px;
  width: min(250px, 62%); padding: 12px 14px;
  background: var(--paper); border: 1px solid var(--separator); border-radius: 16px;
  box-shadow: var(--lift);
  font-size: 0.8125rem; line-height: 1.4; color: var(--secondary-text);
  transform: rotate(-2deg);
}
.hero-chip strong { color: var(--confirmed); font-size: 0.875rem; }
.chip-check {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--confirmed); color: var(--paper); font-size: 0.8125rem; font-weight: 700;
}
@media (max-width: 959px) { .hero-chip { right: 0; top: 64%; } }

/* Footer links */
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; margin-bottom: 8px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.foot-links a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; color: var(--secondary-text); font-weight: 550; }
.foot-links a:hover { color: var(--reading-ink); }

/* ---------- Take a shot (court.js) ---------- */
.court { padding: 0 0 clamp(56px, 8vw, 104px); }
.court-panel {
  border-radius: 32px; border: 1px solid var(--separator); overflow: hidden;
  background:
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px),
    var(--paper);
  box-shadow: var(--lift);
}
#court { display: block; width: 100%; aspect-ratio: 800 / 520; max-width: 100%; touch-action: none; cursor: crosshair; }
.court-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 14px clamp(16px, 3vw, 28px); border-top: 1px solid var(--separator); background: var(--paper);
}
.court-score { margin: 0; color: var(--secondary-text); font-variant-numeric: tabular-nums; }
.court-score strong { color: var(--reading-ink); font-family: var(--display); font-size: 1.25rem; }

/* ---------- Remember it (memory.js) ---------- */
/* Twelve paper cards on the court's ruled panel; Doddy talks in a handwritten bubble beside them. */
.memory { display: none; padding: 0 0 clamp(56px, 8vw, 104px); }
.js .memory { display: block; }
.memory-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px); gap: 24px; align-items: end;
  padding: clamp(16px, 3vw, 32px);
}
.memory-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 14px); }
@media (max-width: 1100px) { .memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mem-card { aspect-ratio: 4 / 5; padding: 0; border: 0; background: none; cursor: pointer; perspective: 800px; border-radius: 14px; color: var(--reading-ink); }
.mem-card[aria-disabled="true"] { cursor: default; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 420ms cubic-bezier(.2,.8,.2,1); }
.mem-card.up .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front {
  position: absolute; inset: 0; display: grid; place-items: center;
  border: 1px solid var(--separator); border-radius: 14px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: var(--lift);
}
.mem-back {
  background: repeating-linear-gradient(to bottom, transparent 0 15px, var(--rule) 15px 16px), var(--quiet-surface);
  font-family: var(--hand); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); color: var(--secondary-text);
  transition: transform 150ms ease, border-color 150ms ease;
}
.mem-card:hover:not(.up) .mem-back { border-color: var(--orange-cue); transform: translateY(-2px); }
.mem-front {
  transform: rotateY(180deg); background: var(--paper);
  grid-template-rows: minmax(0, 1fr) auto; padding: 10% 8% 8%; gap: 4px;
}
.mem-front svg { width: 72%; height: 100%; max-height: 84px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mem-front svg .acc { fill: var(--orange-cue); stroke-width: 2; }
.mem-label { font-family: var(--hand); font-weight: 700; font-size: clamp(1rem, .8rem + .7vw, 1.35rem); line-height: 1; text-align: center; }
.mem-card.matched .mem-front { border-color: var(--confirmed); box-shadow: inset 0 -4px 0 var(--confirmed), var(--lift); }

.memory-doddy { display: grid; justify-items: center; gap: 10px; }
.memory-doddy img { width: min(100%, 200px); }
.memory-bubble {
  margin: 0; padding: 12px 16px; justify-self: stretch;
  background: var(--paper); border: 1px solid var(--separator); border-radius: 18px 18px 4px 18px;
  font-family: var(--hand); font-weight: 700; font-size: 1.55rem; line-height: 1.05; min-height: 3.6em;
}
.memory-bubble.pop { animation: bubble-pop 260ms cubic-bezier(.2,.8,.2,1); }
@keyframes bubble-pop { from { transform: translateY(6px) scale(.97); opacity: .4; } }

@media (max-width: 760px) {
  .memory-stage { grid-template-columns: minmax(0, 1fr); }
  .memory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-doddy { order: -1; grid-template-columns: 84px minmax(0, 1fr); align-items: end; justify-items: stretch; }
  .memory-doddy img { order: -1; width: 84px; }
  .memory-bubble { font-size: 1.3rem; min-height: 0; border-radius: 18px 18px 18px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .mem-inner, .mem-back { transition: none; }
  .memory-bubble.pop { animation: none; }
}

/* ---------- Optional questions after signup ---------- */
.answers { margin: 22px 0 24px; max-width: 34rem; padding: 22px 22px 18px; background: var(--paper); border: 1px solid var(--separator); border-radius: 24px; }
.answers .says-small { margin: 0 0 6px; font-size: 1.7rem; }
.answers .says-small:focus { outline: none; }
.answers .q { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.answers legend, .answers label[for] { display: block; font-weight: 650; margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--separator); background: var(--canvas); font-weight: 600; font-size: 0.9375rem;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.chip:hover span { border-color: var(--secondary-text); }
.chip input:checked + span { background: var(--reading-ink); border-color: var(--reading-ink); color: var(--canvas); }
.chip input:focus-visible + span { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.answers textarea {
  width: 100%; min-height: 88px; padding: 12px 14px; resize: vertical;
  border: 1.5px solid var(--secondary-text); border-radius: 16px; background: var(--canvas); color: var(--reading-ink); font: inherit;
}
.answers textarea::placeholder { color: var(--secondary-text); opacity: 1; }
.answers-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.link-button {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  font: 600 1rem var(--text); color: var(--reading-ink);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--orange-cue);
}

/* ---------- Analytics consent (analytics.js; only shown when GA is configured) ---------- */

.consent {
  position: fixed; z-index: 50; left: 16px; right: 16px; bottom: 16px;
  max-width: 34rem; margin: 0 auto; padding: 18px 20px;
  background: var(--paper); color: var(--reading-ink);
  border: 1px solid var(--separator); border-radius: 22px; box-shadow: var(--lift);
  font-size: 0.9375rem;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 14px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button.quiet { background: transparent; color: var(--reading-ink); box-shadow: inset 0 0 0 1.5px var(--separator); }
.button.quiet:hover { box-shadow: inset 0 0 0 1.5px var(--reading-ink); }
.foot-choice { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
