/* ============================================================================
   Starwink website lab - site layer.
   Built ON the app's system (vendor/*.css, vendor/motion-tokens.js), never beside it:
   colour = app roles only; type = Baloo 2 display + Nunito body + Fraunces numerals only;
   radius by role; motion = the app's curves and durations (--ease-*, --dur-*, --dz-k).
   The only new values here are the SITE SCALE (display sizes and page geometry a phone app
   never needed), declared once below.
   Materials (Motion-Language-V36): PAPER = things you touch; LIGHT = text/art arriving;
   AIR = slow ambient drift. Nothing bounces.
   ========================================================================== */

#app-frame {
  /* site scale: fluid display type and page geometry */
  --site-gutter: clamp(1rem, 0.4rem + 3vw, 4rem);
  --site-max: 76rem;
  --site-h1: clamp(2.35rem, 1.45rem + 3.9vw, 4.4rem);
  --site-h2: clamp(1.9rem, 1.35rem + 2.2vw, 3rem);
  --site-lead: clamp(1.05rem, 0.98rem + 0.32vw, 1.25rem);
  --site-verse: clamp(1.05rem, 0.98rem + 0.3vw, 1.22rem);
  --site-section: clamp(4.5rem, 3rem + 6vw, 9rem);
  --z-head: 20; --z-lab: 40;

  /* 2026-10-30 (founder: "make sure the footer sticks to the bottom of the page as a normal footer should"):
     a block frame let the footer follow a short <main> and leave bare ground under it (confirm page, 1280x1400:
     290px). A column with main growing keeps the footer on the bottom edge; long pages are unchanged. */
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--l0);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--lh-relaxed, 1.6);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
#app-frame > main { flex: 1 0 auto; }
html { scroll-behavior: smooth; background: var(--surface-page); }
body { margin: 0; }
*, *::before, *::after { box-sizing: border-box; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

/* The night scope re-computes the alias roles against the dark palette the shell block
   re-declares, so a night panel reads the same in the light theme (UI-Style section 4). */
#app-frame .dz-night {
  --l0: var(--surface-page); --l1: var(--surface-card); --l2: var(--surface-nested); --l3: var(--surface-sheet);
  --ink-title: rgba(var(--text-title-rgb), 0.92);
  --ink-body: rgba(var(--text-title-rgb), 0.78);
  --ink-meta: rgba(var(--text-title-rgb), 0.62);
  --hairline-faint: rgba(var(--text-second-rgb), 0.08);
  --hairline: rgba(var(--text-second-rgb), 0.12);
  --hairline-strong: rgba(var(--text-second-rgb), 0.2);
  background: var(--feature-bg);
  color: var(--ink-body);
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--site-gutter); top: var(--sp-3); z-index: var(--z-lab); background: var(--l1); color: var(--ink-title); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-control); }

:focus-visible { outline: 2px solid var(--cta); outline-offset: 3px; }

/* ---- type ---------------------------------------------------------------- */
.h1, .h2 { font-family: var(--font-display); color: var(--ink-title); margin: 0; text-wrap: balance; }
.h1 { font-size: var(--site-h1); font-weight: 700; line-height: 1.02; letter-spacing: -0.012em; }
.h2 { font-size: var(--site-h2); font-weight: 700; line-height: 1.06; letter-spacing: -0.008em; }
.h1-b { display: none; }
.head-b .h1-a { display: none; }
.head-b .h1-b { display: inline; }
.lead { font-size: var(--site-lead); line-height: 1.55; color: var(--ink-body); margin: 0; max-width: 34em; text-wrap: pretty; }
.lead--sm { font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); }
.eyebrow { margin: 0 0 var(--sp-4); font-weight: 700; font-size: var(--fs-label); color: var(--cta); letter-spacing: 0.01em; }
/* the home's eyebrow is the first line of its H1 (audit P2-4: the H1 carries the topic words, "stories ... for ages 0 to 6",
   while the approved headline stays the display line); it keeps the eyebrow's own look, measured identical to the <p> */
