/* Landing page styles. Every value comes from tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: 1.2;
  letter-spacing: var(--tracking-body);
  overflow-x: clip;
}
h1, h2, h3, p, figure { margin: 0; font-weight: 400; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--focus-ring-on-dark); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Type */
.display-lg { font-family: var(--font-display); font-size: var(--text-display-lg); line-height: 1; letter-spacing: var(--tracking-display-lg); }
.body-lg { font-size: var(--text-body-lg); line-height: 1.2; letter-spacing: var(--tracking-body-lg); }
.small { font-size: var(--text-small); line-height: 1.2; letter-spacing: var(--tracking-small); }
.muted { color: var(--text-secondary); }
.label { font-size: var(--text-small); letter-spacing: var(--tracking-small); text-transform: uppercase; color: var(--text-secondary); }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-btn);
  background: var(--action-fill); color: var(--action-text);
  border: 1px solid var(--action-fill);
  font: inherit; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--action-fill-hover); border-color: var(--action-fill-hover); }
/* Light button for use on the hero photo */
.btn-light { background: var(--field-fill); color: var(--action-fill); border-color: var(--field-fill); }
.btn-light:hover { background: var(--surface-1); border-color: var(--surface-1); }

/* Layout */
.section { padding: var(--section-y) var(--gutter); }
.wrap { max-width: var(--content-max); margin: 0 auto; }
.center-copy { max-width: 640px; margin: 0 auto; text-align: center; }
.center-copy > p { max-width: 560px; margin: var(--space-5) auto 0; }

/* ---------- Story scroll: hero + statement ---------- */

/* Hero (static layout first; the pinned layout below overrides it) */
.scene-hero {
  position: relative;
  width: 100%;
  height: max(640px, calc(100vw * 941 / 1672));
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--text-on-dark);
  background: var(--scrim);
  overflow: clip; /* not hidden: a hidden box can still be scrolled sideways by focus */
}
.stage { position: absolute; inset: 0; }
.stage img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--scrim) 92%, transparent) 0%,
    color-mix(in srgb, var(--scrim) 80%, transparent) 26%,
    transparent 40%);
}
.hero-layer {
  position: relative; flex: 1;
  display: flex; flex-direction: column; justify-content: space-between;
}
.nav {
  display: flex; justify-content: space-between; align-items: center;
  height: var(--nav-height); padding: 0 var(--gutter);
  max-width: var(--page-max); width: 100%; margin: 0 auto;
}
.brand { font-family: var(--font-display); font-size: var(--text-brand); letter-spacing: var(--tracking-display-xl); }
.nav-pill {
  display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1);
  background: var(--field-fill); border: 1px solid var(--border-subtle); border-radius: var(--radius-nav);
}
.nav-pill a { min-height: 40px; padding: 0 18px; border-radius: var(--radius-card); }
.nav-link { display: inline-flex; align-items: center; color: var(--text-primary); text-decoration: none; }
.nav-link:hover { background: var(--surface-1); }
.hero-copy {
  flex: 1; padding: var(--space-9) var(--gutter) 0;
  max-width: var(--page-max); width: 100%; margin: 0 auto;
}
.hero-copy h1 { max-width: min(400px, max(26vw, 300px)); }
.hero-copy p { max-width: min(340px, max(26vw, 300px)); margin-top: var(--space-5); }
.hero-cta { margin-top: var(--space-6); }
.hero-copy p.hero-note { margin-top: var(--space-4); }
.ext-icon { margin-left: var(--space-2); flex: none; }
.wordmark {
  padding: var(--space-6) var(--gutter) var(--space-5);
  max-width: var(--page-max); width: 100%; margin: 0 auto;
  font-family: var(--font-display); font-size: var(--text-wordmark);
  line-height: .95; letter-spacing: var(--tracking-display-xl);
}

