/*
 * Lanternling stylesheet - hand-written and token-driven.
 *
 * design.md §2 rejected Tailwind in favour of this; the condition was
 * machine-checked token discipline, which lives in
 * app/tests/test_css_tokens.py. Outside :root every colour, font
 * size, radius and spacing value must come from a token below.
 *
 * The VALUES are marketing's (marketing/brand-tokens.md v1.0) and the
 * token names are theirs verbatim. Do not invent one here.
 */

/* ------------------------------------------------------------ fonts
 *
 * Self-hosted: the charter forbids CDN assets, so these ship the same
 * way htmx and alpine do. Licence and provenance: fonts/LICENSE.md.
 *
 * BOTH subsets ship for BOTH families, and dropping latin-ext is a
 * silent, locale-specific failure: `ő` (U+0151) and `ű` (U+0171) live
 * in latin-ext, while `á é í ó ö ú ü` live in latin. Our Hungarian
 * brand name is Mesébeillő. With latin-ext gone, English renders
 * pristine and Hungarian falls back to another face for exactly two
 * letters - the kind of bug nobody notices until a Hungarian
 * customer does.
 */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

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

/* The two other faces a book's text can be set in (MES-803). They are
 * the book's, not the site's: only the font picker's samples and the
 * reader's page text name them, so a browser fetches them only on
 * those two screens.
 *
 * Andika is the whole upstream TTF, unmodified, and not a subset:
 * its licence reserves the name "Andika", and the OFL FAQ counts a
 * web subset as a modified version, which may not carry a reserved
 * name. Playpen Sans reserves none, so it ships as Google's latin +
 * latin-ext subsets like the site's own two families.
 *
 * Playpen Sans sets about 4% wider than Fraunces; the PDF sets it at
 * 0.96 of the size so a page holds, and `size-adjust` does the same
 * here, so the sample and the reader show the book's own measure. */
@font-face {
  font-family: "Andika";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/andika-regular.ttf") format("truetype");
}

@font-face {
  font-family: "Playpen Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  size-adjust: 96%;
  src: url("/static/fonts/playpensans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Playpen Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  size-adjust: 96%;
  src: url("/static/fonts/playpensans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------- tokens */

:root {
  /* colour - marketing/brand-tokens.md §1.
   *
   * BINDING RULES. Every ratio below is computed (WCAG 2.1 relative
   * luminance), not estimated:
   *
   *   --c-lantern-gold and --c-glow are DECORATIVE ONLY on light
   *   ground - 1.70:1 and 1.26:1 on parchment. Never text, never a
   *   focus ring, never the sole indicator of state. They are for
   *   glows, gradients, illustration fills - and the ONE gold-filled
   *   element per screen, the primary action, whose text is ink-night
   *   (8.73:1 on gold).
   *
   *   For gold-family text, icons, links and focus rings on light
   *   ground use --c-gold-ink (5.49:1). Use --c-sage-ink (6.00:1) for
   *   success/calm and --c-rose-ink (6.19:1) for gentle warnings.
   *   --c-sage (2.52:1) and --c-rose-dust (2.19:1) are dark-ground
   *   only.
   *
   *   Focus rings: --focus-light on light ground, --focus-dark on
   *   dark. Never signal state by glow alone - pair it with shape,
   *   text or an icon.
   */
  --c-ink-night: #16213a;
  --c-ink-deep: #0e1626;
  --c-lantern-gold: #f2b45c;
  --c-glow: #ffd79a;
  --c-parchment: #fbf6ec;
  --c-paper-white: #fffdf8;
  --c-sage: #8aa391;
  --c-rose-dust: #d89a8a;
  --c-ink-text: #2a2a2e;
  --c-ink-muted: #5a5a64;
  --c-gold-ink: #8a5a12;
  --c-sage-ink: #48654f;
  --c-rose-ink: #8c4a38;

  /* semantic */
  --bg-page: var(--c-parchment);
  --bg-raised: var(--c-paper-white);
  --bg-night: var(--c-ink-night);
  --fg-body: var(--c-ink-text);
  --fg-muted: var(--c-ink-muted);
  --fg-on-night: var(--c-parchment);
  --fg-on-night-muted: #c9c3b4;
  --accent: var(--c-lantern-gold);
  --accent-on-light: var(--c-gold-ink);
  --focus-light: var(--c-gold-ink);
  --focus-dark: var(--c-glow);
  --border-line: var(--c-ink-muted);

  /* THE COLOUR BASE (MES-300 option C, Oliver 2026-09-22). The header
   * blue is the product's second ink, not only the sky's ground: a
   * heading, the rule under a section question, and the nameplate a
   * card wears take it, so a screen of parchment and gold reads as
   * one family instead of as one flat wash. No new colour value -
   * --c-ink-night at every one of them, which is 14.9:1 on parchment
   * where --c-ink-text is 13.3:1, so contrast goes UP.
   *
   * It is a TOKEN, not a rule with a colour in it, because the same
   * h1 sits on the night ground on the landing and on the reader's
   * cover: those blocks flip the token rather than fight a
   * higher-specificity rule. */
  --fg-heading: var(--c-ink-night);
  --plate-bg: var(--c-ink-night);
  --plate-fg: var(--fg-on-night);
  --plate-bg-settled: #3b4763;

  /* type - §2. Headings in the display serif, everything functional
   * in the sans. */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t--1: 0.833rem;
  --t-0: 1rem;
  --t-body: 1.0625rem;
  --t-1: 1.25rem;
  --t-2: 1.563rem;
  --t-3: 1.953rem;
  --t-4: 2.441rem;
  --t-hero: clamp(2.25rem, 6vw, 3.5rem);

  /* spacing - §3, 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  /* The two negatives the scale needs. A block that BLEEDS to its
   * card's edge pulls back by exactly the card's own padding, so the
   * number is the scale's and never a literal - and the spacing lint
   * reads a token here where it would refuse a calc(). */
  --s-1-neg: calc(var(--s-1) * -1);
  --s-4-neg: calc(var(--s-4) * -1);
  /* The two negatives the scale needs. A block that BLEEDS to its
   * card's edge pulls back by exactly the card's own padding, so the
   * number is the scale's and never a literal - and the spacing lint
   * reads a token here where it would refuse a calc(). */
  --s-1-neg: calc(var(--s-1) * -1);
  --s-4-neg: calc(var(--s-4) * -1);

  /* radii - §4 */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 24px;
  --r-pill: 999px;
  --r-card: var(--r-xl);

  /* elevation & glow - §5. Warm-tinted (ink-night alpha), never
   * neutral grey. --glow-warm is the signature effect; use it
   * sparingly enough that it stays special. */
  --shadow-sm: 0 1px 2px rgba(22, 33, 58, 0.06);
  --shadow-md: 0 2px 8px rgba(22, 33, 58, 0.08);
  --shadow-lg: 0 8px 24px rgba(22, 33, 58, 0.12);
  --glow-warm: 0 0 24px rgba(242, 180, 92, 0.35);
  --glow-warm-lg: 0 0 48px rgba(242, 180, 92, 0.28);
  --glow-pool: radial-gradient(circle, rgba(242, 180, 92, 0.35), transparent 70%);
  --lamp-ring: 0 0 0 3px rgba(255, 215, 154, 0.35);
  /* the spine strip of a hardback cover in the library (MES-795) */
  --cover-spine: linear-gradient(
    to right,
    rgba(22, 33, 58, 0.28),
    rgba(22, 33, 58, 0.08) 70%,
    rgba(255, 255, 255, 0.18)
  );

  /* lines - marketing/brand-tokens.md v1.1 + journey v3 §4a. A hairline
   * is a line, not a text colour: --c-line 1.52:1 on parchment
   * (dividers, card edges), --c-line-strong 3.48:1 (control borders,
   * WCAG 1.4.11); the night pair does the same job on the sky. */
  --c-line: #d6c9af;
  --c-line-strong: #938260;
  --c-line-night: #35435f;
  --c-line-night-strong: #63739a;
  --border-soft: var(--c-line);
  --border-control: var(--c-line-strong);

  /* the guided flow. --c-gold-wash is 1.09:1 against parchment, so a
   * selected chip is NEVER signalled by fill alone - fill, border and
   * weight all change together. --c-gold-edge is 3.45:1. */
  --c-gold-wash: #fcebcf;
  --c-gold-edge: #b07a1e;
  --chip-bg-selected: var(--c-gold-wash);
  --chip-border-selected: var(--c-gold-edge);

  /* buttons - journey v3 §4a: exactly one gold-filled element per
   * screen, the primary action. Everything else the product ASKS is
   * the one secondary: the same pill, shorter and quieter, drawn on
   * paper with a hairline edge. There is no third, text-link style
   * (Oliver, 2026-09-18) - an action that looks like a sentence does
   * not read as a thing to press. Marketing's set stops at the
   * primary; the secondary names follow theirs. */
  --btn-primary-bg: var(--c-lantern-gold);
  --btn-primary-fg: var(--c-ink-night);
  --btn-secondary-bg: var(--bg-raised);
  --btn-secondary-fg: var(--fg-body);
  --btn-secondary-border: var(--border-control);
  --btn-h: 56px;
  --btn-h-secondary: 48px;

  /* the question is the hero element: 25px on a phone, 35px wide */
  --t-ask: clamp(1.563rem, 6vw, 2.2rem);

  /* touch targets (WCAG 2.2 SC 2.5.8 floor is 24px; the flow is
   * thumb-driven, so chips get more), the child's thumbnail and the
   * one-column measure */
  --tap-min: 44px;
  --tap-chip: 56px;
  --avatar: 40px;
  --avatar-lg: 96px;
  --step-max: 34rem;
  --drop-max: 260px;
  --lamp-w: 12px;
  --lamp-h: 16px;
  --sky-top-h: 56px;
  --lang-min: 92px;
  --sky-steps-h: 40px;
  --pages-h: 250px;
  --pages-w: 250px;

  /* the painted Lámpácska at the large still slot: a 640px file shown
   * at 240px, so it is a 2x picture on a phone. Its parchment ground
   * is opaque and square, which reads as a sticker on a card and hides
   * any glow behind it - so the picture is masked to fade into
   * whatever it sits on, and the warm pool shows around it. */
  --art-lg: 240px;
  --art-fade: radial-gradient(
    closest-side,
    rgba(0, 0, 0, 1) 62%,
    rgba(0, 0, 0, 0) 100%
  );

  /* the scrim that travels with the painted sky - ink-night alpha,
   * heaviest over the lit lantern at the foot of the phone crop. It is
   * declared with the image and never without it: over the flat night
   * ground the same wash would just darken a hero that has no art.
   *
   * The stops are MEASURED, on the 375px crop and on the 544px one:
   * over every hero text box the mean contrast is 9.3 or better and
   * under 0.06% of pixels fall below the 4.5 floor - single stars, not
   * the lantern. A lighter scrim still reads, but the painting then
   * competes with the two drawings, and the drawings are the product. */
  --hero-art-scrim: linear-gradient(
    to bottom,
    rgba(22, 33, 58, 0.78),
    rgba(22, 33, 58, 0.58) 42%,
    rgba(22, 33, 58, 0.92)
  );

  /* the lightbox scrim: ink-deep at 0.88, dark enough that a pale
   * illustration on parchment ground reads as lifted off the page and
   * the page behind it stops competing for the eye */
  --lightbox-scrim: rgba(14, 22, 38, 0.88);

  /* the guide's halo: a filter, so it survives prefers-reduced-motion
   * as a STATIC lit state rather than going dark */
  --glow-drop: drop-shadow(0 0 10px rgba(242, 180, 92, 0.55));

  /* motion - §6 */
  --m-fast: 150ms;
  --m-base: 250ms;
  --m-slow: 400ms;
  --m-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* the quill's line (the wait strip, see its own section below).
   * Three drawing colours and the component's one number. They are
   * here and not on .qline because of the token tests: no colour
   * literal may appear outside :root, and every var() anywhere in
   * this file must resolve to a definition inside THIS block - a
   * component-local custom property does not count. */
  --quill-vane: #3e3427;
  --quill-spine: #f6efe1;
  --ink-ghost: rgba(22, 33, 58, 0.24);
  --ink-pos: 0;
  /* the running stage's glide (MES-736, MES-769): the strip sets all
   * but --ink-f on itself; these are its rest, a glide of nothing that
   * lasts no time. */
  --ink-e: 0;
  --ink-f: 0;
  --e-from: 0;
  --glide-end: 0;
  --glide-f: 0;
  --glide-s: 0s;
  --glide-at: 0s;

  /* the PC layout (MES-489, marketing's MES-488 round 3, Oliver's go
   * 2026-11-09). Read only inside the 64rem block at the end of this
   * file; the widths grow once more at 100rem. */
  --site-max: 72rem;
  --read-max: 46rem;
  --show-max: 64rem;
  --decide-max: 28rem;
  --hero-stack-w: 400px;
  --hero-stack-h: 440px;
  --muse-max: 360px;
  /* the space beside the sheet, and the footer's inline padding: the
   * frame's edge on a wide window, a fixed margin on a narrow one */
  --sheet-gap: max(var(--s-7), calc(50vw - var(--site-max) / 2));
  --stage-gutter: max(var(--s-6), calc(50vw - var(--site-max) / 2));
  /* the painting behind a question screen; each screen and step sets
   * its own picture and anchor */
  --stage-art: none;
  /* the family evening, which two PC screens share; set in the PC
   * block, where the painting is named once */
  --art-family-reading: none;
  --stage-pos: center;
  --stage-glass: rgba(14, 22, 38, 0.72);
  --stage-glass-blur: blur(6px);
  --stage-floor: rgba(14, 22, 38, 0.88);
  --stage-scrim-left: linear-gradient(
    90deg,
    rgba(14, 22, 38, 0.55),
    rgba(14, 22, 38, 0.15) 45%,
    rgba(14, 22, 38, 0) 65%
  );
  --stage-scrim-right: linear-gradient(
    270deg,
    rgba(14, 22, 38, 0.55),
    rgba(14, 22, 38, 0.15) 45%,
    rgba(14, 22, 38, 0) 65%
  );
  --stage-scrim: var(--stage-scrim-left);
  /* the sheet: a page laid into the scene, two pages under it showing
   * at the edge on the side away from the subject (+1 right, -1 left) */
  --sheet-x: 1;
  --sheet-edge: rgba(255, 215, 154, 0.3);
  --sheet-under-1: #efe6d2;
  --sheet-under-2: #e2d5ba;
  --sheet-drop: rgba(8, 12, 22, 0.55);
  /* the deciding screen's family band */
  --decide-band-h: clamp(36rem, 70vh, 46rem);
  --decide-band-scrim: linear-gradient(
    90deg,
    rgba(14, 22, 38, 0.82),
    rgba(14, 22, 38, 0.5) 38%,
    rgba(14, 22, 38, 0) 60%
  );
  --decide-band-fade: linear-gradient(to bottom, #000 72%, transparent);
  --decide-heading-max: 30rem;
  --decide-heading-shadow: 0 2px 16px rgba(8, 12, 22, 0.6);
  --decide-lead-shadow: 0 1px 10px rgba(8, 12, 22, 0.7);
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--fg-body);
  background: var(--bg-page);
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg-heading);
}

/* Every block that paints the night ground flips the heading token
 * with it: a blue heading on a blue ground is not a heading. */
.sky,
.hero,
.cover,
.plate {
  --fg-heading: var(--plate-fg);
}

h1 {
  font-size: var(--t-4);
}

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

/* Every interactive element gets a visible ring; nothing relies on
 * the browser default. --focus-light only: gold and glow fail on
 * light ground. */
:focus-visible {
  outline: 2px solid var(--focus-light);
  outline-offset: 2px;
}

/* ------------------------------------------------------- the sky
 *
 * ONE night band (journey v3 §4a): the site header and the step
 * lanterns share one ink-night sky at the top of every screen; the
 * separate rail is gone. From the photo on, the child's thumbnail
 * hangs at the right end of the lantern row.
 */

.sky {
  background: var(--bg-night);
  color: var(--fg-on-night);
}

.sky :focus-visible {
  outline-color: var(--focus-dark);
}

/* The header row WRAPS. The brand wordmark is a fixed 24 px-tall
 * drawing (122 px wide in Hungarian), the language pill has a floor
 * and the nav link is nowrap, so on a 320-375 px phone the row has a
 * minimum width the viewport cannot give it - it used to spend the
 * header's own right padding and then push the nav off the screen
 * (MES-159). Nothing here shrinks honestly: a smaller wordmark is an
 * unreadable wordmark. So the trailing group drops to a second row
 * wherever it must, and the block padding keeps that row off the edge
 * of the band. */
.sky-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--s-3);
  row-gap: var(--s-2);
  min-height: var(--sky-top-h);
  max-inline-size: var(--step-max);
  margin: 0 auto;
  padding: var(--s-2) var(--s-4);
}