.h1 > .eyebrow { display: block; font-family: var(--font-body, Nunito, sans-serif); line-height: 1.6; text-wrap: wrap; text-shadow: none; }
#app-frame.dz-light .eyebrow { color: var(--tag-gold-ink); }
#app-frame.dz-light .dz-night .eyebrow { color: var(--cta); }
.note { margin: var(--sp-3) 0 0; font-size: var(--fs-meta); color: var(--ink-meta); }
#app-frame.dz-light .note, #app-frame.dz-light .deck-hint { color: var(--ink-body); }   /* meta ink on cream measured 4.34:1 */
#app-frame.dz-light .dz-night .note { color: var(--ink-meta); }
.num { font-family: var(--font-numeral); font-variant-numeric: tabular-nums lining-nums; font-weight: 600; }

/* ---- icons (the app's Phosphor set, line weight) -------------------------- */
.ico { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; flex: none; }
.ico svg { width: 100%; height: 100%; fill: currentColor; }

/* ---- header ----------------------------------------------------------------
   Sits over the hero night art, so its ink is the fixed over-art ink. Its CTA stays a
   ghost while the hero's gold button is on screen (one gold per viewport) and lights
   up gold once the hero scrolls away (LIGHT: colour only, never a slide). */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-head);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: calc(var(--sp-3) + env(safe-area-inset-top)) var(--site-gutter) var(--sp-3);
  color: var(--onart-ink);
  transition: background-color calc(var(--dur-medium) * var(--dz-k)) var(--ease-light),
              box-shadow calc(var(--dur-medium) * var(--dz-k)) var(--ease-light);
}
#app-frame .site-head.is-scrolled { /* ID-scoped so it outranks the night scope's solid ground: a glass bar */
  background: rgba(var(--feature-bg-rgb), 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(var(--onart-scrim-rgb, 0,0,0), 0.25);
}
.arm-shelf .site-head:not(.is-scrolled) { color: var(--ink-title); }
#app-frame .site-head.dz-night:not(.is-scrolled) { background: transparent; }
#app-frame .site-head.dz-night { color: var(--onart-ink); }
.brand { display: inline-flex; color: inherit; }
.wordmark { display: block; width: clamp(7.25rem, 6rem + 4vw, 9.5rem); }
.wordmark svg { display: block; width: 100%; height: auto; fill: currentColor; overflow: visible; }
.wordmark .tittle { transform-box: fill-box; transform-origin: 50% 50%; }
.wordmark.wink .tittle { animation: sw-wink calc(620ms * var(--dz-k)) var(--ease-inout); }
@keyframes sw-wink {
  0% { transform: scaleY(1); fill: currentColor; filter: none; }
  35% { transform: scaleY(0.16); fill: var(--cta); filter: drop-shadow(0 0 6px rgba(var(--cta-rgb), 0.9)); }
  60% { transform: scaleY(1.06); fill: var(--cta); filter: drop-shadow(0 0 10px rgba(var(--cta-rgb), 0.7)); }
  100% { transform: scaleY(1); fill: currentColor; filter: none; }
}
.head-tools { display: flex; align-items: center; gap: var(--sp-3); }
.head-cta { transition: background calc(var(--dur-medium) * var(--dz-k)) var(--ease-light), color calc(var(--dur-medium) * var(--dz-k)) var(--ease-light), box-shadow calc(var(--dur-medium) * var(--dz-k)) var(--ease-light); }
.site-head.is-scrolled:not(.cta-quiet) .head-cta { background: var(--gold-grad); color: var(--gold-ink); border-color: transparent; box-shadow: var(--sh-gold); }
/* phones: one action in the header at a time - the language switch over the hero, the CTA once it has scrolled away */
@media (max-width: 559.98px) { .site-head .head-cta { display: none; } .site-head.is-scrolled .head-cta { display: inline-flex; } .site-head.is-scrolled .seg--sm { display: none; } }