/* Statement with scattered faces (static) */
.scene-statement { position: relative; padding: var(--section-y) var(--gutter); background: var(--surface-1); }
.statement-bg { display: none; }
.scatter { position: relative; max-width: var(--content-max); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--space-7); }
.statement-copy { text-align: center; max-width: 640px; }
.statement-copy p { margin-top: var(--space-5); }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-6); }
.slot { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); width: 200px; text-align: center; }
.av {
  width: var(--avatar-size); height: var(--avatar-size);
  border-radius: var(--radius-full); object-fit: cover; background: var(--surface-2);
}
/* Question bubble, after the old luffu.com homepage: frosted, see-through, thin border, one line */
.chip {
  background: var(--bubble-fill);
  -webkit-backdrop-filter: blur(var(--bubble-blur)); backdrop-filter: blur(var(--bubble-blur));
  border: 1px solid var(--bubble-border); border-radius: var(--radius-bubble);
  padding: var(--space-2) var(--space-3);
  color: var(--bubble-text);
  font-size: var(--text-body); line-height: 1.2; letter-spacing: var(--tracking-body);
}
.lifters { display: none; }

@media (min-width: 1200px) {
  .chip { white-space: nowrap; }
  .scatter { display: block; max-width: var(--page-max); height: 900px; }
  .statement-copy { position: absolute; left: 50%; top: 470px; transform: translateX(-50%); width: 460px; }
  .slots { display: block; }
  .slot { position: absolute; left: calc(var(--x) - var(--avatar-size) / 2); top: var(--y); width: var(--avatar-size); display: block; }
  .slot .chip { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); }
  .slot.up .chip { top: auto; bottom: 100%; }
  .slot.right .chip { left: calc(100% + var(--space-2)); top: 50%; transform: translateY(-50%); }
}

/* ---------- Pinned mode (added by js/story-scroll.js) ----------
   JS sets these on .story-scroll every frame (all 0..1): --bg-in, --bg2-in, --copy-in.
   Each .slot gets --chip (its bubble's opacity). */
.story-scroll.is-pinned { height: 400vh; } /* 300vh of scroll drives the transition */
.is-pinned .story-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: clip;
}
.is-pinned .scene-hero { position: absolute; inset: 0; width: auto; height: auto; }
.is-pinned .stage {
  inset: auto; left: 50%; top: 50%;
  width: max(100%, calc(100svh * 1672 / 941));
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
}
.is-pinned .hero-layer { opacity: calc(1 - var(--bg-in, 0)); }
.is-pinned.hero-gone .hero-layer { visibility: hidden; }

.is-pinned .scene-statement { position: absolute; inset: 0; padding: 0; background: none; }
/* While the hero is still showing, clicks go through to its nav and form */
.is-pinned:not(.hero-gone) .scene-statement { pointer-events: none; }
.is-pinned .statement-bg { display: block; position: absolute; inset: 0; background: var(--surface-0); opacity: var(--bg-in, 0); }
.is-pinned .statement-bg-2 { background: var(--surface-1); opacity: var(--bg2-in, 0); }
.is-pinned .scatter { position: absolute; inset: 0; max-width: none; height: auto; margin: 0; padding: var(--space-8) var(--gutter); justify-content: center; }
.is-pinned .statement-copy { position: relative; opacity: var(--copy-in, 0); }
.is-pinned.copy-hidden .statement-copy { visibility: hidden; }
.is-pinned .slot .av { visibility: hidden; }
.is-pinned .lifters { display: block; position: absolute; inset: 0; pointer-events: none; }
.lifter {
  position: absolute; left: 0; top: 0;
  width: 100px; height: 100px;
  border-radius: var(--radius-full); object-fit: cover;
  transform-origin: 0 0;
  opacity: 0;
  will-change: transform, opacity;
}

/* Pinned, compact (tablet and phone): faces in a grid above the copy, chips hidden */
.is-pinned .slots { display: grid; grid-template-columns: repeat(3, var(--avatar-size)); gap: var(--space-4) var(--space-6); order: -1; }
.is-pinned .slot { width: auto; }
.is-pinned .slot .chip { display: none; }
@media (min-width: 768px) {
  .is-pinned .slots { grid-template-columns: repeat(6, var(--avatar-size)); gap: var(--space-4); }
}