/* One group, so the two controls wrap together and stay together;
 * the auto margin holds them at the far end on whichever row they
 * land on. A growing spacer between them instead leaves the pill at
 * the end of the first row and the link alone at the left margin of
 * the second. */
.sky-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-inline-start: auto;
}

/* The lantern is the only place --glow-warm is spent in the header. */
.brand-mark {
  display: inline-flex;
  color: var(--c-lantern-gold);
  border-radius: var(--r-pill);
  box-shadow: var(--glow-warm);
}

.brand-mark svg {
  display: block;
  width: var(--s-5);
  height: var(--s-5);
}

/* The wordmark. Scoped to its own class: styling every anchor in the
 * header made the nav link render as a second brand. */
.brand-name {
  display: inline-flex;
  color: var(--fg-on-night);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  font-size: var(--t-1);
}

/* The wordmark SVG carries its authored width/height attributes; the
 * height wins here and `auto` keeps the viewBox aspect. */
.brand-name svg {
  display: block;
  height: var(--s-5);
  width: auto;
}

.tagline {
  display: none;
  color: var(--fg-on-night-muted);
  font-size: var(--t--1);
}

/* Navigation sits quieter than the brand, at the far end. */
.site-nav {
  color: var(--c-glow);
  text-decoration: none;
  font-size: var(--t--1);
  white-space: nowrap;
}

.site-nav:hover {
  text-decoration: underline;
}

/* The language selector: a small outlined pill on the sky. The
 * native select keeps the keyboard and the screen reader; only its
 * chrome is ours. */
.lang-form {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: var(--s-1) var(--s-5) var(--s-1) var(--s-3);
  min-height: var(--s-6);
  /* Chrome sizes an appearance-less select to its longest option
   * WITHOUT the author padding, so the text clips by the arrow's
   * width; a floor the longest name fits under stops that. */
  min-inline-size: var(--lang-min);
  border: 1px solid var(--c-line-night-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg-on-night);
  font: inherit;
  font-size: var(--t--1);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-glow) 50%),
    linear-gradient(135deg, var(--c-glow) 50%, transparent 50%);
  background-position: right var(--s-3) top 55%, right var(--s-2) top 55%;
  background-size: var(--s-1) var(--s-1), var(--s-1) var(--s-1);
  background-repeat: no-repeat;
}

.lang-select option {
  color: var(--fg-body);
  background: var(--bg-raised);
}

.lang-submit {
  min-height: var(--s-6);
  margin: 0;
  padding: 0 var(--s-3);
  font-size: var(--t--1);
  height: auto;
}

/* The lantern row: one lamp per step, the current one glowing. */
.sky-steps {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--sky-steps-h);
  max-inline-size: var(--step-max);
  margin: 0 auto;
  padding: 0 var(--s-4);
  border-top: 1px solid var(--c-line-night);
}

.sky-steps ol {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.lamp {
  display: block;
  inline-size: var(--lamp-w);
  block-size: var(--lamp-h);
  border: 2px solid var(--c-line-night-strong);
  border-radius: var(--r-sm) var(--r-sm) var(--r-md) var(--r-md);
}

.lamp.is-lit {
  background: var(--c-lantern-gold);
  border-color: var(--c-lantern-gold);
}

.lamp.is-current {
  background: var(--c-lantern-gold);
  border-color: var(--c-glow);
  box-shadow: var(--lamp-ring), var(--glow-warm);
}

.lamp.is-working {
  animation: lamp-flicker 1.6s var(--m-ease) infinite;
}

.steps-label {
  color: var(--c-line-night-strong);
  font-size: var(--t--1);
  margin: 0 0 0 var(--s-2);
}

/* The child rides along: the browser's own 256 px thumbnail, round,
 * gold-ringed, with the name beside it. */
.thumb {
  display: block;
  inline-size: var(--avatar);
  block-size: var(--avatar);
  border-radius: var(--r-pill);
  border: 2px solid var(--c-lantern-gold);
  box-shadow: var(--glow-warm);
  overflow: hidden;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  background: var(--c-line-night);
}

.thumb img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.thumb-name {
  color: var(--c-glow);
  font-size: var(--t--1);
  margin: 0;
}

/* The slot at the row's end: thumbnail (when this browser has one)
 * and the name; the name alone when it does not. */
.thumb-slot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 0 auto;
}

.thumb-slot .thumb {
  margin: 0;
}

/* The status line under the lanterns: "drawing in the meantime". */
.sky-status {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  max-inline-size: var(--step-max);
  margin: 0 auto;
  padding: 0 var(--s-4) var(--s-2);
  color: var(--c-glow);
  font-size: var(--t--1);
}

/* ----------------------------------------------------------- layout */

main {
  max-width: var(--step-max);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-8);
}

/* The landing's hero continues the sky: no padding between them. */
main.main--flush {
  padding: 0 0 var(--s-8);
}

/* Body measure capped at 65ch (§2) - prose only, never the grid. */
main p,
main li {
  max-width: 65ch;
}

/* Links in the body take the ink gold; the header keeps its own. */
main a {
  color: var(--accent-on-light);
}

/* ------------------------------------------------------------ forms */

label {
  display: block;
  margin-top: var(--s-4);
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: var(--btn-h);
  padding: var(--s-2) var(--s-4);
  margin-top: var(--s-1);
  border: 1px solid var(--border-control);
  border-radius: var(--r-lg);
  font: inherit;
  font-size: var(--t-1);
  color: var(--fg-body);
  background: var(--bg-raised);
}

textarea {
  font-size: var(--t-0);
}

fieldset {
  margin-top: var(--s-4);
  padding: 0;
  border: 0;
}

/* ---------------------------------------------------------- buttons
 *
 * TWO styles, and no third. One gold-filled element per screen: the
 * primary. A <button> is the primary by default (a 56 px lantern-gold
 * pill, ink-night text); `.secondary` is the same pill on paper with
 * a hairline edge, at 48 px - visibly a button, only quieter and
 * smaller. `.button` is both of them for anchors.
 *
 * Nothing the product asks is drawn as a text link (Oliver,
 * 2026-09-18). A link is for going to read something else; a button
 * is for doing the thing this screen is about, and the two must not
 * look alike. `app/tests/test_button_hierarchy.py` is the pin.
 */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--btn-h);
  margin-top: var(--s-4);
  padding: var(--s-2) var(--s-5);
  border: 1px solid var(--btn-primary-bg);
  border-radius: var(--r-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font: inherit;
  font-size: var(--t-1);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow var(--m-fast) var(--m-ease);
}

button:hover,
.button:hover {
  box-shadow: var(--shadow-md);
}

button.secondary,
.button.secondary {
  min-height: var(--btn-h-secondary);
  border: 1.5px solid var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  font-size: var(--t-0);
  font-weight: 600;
}

/* The landing CTA glows; nothing else does. */
button.glow,
.button.glow {
  box-shadow: var(--glow-warm);
}

/* A control the page has switched off reads as switched off. */
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button.btn-wide,
.button.btn-wide {
  display: flex;
  width: 100%;
}

/* ------------------------------------------------------------ cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-4);
}

.card {
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  padding: var(--s-3);
  box-shadow: var(--shadow-sm);
}

.card img {
  max-width: 100%;
  border-radius: var(--r-lg);
}

/* ------------------------------------------------------------ state */

.status-line {
  color: var(--accent-on-light);
}

/* The "checked at" clock: reassurance that the page is still alive,
   not the message. Muted so it does not compete with the state, and
   on its own line because it sits OUTSIDE the aria-live region. */
.status-checked {
  color: var(--fg-muted);
}

.error-page {
  color: var(--c-rose-ink);
}

.story-text {
  max-width: 65ch;
  white-space: pre-wrap;
  background: var(--bg-raised);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------ utilities */

/* clip-path, not `margin: -1px`: the token test allows only 0 and auto
 * beside a token for any margin. */
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
  margin: 0;
  padding: 0;
  border: 0;
}

[x-cloak] {
  display: none;
}

/* ------------------------------------------- the guided flow (/create)
 *
 * Authored at 375px first. One question per screen, one column, and
 * the action bar in flow at the end of the question - nothing is
 * pinned over the page, so a press lands on what is visible.
 */

.flow {
  max-inline-size: var(--step-max);
  margin: 0 auto;
}

/* The question beside the guide: the biggest thing on the screen. */
.ask-row {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.ask-row .question {
  flex: 1 1 auto;
}

.ask-row .flow-guide {
  margin: 0;
}

/* ------------------------------------------------------- the guide
 *
 * Lámpácska (marketing/brand-assets/mascot-lampacska.svg, the Kerek
 * proportion, byte-copied under static/brand/ and INLINED so
 * currentColor and the token fills resolve). The state classes below
 * are marketing's mascot.css, re-homed on the WRAPPER (.guide) because
 * the class list of a byte-copied file cannot change. Group ids
 * (#glow #flame #face #eye-l #eye-r #eyes-closed #folds #sparks
 * #shadow #body-line) are the stable API.
 *
 * THE NO-ANIMATION STATE IS LIT: the reduced-motion rule at the end
 * of this file nulls every animation and what remains is the warm
 * state. Only opacity and transform animate. The per-answer hop is
 * retired (brand-world §10): on an answer the glow brightens.
 */

.flow-guide {
  display: flex;
  justify-content: center;
  margin: 0 0 var(--s-3);
}

/* The lantern speaking on a progress wait with nothing to look at
 * (partials/progress_guide.html). The bubble stacks ABOVE her, where
 * its tail points, and takes the picture's own width rather than the
 * page's: a balloon wider than the lantern under it reads as a banner
 * instead of as something she said. The progress screen has no paper
 * frame around the guide, which is what the preview waits size their
 * bubble against, so the width is stated here. */
.flow-guide--speaking {
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.flow-guide--speaking .bubble {
  inline-size: min(var(--art-lg), 100%);
}

.mascot-wrap {
  display: inline-flex;
  block-size: var(--s-8);
  color: var(--accent-on-light);
}

.mascot-wrap--sm {
  block-size: var(--s-7);
}

.mascot-wrap--lg {
  block-size: var(--s-9);
}

.mascot {
  display: block;
  block-size: 100%;
  inline-size: auto;
  transform-origin: 48px 100px;
  transition: transform var(--m-base) var(--m-ease);
}

.mascot #glow {
  transform-origin: 48px 52px;
  animation: lamp-breathe 4s var(--m-ease) infinite alternate;
}

.is-wake .mascot #glow,
.is-wake .mascot #flame {
  animation: lamp-wake var(--m-slow) var(--m-ease) 1;
}

/* Listening: the character leans a little toward the control. */
.is-listening .mascot {
  transform: rotate(2deg);
}

/* Pleased: the light brightens. Nothing hops. */
.is-pleased .mascot #glow {
  opacity: 1;
  animation: none;
}

/* Idle for 30s: the light drops and the eyes close. It does not
 * speak here - if a hint is needed the interface shows it. */
.is-dim .mascot #glow {
  opacity: 0.25;
  animation: none;
}

.is-dim .mascot #eye-l,
.is-dim .mascot #eye-r {
  display: none;
}

.is-dim .mascot #eyes-closed {
  display: inline !important;
}

/* Working: the waits. The one long ambient animation in the product. */
.is-working .mascot #glow {
  animation: lamp-flicker 2.4s var(--m-ease) infinite;
}

.is-working .mascot #sparks {
  opacity: 1;
}

.is-working .mascot #sparks circle {
  animation: lamp-spark 3s var(--m-ease) infinite;
}

.is-working .mascot #sparks circle:nth-child(2) {
  animation-delay: 1s;
}

.is-working .mascot #sparks circle:nth-child(3) {
  animation-delay: 2s;
}

/* Small (48px): verified legible at 32px with this treatment. Below
 * that use the mark, not the mascot. */
.mascot-wrap--sm .mascot #folds,
.mascot-wrap--sm .mascot #sparks,
.mascot-wrap--sm .mascot #shadow {
  display: none;
}

.mascot-wrap--sm .mascot #body-line {
  stroke-width: 3.4;
}

/* ------------------------------------------------- the painted guide
 *
 * The raster Lámpácska (brand-world §12), which the macro renders in
 * place of the vector at the lg slot - the waits, where the guide is
 * large, still and the only thing on the screen. It carries no state
 * class of its own: a WebP cannot repaint itself, so the lantern's
 * light is a halo AROUND the picture. The halo is a ::before rather
 * than a glow behind the file, because the painting's parchment ground
 * is opaque and would hide anything underneath it.
 *
 * Its resting state is LIT, so the reduced-motion rule at the end of
 * this file - which nulls the flicker - leaves a lantern that is on,
 * exactly as it does for the vector.
 */

.mascot-wrap--art {
  position: relative;
  display: block;
  inline-size: min(var(--art-lg), 100%);
  /* .mascot-wrap's 64px block-size is the VECTOR's slot and would
   * squash a square picture into a letterbox; the ratio has to derive
   * the other axis, so one of the two must be auto. */
  block-size: auto;
  aspect-ratio: 1 / 1;
}

.mascot-wrap--art::before {
  content: "";
  position: absolute;
  inset: calc(var(--s-3) * -1);
  border-radius: var(--r-pill);
  background: var(--glow-pool);
}

.mascot-wrap--art.is-working::before {
  animation: lamp-flicker 2.4s var(--m-ease) infinite;
}

.mascot-art {
  position: relative;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  /* both spellings: Safari only took the unprefixed property in 15.4,
   * and there is no build step to add the prefix for us. A browser
   * that understands neither shows the parchment square, which is the
   * picture, not a broken one. */
  -webkit-mask-image: var(--art-fade);
  mask-image: var(--art-fade);
}

/* In a wait frame the box keeps the aspect ratio of the picture that
 * will replace it, so the painting is sized off the frame rather than
 * off the viewport: it never grows the box and never gets cropped.
 * 62% is measured, not chosen: at 375px the frame is 328x219 and the
 * status line under it costs 59px of margin, gap and text, so past
 * ~68% the picture starts being clipped by the frame's overflow. */