/* ---- controls: segmented (the app's track + lit thumb) --------------------- */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-pill);
  background: rgba(var(--text-second-rgb), 0.1); box-shadow: inset 0 0 0 1px var(--hairline);
}
.seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  min-height: 36px; padding: 0 var(--sp-4); border-radius: var(--radius-pill);
  font-weight: 700; font-size: var(--fs-label); color: var(--ink-meta);
  transition: color calc(var(--dur-small) * var(--dz-k)) var(--ease-light), background-color calc(var(--dur-small) * var(--dz-k)) var(--ease-light);
}
.seg button[aria-pressed="true"] { background: var(--l3); color: var(--ink-title); box-shadow: var(--sh-sm); }
.seg--sm button { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-meta); }
.site-head:not(.is-scrolled) .seg--sm { background: rgba(var(--onart-scrim-rgb, 0,0,0), 0.28); box-shadow: inset 0 0 0 1px rgba(242,239,232,0.16); }
.site-head:not(.is-scrolled) .seg--sm button { color: rgba(242,239,232,0.72); }
.site-head:not(.is-scrolled) .seg--sm button[aria-pressed="true"] { background: rgba(242,239,232,0.16); color: var(--onart-ink); box-shadow: none; }
.arm-shelf .site-head:not(.is-scrolled) .seg--sm { background: rgba(var(--text-second-rgb), 0.1); box-shadow: inset 0 0 0 1px var(--hairline); }
.arm-shelf .site-head:not(.is-scrolled) .seg--sm button { color: var(--ink-meta); }
.arm-shelf .site-head:not(.is-scrolled) .seg--sm button[aria-pressed="true"] { background: var(--l3); color: var(--ink-title); }

/* ---- buttons: the action ladder (gold commit / ghost / text) -------------- */
.btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--control-h-md); padding: 0 var(--sp-6); border-radius: var(--radius-control);
  font-family: var(--font-button, var(--font-display)); font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.005em;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: transform calc(var(--dur-press) * var(--dz-k)) var(--ease-out), box-shadow calc(var(--dur-small) * var(--dz-k)) var(--ease-out);
}
.btn:active { transform: scale(var(--press-scale, 0.97)); }
.btn--gold { background: var(--gold-grad); color: var(--gold-ink); box-shadow: var(--sh-gold); }
@media (hover: hover) and (pointer: fine) { .btn--gold:hover { box-shadow: var(--sh-gold), 0 0 0 4px rgba(var(--cta-rgb), 0.16); } }
.btn--ghost { background: transparent; color: inherit; border-color: var(--hairline-strong); }
.site-head:not(.is-scrolled) .btn--ghost { border-color: rgba(242,239,232,0.34); }
.arm-shelf .site-head:not(.is-scrolled) .btn--ghost { border-color: var(--hairline-strong); }
.btn--onart { color: var(--onart-ink); border-color: rgba(242,239,232,0.4); }
.btn--sm { min-height: var(--control-h-sm); padding: 0 var(--sp-4); font-size: 0.9375rem; }
.link-listen {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h-sm); padding: 0 var(--sp-2);
  color: var(--ink-title); font-weight: 700; text-decoration: none; border-radius: var(--radius-control);
}
.link-listen span:last-child { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 1px; }
.link-listen .ico { color: var(--cta); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-7); }

/* ---- the join form: the gold button UNFOLDS into the field (PAPER + LIGHT); its rules live in v17.css (2026-10-30 redesign) --- */
@keyframes sw-unfold { from { opacity: 0; transform: scaleX(0.92); filter: blur(3px); } }

/* ============================================================================
   HERO A - tonight's story (a night panel in both themes)
   The art is a Feature window: the picture holds the right ~74%, dissolving left into
   the panel's own night, so the copy sits on the scene's dark near plane, never on a
   separate box beside the picture (UI-Style section 5 composition law, carried over).
   ========================================================================== */
.hero { position: relative; }
.arm-story .hero--shelf, .arm-shelf .hero--story { display: none; }
.hero--story { min-height: min(100svh, 58rem); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
/* Feature window: the picture starts 16% in and dissolves left into the panel's night; its crop is
   pinned left so the subject (Tove, 32-52% of slide 3) lands right of the words and the scene's own
   near plane (the rope coil) lies under them. */
.hero-art { position: absolute; inset: 0 0 0 16%; z-index: -1; }
.hero-art::after { /* the near plane deepened under the words: a scrim, not a box */
  content: ""; position: absolute; inset: 0 0 0 -20%; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--feature-bg-rgb), 0.92) 0%, rgba(var(--feature-bg-rgb), 0.8) 30%, rgba(var(--feature-bg-rgb), 0.5) 46%, rgba(var(--feature-bg-rgb), 0) 62%); }