/* Pinned, wide: scattered around the copy, sized to the viewport */
@media (min-width: 1100px) and (min-height: 680px) {
  .is-pinned .scatter { display: block; padding: 0; }
  .is-pinned .statement-copy { position: absolute; left: 50%; top: 62%; width: min(460px, 38vw); transform: translate(-50%, -50%); }
  .is-pinned .slots { display: block; }
  .is-pinned .slot { position: absolute; left: calc(var(--x) - var(--avatar-size) / 2); top: var(--yv); width: var(--avatar-size); }
  .is-pinned .slot .chip {
    display: block; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
    white-space: nowrap;
    opacity: var(--chip, 0);
  }
  .is-pinned .slot.up .chip { top: auto; bottom: 100%; }
  .is-pinned .slot.right .chip { left: calc(100% + var(--space-2)); top: 50%; transform: translateY(-50%); }
  /* Below the avatar, running outward (away from the heading), as on Luffu */
  .is-pinned .slot.pin-left .chip { left: auto; right: 0; transform: none; }
  .is-pinned .slot.pin-right .chip { left: 0; transform: none; }
  .is-pinned .slot.chip-off .chip { visibility: hidden; }
}

/* ---------- Rest of page ---------- */
/* Feature motion cards: a tall panel, then a centred label and copy (Luffu media stack).
   js/motion-cards.js sets data-step on each panel to run its loop; with no data-step
   (no JS, reduced motion) each panel shows one still, finished frame. */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature { text-align: center; }
.feature .label { margin-top: var(--space-5); }
.feature h3 { margin-top: var(--space-2); }
.feature-copy { max-width: 340px; margin: var(--space-2) auto 0; color: var(--text-secondary); }
.media {
  position: relative; aspect-ratio: var(--media-ratio); overflow: clip;
  min-height: 0; /* keep the 4:5 shape even when the content is taller */
  border-radius: var(--radius-card);
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space-6) var(--space-5) var(--space-5);
  text-align: center;
}
.media img { border-radius: var(--radius-full); object-fit: cover; }
.media [data-hide] { display: none; }
.media > *, .ans-stage > * { transition: opacity 400ms ease, transform 400ms ease; }

/* Ask: guided prompts. For each family member a carousel of prompt cards (from the app's
   prompt library) slides along to the suggested one, which is ticked; its full question drops
   into the WhatsApp message, and on Send the cards clear and the message lands as sent.
   States (set by JS): data-avatar = ring | in | out; data-step = deal | pick | ready | press | sent | clear.
   With no data-step the panel shows one still frame: card picked, message ready to send. */
.media-ask { background: var(--surface-2); container-type: inline-size; padding-top: var(--space-5); }
.ask-person { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); color: var(--text-secondary); font-size: var(--text-small); }
.ask-person img { width: 56px; height: 56px; border: 3px solid var(--surface-0); transition: transform 600ms cubic-bezier(.22,1,.36,1), opacity 500ms ease; }
.ask-person span { transition: opacity 400ms ease; }
.media-ask[data-avatar="ring"] .ask-person img { transform: scale(.55); opacity: .25; }
.media-ask[data-avatar="ring"] .ask-person span,
.media-ask[data-avatar="out"] .ask-person span { opacity: 0; }
.media-ask[data-avatar="out"] .ask-person img { transform: scale(.25); opacity: 0; }

.ask-eyebrow { margin-top: var(--space-2); font-size: var(--text-small); letter-spacing: var(--tracking-small); text-transform: uppercase; color: var(--text-secondary); transition: opacity 400ms ease; }

/* The prompt carousel (like the app's Prompts tab): one card in focus, its neighbours peeking
   in smaller and faded. JS sets --f (the focused index) on .ask-deck and slides it along. */