.working-box .mascot-wrap--art {
  inline-size: auto;
  block-size: min(var(--art-lg), 62%);
}

/* THE BUBBLE (the two waits with nothing to read: the sheet being
 * drawn and the story being written, journey.md §14.5 and §4.13). On
 * those screens the lantern speaks. The frame is taller than the
 * other waits' because it holds three things rather than two, and the
 * percentage above is re-measured for it: at 375px the speaking frame
 * is 343x274, the picture keeps the 142px it had, and the height that
 * was added goes to the bubble. */
.figure-box.working-box--speaking {
  aspect-ratio: 5 / 4;
}

.working-box--speaking .mascot-wrap--art {
  block-size: min(var(--art-lg), 52%);
}

/* Inside a speaking box the frame's own gap is the only spacing there
 * is room for: the status line's paragraph margin on top of it pushes
 * the bubble out through the top of the frame, where overflow eats
 * it. */
.working-box--speaking .status-line {
  margin-block: 0;
}

/* The working box is paper-white, so the bubble is the lantern's own
 * warm wash: paper-white on paper-white would be a shadow and nothing
 * else. Fixed width and two lines of height whatever the card says -
 * a bubble that re-sizes every four seconds would make the lantern
 * under it twitch. */
.bubble {
  position: relative;
  display: grid;
  align-items: center;
  inline-size: 84%;
  min-block-size: var(--s-8);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--c-gold-wash);
  box-shadow: var(--shadow-sm);
}

/* the tail, pointing down at the lantern it belongs to */
.bubble::after {
  content: "";
  position: absolute;
  inset-block-start: 100%;
  inset-inline-start: 50%;
  border: var(--s-2) solid transparent;
  border-block-start-color: var(--c-gold-wash);
  transform: translateX(-50%);
}

/* Both cards share one grid cell, so the one leaving and the one
 * arriving fade in the same place. They do NOT overlap: the card
 * arriving waits out the card leaving (the delay on the is-on rule
 * below), because two different sentences at half opacity on top of
 * each other are unreadable for the whole length of the fade -
 * measured on the demo stack, and it looks like a rendering fault
 * rather than a soft change.
 *
 * The motion rule at the end of this file drops both transitions
 * under prefers-reduced-motion, which leaves an instant swap on the
 * same four-second cadence - reduced motion asks for no movement, not
 * for a slower bubble. */
.bubble-card {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-0);
  color: var(--fg-body);
  opacity: 0;
  transition: opacity var(--m-fast) var(--m-ease);
}

.bubble-card.is-on {
  opacity: 1;
  transition: opacity var(--m-fast) var(--m-ease) var(--m-fast);
}

@keyframes lamp-breathe {
  from {
    opacity: 0.62;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes lamp-wake {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes lamp-flicker {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes lamp-spark {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1);
  }
}

/* ------------------------------------------------- the working poses
 *
 * Lámpácska at work on the three waits, re-homed from
 * marketing/brand-assets/mascot.css ("THE WORKING POSES") exactly as
 * the state classes were: marketing authors the beat, the app runs it,
 * and app/tests/test_mascot_poses.py holds the two copies to the same
 * numbers.
 *
 * The raster cannot repaint itself, so a moving lantern is a STACK of
 * paintings in one slot, one visible at a time. The macro lays the
 * still down first and the frames of the requested set over it; each
 * frame's opacity is keyed to its beat of a 9.6s loop of twelve 800ms
 * beats (marketing/product-design/wait-motion-spec.md §2):
 *
 *   beat      1      2      3      4      5      6      7      8   9-12
 *   pacing  walk1  walk2  walk3  walk2  walk1  walk2  walk3  walk2  muse
 *   writing write  write  write  write  write  write  write  write  muse
 *
 * THE STILL IS THE REDUCED-MOTION STATE, and it is hidden by an
 * ANIMATION rather than by a static rule: the motion rule at the end
 * of this file nulls every animation, which restores the still's
 * static opacity 1 and leaves every pose at its static opacity 0. So
 * the no-animation state is exactly the screen that shipped before the
 * poses existed - lit, still, and never a blank slot. Do not
 * "simplify" it into display: none.
 *
 * The loop is deliberately NOT a multiple of the bubble's 4s cards
 * (.bubble-card above): two independent cadences read as a character
 * with its own life, one cadence reads as a slideshow.
 *
 * Steps CUT and poses CROSS-FADE, also deliberately: a dissolve
 * between two hand-painted strides is a smear, and a cut into the
 * muse is a jump. Only opacity and transform move here, so the token
 * test stays green and nothing animates colour.
 */

.mascot-pose {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* the still, hidden for as long as a loop runs over it */
.is-pacing .mascot-art--still,
.is-writing .mascot-art--still {
  animation: pose-still 9.6s step-end infinite;
}

@keyframes pose-still {
  0%,
  100% {
    opacity: 0;
  }
}

/* Set A - PACING: the lantern walks, walks, and stops to think. Beats
 * 1-8 are two strides (1,2,3,2 / 1,2,3,2), beats 9-12 the muse. One
 * beat is 8.333% of the loop; a frame leaves 0.01% before the next
 * arrives, and that hairline is the cut. */
@keyframes pose-walk1 {
  0%,
  8.32% {
    opacity: 1;
  }

  8.33%,
  33.32% {
    opacity: 0;
  }

  33.33%,
  41.65% {
    opacity: 1;
  }

  41.66%,
  97% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes pose-walk2 {
  0%,
  8.32% {
    opacity: 0;
  }

  8.33%,
  16.65% {
    opacity: 1;
  }

  16.66%,
  24.99% {
    opacity: 0;
  }

  25%,
  33.32% {
    opacity: 1;
  }

  33.33%,
  41.65% {
    opacity: 0;
  }

  41.66%,
  49.99% {
    opacity: 1;
  }

  50%,
  58.32% {
    opacity: 0;
  }

  58.33%,
  66.65% {
    opacity: 1;
  }

  66.66%,
  100% {
    opacity: 0;
  }
}

@keyframes pose-walk3 {
  0%,
  16.65% {
    opacity: 0;
  }

  16.66%,
  24.99% {
    opacity: 1;
  }

  25%,
  49.99% {
    opacity: 0;
  }

  50%,
  58.32% {
    opacity: 1;
  }

  58.33%,
  100% {
    opacity: 0;
  }
}

/* the rest beat, shared by both sets: four beats of musing, faded into
 * and out of over ~270ms */
@keyframes pose-muse {
  0%,
  64% {
    opacity: 0;
  }

  66.66%,
  97% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* Set B - WRITING: eight beats at the page, then the same rest. One
 * frame, so the life in it is a slow nod, not a second painting. */
@keyframes pose-write {
  0%,
  64% {
    opacity: 1;
  }

  66.66%,
  97% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes lamp-nod {
  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(-1.5deg);
  }
}

.is-pacing .mascot-pose--walk1 {
  animation: pose-walk1 9.6s linear infinite;
}

.is-pacing .mascot-pose--walk2 {
  animation: pose-walk2 9.6s linear infinite;
}

.is-pacing .mascot-pose--walk3 {
  animation: pose-walk3 9.6s linear infinite;
}

.is-pacing .mascot-pose--muse,
.is-writing .mascot-pose--muse {
  animation: pose-muse 9.6s var(--m-ease) infinite;
}

.is-writing .mascot-pose--write {
  transform-origin: 50% 88%;
  animation:
    pose-write 9.6s var(--m-ease) infinite,
    lamp-nod 1.6s var(--m-ease) infinite;
}

/* -------------------------------------------------------- one step */

.question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-ask);
  line-height: 1.2;
  margin: 0;
}

/* A short rule under the question, in the header blue: it marks where
 * one section begins without drawing a divider across the column -
 * a full-width line reads as "everything above is over", which is
 * wrong on a screen the parent can walk back through. */
.question::after {
  content: "";
  display: block;
  inline-size: 3rem;
  block-size: 3px;
  border-radius: var(--r-pill);
  background: var(--c-ink-night);
  margin-block-start: var(--s-3);
}

.hint {
  color: var(--fg-muted);
  font-size: var(--t-0);
  margin: var(--s-2) 0 0;
  max-width: 65ch;
}

.notice {
  background: var(--bg-raised);
  border-left: var(--s-1) solid var(--accent-on-light);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin: 0 0 var(--s-4);
}

/* The one refusal that is not about a missing input. Rose, which is
 * this system's gentle-warning ink, and never the gold of a thing to
 * press: nothing here is a control. */
.notice--refusal {
  border-left-color: var(--c-rose-ink);
}

/* The known-hero tile: the FIRST block in the product that the header
 * blue fills (Oliver's letter 1B, MES-329). It is filled rather than
 * bordered because it says something the parent did not ask to be
 * told and must not skim past - the price of their book is different -
 * and the fill is the token every plate wears, so it reads as this
 * family's second ink and not as an alert. Not rose: nothing is
 * refused here and nothing has gone wrong.
 *
 * The heading token flips with the ground, like every other block
 * that paints the night (`.plate`), or a blue heading would sit on a
 * blue ground. The left rule goes with it: an accent stripe on a
 * filled dark block is a seam, not an emphasis. */
.notice--branded {
  --fg-heading: var(--plate-fg);
  /* The quiet ink flips with the ground too. `--fg-muted` is a grey
   * chosen against parchment and is unreadable on the night; this is
   * the token every other block on that ground uses for the same
   * job, and the rewrite field's hint is the one line here that
   * takes it. */
  --fg-muted: var(--fg-on-night-muted);
  background: var(--plate-bg);
  border-left: 0;
  color: var(--plate-fg);
}

.notice--branded h2 {
  font-size: var(--t-2);
  margin: 0 0 var(--s-2);
}

.notice--branded p {
  margin: var(--s-2) 0 0;
}

/* The figure, in the display face like every other amount in the
 * product: it is the one line on this block a parent reads twice. */
.branded-amount {
  font-family: var(--font-display);
}

/* The only control the tile ever carries sits on the night ground,
 * so it takes the dark focus ring rather than the light one. */
.notice--branded .button {
  --focus-light: var(--focus-dark);
}

.notice--refusal h2 {
  font-size: var(--t-2);
  margin: 0 0 var(--s-2);
}

.notice--refusal p {
  margin: var(--s-2) 0 0;
}

.quoted-label {
  color: var(--fg-muted);
  font-size: var(--t-0);
}

/* The parent's own words, quoted back. Indented and in the reading
 * face, so they read as theirs and not as ours. */
.quoted-answers {
  margin: var(--s-1) 0 0;
  padding-inline-start: var(--s-5);
}

.quoted-answers li {
  overflow-wrap: anywhere;
}

/* A row of one quiet control under a block it belongs to. */
.flow-actions--quiet {
  margin-block-start: var(--s-3);
}

/* The kind of animal, revealed by the relation above it. */
.pet-kind {
  margin-block-start: var(--s-2);
}

/* "What kind of animal?" follows the relation on the photo screen's
 * add door, where there is no script to follow it with: the panel is
 * a <details> that works without JS and the server drops the kind for
 * every relation but the animal one, so a box beside „Anya" is a
 * control whose value is discarded. `:has()` on the select's own
 * checked option is the whole mechanism, and it re-evaluates as the
 * parent picks. A browser without :has() shows the question always,
 * which is where this screen stood before - a graceful floor, not a
 * second behaviour. The cast step asks the same question with Alpine,
 * because that screen already has it. */
.pet-kind--follows {
  display: none;
}

.add-cast-body:has(#new_char_relation option[value="pet"]:checked)
  .pet-kind--follows {
  display: block;
}

.answer-field {
  min-height: var(--btn-h);
}

.answer-slot {
  margin-top: var(--s-4);
}

/* The answer already given, shown back on a step the parent returns
 * to. Reads as a settled choice, not as a control: the only control
 * beside it is the one that changes it. */
.chosen-answer {
  margin-top: var(--s-4);
}

.chosen-answer-text {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  margin: 0 0 var(--s-2);
  font-size: var(--t-1);
}

.field-error {
  color: var(--c-rose-ink);
  font-size: var(--t-0);
  margin: var(--s-2) 0 0;
}

/* ------------------------------------------------------------ chips
 *
 * Chips are cards (journey v3 §4a): a two-column grid of 56 px
 * paper-white cards. Selected = wash + edge + check - three channels,
 * because --c-gold-wash against parchment is 1.09:1 and the fill
 * alone would be invisible to a low-contrast reader.
 */

.chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin: var(--s-4) 0 0;
  padding: 0;
  border: 0;
}

.chips.chips--age {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--tap-chip);
  margin: 0;
  padding: var(--s-3);
  border: 1px solid var(--border-control);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  color: var(--fg-body);
  font: inherit;
  font-size: var(--t-0);
  font-weight: normal;
  line-height: 1.3;
  text-align: start;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: none;
}

.chips--age .chip {
  justify-content: center;
  min-height: var(--tap-min);
}

/* Selection never moves a chip (architect, 2026-09-07): the 2 px
 * edge is the 1 px border plus an inset ring, and the check sits out
 * of flow in the top corner, inside the padding above the label, so
 * a chip's box is the same selected and not. Drawn inline after the
 * label the check wrapped it and the grid stretched all three chips. */
.chip[aria-pressed="true"],
.chip-input:checked + .chip,
.chip.is-selected {
  background: var(--chip-bg-selected);
  border-color: var(--chip-border-selected);
  box-shadow: inset 0 0 0 1px var(--chip-border-selected);
  font-weight: bold;
}

.chip[aria-pressed="true"]::after,
.chip-input:checked + .chip::after,
.chip.is-selected::after {
  content: "\2713";
  position: absolute;
  inset-block-start: var(--s-1);
  inset-inline-end: var(--s-2);
  color: var(--accent-on-light);
  font-size: var(--t--1);
  font-weight: 700;
  line-height: 1;
}

/* "I'll write my own" IS a chip: the same box in the same grid, last
 * position, full width, dashed gold edge and a pen; it expands in
 * place into the field beneath the grid. */
.chip.chip--own {
  grid-column: 1 / -1;
  border: 2px dashed var(--chip-border-selected);
  background: transparent;
  color: var(--accent-on-light);
  font-weight: 600;
}

.chip.chip--own::before {
  content: "\270E";
  margin-right: var(--s-2);
}

.chip.chip--own[aria-pressed="true"] {
  background: var(--chip-bg-selected);
  box-shadow: none;
}

.chips .answer-slot {
  grid-column: 1 / -1;
  margin: 0;
}

/* The style question on the photo screen: the chip grid IS the
 * answer, so the question is the fieldset's own <legend>, which
 * inherits none of the `label` rule and is styled here. */
.style-choice {
  margin: var(--s-5) 0 0;
  padding: 0;
  border: 0;
}

.style-choice > legend {
  padding: 0;
  font-weight: bold;
}

.style-choice > .chips {
  margin-top: var(--s-3);
}

/* On the photo screen the style is the book's one look, asked once,
 * and its question wears the photo cards' heading rather than a
 * field label's bold: a bold body line under the cards read as a
 * caption to the pictures, and a parent pressed start past it without
 * seeing a choice (MES-735). The reveal's panel keeps the label, where
 * the door above it is already the heading. The question is a real
 * <h2> inside the legend, so heading navigation finds it beside the
 * cards' own. */
.style-choice--book > legend > h2 {
  font-size: var(--t-2);
  margin: 0;
}

/* A style tile is a PICTURE and a name (Oliver, 2026-09-17): the
 * sample fills the tile's width in a square slot and the name sits
 * under it, centred. The sample is a 512x512 bust crop that marketing
 * measured at the width these tiles actually get (~140 px here,
 * ~130 px in the reveal's panel), where a full figure collapses into
 * one small coloured shape - so the slot is square and the image is
 * never cropped or letterboxed further. */
.chip--style {
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-2);
  padding: var(--s-2);
  text-align: center;
}

/* `anywhere` on the chip breaks a Hungarian compound mid-word as soon
 * as the column narrows (the panel's chips are ~130 px): "ecsetnyomok
 * / kal". `break-word` only breaks a word that cannot fit at all, so
 * the long ones move down whole instead. */
.chip--style .chip-name {
  overflow-wrap: break-word;
  font-weight: bold;
}

/* The chosen tile wears the same header blue as a nameplate, on its
 * name: the gold wash behind a picture is hard to see at tile size,
 * and the tick alone is one small mark in a corner. Fill, weight and
 * the tick all still change together. */
.chip-input:checked + .chip--style .chip-name {
  background: var(--plate-bg);
  color: var(--plate-fg);
  border-radius: var(--r-sm);
  padding: var(--s-1) var(--s-2);
  margin: 0 var(--s-1-neg);
}

/* The check mark sits in the tile's top corner, over the picture, so
 * it carries the tile's own background behind it: a sample with a dark
 * corner would otherwise swallow it. */
/* A font row is its name over one line of a story set in that face
 * (MES-803): one column, so the line has the width a page gives it.
 * The sample keeps its own weight when the row is chosen - a bolded
 * sample would show a face the book is not set in - and the name
 * wears the style tile's nameplate, so the two choices read alike. */
.chips.chips--font {
  grid-template-columns: minmax(0, 1fr);
}

.chip--font {
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-1);
  padding: var(--s-3) var(--s-6) var(--s-3) var(--s-4);
  overflow-wrap: break-word;
}