.hero-art picture { display: block; width: 100%; height: 100%; }
.hero-img { width: 100%; height: 100%;
  object-fit: cover; object-position: 0% 40%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 16%), linear-gradient(0deg, transparent 0%, #000 20%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 16%), linear-gradient(0deg, transparent 0%, #000 20%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  transform-origin: 60% 45%;
  animation: sw-picture calc(var(--dur-ceremony) * var(--dz-k)) var(--ease-settle) backwards,
             sw-drift calc(48s * var(--dz-air)) var(--ease-loop) calc(var(--dur-ceremony) * var(--dz-k)) infinite alternate;
}
@keyframes sw-picture { from { opacity: 0; filter: blur(12px) brightness(0.55); transform: scale(1.06); } }
@keyframes sw-drift { from { transform: scale(1); } to { transform: scale(1.045) translate(-0.8%, -0.4%); } }
.hero--story::after { /* a soft top scrim so the header reads on bright skies */
  content: ""; position: absolute; inset: 0 0 auto; height: 9rem; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(var(--feature-bg-rgb), 0.55), rgba(var(--feature-bg-rgb), 0)); }
.hero-copy { position: relative; padding: 0 var(--site-gutter) clamp(3rem, 2rem + 5vw, 7rem); max-width: calc(var(--site-max) + 2 * var(--site-gutter)); width: 100%; margin: 0 auto; }
/* the words stay left of the subject at every width and in both languages (RO runs ~25% longer) */
.hero--story .hero-copy > * { max-width: min(34rem, 38vw); }
.hero--story .lead { color: var(--ink-title); text-shadow: 0 1px 12px rgba(var(--feature-bg-rgb), 0.9); }

/* arrival, in reading order (LIGHT: rise + soft focus, once) */
.hero-copy > * { animation: sw-rise calc(var(--dur-large) * var(--dz-k)) var(--ease-soft) backwards; }
.hero-copy > :nth-child(1) { animation-delay: calc(520ms * var(--dz-k)); }
.hero-copy > :nth-child(2) { animation-delay: calc(600ms * var(--dz-k)); }
.hero-copy > :nth-child(3) { animation-delay: calc(720ms * var(--dz-k)); }
.hero-copy > :nth-child(4) { animation-delay: calc(820ms * var(--dz-k)); }
.hero-copy > :nth-child(5) { animation-delay: calc(900ms * var(--dz-k)); }
@keyframes sw-rise { from { opacity: 0; transform: translateY(14px); filter: blur(5px); } }

@media (max-width: 819.98px) {
  .hero--story .hero-copy > * { max-width: none; }
  .hero--story { min-height: 0; align-items: stretch; grid-template-rows: auto auto; }
  .hero-art { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 4 / 4.6; z-index: 0; }
  .hero-art::after { inset: 0; background: linear-gradient(0deg, rgba(var(--feature-bg-rgb), 0.9) 0%, rgba(var(--feature-bg-rgb), 0.55) 26%, rgba(var(--feature-bg-rgb), 0) 48%); }
  .hero-img { object-position: 50% 18%; -webkit-mask-composite: source-over;
    -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 34%); mask-image: linear-gradient(0deg, transparent 0%, #000 34%);
    -webkit-mask-composite: source-over; mask-composite: add; transform-origin: 50% 30%; }
  .hero--story .hero-copy { margin-top: -5.5rem; padding-bottom: var(--sp-8); }
}

/* ============================================================================
   HERO B - the shelf: the catalogue's own covers, fanned like books held in a hand
   (PAPER: each cover has weight; the fan leans toward the pointer on a gentle spring)
   ========================================================================== */