.ask-deck { position: relative; width: 100%; height: 160px; margin-top: var(--space-2); transition: opacity 450ms ease, transform 450ms ease; }
.pcard {
  --w: min(196px, 58cqi);
  --step: calc(var(--w) + 12px);
  position: absolute; top: 4px; left: 50%; width: var(--w); height: 152px; margin-left: calc(var(--w) / -2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--dialog-fill); border: 1px solid var(--border-subtle); border-radius: var(--radius-card);
  text-align: center; opacity: .5;
  transform: translateX(calc((var(--i) - var(--f, 0)) * var(--step))) scale(.88);
  transition: transform 600ms cubic-bezier(.22,1,.36,1), opacity 400ms ease, border-color 300ms ease;
}
.pcard.is-focus { z-index: 2; opacity: 1; transform: translateX(calc((var(--i) - var(--f, 0)) * var(--step))) scale(1); }
.pcard-title { font-family: var(--font-display); font-size: var(--text-body-lg); line-height: 1.1; letter-spacing: var(--tracking-body-lg); color: var(--text-primary); }
.pcard-q { font-size: var(--text-small); line-height: 1.3; letter-spacing: var(--tracking-small); color: var(--text-secondary); }
.pcard-tick {
  position: absolute; top: -8px; right: -8px; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: var(--radius-full);
  background: var(--action-fill); color: var(--action-text);
  opacity: 0; transform: scale(.4); transition: opacity 250ms ease, transform 300ms cubic-bezier(.22,1,.36,1);
}
/* Picked: outlined and ticked */
.pcard.is-picked { border-color: var(--border-strong); outline: 1px solid var(--border-strong); outline-offset: 0; }
.pcard.is-picked .pcard-tick { opacity: 1; transform: none; }
/* Cards wait off to the right, slide in, and clear upward once sent */
.media-ask[data-step="deal-start"] .pcard { transition: none; }
.media-ask[data-step="deal-start"] .ask-deck,
.media-ask[data-step="clear"] .ask-deck { opacity: 0; }
.media-ask[data-step="sent"] .ask-deck { opacity: 0; transform: translateY(-16px); }
.media-ask[data-step="sent"] .ask-eyebrow,
.media-ask[data-step="clear"] .ask-eyebrow,
.media-ask[data-step="deal-start"] .ask-eyebrow { opacity: 0; }

/* Sent message: lands where the cards were */
.ask-sent { position: absolute; left: var(--space-5); right: var(--space-5); bottom: 100px; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); opacity: 0; transform: translateY(16px); transition: opacity 400ms ease, transform 400ms ease; }
.media-ask[data-step="sent"] .ask-sent { opacity: 1; transform: none; }
.ask-bubble { width: min(260px, 82%); border-radius: var(--radius-card); overflow: clip; background: var(--action-fill); color: var(--action-text); text-align: left; }
/* Rich link preview, like a shared invite in WhatsApp or iMessage: a photo to jog the memory
   with the question over it, then a footer band with the call to answer. */
.ask-preview { position: relative; height: min(128px, 38cqi); }
.ask-preview img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; object-fit: cover; object-position: var(--pos, center); }
.ask-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--scrim) 78%, transparent) 0%, color-mix(in srgb, var(--scrim) 35%, transparent) 70%, transparent 100%); }
.ask-preview-q { position: relative; z-index: 1; padding: var(--space-3) var(--space-3) 0; font-family: var(--font-display); font-size: var(--text-body-lg); line-height: 1.1; letter-spacing: var(--tracking-body-lg); color: var(--text-on-dark); }
.ask-preview-foot { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3) var(--space-3); font-size: var(--text-small); }
.ask-preview-site { color: var(--text-on-dark-muted); opacity: .8; }
.ask-meta { font-size: var(--text-small); color: var(--text-secondary); }

/* WhatsApp message field: the picked question drops in, ready to send */
.ask-input {
  position: absolute; left: var(--space-5); right: var(--space-5); bottom: var(--space-5);
  display: flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: var(--space-2) 6px var(--space-2) var(--space-4);
  background: var(--bubble-fill); border: 1px solid var(--bubble-border); border-radius: var(--radius-card);
  -webkit-backdrop-filter: blur(var(--bubble-blur)); backdrop-filter: blur(var(--bubble-blur));
  font-family: var(--font-body); font-size: var(--text-small); line-height: 1.3; letter-spacing: var(--tracking-small); text-align: left;
}
.ask-text { flex: 1; min-width: 0; transition: opacity 350ms ease, transform 350ms ease; }
.ask-text:empty::before { content: "Message\2026"; color: var(--text-secondary); }
.ask-send { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; border-radius: var(--radius-btn); background: var(--action-fill); color: var(--action-text); font-family: var(--font-body); font-size: var(--text-small); opacity: 0; transition: opacity 300ms ease, transform 150ms ease; }
.media-ask:not([data-step]) .ask-send,
.media-ask[data-step="ready"] .ask-send,
.media-ask[data-step="press"] .ask-send { opacity: 1; }
.media-ask[data-step="press"] .ask-send { transform: scale(.94); }
.media-ask[data-step="pick"] .ask-text { opacity: 0; transform: translateY(-6px); }