.chip--font .chip-name {
  align-self: flex-start;
  font-weight: bold;
}

.chip--font .font-sample {
  font-size: var(--t-body);
  font-weight: normal;
  line-height: 1.45;
}

.chip-input:checked + .chip--font .chip-name,
.chip--font[aria-pressed="true"] .chip-name {
  background: var(--plate-bg);
  color: var(--plate-fg);
  border-radius: var(--r-sm);
  padding: 0 var(--s-2);
  margin-inline-start: var(--s-1-neg);
}

/* The format step (MES-811): two full-width cards, each its name and
 * its price on one line and what it is beneath. No nameplate on the
 * chosen card - "Nyomtatott könyv + digitális" in a plate wrapped into
 * a heavy two-line block (MES-778 critique); the wash, the edge, the
 * weight and the tick change together as on every chip. The price
 * keeps normal weight when chosen so the figure never reflows, and
 * the line that says what the card is NOT is the quiet ink. */
.chips.chips--format {
  grid-template-columns: minmax(0, 1fr);
}

.chip--format {
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-1);
  padding: var(--s-3) var(--s-6) var(--s-3) var(--s-4);
  overflow-wrap: break-word;
}

/* Name over price on both cards: side by side, the longer name pushed
 * its price to a second line at 375 px and the two cards read
 * differently. */
.chip--format .format-head {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chip--format .chip-name {
  font-weight: bold;
}

.chip--format .format-price {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip--format .format-line {
  font-weight: normal;
}

.chip--format .format-line--not {
  color: var(--fg-muted);
  font-size: var(--t--1);
}

.chip-input:checked + .chip--style::after {
  background: var(--bg-raised);
  border-radius: var(--r-pill);
  padding: 0 var(--s-1);
}

.chip-sample {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--r-md);
  margin: 0;
}

/* The real radio, kept focusable and keyboard-operable. */
.chip-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.chip-input:focus-visible + .chip {
  outline: 2px solid var(--focus-light);
  outline-offset: 2px;
}

/* A row of small chips inside a card (the species). */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-3) 0 0;
  padding: 0;
  border: 0;
}

.chip-row .chip {
  min-height: var(--tap-min);
  padding: var(--s-2) var(--s-3);
  padding-inline-end: var(--s-6);
  border-radius: var(--r-pill);
}

/* In a pill the check sits in the reserved end padding, centred. */
.chip-row .chip::after {
  inset-block: 0;
  display: flex;
  align-items: center;
}

/* ------------------------------------------------------ the cast
 *
 * Person cards (journey v3 §4a): avatar initial, the name in the
 * display serif, a "done" check the moment the card has a name; the
 * add control is a full-width dashed card-button in the flow.
 */

.person {
  display: grid;
  grid-template-columns: var(--avatar) minmax(0, 1fr) auto;
  gap: var(--s-3);
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: var(--s-4);
  margin: var(--s-3) 0 0;
}

.person-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: var(--avatar);
  block-size: var(--avatar);
  border-radius: var(--r-pill);
  background: var(--c-gold-wash);
  color: var(--accent-on-light);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-1);
}

.person-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-1);
  margin: 0;
  overflow-wrap: anywhere;
}

.person-name.is-empty {
  color: var(--fg-muted);
}

.person-meta {
  color: var(--fg-muted);
  font-size: var(--t--1);
  margin: 0;
}

.person-done {
  color: var(--c-sage-ink);
  font-size: var(--t--1);
  font-weight: 600;
  white-space: nowrap;
}

.person-done::before {
  content: "\2713 ";
}

.person-fields {
  grid-column: 2 / -1;
}

.person-fields label {
  margin-top: var(--s-2);
}

.person-fields input[type="text"] {
  min-height: var(--btn-h-secondary);
  font-size: var(--t-0);
}

/* Placement only: a secondary at the end of the card's own row. */
.person-remove {
  grid-column: 2 / -1;
  justify-self: end;
  margin: 0;
}

.add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--btn-h);
  margin: var(--s-3) 0 0;
  padding: var(--s-3);
  border: 2px dashed var(--chip-border-selected);
  border-radius: var(--r-card);
  background: transparent;
  color: var(--accent-on-light);
  font-size: var(--t-0);
  font-weight: 600;
  box-shadow: none;
}

.add-card::before {
  content: "+";
  margin-right: var(--s-2);
}

.add-card:hover {
  box-shadow: none;
  background: var(--chip-bg-selected);
}

/* The photo screen's add-a-character door: the same dashed card as
 * the cast step's, but a <summary>, so the fields open in place and
 * the door works with no script. `list-style: none` drops the native
 * triangle - `.add-card` draws its own "+". */
.add-cast > summary {
  cursor: pointer;
  list-style: none;
}

.add-cast > summary::-webkit-details-marker {
  display: none;
}

.add-cast > summary:focus-visible {
  outline: 2px solid var(--focus-light);
  outline-offset: 2px;
}

.add-cast[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.add-cast-body {
  border: 2px dashed var(--chip-border-selected);
  border-top: 0;
  border-radius: 0 0 var(--r-card) var(--r-card);
  padding: var(--s-3) var(--s-4) var(--s-4);
}

.add-cast-body .species-choice {
  margin: var(--s-3) 0 0;
  padding: 0;
  border: 0;
}

.add-cast-body .species-choice > legend {
  padding: 0;
  font-weight: bold;
}

.add-cast-body > button {
  margin: var(--s-4) 0 0;
}

.disclosure {
  margin: var(--s-3) 0 0;
}

/* The outfit choice on a person's photo card (MES-775): two pills,
 * the species row's look, under a legend that reads like a label. */
/* Positioned, so the visually hidden radios sit inside it and a
 * keyboard focus does not scroll the page to where they would land. */
.outfit-choice {
  position: relative;
  margin: var(--s-4) 0 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.outfit-choice legend {
  padding: 0;
  font-weight: bold;
}

/* ------------------------------------------- the read-back card */

/* The same plate as a character card's, because this card carries the
 * whole commission: it sits ON the card rather than over it, so the
 * two are one object. */
.card-title {
  --fg-heading: var(--plate-fg);
  font-size: var(--t-2);
  background: var(--plate-bg);
  border-radius: var(--r-card) var(--r-card) 0 0;
  padding: var(--s-3) var(--s-5);
  margin: var(--s-5) 0 0;
}

.card-title + .commission-card {
  margin-block-start: 0;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

.commission-card {
  background: var(--bg-raised);
  border: 1px solid var(--chip-border-selected);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md), var(--glow-warm);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0 0;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--s-2) var(--s-3);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border-soft);
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row dt {
  color: var(--fg-muted);
  font-size: var(--t-0);
}

.summary-row dd {
  font-size: var(--t-0);
  margin: 0;
  overflow-wrap: anywhere;
}

/* The deciding screen's money lines on the print road (MES-811): a
 * line's name takes the width and its figure sits flush right in
 * tabular digits, so the three figures stand in one column and the
 * sum reads as theirs. The name is the body ink, not the read-back's
 * muted label: here the name IS the thing bought. */
.decide-lines .summary-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.decide-lines .summary-row dt {
  color: var(--fg-body);
}

.decide-lines .summary-row dd {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.decide-lines .decide-total dt {
  font-weight: bold;
}

/* A paid copy's line on a /books row sits under its own label, the
 * reader card's heading, so the row says whose station it is. */
.book-print-label {
  margin-block-end: 0;
  font-weight: bold;
}

.book-print .status-line {
  margin-block-start: 0;
}

/* --------------------------------------------------- consent row */

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin: var(--s-5) 0 0;
}

/* Every checkbox is a tap target, not a 13px default. */
input[type="checkbox"] {
  inline-size: var(--s-5);
  block-size: var(--s-5);
  vertical-align: middle;
}

.consent-row input[type="checkbox"] {
  margin: var(--s-3);
  flex: 0 0 auto;
}

.consent-row label {
  margin: 0;
  font-weight: normal;
}

/* ------------------------------------------------------- actions
 *
 * The action bar: the primary full width, and under it - where the
 * screen has one - the way back, the same width as a secondary.
 *
 * IN FLOW, at every width. A bar pinned to the bottom of the viewport
 * covers the band just above it at EVERY scroll position except the
 * very last one - the covered rows are [scroll + height - bar, scroll
 * + height], and they hold page content until the page is scrolled to
 * its end - so any control small enough to fit on screen sits, at some
 * resting position, half visible with its middle under the bar. The
 * thumb goes to what is visible and the press goes to the bar: a tap
 * on a story motif ran Continue, a tap on a drawing's yes opened
 * checkout, a tap on "add someone" added nobody. Three screens each
 * grew their own scroll-clearance for that, and a clearance can only
 * fix the arrival; the geometry is what has to go. Above 48rem the bar
 * has always been in flow and none of it ever happened there.
 */

.flow-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-2);
  margin: var(--s-6) 0 0;
  padding: var(--s-3) 0 var(--s-4);
}

.flow-actions button,
.flow-actions .button {
  width: 100%;
  margin: 0;
}

.flow-actions .bar-note {
  text-align: center;
  margin: 0;
}

/* A form in the bar is the button's wrapper, nothing more. */
.flow-actions form {
  margin: 0;
}

/* The terms lines above a priced button (MES-443): small print in the
   bar, the box on the consent row's shape, close to the button it
   unlocks. */
.flow-actions .terms-info {
  margin: 0;
  font-size: var(--t--1);
}

.flow-actions .terms-row {
  margin: var(--s-2) 0 var(--s-3);
  font-size: var(--t--1);
}

.flow-actions .terms-row input[type="checkbox"] {
  margin: 0 var(--s-1) 0 0;
}

/* The harmonised guarantee notice under a priced door (MES-499): the
   official graphic at thumbnail width, below the button area so it
   moves neither the button nor the price, opening at full size on a
   tap. Small on purpose (Oliver, K-39: not obtrusive); the width is a
   spacing token so it never outgrows a 320 px column. */
.guarantee-notice {
  margin: var(--s-4) 0 0;
}

.guarantee-notice a {
  display: inline-block;
}

.guarantee-notice img {
  display: block;
  inline-size: var(--s-10);
  block-size: auto;
}

/* A stack of choices in the page. */
.actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-4) 0 0;
}

.actions button,
.actions .button {
  width: 100%;
  margin: 0;
}

.flow-footer {
  margin: var(--s-6) 0 0;
  text-align: center;
}

/* ------------------------------------------------------ icons
 *
 * Direction B (Lámpásdrót, monoline): one colour, inherits
 * currentColor, one file per icon. Chrome, never competing with a
 * child's face or a rendered page.
 */

.icon {
  display: inline-block;
  inline-size: var(--s-5);
  block-size: var(--s-5);
  flex: 0 0 auto;
  vertical-align: middle;
}

.icon svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

/* A page that is one column, phone-first. */
.page {
  max-inline-size: var(--step-max);
  margin: 0 auto;
}

.page h1 {
  font-size: var(--t-ask);
  line-height: 1.2;
  margin: 0 0 var(--s-2);
}

.lead {
  font-size: var(--t-1);
  margin: 0 0 var(--s-3);
}

.muted {
  color: var(--fg-muted);
}

/* The one line that says the parent may leave. On every wait. */
.leave-note {
  color: var(--fg-muted);
  font-size: var(--t-0);
  margin: var(--s-4) 0 0;
}

/* ---------------------------------------------------------- landing
 *
 * The hero continues the sky: heading, the sub, the ONE gold button
 * at full width with the glow, the digital line, then the two drawings
 * as tilted pages over a pool of warm light. Everything else on
 * parchment.
 */

.hero {
  background: var(--bg-night);
  color: var(--fg-on-night);
  padding: var(--s-5) var(--s-4) var(--s-6);
  margin: 0;
}

/* The painted sky (brand-world §12) is the hero's GROUND, never a
 * block: it costs zero height, so the one gold action stays where it
 * is instead of moving below the fold. The modifier is added by the
 * template only when the file is on disk, so an absent painting leaves
 * the flat ink-night above untouched - scrim included, which is why
 * the scrim is declared here with the image and not on .hero.
 *
 * Anchored bottom left: the lantern and the open book sit low in the
 * painting's left third, so a phone crop keeps them and the quiet
 * right of the sky rises behind the heading. */
.hero--art {
  background-image: var(--hero-art-scrim),
    url("/static/brand/hero-lanternlight.webp");
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: cover;
}

.hero-inner {
  max-inline-size: var(--step-max);
  margin: 0 auto;
}

.hero h1 {
  font-size: var(--t-hero);
  line-height: 1.1;
  margin: 0 0 var(--s-4);
}

.hero p {
  font-size: var(--t-body);
  margin: 0 0 var(--s-3);
}

.hero .hero-preview {
  color: var(--c-glow);
}

.hero .ask-row .mascot-wrap {
  color: var(--c-lantern-gold);
}

.hero-cta {
  margin: var(--s-4) 0 0;
}

.hero-cta .button {
  width: 100%;
  margin: 0;
}

/* A book under way is a second, quiet door under the gold one. The
 * secondary keeps its shape on the night ground and swaps its
 * palette: a paper pill beside the gold one would be two loud
 * elements, and the hairline pair for the sky is what an outline is
 * for there. */
.hero-cta .hero-continue {
  margin-block-start: var(--s-3);
  border-color: var(--c-line-night-strong);
  background: transparent;
  color: var(--fg-on-night);
}