.hero--shelf {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: var(--sp-6);
  min-height: min(100svh, 56rem); padding: 7rem var(--site-gutter) var(--sp-8);
  max-width: calc(var(--site-max) + 2 * var(--site-gutter)); margin: 0 auto;
}
.hero--shelf .hero-copy { padding: 0; margin: 0; }
.hero--shelf .h1 { max-width: 11em; }
.deck { position: relative; height: clamp(22rem, 16rem + 18vw, 34rem); perspective: 1600px; touch-action: pan-y; }
.card {
  position: absolute; left: 50%; top: 50%; width: clamp(11rem, 7rem + 11vw, 17rem); aspect-ratio: 3 / 4;
  border-radius: var(--radius-tile); overflow: hidden; cursor: pointer; appearance: none; border: 0; padding: 0; background: var(--l2);
  box-shadow: var(--sh-material); transform-origin: 50% 120%;
  translate: -50% -50%;
  transition: transform calc(var(--dur-large) * var(--dz-k)) var(--ease-settle), box-shadow calc(var(--dur-medium) * var(--dz-k)) var(--ease-out), filter calc(var(--dur-medium) * var(--dz-k)) var(--ease-light);
  animation: sw-deal calc(900ms * var(--dz-k)) var(--ease-settle) backwards;
}
.card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(242,239,232,0.12); pointer-events: none; }
.card .card-title {
  position: absolute; inset: auto 0 0; padding: var(--sp-8) var(--sp-4) var(--sp-4); text-align: left;
  font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.15; color: var(--onart-ink);
  background: linear-gradient(transparent, rgba(var(--feature-bg-rgb), 0.82));
  opacity: 0; transform: translateY(6px);
  transition: opacity calc(var(--dur-small) * var(--dz-k)) var(--ease-light), transform calc(var(--dur-small) * var(--dz-k)) var(--ease-out);
}
.card.is-front .card-title { opacity: 1; transform: none; }
.card:not(.is-front) { filter: brightness(0.86) saturate(0.95); }
@media (hover: hover) and (pointer: fine) { .card:not(.is-front):hover { filter: none; box-shadow: var(--sh-lg); } }
@keyframes sw-deal { from { opacity: 0; transform: translateY(40px) rotate(0deg) scale(0.94); } }
.deck-hint { position: absolute; inset: auto 0 -3.75rem; text-align: center; font-size: var(--fs-meta); color: var(--ink-meta); pointer-events: none; }
@media (max-width: 819.98px) {
  .hero--shelf { grid-template-columns: 1fr; padding-top: 6rem; min-height: 0; gap: var(--sp-5); }
  .deck { height: 21rem; order: -1; margin-bottom: var(--sp-8); }
  .card { width: 12.5rem; }
}

/* ============================================================================
   THE SAMPLE PLAYER - one whole chapter, verse lit as it is read
   ========================================================================== */
.listen { padding: var(--site-section) var(--site-gutter); }
.listen-inner { max-width: var(--site-max); margin: 0 auto; }
.listen-head { max-width: 40rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.listen-head .lead { margin-top: var(--sp-4); }
.player { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "bar bar" "stage verse" "progress verse"; gap: var(--sp-4) clamp(1.5rem, 1rem + 2vw, 3rem); }
.player-bar { grid-area: bar; display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between; }
.stage { grid-area: stage; position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-card); overflow: hidden; background: var(--l1); box-shadow: var(--sh-material), inset 0 0 0 1px var(--hairline); }
.stage-pics { position: absolute; inset: 0; }
.stage-pics img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-pics img.is-in { animation: sw-page calc(var(--dur-large) * 1.4 * var(--dz-k)) var(--ease-settle) both; }
.stage-pics img.is-out { animation: sw-page-out calc(var(--dur-large) * 1.4 * var(--dz-k)) var(--ease-veil) both; }
@keyframes sw-page { from { opacity: 0; filter: blur(8px); transform: scale(1.035); } to { opacity: 1; filter: blur(0); transform: scale(1); } }
@keyframes sw-page-out { from { opacity: 1; } to { opacity: 0; } }
.player[data-state="playing"] .stage-pics img.is-current { animation: sw-page calc(var(--dur-large) * 1.4 * var(--dz-k)) var(--ease-settle) both, sw-kenburns calc(30s * var(--dz-air)) linear calc(var(--dur-large) * 1.4 * var(--dz-k)) both; }
@keyframes sw-kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }

/* the play control: the one gold commit of this section, a round lit disc on the picture */
.play {
  position: absolute; right: clamp(0.75rem, 0.5rem + 1vw, 1.25rem); bottom: clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
  width: clamp(3.5rem, 3rem + 1.6vw, 4.5rem); aspect-ratio: 1; border-radius: var(--radius-pill); border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--gold-grad); color: var(--gold-ink); box-shadow: var(--sh-gold), 0 8px 26px rgba(var(--shadow-rgb), 0.5);
  transition: transform calc(var(--dur-press) * var(--dz-k)) var(--ease-out), opacity calc(var(--dur-small) * var(--dz-k)) var(--ease-light);
}
.play:active { transform: scale(var(--press-scale, 0.97)); }
.play .ico { grid-area: 1 / 1; width: 40%; height: 40%; transition: opacity calc(var(--dur-small) * var(--dz-k)) var(--ease-light), transform calc(var(--dur-small) * var(--dz-k)) var(--ease-out), filter calc(var(--dur-small) * var(--dz-k)) var(--ease-light); }
.play .ico--play { translate: 6% 0; }
.play .ico--pause, .player[data-state="playing"] .play .ico--play { opacity: 0; transform: scale(0.7); filter: blur(2px); }
.player[data-state="playing"] .play .ico--pause { opacity: 1; transform: none; filter: none; }
.player[data-state="idle"] .play::before { /* a slow breath of warm light around the idle play: AIR, stops once playing */
  content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid rgba(var(--cta-rgb), 0.5);
  animation: sw-breathe calc(3.2s * var(--dz-air)) var(--ease-loop) infinite; pointer-events: none; }
@keyframes sw-breathe { 0%, 100% { opacity: 0; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.04); } }
.player[data-state="ended"] .play { opacity: 0; pointer-events: none; }

.stage-end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-6);
  background: rgba(var(--feature-bg-rgb), 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: sw-rise calc(var(--dur-large) * var(--dz-k)) var(--ease-soft) backwards; }
.stage-end[hidden] { display: none; }
.actions--end { margin-top: 0; flex-direction: column; justify-content: center; gap: var(--sp-3); }
.end-join { display: flex; justify-content: center; width: min(100%, 27rem); }
.note--onart { margin: 0; color: rgba(242,239,232,0.72); }
.stage-end .join-row { background: rgba(242,239,232,0.1); box-shadow: inset 0 0 0 1px rgba(242,239,232,0.24); }
.stage-end .join :is(input, .join-heard, .join-news), .stage-end .join-done { color: var(--onart-ink); }
.end-line { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); color: var(--onart-ink); text-wrap: balance; }

/* progress: one lit segment per page (click to jump). LIGHT: the fill grows with the reading */
.progress { grid-area: progress; display: flex; gap: 4px; }
.progress button { flex: 1; height: 28px; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; align-items: center; }
/* track and fill share one grid cell; as two grid items they took a row each and the fill drew below the track */
.progress button::before, .progress button > i { grid-area: 1 / 1; }
.progress button::before { content: ""; display: block; height: 4px; border-radius: var(--radius-pill); background: rgba(var(--text-title-rgb), 0.16); }
.progress button > i { display: block; height: 4px; border-radius: var(--radius-pill); background: var(--cta); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(var(--cta-rgb), 0.45); }
.progress button.is-done > i { transform: scaleX(1); }