/* Answer: family members answering out loud, after Luffu's voice-logging video.
   One person at a time: a ring grows and the photo fades in, a dotted line draws out from the
   centre, bars swell while they talk and their words land one by one, then it all collapses
   and the next person arrives. The light slowly dims across the loop.
   States (set by JS): data-avatar = ring | in | out, data-wave = hidden | in | out.
   With no data-avatar (no JS, reduced motion) it shows one still frame. */
.media-answer {
  background: linear-gradient(160deg, var(--answer-light) 0%, var(--answer-dark) 80%);
  color: var(--text-on-dark);
  padding-top: var(--space-9);
}
.ans-shade { position: absolute; inset: 0; background: var(--answer-dark); opacity: var(--shade, 0); transition: opacity 1.6s ease; pointer-events: none; }
.media-answer > :not(.ans-shade) { position: relative; }
.ans-who { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.ans-avatar {
  display: block; width: 104px; height: 104px; border-radius: var(--radius-full);
  border: 2px solid var(--avatar-ring); overflow: clip;
  transition: transform 600ms cubic-bezier(.22,1,.36,1), opacity 500ms ease;
}
.ans-avatar img { width: 100%; height: 100%; display: block; transition: opacity 600ms ease; }
.ans-name { font-size: var(--text-small); color: var(--text-on-dark-muted); transition: opacity 400ms ease; }
.media-answer[data-avatar="ring"] .ans-avatar { transform: scale(.55); }
.media-answer[data-avatar="ring"] .ans-avatar img,
.media-answer[data-avatar="ring"] .ans-name { opacity: 0; }
.media-answer[data-avatar="out"] .ans-avatar { transform: scale(.25); opacity: 0; }
.media-answer[data-avatar="out"] .ans-name { opacity: 0; }

.ans-wave {
  display: flex; align-items: center; justify-content: space-between;
  width: 80%; height: 36px; margin-top: var(--space-9);
  transition: transform 500ms cubic-bezier(.22,1,.36,1), opacity 400ms ease;
}
.ans-wave i { width: 1.5px; height: 100%; border-radius: 1px; background: var(--wave-tick); transform: scaleY(var(--s, .09)); }
.media-answer[data-wave="hidden"] .ans-wave { transform: scaleX(0); opacity: 0; transition: none; }
.media-answer[data-wave="out"] .ans-wave { transform: scaleX(.12); opacity: 0; }

.ans-words {
  max-width: 92%; min-height: 2.6em; margin-top: var(--space-4);
  font-family: var(--font-display); font-style: italic; font-size: var(--text-body-lg); line-height: 1.3;
  color: var(--text-on-dark); transition: opacity 400ms ease;
}
.ans-words.is-fading { opacity: 0; }
.ans-words span { opacity: .78; }
.ans-words .k { font-style: normal; opacity: 1; }
.media-answer[data-avatar] .ans-words span { opacity: 0; transition: opacity 220ms ease; }
.media-answer[data-avatar] .ans-words span.heard { opacity: .4; }
.media-answer[data-avatar] .ans-words span.said { opacity: .78; }
.media-answer[data-avatar] .ans-words span.k.said { opacity: 1; }

/* Keep: Grandma's book, after Apple Books. The closed cover swings open to the contents,
   the list fills in, then pages turn one at a time through the chapters, and it loops.
   States (set by JS): data-step = reset | closed | open | closing; pages get .is-turned.
   With no data-step the panel shows the still frame: open at Chapter 1. */
.media-keep { background: var(--surface-1); justify-content: center; container-type: inline-size; }
.book { position: relative; width: min(240px, 76cqi); aspect-ratio: 3 / 4; perspective: 1400px; transition: opacity 500ms ease, transform 500ms ease; }
/* Page edges behind the top page, so it reads as a thick book (layered fills, no shadow) */
.book::before, .book::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--border-subtle);
  border-radius: 2px var(--radius-card) var(--radius-card) 2px; background: var(--surface-0);
}
.book::before { transform: translate(6px, 6px); }
.book::after { transform: translate(3px, 3px); }
.book-page {
  position: absolute; inset: 0; z-index: var(--z);
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--book-paper); border: 1px solid var(--border-subtle); border-left: 3px solid var(--surface-2);
  border-radius: 2px var(--radius-card) var(--radius-card) 2px;
  text-align: left; transform-origin: left center; backface-visibility: hidden;
  transition: transform 1000ms cubic-bezier(.45,.05,.25,1), opacity 450ms ease 500ms;
}
.book-page.is-turned { transform: rotateY(-170deg); opacity: 0; }