/* The sign-out confirmation, on the page the press lands on. The
 * same paper card as the capacity line: a message ABOUT the system,
 * on the night ground, reads as one. Specificity matched to
 * `.hero p` above, which would otherwise own the margin. */
.hero .hero-signed-out {
  background: var(--bg-raised);
  color: var(--fg-body);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin: 0 0 var(--s-4);
}

.hero-capacity {
  background: var(--bg-raised);
  color: var(--fg-body);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-5);
}

/* The two drawings: slightly tilted, overlapping "pages" over a warm
 * pool of light. Every image box carries its aspect ratio. */
.pages-stack {
  position: relative;
  block-size: var(--pages-h);
  margin: var(--s-5) 0 var(--s-3);
}

.pages-stack::before {
  content: "";
  position: absolute;
  inset: 20% 10%;
  border-radius: var(--r-pill);
  background: var(--glow-pool);
}

.pages-stack figure {
  position: absolute;
  inline-size: var(--pages-w);
  max-inline-size: 72%;
  aspect-ratio: 3 / 2;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-line-night);
  box-shadow: var(--shadow-lg), var(--glow-warm-lg);
}

.pages-stack figure:first-child {
  left: var(--s-2);
  top: var(--s-2);
  transform: rotate(-4deg);
}

.pages-stack figure:last-child {
  right: var(--s-2);
  top: var(--s-7);
  transform: rotate(3deg);
}

.pages-stack img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.landing-body {
  max-inline-size: var(--step-max);
  margin: 0 auto;
  padding: var(--s-6) var(--s-4) 0;
}

.section {
  margin: 0 0 var(--s-6);
}

.section h2 {
  font-size: var(--t-2);
  margin: 0 0 var(--s-3);
}

.how-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.how-list li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border-soft);
}

.how-list .icon {
  color: var(--accent-on-light);
  margin-top: var(--s-1);
}

.promise {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-sm);
}

.promise ul {
  margin: 0;
  padding: 0 0 0 var(--s-5);
}

.promise li {
  margin: 0 0 var(--s-2);
}

.price-card {
  background: var(--bg-raised);
  border: 1.5px solid var(--chip-border-selected);
  border-radius: var(--r-card);
  padding: var(--s-5);
  box-shadow: var(--shadow-md);
}

.price-card h2 {
  margin: 0;
}

.price {
  font-family: var(--font-display);
  font-size: var(--t-2);
  margin: var(--s-2) 0 var(--s-3);
}

.price-card ul {
  margin: var(--s-2) 0 0;
  padding: 0 0 0 var(--s-5);
}

.honesty {
  color: var(--fg-muted);
  font-size: var(--t-0);
}

.faq details {
  border-bottom: 1px solid var(--border-soft);
  padding: var(--s-3) 0;
}

.faq summary {
  cursor: pointer;
  font-weight: bold;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}

/* display:flex drops the native disclosure triangle, so the fold
 * carries its own: a question that opens must look like one. */
.faq summary::before,
details.story-fold summary::before,
details.consent-door summary::before {
  content: "\25B8";
  flex: 0 0 auto;
  margin-inline-end: var(--s-2);
  color: var(--accent-on-light);
  transition: transform var(--m-fast) var(--m-ease);
}

.faq details[open] > summary::before,
details.story-fold[open] > summary::before,
details.consent-door[open] > summary::before {
  transform: rotate(90deg);
}

.faq details p {
  margin: var(--s-2) 0 0;
}

/* The way to the account screen from the signed-in home. Set apart
 * from the two buttons above it by a rule, so it never reads as a
 * third thing that starts a book. */
.books-account {
  margin: var(--s-5) 0 0;
  padding: var(--s-4) 0 0;
  border-top: 1px solid var(--border-soft);
}

.landing-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  padding: var(--s-5) 0 0;
  border-top: 1px solid var(--border-soft);
}

.landing-footer a {
  color: var(--accent-on-light);
}

/* The site footer: one quiet line under every screen, carrying the
 * links the law wants reachable from anywhere (the legal notice
 * today). Small and muted so a flow screen does not grow a second
 * call to action; the landing folds the line into its own footer. */
.site-footer {
  max-width: var(--step-max);
  margin: 0 auto;
  padding: 0 var(--s-4) var(--s-5);
  color: var(--fg-muted);
  font-size: var(--t--1);
  text-align: center;
}

.site-footer a {
  color: var(--accent-on-light);
}

.site-footer a + a {
  margin-inline-start: var(--s-3);
}

/* A legal document page: the version line under the title, the
   earlier versions as a quiet list at the foot. */
.legal-doc-version {
  color: var(--fg-muted);
}

.legal-doc-versions {
  margin-top: var(--s-5);
  font-size: var(--t--1);
}

/* The legal notice page: label over value, the register as printed. */
.legal-notice dt {
  margin-top: var(--s-4);
  font-weight: bold;
}

.legal-notice dd {
  margin: 0;
}

/* ------------------------------------------------------------ trust */

.trust-lines {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
}

.trust-lines li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  margin: 0 0 var(--s-2);
  box-shadow: var(--shadow-sm);
}

.trust-lines .icon {
  color: var(--accent-on-light);
  margin-top: var(--s-1);
}

/* The legal block reads as a LABELLED legal block, never as a broken
 * translation: bordered, labelled, in the sans. */
.legal-block {
  border: 1px solid var(--border-control);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin: var(--s-5) 0 0;
  font-size: var(--t-0);
}

.legal-block h2 {
  font-family: var(--font-sans);
  font-size: var(--t--1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin: 0 0 var(--s-3);
}

.legal-block p {
  margin: 0 0 var(--s-3);
}

/* The photo screen's FAQ: the landing FAQ's affordance, under the
 * attestation, so the whole promise is one press from the checkbox
 * without standing between the parent and the start button. Its
 * points keep the trust card look, tightened for a panel. */
.photo-faq {
  margin: var(--s-4) 0 0;
}

.photo-faq .trust-lines {
  margin: var(--s-2) 0 var(--s-2);
}

.mode-line {
  background: var(--bg-raised);
  border-left: var(--s-1) solid var(--chip-border-selected);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-4) 0 0;
}

/* ----------------------------------------------------------- photos
 *
 * The drop zone IS the screen: a 3:4 dashed card with the photo icon
 * and the gold "choose" inside; "I don't have a photo" is a small
 * text link under it, and only then does the description open.
 */

.photo-card {
  margin: var(--s-5) 0 0;
}

.photo-card h2 {
  font-size: var(--t-2);
  margin: 0 0 var(--s-2);
}

.guide-text {
  color: var(--fg-muted);
  margin: var(--s-2) 0 var(--s-4);
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  inline-size: 100%;
  max-inline-size: var(--drop-max);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  padding: var(--s-4);
  border: 2px dashed var(--chip-border-selected);
  border-radius: var(--r-card);
  background: var(--bg-raised);
  text-align: center;
  overflow: hidden;
}

.drop-zone .icon {
  inline-size: var(--s-7);
  block-size: var(--s-7);
  color: var(--accent-on-light);
}

.drop-zone.has-photo {
  border-style: solid;
  padding: 0;
}

.drop-zone .photo-thumb {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}

/* A drawing in the frame, not a photograph: the sheet is a full
   figure and cropping it to the frame's 3:4 takes the feet off, so it
   is fitted whole on the paper instead of covering the box. */
.drop-zone .photo-thumb--drawing {
  object-fit: contain;
  background: var(--bg-raised);
}

.drop-zone .drop-hint {
  color: var(--fg-muted);
  font-size: var(--t--1);
  margin: 0;
}

/* The file input is the real control; the label is the button. */
.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--btn-h-secondary);
  margin: 0;
  padding: var(--s-2) var(--s-5);
  border: 1px solid var(--btn-primary-bg);
  border-radius: var(--r-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-weight: 700;
  cursor: pointer;
}

.file-button.secondary {
  border-color: var(--btn-secondary-border);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  font-weight: 600;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-button:focus-within {
  outline: 2px solid var(--focus-light);
  outline-offset: 2px;
}

/* The replace door sits on the photo, at its foot. */
.drop-zone.has-photo .file-button {
  position: absolute;
  inset-block-end: var(--s-3);
  inset-inline: var(--s-3);
}

.photo-status {
  color: var(--c-sage-ink);
  margin: var(--s-2) 0 0;
  text-align: center;
}

/* The return visit's row has no drop zone above it, so the word that
   says the drawing is done lines up with the name instead of with a
   picture that is not there. */
.photo-card--drawn .photo-status {
  text-align: start;
}

.photo-links {
  text-align: center;
  margin: var(--s-2) 0 0;
}

/* The description, opened only on "I don't have a photo". */
.describe-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: var(--s-4);
  margin: var(--s-3) 0 0;
}

.describe-card label {
  margin-top: 0;
}

/* ---------------------------------------------------------- preview */

.stage {
  margin: var(--s-4) 0 0;
}

/* Every image box carries an aspect ratio: no layout shift while a
 * picture lands over mobile data. */
.figure-box {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-md);
}

.figure-box.is-square {
  aspect-ratio: 1 / 1;
}

.figure-box img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* The working box: a landscape frame with the lantern at work and one
 * status line. The box itself is the promise that something is
 * coming; the words say what. */
.working-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  text-align: center;
  color: var(--fg-muted);
}

.reveal-card {
  background: var(--bg-raised);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--glow-warm);
  padding: var(--s-4);
  margin: var(--s-4) 0 0;
}

/* THE NAMEPLATE. Every card that carries a person wears its name on
 * a header-blue plate: the reveal's character cards, and the read-back
 * card on the deciding screen, which carries the whole commission.
 * It bleeds to the card's edges (negative margins against the card's
 * own padding), so it is a plate and not a coloured word. */
.reveal-card h2 {
  --fg-heading: var(--plate-fg);
  font-size: var(--t-2);
  background: var(--plate-bg);
  border-radius: var(--r-md);
  margin: var(--s-4-neg) var(--s-4-neg) var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-start-start-radius: var(--r-xl);
  border-start-end-radius: var(--r-xl);
}

/* A card whose drawing the parent has said yes to RECEDES: the warm
 * glow is what the screen uses to say "this one is asking you
 * something", so a settled card gives it up, and its plate goes to
 * the lighter night. The tick on the plate is decorative - the
 * accepted line under the drawing is the one that is read out. */
.reveal-card.is-settled {
  box-shadow: var(--shadow-sm);
}

.reveal-card.is-settled h2 {
  background: var(--plate-bg-settled);
}

.reveal-card.is-settled h2::after {
  content: "\2713";
  float: inline-end;
}

.reveal-figures {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

/* The frame a drawing is shown in: 4:3, the top of the 2:3 sheet,
 * which is where the face is. That is the crop the deciding screen's
 * strip of the cast wants - a row of reminders under page one. On the
 * reveal the drawing is the screen, so the frame takes the sheet's
 * own shape instead (.is-whole). */
.reveal-figure {
  position: relative;
  /* Basis 0 and no auto minimum: with a real sheet in it (the SMOKE
   * fixture since 2026-09-07) Chrome otherwise sizes the frame from
   * the image's intrinsic width and it shrinks to a third of the row. */
  flex: 1 1 0;
  min-inline-size: 0;
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--bg-page);
}

.reveal-figure img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: top;
}

/* The whole sheet, filling the frame: the drawing is what this screen
 * is for and a crop of it left the picture smaller than the doors
 * under it. The sheet is 2:3 (1024x1536, and 832x1248 as the renderer
 * actually returns it), so nothing is cut away here. */
.reveal-figure.is-whole {
  aspect-ratio: 2 / 3;
}

.reveal-figure.is-whole img {
  object-position: center;
}

/* The picture IS the control: a transparent button over the whole
 * drawing, and NOTHING drawn on top of it - no pill, no scrim, no
 * corner badge. Its label lives in the accessible name. The pointer
 * is the only affordance, which costs a phone nothing and tells a
 * mouse what the press does. */
.figure-zoom {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  cursor: zoom-in;
}

.figure-zoom:hover {
  box-shadow: none;
}

/* The whole figure, over the page: a native modal <dialog> in the top
 * layer, so no z-index ladder and Escape for free. The box fills the
 * viewport and the picture is centred inside it, which makes every
 * pixel that is not the picture a "tap outside" (the template closes
 * on a click whose target is the dialog itself). */
.lightbox {
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: 100%;
  max-block-size: 100%;
  margin: 0;
  padding: var(--s-4);
  border: 0;
  background: transparent;
  overflow: hidden;
}

.lightbox::backdrop {
  background: var(--lightbox-scrim);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  display: block;
  max-inline-size: 100%;
  max-block-size: 100%;
  inline-size: auto;
  block-size: auto;
  object-fit: contain;
  border-radius: var(--r-lg);
}

.lightbox-close {
  position: absolute;
  inset-block-start: var(--s-4);
  inset-inline-end: var(--s-4);
  min-height: var(--tap-min);
  margin: 0;
  padding: var(--s-2) var(--s-4);
  border: 0;
  background: var(--bg-raised);
  color: var(--fg-body);
  font-size: var(--t-0);
}

.lightbox :focus-visible {
  outline-color: var(--focus-dark);
}

.reveal-own {
  flex: 0 0 auto;
  inline-size: var(--s-9);
}

.reveal-own img {
  display: block;
  inline-size: var(--s-9);
  block-size: var(--s-9);
  object-fit: cover;
  border-radius: var(--r-lg);
}

.reveal-own figcaption {
  color: var(--fg-muted);
  font-size: var(--t--1);
  margin: var(--s-1) 0 0;
}

.doors {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-4) 0 0;
}

.doors form {
  margin: 0;
}

.doors button,
.doors .file-button,
.doors .button {
  display: flex;
  width: 100%;
  margin: 0;
}

/* The change panel: "draw them again" is the <summary>, so it wears
 * the secondary's own tokens - the same button, opening its panel in
 * place under itself. Never gold: "yes, that's them" is the one
 * gold element on the reveal. */
.change-panel summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--btn-h-secondary);
  padding: var(--s-2) var(--s-5);
  border: 1.5px solid var(--btn-secondary-border);
  border-radius: var(--r-pill);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.change-panel summary:focus-visible {
  outline: 2px solid var(--focus-light);
  outline-offset: 2px;
}