/* the verse: every stanza present, the one being read is lit (LIGHT), the rest rest in the dark */
.verse-wrap { grid-area: verse; display: flex; flex-direction: column; min-height: 0; }
.verse-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--hairline); }
.story-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; color: var(--ink-title); line-height: 1.2; }
.pager { margin: 0; display: inline-flex; gap: 0.3em; align-items: baseline; color: var(--ink-meta); font-size: 1rem; white-space: nowrap; }
.pager #page-n { color: var(--cta); text-shadow: var(--glow-numeral); font-size: 1.35rem; }
.verse { position: relative; flex: 1; overflow: hidden; margin: 0; padding: var(--sp-5) 0;
  -webkit-mask-image: linear-gradient(transparent, #000 5%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 5%, #000 78%, transparent); }
.verse-track { transition: transform calc(700ms * var(--dz-k)) var(--ease-inout); }
.stanza { margin: 0 0 var(--sp-5); font-size: var(--site-verse); line-height: 1.5; color: var(--ink-title); opacity: 0.26; cursor: pointer;
  transition: opacity calc(var(--dur-large) * var(--dz-k)) var(--ease-light), filter calc(var(--dur-large) * var(--dz-k)) var(--ease-light); filter: blur(0.3px); }
.stanza.is-current { opacity: 1; filter: none; }
/* verse lines: one line of the poem per line; a wrapped line hangs, as poems are set in books */
.stanza .ln { display: block; padding-left: 1.1em; text-indent: -1.1em; text-wrap: pretty; }
.verse.is-swapping .verse-track { animation: sw-swap calc(var(--dur-medium) * 2 * var(--dz-k)) var(--ease-veil); }
@keyframes sw-swap { 45% { opacity: 0; filter: blur(6px); } 55% { opacity: 0; filter: blur(6px); } }
.verse-nav { display: flex; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--hairline); }
.icon-btn { width: var(--control-h-sm); height: var(--control-h-sm); display: grid; place-items: center; border-radius: var(--radius-pill); border: 1px solid var(--hairline-strong); background: transparent; color: var(--ink-title); cursor: pointer; transition: transform calc(var(--dur-press) * var(--dz-k)) var(--ease-out), background-color calc(var(--dur-small) * var(--dz-k)) var(--ease-light); }
.icon-btn:active { transform: scale(var(--press-scale, 0.97)); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: rgba(var(--text-title-rgb), 0.06); } }
.icon-btn .ico { width: 1.25rem; height: 1.25rem; }

/* desktop: the verse column takes the stage's height instead of setting it (size containment keeps the
   poem's full length out of the grid's row sizing); it scrolls by transform inside that box */
@media (min-width: 820px) { .verse-wrap { contain: size; } .verse { min-height: 0; } }
@media (max-width: 819.98px) {
  .player { grid-template-columns: 1fr; grid-template-areas: "bar" "stage" "progress" "verse"; }
  .verse { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; padding: var(--sp-4) 0 var(--sp-2); }
  .verse-track { transform: none !important; }
  .stanza { display: none; opacity: 1; filter: none; }
  .stanza.is-current { display: block; animation: sw-rise calc(var(--dur-medium) * var(--dz-k)) var(--ease-soft) backwards; }
  .player-bar .seg { flex: 1; } .player-bar .seg button { flex: 1; padding: 0 var(--sp-2); }
}

/* scroll reveal: enhances an already-visible default; site.js only hides what is below the fold at load */
.reveal.is-pending { opacity: 0; transform: translateY(18px); filter: blur(4px); }
.reveal.is-shown { transition: opacity calc(var(--dur-large) * var(--dz-k)) var(--ease-soft), transform calc(var(--dur-large) * var(--dz-k)) var(--ease-soft), filter calc(var(--dur-large) * var(--dz-k)) var(--ease-soft); }

/* evening: the page keeps bedtime like the app (slower by --dz-k from motion-tokens; art dimmed a touch) */
.wind-down .hero-img, .wind-down .stage-pics img { filter: brightness(0.9) saturate(0.94); }

/* reduced motion: light only - every movement becomes a short fade; loops stop */
@media (prefers-reduced-motion: reduce) {
  #app-frame *, #app-frame *::before, #app-frame *::after { animation-duration: 150ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 150ms !important; scroll-behavior: auto; }
  .hero-img { animation-name: sw-fade !important; }
  .reveal.is-pending { transform: none; filter: none; }
  .player[data-state="idle"] .play::before { display: none; }
  html { scroll-behavior: auto; }
}
@keyframes sw-fade { from { opacity: 0; } }

/* ---- LAB chrome (not the page) ------------------------------------------- */
.lab { position: fixed; left: 12px; bottom: 12px; z-index: var(--z-lab); display: grid; gap: 6px; padding: 10px 12px; width: 190px;
  font: 12px/1.3 system-ui, sans-serif; color: #eee; background: rgba(20,20,22,0.88); border: 1px solid #444; border-radius: 10px; }
.lab-title { margin: 0; font-weight: 700; letter-spacing: 0.04em; color: #aaa; }
.lab label { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px; }
.lab select, .lab button { font: inherit; color: #eee; background: #2a2a2e; border: 1px solid #555; border-radius: 6px; padding: 3px 4px; }
.lab button { cursor: pointer; }
.clean .lab { display: none; }