/* Cover */
.book-cover { align-items: center; justify-content: center; gap: var(--space-2); text-align: center;
  background: var(--book-cover); border-color: var(--book-cover); border-left-color: var(--book-cover); color: var(--text-on-dark); }
.cover-rule { position: absolute; inset: var(--space-2); border: 1px solid var(--book-rule-on-dark); border-radius: 2px; }
.cover-photo { width: 44%; aspect-ratio: 1; height: auto; border: 2px solid var(--avatar-ring); }
.cover-title { margin-top: var(--space-2); font-family: var(--font-display); font-size: var(--text-display-md); line-height: 1; letter-spacing: var(--tracking-display-lg); }
.cover-sub { font-size: var(--text-small); color: var(--text-on-dark-muted); }

/* Contents */
.page-kicker { font-size: var(--text-small); letter-spacing: var(--tracking-small); text-transform: uppercase; color: var(--text-secondary); }
.contents-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.contents-list li { display: flex; align-items: baseline; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-body); color: var(--text-secondary); transition: opacity 350ms ease, color 300ms ease; }
.contents-dots { flex: 1; border-bottom: 1px dotted var(--border-subtle); transform: translateY(-4px); min-width: var(--space-3); }
.contents-num { font-family: var(--font-body); font-size: var(--text-small); }
.contents-list li.is-current { color: var(--text-primary); }
.media-keep[data-step] .contents-list li:not(.is-shown) { opacity: 0; }

/* Chapter page */
.chapter-q { font-family: var(--font-display); font-size: var(--text-body); line-height: 1.15; letter-spacing: var(--tracking-body); color: var(--text-primary); }
.media img.chapter-photo { width: 100%; height: min(72px, 20cqi); border-radius: 2px; object-fit: cover; object-position: var(--pos, center); }
.chapter-text {
  font-family: var(--font-display); font-style: italic; font-size: var(--text-small); line-height: 1.35; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.page-num { margin-top: auto; text-align: center; font-size: var(--text-small); color: var(--text-secondary); }

/* Loop states */
.media-keep[data-step="reset"] .book,
.media-keep[data-step="reset"] .book-page { transition: none; }
.media-keep[data-step="reset"] .book { opacity: 0; }
.media-keep[data-step="closing"] .book { opacity: 0; transform: scale(.96); }

@media (prefers-reduced-motion: reduce) {
  .media *, .media *::before, .media *::after { animation: none !important; transition: none !important; }
}

.waitlist { background: var(--surface-1); }
.stack { display: flex; justify-content: center; margin-bottom: var(--space-6); }
.stack img { width: var(--avatar-size-sm); height: var(--avatar-size-sm); border-radius: var(--radius-full); object-fit: cover; border: 3px solid var(--surface-1); }
.stack img + img { margin-left: calc(var(--space-4) * -1); }
.waitlist-cta { margin-top: var(--space-7); }
.waitlist .note { margin-top: var(--space-4); }

.footer { background: var(--surface-1); padding: var(--space-9) var(--gutter) var(--space-6); border-top: 1px solid var(--border-subtle); }
.footer-inner { max-width: var(--content-max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-7) var(--space-9); }
.footer-brand { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8); min-height: 160px; }
.footer-mark { font-family: var(--font-display); font-size: var(--text-footer-mark); line-height: 1; letter-spacing: var(--tracking-display-xl); }
.footer-links { display: flex; flex-direction: column; gap: 14px; min-width: 200px; padding-left: var(--space-7); border-left: 1px solid var(--border-subtle); }
.footer-links a { color: var(--text-secondary); text-decoration: none; padding: 4px 0; }
.footer-links a:hover { color: var(--text-primary); text-decoration: underline; }