.change-panel[open] summary {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.change-panel > form {
  border: 1.5px solid var(--border-control);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: var(--s-3) var(--s-4) var(--s-4);
  margin: 0;
}

.change-panel h3 {
  font-family: var(--font-display);
  font-size: var(--t-1);
  margin: 0 0 var(--s-3);
}

.change-panel .chips {
  margin-top: var(--s-3);
}

.change-panel .hint {
  margin: var(--s-2) 0 0;
}

/* The book's style wears the same clothes as the change panel, but it
 * belongs to the book, not to a card: it sits under the last card,
 * full width, and its fieldset opens the panel rather than following
 * a photo control, so it drops the photo screen's leading margin. */
.style-panel {
  margin: var(--s-5) 0 0;
}

.style-panel .style-choice {
  margin-top: 0;
}

/* The page review's font door (MES-853): each row is its own submit,
 * a button wearing the photo screen's font row, over the opening of
 * the parent's own story - two lines of it, so three rows stay a
 * glance at 375 px and a long first paragraph does not make one row a
 * page. */
.font-panel .chip--font {
  width: 100%;
}

.font-panel .font-sample {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* Where nothing but the redraw itself can change (a character drawn
 * from words, or the paid gate, where the photo is gone), the door IS
 * the submit: a panel would open on its own button. */
.redraw-plain .hint {
  margin: var(--s-2) 0 0;
  text-align: center;
}

/* The retry on a FAILED card: the file control and the retry itself
 * are one form - one photo, one render - so they stack with the gap
 * the doors around them use rather than touching. */
.fail-retry {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

/* The budget is spent: what the book keeps, said under the drawing. */
.change-settled {
  color: var(--fg-muted);
  margin: var(--s-3) 0 0;
}

/* What comes next, said where the story is asked for: one quiet line
 * between the last card and the pay bar, kept off both. */
.story-order {
  margin-block-start: var(--s-4);
}

.accepted {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--c-sage-ink);
  font-weight: bold;
  margin: var(--s-3) 0 0;
}

.accepted .icon {
  color: var(--c-sage-ink);
}

.fail-block {
  border-left: var(--s-1) solid var(--c-rose-ink);
  padding: var(--s-2) var(--s-4);
  margin: var(--s-3) 0 0;
}

.fail-block h3 {
  font-family: var(--font-display);
  font-size: var(--t-1);
  margin: 0 0 var(--s-2);
}

/* The printed garment the renderer refused, told on the card whose
 * sheet came back plain. An inset note, not a failure: the drawing is
 * good and one thing in it is not what the photo showed, so it takes
 * parchment on the card's paper-white and the gold edge - the rose
 * edge above is the failure surface and must stay distinguishable. */
/* The refusal popup: a modal <dialog> over the reveal, in the top
 * layer like the lightbox, so it settles no z-index and closes on
 * Escape by itself. It is a sheet of paper rather than a picture
 * frame - the box is the surface the words sit on, it is at most as
 * tall as the viewport and scrolls inside when a phone cannot hold
 * it, and the drawing it is about stays visible as the card behind
 * the scrim. */
.notice-pop {
  inline-size: min(30rem, 100% - var(--s-5));
  max-block-size: 85vh;
  margin: auto;
  padding: var(--s-4) var(--s-4) var(--s-5);
  border: 0;
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  color: var(--fg-body);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}

.notice-pop::backdrop {
  background: var(--lightbox-scrim);
}

.notice-pop h3 {
  font-family: var(--font-display);
  font-size: var(--t-1);
  margin: 0 0 var(--s-2);
}

/* Direct children only: the wardrobe field's own .hint keeps its
 * top margin. */
.notice-pop > p {
  margin: 0 0 var(--s-2);
}

/* The way out, under everything the box offers. */
.notice-pop > button {
  margin-top: var(--s-4);
}

.print-wardrobe label {
  margin-top: var(--s-3);
}

/* The story as it lands: paragraphs, large enough to read on a phone
 * while the page is drawn. */
.story-body {
  background: var(--bg-raised);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-sm);
  margin: var(--s-4) 0 0;
}

.story-body p {
  font-size: var(--t-1);
  line-height: 1.6;
  margin: 0 0 var(--s-4);
}

.story-body p:last-child {
  margin-bottom: 0;
}

/* The story's own title, over the story it belongs to: the same words
 * the cover prints. Centred and set apart so it is read as the book's
 * name and not as the story's first sentence. */
.story-title {
  margin: 0 0 var(--s-4);
  font-size: var(--t-2);
  text-align: center;
}

details.story-fold {
  margin: var(--s-4) 0 0;
}

details.story-fold summary {
  cursor: pointer;
  font-weight: bold;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}

.decide-list {
  margin: var(--s-4) 0 0;
  padding: 0 0 0 var(--s-5);
}

.decide-list li {
  margin: 0 0 var(--s-2);
}

/* --------------------------------------------------------- progress */

.pages-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin: var(--s-4) 0 0;
}

.pages-grid figure {
  margin: 0;
}

.pages-grid figcaption {
  color: var(--fg-muted);
  font-size: var(--t--1);
  margin: var(--s-1) 0 0;
}

.pages-grid .figure-box {
  box-shadow: var(--shadow-sm);
}

.page-card {
  background: var(--bg-raised);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-3);
  margin: var(--s-3) 0 0;
}

.page-card h2 {
  font-size: var(--t-1);
  margin: 0 0 var(--s-2);
}

.page-card form {
  margin: 0;
}

.page-card button {
  margin-top: var(--s-2);
}

/* The words the page will print: the book's own voice, set like the
   story rather than like a caption, because this is where the parent
   reads their book before it is made. */
.page-text {
  margin: var(--s-3) 0 0;
}

.page-text p {
  font-size: var(--t-1);
  line-height: 1.6;
  margin: 0 0 var(--s-3);
}

.page-text p:last-child {
  margin-bottom: 0;
}

/* While the edit box is open it IS the page's words: showing them
 * twice in one card reads as a mistake. A browser without :has()
 * simply shows both, which is what the card looked like before. */
.page-card:has(> details[open]) .page-text {
  display: none;
}

.page-card .hint {
  margin: var(--s-2) 0 0;
}

/* ------------------------------------------------- the quill's line
 *
 * The wait screens' progress strip: a written line with a feather
 * resting on its end (partials/quill_line.html, fable/web/quill.py).
 * Everything from here to the reader section is
 * marketing/brand-assets/quill-line.css pasted as landed, minus the
 * four custom properties it hands over, which are merged into :root
 * above. app/tests/test_quill_strip.py pins both halves against that
 * file, so this block is changed by re-running marketing's generator
 * and pasting again, never by hand.
 */

/* A tollvonás — the quill's line. The wait screens' progress strip.
 *
 * THIS IS THE STRIP, adopted on Oliver's ruling of 2026-09-24 („the
 * warm feather with the gold nib, blue written line, no background, no
 * strip box"). Web builds it on MES-382 and keeps its own copy of the
 * body below in app/fable/web/static/app.css; marketing never edits
 * app/. GENERATED by marketing/tools/quill_line.py — change a number
 * there and re-run, do not hand-edit the path, and hand web the new
 * body. Companion artwork: marketing/brand-assets/prop-quill.svg
 * (inline it, so currentColor and the variable fills resolve). Spec and
 * the reasoning: marketing/product-design/quill-line-spec.md.
 *
 * The wait strip's predecessors stay where they are and are not
 * deleted: prop-pen.svg + ink-line.css (the dip pen) and
 * mascot-lampacska-run.svg + lit-road.css (the running Lanternling).
 *
 * Only opacity and transform are animated — no colour keyframes, so the
 * CSS token test stays green.
 *
 * ---------------------------------------------------------------------
 * NO GROUND OF ITS OWN. Oliver, 2026-09-24: „I like it but let's lose
 * the background. It should be just the writing and the pen." The
 * strip's box is gone — no background, no inset rule, no radius, no
 * overflow clip — and with the box went the wrapper element that
 * carried it: THE COMPONENT IS NOW ONE <svg>. The ground under the
 * three paths is the screen's own --bg-page (--c-parchment, #FBF6EC),
 * sampled off the four rendered wait screens at 375 px directly under
 * .working-box, and the whole palette below is measured against it.
 *
 * ---------------------------------------------------------------------
 * ONE CLASS AND NOTHING TO PICK. There is no palette modifier and no
 * flecks switch: `.qline` is the whole component. Night was rejected,
 * the gold feather was rejected beside the warm one, and per-piece
 * marks were refused — each on Oliver's ruling, each with its figures
 * kept in the spec (sections 9.5, 9.7, 10) so it is not re-proposed. A
 * modifier class with one legal value is a way to get it wrong.
 *
 * ---------------------------------------------------------------------
 * FOUR LINES GO IN app.css's :root, NOT NEXT TO THE COMPONENT. The
 * token tests (app/tests/test_css_tokens.py) are strict in two ways
 * this component has to respect, and both were checked by running the
 * tests' own regexes over this file: no colour literal may appear
 * outside :root, and EVERY var(--x) anywhere in app.css must resolve to
 * a definition inside :root — a component-local custom property does
 * not count. Paste the :root block below INTO the existing :root block
 * (do not add a second one: the reference test reads the first :root
 * only), then the rest of the file wherever the component belongs.
 *
 * ---------------------------------------------------------------------
 * ONE NUMBER DRIVES THE WHOLE COMPONENT: --ink-pos, 0 to 94, in the
 * path's own pathLength-100 units. It positions the ink's end, the wet
 * tail and the quill's nib, and they cannot disagree, because all three
 * read the same d and the same variable. 94 and not 100 on purpose: the
 * page is never full — spec section 7.
 *
 * MARKUP the rules below expect (the spec's section 8 has it in full,
 * ready to paste). One element, one class, and the one number on it:
 *
 *   <svg class="qline" style="--ink-pos:44.5" viewBox="0 0 343 50"
 *        preserveAspectRatio="none" aria-hidden="true" focusable="false">
 *     ... three <path> with the SAME d and pathLength="100",
 *         then <g class="q-quill"> holding the contents of
 *         prop-quill.svg's #quill-nibspace
 *   </svg>
 *
 * FIVE things are load-bearing, and each was measured in Chrome at
 * --force-device-scale-factor=1, not assumed:
 *
 *  1. NO vector-effect="non-scaling-stroke" on any of the three paths.
 *     It looks like the right attribute and it silently breaks the
 *     component: with it, the dash measures arc length on the SQUEEZED
 *     path while offset-distance measures it on the pre-transform path,
 *     and the nib walks off the line at narrow viewports.
 *  2. transform-box: view-box with transform-origin: 0 0 on .q-lean.
 *     fill-box puts the anchor on the drawing's bounding box instead of
 *     the nib, and the quill renders below the line.
 *  3. stroke-dashOFFSET, not stroke-dashARRAY, carries the position: it
 *     is a single number, so it transitions.
 *  4. The plume's pivot is a TRANSLATED GROUP, not a transform-origin in
 *     user units. Both were rendered and both hinged at the vane base in
 *     Chrome; the translated group is shipped because its origin is the
 *     group's own (0,0), which cannot resolve anywhere else in an engine
 *     we have not tested. Web: check the plume on iOS Safari before
 *     shipping. If it does not hinge at the vane base, DELETE the
 *     .q-plume rule — the component is complete without it and the nib
 *     tremble alone is still the design.
 *  5. The line BACKTRACKS (14.4% of samples), because handwriting does.
 *     Both stroke-dashoffset and offset-distance measure arc length, so
 *     both are correct across it; the visible consequence is that a
 *     little written ink can sit to the RIGHT of the nib. Measured
 *     worst case: 5.10 px, at --ink-pos 69 — less than the halo's own
 *     radius, so it reads as ink under the nib's light, not as ink the
 *     quill has not reached.
 *
 * aria-hidden is not optional: the accessible truth of a wait screen is
 * the status line above the poll, exactly as with the mascot's bubble.
 * This strip carries no role, no value and no label — spec section 7.
 */

/* ------------------------------------------------------------- the strip */
/* 50 px, and the number is DERIVED (spec section 3). It is not box
   padding — there is no box. It is the drawing's own extent, and all
   four numbers were RE-MEASURED off the emitted path strings this
   round: the writing's band is 21.54 px tall; above its highest point
   the leaned quill reaches 20.79 px at rest and 1.98 px further at
   the squiggle's furthest stop (lean 41.8°, plume -2.6°); an SVG clips
   to its viewBox, so a viewBox that does not hold the ANIMATED pose
   loses the feather's tip. That leaves 2.79 px of air above the
   tip at its highest and 1.94 px below the deepest descender — on the
   page those are the strip's breathing room, not a frame's inset. 48
   would still fit the geometry and leave 0.79 px above the tip at that
   pose, which is the tip grazing the clip edge; 50 stays.

   343 user units wide. It must never be stretched WIDER than 343 px,
   or the quill grows with it; narrower it compresses, which is fine and
   self-consistent — the quill compresses with the line and the nib
   stays planted. margin-inline centres it in a wider column. */

/* THE PALETTE (spec section 9). Written ink on the PAGE'S OWN GROUND,
   --bg-page = --c-parchment = #FBF6EC, which is what is under the strip
   now that the box is gone. --c-ink-night is 14.85:1 on it (it was
   15.74:1 on the paper-white box, so the change costs 6 % of a
   ratio that has 9x the headroom it needs); --c-gold-ink, what the ink
   used before Oliver's ruling of 2026-09-24, is 5.49:1. The blue is
   the same ink the headings, the rule under a question and the
   nameplates wear, so the strip is written in the product's second ink
   rather than in a colour of its own.

   THE QUILL IS WARM AND THE LINE IS COOL, and that split is the
   design: a brown feather with a pale rachis and a gold nib, the
   instrument Lámpácska holds in the painting in the box directly
   above; the ink it lays is blue. The nib is NOT --ink-made — spec
   section 9.3. */

.qline {
  display: block;
  inline-size: 100%;
  max-inline-size: 343px;
  block-size: 50px;
  margin-block-start: var(--s-3);
  margin-inline: auto;
  color: var(--quill-vane);
}

.q-ghost,
.q-ink,
.q-wet {
  fill: none;
  stroke-linecap: round;
}

/* THE PAGE NOT YET WRITTEN ON. Same d as the ink, at the opacity of
   something barely there. Its stroke-width is EXACTLY the ink's, so
   anything the quill has passed is covered perfectly and the written
   line runs unbroken.

   It is the WRITTEN INK'S OWN COLOUR at low alpha, not a warm grey:
   one line at two strengths. The alpha is STRENGTH-MATCHED to its
   ground and re-solved on parchment when the box went — spec section
   9.4 — which is why it is a number and not a copy. */
.q-ghost {
  stroke: var(--ink-ghost);
  stroke-width: 1.9;
}

/* WHAT HAS BEEN MADE. Full strength from the first stroke to the last:
   a page that exists does not become less existent, so the old ink never
   fades. */
.q-ink {
  stroke: var(--c-ink-night);
  stroke-width: 1.9;
  stroke-dasharray: 100 100;
  stroke-dashoffset: calc(100 - var(--ink-pos));
  transition: stroke-dashoffset 600ms ease-out;
}

/* THE LAST FOUR UNITS, STILL WET. Not an animation — a gradient in time
   that moves only when the ink moves. It is what says "this end is the
   fresh end" without anything moving because time passed.

   It is the SAME COLOUR as the written ink and wider than it (2.6
   against 1.9), because wet ink is the same ink and there is no
   "brighter than" on paper. Four units of a second colour at the head
   of the line read as a second pen — rendered and rejected, spec
   section 9. */
.q-wet {
  stroke: var(--c-ink-night);
  stroke-width: 2.6;
  stroke-dasharray: 4 100;
  stroke-dashoffset: calc(4 - var(--ink-pos));
  transition: stroke-dashoffset 600ms ease-out;
}

/* THE QUILL. offset-rotate is 0deg and not auto on purpose: a hand keeps
   a near-constant wrist angle and lets the line wave under it. A quill
   that tilted into every loop would read as a mechanism — and on a line
   that backtracks it would spin. */
.q-quill {
  offset-path: path("M20 40.7C22.19 32.52 27.8 32.49 27.39 40.67C28.9 37.47 30.77 34.26 31.41 33.03C31.47 34.55 31.83 38.5 31.93 40.63C33.3 37.99 35.04 35.34 35.64 34.34C35.76 35.58 36.28 38.81 36.47 40.55C37.93 37.53 39.76 34.49 40.38 33.33C40.46 34.76 40.88 38.46 41 40.46C42.23 36.83 43.9 34.15 45.7 34.34C47.62 34.53 47.32 38.14 44.47 40.25C45.99 39.37 47.05 38.74 47.62 40.29C49.94 33.2 53.9 33.07 53.41 38.27C56.08 30.64 60.19 30.91 59.28 39.9C62.31 42.96 62.72 46.83 60.4 47.06C57.92 47.29 58.78 42.8 62.58 41.08C64.95 39.91 65.98 39.65 67.45 39.59C70.46 30.77 75.19 30.59 73.68 39.36C76.51 39.8 81.22 39.69 84.25 39.27C86.08 38.97 87.29 38.82 88.46 38.83C91.94 28.95 98.15 28.79 96.63 38.59C101.99 32.93 106.6 28.06 105.56 25.81C104.1 24.57 99.59 28.19 100.43 32.96C100.84 36.23 102.77 37.95 106.35 38.4C106.41 41.5 108.39 40.97 109.39 38.66C111.15 33.74 114.06 33.91 114.13 38.31C118.44 31.25 121.3 29.7 121.9 31.77C122.36 33.66 117.63 34 117.57 36.58C117.37 38.99 120.57 38.3 123.07 38.31C124.6 35.96 125.99 33.74 126.9 32.14C126.94 33.88 127.1 36.48 128.52 38.36C129.96 34.05 131.87 30.91 133.88 31.24C136.03 31.56 135.62 35.88 132.4 38.27C134.11 37.29 135.31 36.59 135.91 38.47C139.15 29.57 145.94 29.75 144.86 38.69C148 39.33 153.21 39.57 156.55 39.37C158.56 39.21 159.9 39.14 161.19 39.24C163.96 31.96 168.69 32.14 167.42 39.48C170.22 42.93 170.52 47.05 168.31 47.11C165.94 47.18 166.87 42.5 170.52 40.97C172.81 39.92 173.79 39.72 175.2 39.78C178.97 34.18 181.55 33.01 182.14 34.71C182.6 36.26 178.29 36.39 178.3 38.49C178.17 40.45 181.08 39.99 183.36 40.07C184.59 37.67 186.12 35.29 186.65 34.38C186.73 35.54 187.12 38.57 187.25 40.2C188.38 38.23 189.81 36.28 190.3 35.53C190.43 36.49 190.94 38.98 191.14 40.31C192.33 38.06 193.83 35.81 194.35 34.95C194.44 36.04 194.88 38.89 195.03 40.42C197.13 34.23 200.83 34.3 200.42 38.9C202.89 32 206.73 32.44 205.92 40.63C208.6 41.21 213.06 41.31 215.94 41C217.67 40.76 218.82 40.65 219.93 40.69C225.07 35.38 229.48 30.76 228.48 28.62C227.08 27.44 222.76 30.84 223.57 35.39C223.97 38.51 225.82 40.17 229.26 40.61C230.62 36.51 232.43 33.48 234.33 33.72C236.37 33.95 235.99 38.03 232.93 40.41C234.55 39.43 235.69 38.72 236.26 40.48C237.68 38.54 238.97 36.71 239.81 35.39C239.92 36.79 240.2 38.88 241.71 40.34C244.34 32.21 248.7 32.07 248.1 38.04C251.18 29.06 255.68 29.39 254.54 39.93C254.69 42.65 256.66 42.14 257.59 40.08C259.21 35.71 262.13 35.77 262.32 39.64C262.91 43 266.52 42.86 268.55 39.4C271.61 42.27 272.07 45.93 269.75 46.15C267.27 46.38 268.08 42.14 271.86 40.5C274.22 39.39 275.24 39.15 276.71 39.09C280.98 31.56 283.75 29.85 284.28 31.99C284.68 33.96 280.15 34.47 280.04 37.18C279.8 39.7 282.87 38.88 285.27 38.8C288.26 39.26 293.22 39.2 296.4 38.81C298.33 38.53 299.6 38.39 300.83 38.42C303.71 30.46 309.03 30.4 307.83 38.33C309.14 34.36 310.87 31.45 312.66 31.7C314.58 31.96 314.2 35.92 311.3 38.18C312.84 37.25 313.91 36.58 314.44 38.3C317.67 41.38 318.16 45.17 315.74 45.3C313.14 45.44 313.97 41.1 317.92 39.57C320.38 38.53 321.46 38.33 323 38.34");
  offset-distance: calc(var(--ink-pos) * 1%);
  offset-rotate: 0deg;
  transform-box: view-box;
  transform-origin: 0 0;
  transition: offset-distance 600ms ease-out;
}

/* The vane is currentColor, which .qline sets from --quill-vane, so the
   drawing file carries no colour of its own. 0.92 and not 1: at 0.92
   the blank line under the feather is hidden rather than veiled, which
   is a quill lying on a page; what the vane may never cover is written
   ink, and the 6.07 px right / 5.35 px up clearance in spec section 4.3
   is what rules that out. */
.q-quill .q-vane {
  fill: currentColor;
  fill-opacity: 0.92;
}

/* The rachis is drawn OVER the vane in a different tone. That one line
   is the whole difference between a feather and a blade at this size,
   and it is how her quill is painted in the working box above. It is
   8.35:1 against the vane it is drawn on. */
.q-quill .q-shaft {
  fill: var(--quill-spine);
}

/* The nib is the metal: it belongs to the instrument, not to the line,
   so it is gold while the ink is blue. Rendered both ways at 1x — a
   blue nib merges into the blue ink it is standing on and the contact
   point disappears; the gold nib keeps it. Spec section 9.3. */
.q-quill .q-nib,
.q-quill .q-wetdot {
  fill: var(--c-gold-ink);
}

/* Where offset-path is not supported, the quill simply is not drawn. A
   written line with no quill still tells the whole truth, because the
   position IS the end of the ink. Never a quill parked at the origin. */
@supports not (offset-path: path("M0 0 L1 1")) {
  .q-quill {
    display: none;
  }
}

/* ----------------------------------------------------------- the working */
/* Nothing here moves the quill ALONG the line. The rule Oliver upheld:
   the line's LENGTH may only grow when a real piece of the book has been
   made. What these keyframes say is "a hand is at work", which is true
   on every one of these screens and claims nothing. */

/* THE SQUIGGLE. ±3.2° about the NIB, which is the rotation centre, so
   the nib does not move at all and the feather's tip travels 1.8 px each
   way — 3.6 px peak to peak, against the dip pen's 0.8 px. That is the
   difference between „squiggling a bit" and a shimmer. Five stops at
   uneven times and uneven amplitudes so it never locks into a
   metronome. */
@keyframes qline-squiggle {
  0% { transform: rotate(45deg); }
  17% { transform: rotate(48.2deg); }
  38% { transform: rotate(41.8deg); }
  61% { transform: rotate(47deg); }
  83% { transform: rotate(43.4deg); }
  100% { transform: rotate(45deg); }
}

/* THE PLUME FLEX. ±2.6° about the VANE BASE, so the barbs move 1.1 px
   against a spine that is doing something else. Two rotations on
   different clocks is what makes a feather flex rather than a stick
   waggle. 1.7 s against the squiggle's 1.1 s: they coincide once every
   18.7 s and are otherwise out of phase. */
@keyframes qline-plume {
  0% { transform: rotate(0deg); }
  26% { transform: rotate(-2.6deg); }
  54% { transform: rotate(2deg); }
  79% { transform: rotate(-1.1deg); }
  100% { transform: rotate(0deg); }
}

/* The wet ink catching the light. 2.4 s, the mascot's existing working
   flicker, unchanged and on purpose: the strip's light and the big
   lantern's light breathe on the same clock even though nothing else on
   the two does. */
@keyframes qline-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

/* The pivot is the nib, which is this group's own local (0,0). If this
   group ever pivots anywhere else the nib leaves the line. */
.qline .q-lean {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: qline-squiggle 1.1s ease-in-out infinite;
}

/* The pivot is the vane base, which is THIS group's own local (0,0),
   because prop-quill.svg translates the vanes to make it so. */
.qline .q-plume {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: qline-plume 1.7s ease-in-out infinite;
}

.qline .q-halo,
.qline .q-quill .q-wetdot {
  animation: qline-flicker 2.4s ease-in-out infinite;
}

/* -------------------------------------------------- reduced motion */
/* app.css nulls `animation` globally here, which would drop the quill
   back to its SVG attribute pose — correct already, because that pose is
   the quill at rest on the line. These rules restate it so the component
   is right even where that global rule is not in force, and so the strip
   is a quill resting on written ink rather than a dead one. */

@media (prefers-reduced-motion: reduce) {
  .qline .q-lean,
  .qline .q-plume,
  .qline .q-halo,
  .qline .q-quill .q-wetdot {
    animation: none;
  }

  .qline .q-lean {
    transform: rotate(45deg);
  }

  .qline .q-plume {
    transform: none;
  }

  .qline .q-halo,
  .qline .q-quill .q-wetdot {
    opacity: 1;
  }

  .q-ink,
  .q-wet,
  .q-quill {
    transition: none;
  }
}

/* ------------------------------------------------------------ the glide */
/* MES-736 and MES-769, web's and not marketing's: everything above
   this line is marketing's file as landed and is pinned to it. Oliver,
   on staging, 2026-11-12: the quill did not move continuously; and
   2026-11-16: it moved fluidly only on the first drawing, "each line
   owns its current waiting step". So each wait draws its own line,
   and time moves the quill - but only inside the stage that is
   running, and never to where it ends (web/quill.py):

   --ink-pos is e + (end - e) * f, written in the markup. --ink-e is
   the part of the wait that exists: qline-write writes it in from
   --e-from, where the strip this one replaces had it, in the 600 ms
   marketing gave the ink (a strip delivered out of band is a NEW
   element, so their transition never runs). --ink-f is the share of
   the room left before --glide-end that time has written: qline-glide
   runs it from 0 to --glide-f over --glide-s, and --glide-at is the
   NEGATIVE delay that starts it as far in as the book already is, so
   a strip delivered by a poll picks the glide up where the last one
   was. Because the room is what is left AFTER what exists, a drawing
   or a page that lands moves the glide on with it. Easing out: about
   the stage's usual pace at first, slowing to a stop short of its
   end, where a stage that runs long waits for its own row, squiggling.

   Both are registered so that they interpolate; a browser without
   @property flips each once, halfway, and still never draws less than
   what exists nor reaches the stage's end. Reduced motion drops the
   animations (the motion rule at the end of the file): --ink-e is
   then the markup's own value and --ink-f its :root 0, so the strip
   is exactly what exists. */
@property --ink-e {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@property --ink-f {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

@keyframes qline-write {
  from { --ink-e: var(--e-from); }
}

@keyframes qline-glide {
  from { --ink-f: 0; }
  to { --ink-f: var(--glide-f); }
}

.qline {
  animation:
    qline-write 600ms ease-out both,
    qline-glide var(--glide-s) cubic-bezier(0.5, 1, 0.89, 1)
      var(--glide-at) both;
}

/* ----------------------------------------------------------- reader */

.reader {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  gap: var(--s-4);
  margin: var(--s-4) 0 0;
}

.reader::-webkit-scrollbar {
  display: none;
}

.spread {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.spread .figure-box {
  aspect-ratio: 3 / 2;
}

.spread.is-square .figure-box {
  aspect-ratio: 1 / 1;
}

/* Read aloud at arm's length: 20px on a phone. */
.spread-text {
  font-family: var(--font-display);
  font-size: var(--t-1);
  line-height: 1.55;
  margin: var(--s-3) 0 0;
}

/* A page holds as many of the story's paragraphs as it was cut with;
   the break between them is the story screen's, so the same words are
   spaced the same way before and after payment. */
.spread-text p {
  margin: 0 0 var(--s-4);
}

.spread-text p:last-child {
  margin-bottom: 0;
}

/* The book's own font (MES-803), on the reader's page text and on the
 * picker's samples: the face the PDF is set in, nothing else of the
 * screen. Fraunces is the site's display face already. Playpen Sans
 * has no U+2010 HYPHEN, the character a broken line ends in by
 * default, so its line-end hyphen is the U+002D it does carry (the
 * PDF does the same) rather than a dash from a fallback face. */
[data-book-font="fraunces"] {
  font-family: var(--font-display);
}

[data-book-font="andika"] {
  font-family: "Andika", var(--font-sans);
}

[data-book-font="playpen"] {
  font-family: "Playpen Sans", var(--font-sans);
  hyphenate-character: "-";
}

.reader.is-picture-only .spread-text {
  display: none;
}

.cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-night);
  color: var(--fg-on-night);
  box-shadow: var(--shadow-lg), var(--glow-warm-lg);
}

.cover h2 {
  font-size: var(--t-3);
  margin: 0;
  padding: 0 var(--s-5);
}

.cover small {
  color: var(--c-glow);
  font-size: var(--t--1);
}

/* The book's own cover: a square picture in either layout, shown
   whole. The spread's 3:2 box would crop the title lettered in it. */
.spread .cover.cover--art {
  aspect-ratio: 1 / 1;
  background: var(--bg-raised);
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin: var(--s-3) 0 0;
}

.reader-nav button {
  margin: 0;
  min-height: var(--tap-min);
}

.reader-position {
  color: var(--fg-muted);
}

/* ------------------------------------------------------------ books */

.book-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  background: var(--bg-raised);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  margin: var(--s-3) 0 0;
  box-shadow: var(--shadow-sm);
}

.book-row h2 {
  font-size: var(--t-1);
  margin: 0;
  flex: 1 1 100%;
}

.book-row .button {
  margin: 0;
  margin-left: auto;
}

/* A finished book with its own cover (MES-795): the cover stands at
   the card's left like a hardback on a shelf - square spine edge, a
   rounded fore-edge, a shaded spine strip - and is the way into the
   reader. The words take the rest of the card. */
.book-row.has-cover {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: var(--s-4);
}

.book-row-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  flex: 1 1 0;
  min-width: 0;
}

.book-row-body > p {
  margin: 0;
}

.book-cover {
  position: relative;
  flex: 0 0 auto;
  inline-size: 7rem;
  border-radius: var(--r-sm) var(--r-md) var(--r-md) var(--r-sm);
  box-shadow: var(--shadow-md);
  transition:
    transform 160ms ease-out,
    box-shadow 160ms ease-out;
}

.book-cover img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-sm) var(--r-md) var(--r-md) var(--r-sm);
}

.book-cover::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 6px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--cover-spine);
  pointer-events: none;
}

.book-cover:hover,
.book-cover:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  .book-cover {
    transition: none;
  }

  .book-cover:hover,
  .book-cover:focus-visible {
    transform: none;
  }
}

/* ------------------------------------------------ the printed copy */

/* The print card under the reader's PDF link (MES-420): a quiet card,
   its one action secondary, so the PDF stays the screen's gold. */
.print-card {
  margin: var(--s-5) 0;
  padding: var(--s-4);
}

.print-card h2 {
  font-size: var(--t-1);
  margin: 0 0 var(--s-2);
}

.print-card p:last-child {
  margin-bottom: 0;
}

/* The gift by e-mail under the print card (MES-810): the print card's
   quiet card, one row per gift sent, the row's status in the body ink
   beside a failed one's rose. */
.gift-card {
  margin: var(--s-5) 0;
  padding: var(--s-4);
}

.gift-card h2 {
  font-size: var(--t-1);
  margin: 0 0 var(--s-2);
}