/* Phone */
@media (max-width: 767px) {
  .scrim { background: linear-gradient(180deg,
    color-mix(in srgb, var(--scrim) 88%, transparent) 0%,
    color-mix(in srgb, var(--scrim) 55%, transparent) 55%,
    color-mix(in srgb, var(--scrim) 80%, transparent) 100%); }
  .hero-copy { padding-top: var(--space-6); }
  .hero-copy h1, .hero-copy p { max-width: 100%; }
  .nav-pill .nav-link { display: none; }
}

/* ---------- Waitlist dialog (opened from the nav, like the old luffu.com) ---------- */
html:has(.waitlist-dialog[open]) { overflow: hidden; }
.waitlist-dialog {
  width: min(var(--dialog-width), calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  overflow: auto;
  margin: auto;
  padding: var(--space-8) var(--space-6) var(--space-6);
  border: 0; border-radius: var(--radius-card);
  background: var(--dialog-fill); color: var(--text-primary);
  opacity: 0;
  transition: opacity var(--motion-fade) ease, overlay var(--motion-fade) allow-discrete, display var(--motion-fade) allow-discrete;
}
.waitlist-dialog::backdrop {
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--motion-fade) ease, overlay var(--motion-fade) allow-discrete, display var(--motion-fade) allow-discrete;
}
.waitlist-dialog[open], .waitlist-dialog[open]::backdrop { opacity: 1; }
@starting-style {
  .waitlist-dialog[open], .waitlist-dialog[open]::backdrop { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .waitlist-dialog, .waitlist-dialog::backdrop { transition: none; }
}
.dialog-close {
  position: absolute; top: var(--space-2); right: var(--space-2);
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-btn); background: transparent;
  color: var(--text-primary); font: inherit; font-size: var(--text-small); cursor: pointer;
}
.dialog-close:hover { background: var(--surface-1); }
.dialog-brand { text-align: center; font-family: var(--font-display); font-size: var(--text-brand); letter-spacing: var(--tracking-display-xl); color: var(--text-secondary); }
.dialog-title { margin-top: var(--space-4); text-align: center; font-family: var(--font-display); font-size: var(--text-display-lg); line-height: 1; letter-spacing: var(--tracking-display-lg); }
.dialog-desc { margin-top: var(--space-3); text-align: center; }
.dialog-form { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-6); }
.field-group { display: flex; flex-direction: column; gap: var(--space-2); }
.field-label { font-size: var(--text-small); letter-spacing: var(--tracking-small); }
.field-row { display: flex; flex-direction: column; gap: var(--space-2); }
.dialog-form input {
  min-height: 44px; padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-card);
  background: var(--field-fill); color: var(--text-primary); font: inherit;
}
.dialog-form input:hover { border-color: var(--text-secondary); }
.dialog-form input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; border-color: var(--border-strong); }
.dialog-submit { width: 100%; }

/* Waitlist form status */
.form-status { min-height: 1.4em; margin: 0; }
.form-status[data-kind="error"] { color: var(--text-error); }
.form-status[data-kind="success"] { color: var(--text-primary); }
.dialog-form input[aria-invalid="true"] { border-color: var(--text-error); }
.dialog-submit:disabled { opacity: .6; cursor: default; }

/* Legal pages (privacy.html, terms.html). Tokens only. */
.legal { max-width: 720px; margin: 0 auto; padding: var(--space-8) var(--gutter) var(--space-9); }
.legal-back { display: inline-block; margin-bottom: var(--space-7); color: var(--text-secondary); text-decoration: none; }
.legal-back:hover { color: var(--text-primary); text-decoration: underline; }
.legal h1 { font-family: var(--font-display); font-size: var(--text-display-lg); line-height: 1; letter-spacing: var(--tracking-display-lg); margin-bottom: var(--space-3); }
.legal h2 { font-family: var(--font-display); font-size: var(--text-display-md); line-height: 1.1; margin: var(--space-8) 0 var(--space-3); }
.legal p, .legal li { font-size: var(--text-body); line-height: 1.5; color: var(--text-primary); }
.legal p { margin-bottom: var(--space-4); }
.legal ul { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.legal li { margin-bottom: var(--space-2); }
.legal a { text-decoration: underline; }