.gift-card > p:last-child {
  margin-bottom: 0;
}

.gift-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gift-row {
  border-bottom: 1px solid var(--border-soft);
  padding: var(--s-3) 0;
}

.gift-row p {
  margin: 0;
}

.gift-row-who {
  font-weight: bold;
  overflow-wrap: anywhere;
}

.gift-row-status {
  color: var(--fg-muted);
}

.gift-row--failed .gift-row-status {
  color: var(--c-rose-ink);
}

.gift-revoke {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

/* The warning between the address and the rest of the gift form. */
.gift-warn {
  margin: var(--s-4) 0;
}

/* The product on the address screen (MES-506): the picture at the
   guarantee notice's thumbnail width beside its type and maker lines,
   so the form still starts in the first screenful at 375 px. */
.print-product {
  display: grid;
  grid-template-columns: var(--s-10) minmax(0, 1fr);
  gap: var(--s-3);
  align-items: center;
  margin: 0 0 var(--s-4);
}

.print-product img {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.print-product p {
  margin: 0;
}

.print-product p + p {
  margin-top: var(--s-2);
}

/* What is ordered, the line the order button answers. */
.print-format-line {
  font-weight: bold;
  margin: 0;
}

/* Postcode beside the town: four digits need a quarter of the row. */
.print-address-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--s-3);
}

/* ------------------------------------------------- the inbox screen */

.inbox-email {
  font-weight: bold;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------ desktop
 *
 * One breakpoint. The phone layout is the design; this only lets the
 * header carry its tagline again.
 */
@media (min-width: 48rem) {
  .tagline {
    display: inline;
  }
}

/* ------------------------------------------------------- PC layout
 *
 * MES-489 builds marketing's MES-488 round 3 (Oliver's go 2026-11-09).
 * Everything sits behind ONE breakpoint, 64rem (1024 px), so a phone
 * and a tablet render exactly as before, and nothing here adds, hides
 * or moves a word: pseudo-elements carry only a picture.
 *
 * Four families of screen:
 * - the landing, a shop window: hero copy left, the two drawings
 *   right, the body in two columns with the guide beside the FAQ;
 * - the question screens (`body.scene`: the sign-in, every create
 *   step, the photos, every story question): the PAINTING IS THE
 *   PAGE. It fills the window behind everything, the header turns to
 *   smoked glass over it, and the questions sit on a sheet of paper
 *   laid into the scene. Within one flow the sheet keeps its place,
 *   so the buttons stay under the hand; the scene changes with the
 *   step. Create and the photos lay the sheet on the left, the story
 *   questions and the sign-in on the right;
 * - the customer's own book (reveal, deciding, books, reader) uses
 *   the width for their own drawings; the deciding screen opens on
 *   the invented family reading together, in a band ABOVE the
 *   customer's drawings, never beside them;
 * - the reading screens (legal, trust, account) at a 46rem measure.
 *
 * Art rule (marketing): a stranger's child never stands beside the
 * customer's own child, so the question screens' paintings have no
 * person in them and nothing is added to the reveal, books or reader.
 */
@media (min-width: 64rem) {
  /* ---------------------------------------------------- the shell */

  .sky-top,
  .sky-steps,
  .sky-status {
    max-inline-size: var(--site-max);
  }

  .site-footer {
    max-width: var(--site-max);
    text-align: start;
  }

  /* ------------------------------------------------------ landing */

  /* the landing's main runs the full window; its two bands keep
   * their own frame */
  main.main--flush {
    max-width: none;
  }

  .hero {
    padding: var(--s-8) var(--s-6);
  }

  .hero-inner {
    max-inline-size: var(--site-max);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--s-8);
    align-items: center;
  }

  .hero-inner > * {
    grid-column: 1;
  }

  .hero-inner > .pages-stack {
    grid-column: 2;
    grid-row: 1 / span 6;
    --pages-w: var(--hero-stack-w);
    block-size: var(--hero-stack-h);
    margin: 0;
  }

  .hero-inner > .pages-stack figure {
    max-inline-size: 78%;
  }

  .hero-inner > .pages-stack figure:last-child {
    top: var(--s-10);
  }

  .hero-cta .button {
    width: auto;
    padding-inline: var(--s-7);
  }

  .landing-body {
    max-inline-size: var(--site-max);
    padding: var(--s-8) var(--s-6) 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--s-7);
    align-items: start;
  }

  .landing-body > .section:first-child,
  .landing-body > .honesty,
  .landing-body > .landing-footer {
    grid-column: 1 / -1;
  }

  .how-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-6);
  }

  .how-list li {
    flex-direction: column;
    border-bottom: 0;
    border-top: 2px solid var(--c-gold-edge);
    padding: var(--s-4) 0 0;
  }

  .landing-body > .promise,
  .landing-body > .price-card {
    margin: 0 0 var(--s-7);
    align-self: stretch;
  }

  .landing-body > .faq {
    grid-column: 1;
  }

  /* the guide wondering, beside the questions */
  .landing-body::after {
    content: "";
    grid-column: 2;
    grid-row: 4;
    align-self: center;
    justify-self: center;
    inline-size: 100%;
    max-inline-size: var(--muse-max);
    aspect-ratio: 1 / 1;
    background: url("/static/brand/mascot-lampacska-paint-muse.webp")
      center / contain no-repeat;
    -webkit-mask-image: var(--art-fade);
    mask-image: var(--art-fade);
  }

  .landing-body > .landing-footer {
    grid-row: 5;
  }

  /* --------------------------------- question screens: the stage */

  /* The painting is the body's own ground, attached to the window, so
   * it stays put while the sheet scrolls over it. A ground and not a
   * fixed layer: nothing in this stylesheet pins itself to the
   * viewport (test_motif_tap_reach), and a background cannot take a
   * press. */
  body.scene {
    display: flex;
    flex-direction: column;
    min-block-size: 100vh;
    background:
      var(--stage-scrim) fixed,
      var(--stage-art) var(--stage-pos) / cover no-repeat fixed,
      var(--c-ink-deep);
  }

  /* the header: smoked glass, so the painting runs up under it */
  .scene > .sky {
    background: var(--stage-glass);
    -webkit-backdrop-filter: var(--stage-glass-blur);
    backdrop-filter: var(--stage-glass-blur);
  }

  /* the sheet: a page of the book laid into the scene */
  .scene > main {
    flex: none;
    inline-size: calc(100% - 2 * var(--sheet-gap));
    max-width: calc(var(--step-max) + 2 * var(--s-7) - 2 * var(--s-4));
    margin-block: var(--s-8) var(--s-9);
    margin-inline: var(--sheet-gap) auto;
    padding: var(--s-7);
    background: var(--c-parchment);
    border-radius: var(--r-md);
    box-shadow:
      0 0 0 1px var(--sheet-edge),
      calc(var(--sheet-x) * 5px) 6px 0 -2px var(--sheet-under-1),
      calc(var(--sheet-x) * 10px) 12px 0 -4px var(--sheet-under-2),
      0 28px 64px var(--sheet-drop),
      var(--glow-warm-lg);
  }

  .scene .flow,
  .scene--photos .page {
    margin: 0;
  }

  /* the footer: a dark strip under the scene, the links in lamplight */
  .scene > .site-footer {
    max-width: none;
    margin: auto 0 0;
    padding-block: var(--s-4);
    padding-inline: var(--stage-gutter);
    background: var(--stage-floor);
    color: var(--fg-on-night-muted);
  }

  .scene > .site-footer a {
    color: var(--c-glow);
  }

  /* the right hand: the story questions and the sign-in */
  .scene--story,
  .scene--signin {
    --stage-scrim: var(--stage-scrim-right);
    --sheet-x: -1;
  }

  .scene--story > main,
  .scene--signin > main {
    margin-inline: auto var(--sheet-gap);
  }

  .scene--signin > main {
    margin-block-start: var(--s-9);
  }

  /* The step decides the scene. `data-scene` is the flow's step,
   * bound by Alpine; without script it is absent and the first
   * step's picture stands, which is the screen every section is then
   * shown on. */
  .scene--create {
    --stage-art: url("/static/brand/stage-name-book.webp");
    --stage-pos: center 45%;
  }

  .scene--create:has(.flow[data-scene="2"]) {
    --stage-art: url("/static/brand/stage-age-boots.webp");
    --stage-pos: center 80%;
  }

  .scene--create:has(.flow[data-scene="3"]) {
    --stage-art: url("/static/brand/stage-cast-pegs.webp");
    --stage-pos: center 30%;
  }

  .scene--create:has(.flow[data-scene="4"]) {
    --stage-art: url("/static/brand/stage-save-paperbird.webp");
    --stage-pos: center 20%;
  }

  /* The format step lends the deciding screen's family evening
   * (MES-778: a new painting is its own spend). It has no Christmas
   * twin, so the season keeps it too. */
  .scene--create:has(.flow[data-scene="format"]) {
    --stage-art: var(--art-family-reading);
    --stage-pos: center 40%;
  }

  .scene--photos {
    --stage-art: url("/static/brand/stage-photos-easel.webp");
    --stage-pos: center 40%;
  }

  .scene--story {
    --stage-art: url("/static/brand/stage-theme-gate.webp");
    --stage-pos: center 55%;
  }

  .scene--story:has(.flow[data-scene="2"]) {
    --stage-art: url("/static/brand/stage-lesson-friends.webp");
    --stage-pos: center 55%;
  }

  .scene--story:has(.flow[data-scene="3"]) {
    --stage-art: url("/static/brand/stage-moments-keepsakes.webp");
    --stage-pos: center 75%;
  }

  .scene--signin {
    --stage-art: url("/static/brand/stage-signin-letter.webp");
    --stage-pos: center 40%;
  }

  /* ------------------------------- the customer's own book screens */

  main:has(.reveal-card),
  main:has(.decide-main),
  main:has(.reader),
  main:has(.book-row) {
    max-width: var(--site-max);
    padding-inline: var(--s-6);
  }

  main:has(.reveal-card) .page,
  main:has(.decide-main) .page,
  main:has(.reader) .page,
  main:has(.book-row) .page {
    max-inline-size: var(--show-max);
  }

  /* reveal: the cast side by side, the question and lead above */
  #preview-stage:has(.reveal-card) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 24rem));
    column-gap: var(--s-6);
    justify-content: center;
    align-items: start;
  }

  #preview-stage:has(.reveal-card) > :not(.reveal-card) {
    grid-column: 1 / -1;
  }

  #preview-stage:has(.reveal-card) > h1,
  #preview-stage:has(.reveal-card) > .lead {
    text-align: center;
    margin-inline: auto;
  }

  /* deciding: the family evening is the top of the page. The band
   * runs across the whole window, up under the smoked-glass header;
   * the heading and the lead sit in the lamplit room on its left, and
   * the two columns rise out of its lower edge onto the paper. Read
   * off the stage's own wrappers, not a body class: the poll swaps
   * the stage from the reveal to this screen without a new page. */
  /* The family evening is two screens' painting (the deciding band
   * and the format step's scene), named once. */
  body {
    --art-family-reading: url("/static/brand/stage-family-reading.webp");
  }

  body:has(.decide-main) {
    position: relative;
  }

  body:has(.decide-main)::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    block-size: var(--decide-band-h);
    z-index: -1;
    background:
      var(--decide-band-scrim),
      var(--art-family-reading) 60% 40% / cover
        no-repeat,
      var(--c-ink-deep);
    -webkit-mask-image: var(--decide-band-fade);
    mask-image: var(--decide-band-fade);
  }

  body:has(.decide-main) > .sky {
    background: var(--stage-glass);
    -webkit-backdrop-filter: var(--stage-glass-blur);
    backdrop-filter: var(--stage-glass-blur);
  }

  #preview-stage:has(.decide-main) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--decide-max));
    column-gap: var(--s-8);
    align-items: start;
  }

  #preview-stage:has(.decide-main) > :not(.decide-aside) {
    grid-column: 1;
  }

  #preview-stage:has(.decide-main) > h1 {
    max-inline-size: var(--decide-heading-max);
    margin-block-start: var(--s-8);
    color: var(--fg-on-night);
    font-size: var(--t-4);
    text-shadow: var(--decide-heading-shadow);
  }

  #preview-stage:has(.decide-main) > .lead {
    max-inline-size: var(--decide-heading-max);
    color: var(--fg-on-night);
    text-shadow: var(--decide-lead-shadow);
  }

  .decide-main {
    margin-block-start: var(--s-9);
  }

  /* The door's column scrolls with the page: the mock-up pinned it
   * (sticky), and nothing here pins itself to the viewport. */
  .decide-aside {
    grid-column: 2;
    grid-row: 3;
    margin-block-start: var(--s-9);
    background: var(--bg-raised);
    border: 1px solid var(--chip-border-selected);
    border-radius: var(--r-card);
    padding: var(--s-6) var(--s-5) var(--s-5);
    box-shadow: var(--shadow-lg), var(--glow-warm-lg);
  }

  .decide-aside > :first-child {
    margin-top: 0;
  }

  /* books: two columns of cards */
  .page:has(> .book-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--s-5);
    align-items: stretch;
  }

  .page:has(> .book-row) > :not(.book-row) {
    grid-column: 1 / -1;
  }

  .book-cover {
    inline-size: 9rem;
  }

  /* reader: the open book, picture left, words right */
  .reader {
    gap: var(--s-6);
  }

  .spread {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    column-gap: var(--s-7);
    align-items: center;
  }

  .spread:has(.cover) {
    grid-template-columns: minmax(0, 40rem);
    justify-content: center;
  }

  /* A square cover is sized by the screen's height too, or its
     lettered title starts below the fold on a laptop. */
  .spread:has(.cover--art) {
    grid-template-columns: minmax(0, min(40rem, 70svh));
  }

  .spread-text {
    font-size: var(--t-2);
    margin: 0;
  }

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

  main:has(> .legal-doc-page),
  main:has(> .legal-notice),
  main:has(> .terms-page),
  main:has(> .page > .trust-lines),
  main.main--read {
    max-width: var(--read-max);
  }

  main:has(> .legal-doc-page) .page,
  main:has(> .legal-notice) .page,
  main:has(> .terms-page) .page,
  main:has(> .page > .trust-lines) .page {
    max-inline-size: none;
  }
}

/* a big monitor: the frame grows, the question column does not.
 * `html[lang]` and not a second `:root` block: it is the same element
 * and outranks `:root`, and the stylesheet keeps ONE `:root`, which
 * the token tests read as the definitions. */
@media (min-width: 100rem) {
  html[lang] {
    --site-max: 80rem;
    --show-max: 72rem;
    --decide-max: 32rem;
  }
}

/* ----------------------------------------------------------- motion
 *
 * §6: reduced motion must disable ambient animation - the drifting
 * sparks, the lantern flicker - and leave a static lit state. There
 * are none yet; the rule is in place before the first one lands. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------ the consent doors */

/* One line per book on /account. The door is a fold in small,
 * regular-weight text so it reads as a quiet option under the book's
 * name, not as a step of the page; the tap target stays full size. */
.consent-doors {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
}

.consent-doors > li {
  border-bottom: 1px solid var(--border-soft);
  padding: var(--s-3) 0;
}

.consent-doors p {
  margin: 0;
}

details.consent-door summary {
  cursor: pointer;
  font-size: var(--t--1);
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  color: var(--accent-on-light);
}

.consent-door > p,
.consent-door > form {
  margin: var(--s-2) 0 0;
}
