/* Foyer — hearth-lit dark. See DESIGN.md. */

:root {
  --ink-deep: oklch(16% 0.015 60);
  --ink: oklch(20% 0.02 55);
  --ink-soft: oklch(26% 0.025 50);
  --cream: oklch(92% 0.02 85);
  --cream-dim: oklch(76% 0.025 80);
  --cream-faint: oklch(63% 0.02 75); /* >=4.5:1 on ink-deep with headroom */
  --ember: oklch(70% 0.15 55);
  --ember-deep: oklch(58% 0.14 50);
  --flame: oklch(60% 0.17 35);
  --gold: oklch(82% 0.13 85);
  --island: #0b0a09;
  --step: 4px; /* pixel unit for chunky borders */
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);    /* smooth, for hovers */
  --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);  /* settling, hand-placed */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);     /* confident docking */
  /* per-sound colours, from the sprite palette — a sound keeps its colour on
     both its tray chip and its placed puck */
  --snd-fire: var(--ember);          /* hearth amber */
  --snd-rain: oklch(70% 0.09 250);   /* slate-blue */
  --snd-city: oklch(74% 0.11 0);     /* Tokyo neon-pink */
  --snd-birds: oklch(66% 0.12 145);  /* forest moss */
  --snd-chimes: var(--gold);         /* chimes gold */
  --snd-stream: oklch(66% 0.08 190); /* stream teal */
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(24% 0.03 55), transparent 55%),
    var(--ink-deep);
  color: var(--cream);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ember-deep); color: var(--cream); }

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

img, canvas { image-rendering: pixelated; }

.wrap {
  width: min(1120px, calc(100% - clamp(2.5rem, 8vw, 7rem)));
  margin-inline: auto;
}

/* ---------- type ---------- */

h1, h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }

.kicker {
  font-family: "Silkscreen", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--ember);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.kicker::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--ember);
  box-shadow: 0 0 14px oklch(70% 0.15 55 / 0.7);
}

.sub {
  color: var(--cream-dim);
  max-width: 36rem;
  margin-top: 1.4rem;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
}

/* ---------- header ---------- */

.site-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1.4rem, 5vw, 4rem);
}

.wordmark {
  font-family: "Silkscreen", monospace;
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  color: var(--ember);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.wordmark:hover { color: var(--gold); }
.wordmark-mark {
  display: block;
  width: 1.55em; height: 1.55em;
  image-rendering: pixelated;
  flex: none;
}

/* ---------- pixel button ---------- */

.px-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font: 700 1.05rem "Bricolage Grotesque", sans-serif;
  color: var(--ink-deep);
  background: var(--ember);
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border: none;
  cursor: pointer;
  clip-path: polygon(
    0 var(--step), var(--step) var(--step), var(--step) 0,
    calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step), 100% var(--step),
    100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)) 100%, var(--step) 100%,
    var(--step) calc(100% - var(--step)), 0 calc(100% - var(--step))
  );
  transition: transform 0.07s steps(2), background 0.15s;
}
.px-btn:hover { background: var(--gold); transform: translateY(calc(var(--step) * -0.5)); }
.px-btn:active { transform: translateY(2px); }

.px-btn.ghost {
  background: transparent;
  color: var(--cream-dim);
  box-shadow: inset 0 0 0 2px var(--ink-soft);
}
.px-btn.ghost:hover { color: var(--cream); box-shadow: inset 0 0 0 2px var(--ember-deep); background: transparent; }
.px-btn.ghost[aria-pressed="true"] {
  color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--ember-deep);
  background: oklch(70% 0.15 55 / 0.08);
}

.cta-note {
  font-size: 0.9rem;
  color: var(--cream-faint);
  margin-top: 0.8rem;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;  /* title crowns the top, demo centers below */
  justify-items: center;
  padding: clamp(5.5rem, 12vh, 8rem) clamp(1.4rem, 5vw, 4rem) clamp(3rem, 8vh, 5rem);
  overflow: hidden;
}

.hero-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  list-style: none;
  counter-reset: step;
}
.hero-steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  counter-increment: step;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.hero-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.55em; height: 1.55em;
  font-family: "Silkscreen", monospace;
  font-size: 0.7em;
  color: var(--ember);
  box-shadow: inset 0 0 0 1.5px oklch(70% 0.15 55 / 0.5);
  border-radius: 999px;
}
.hero-steps .hp-glyph { font-size: 0.9em; filter: saturate(0.85); }
.hero::after { /* ember vignette, comme les slides — respire comme un feu */
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  transform-origin: 68% 62%;
  background: radial-gradient(55% 45% at 68% 62%, oklch(70% 0.15 55 / 0.09), transparent 70%);
  animation: ember-breathe 7s ease-in-out 1.4s infinite;
}
@keyframes ember-breathe {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  42%      { opacity: 1; transform: scale(1.06); }
  68%      { opacity: 0.88; transform: scale(1.02); }
}

/* ---------- hero entrance: the room is furnished by hand on load ---------- */
/* Gated on html.js so it never hides content if the script fails. transform/opacity only. */
@keyframes hero-dock {   /* the notch pill drops into the top edge */
  from { opacity: 0; transform: translateX(-50%) translateY(-130%); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes hero-rise {   /* steps, chips, hints settle up into place */
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hero-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sr-place {    /* a furniture sprite, set down: drops the last few px and seats */
  0%   { opacity: 0; transform: translate(-50%, -66%) scale(0.5); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
/* centering-preserving variants (these elements keep a translate offset at rest) */
@keyframes you-in {      /* listener: settles to translate(-50%, -50%) */
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes empty-in {    /* hint: keeps translateX(-50%); opacity is handed back to JS via backwards fill */
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.js .hero .notch { animation: hero-dock 0.62s var(--ease-expo) both; }

.js .hero-steps li { animation: hero-rise 0.55s var(--ease-quint) both; }
.js .hero-steps li:nth-child(1) { animation-delay: 0.24s; }
.js .hero-steps li:nth-child(2) { animation-delay: 0.34s; }
.js .hero-steps li:nth-child(3) { animation-delay: 0.44s; }

.js .mixer-stage .sr-floor { animation: hero-fade 0.6s ease-out 0.34s both; }
.js .mixer-stage .sr-wall  { animation: hero-fade 0.6s ease-out 0.46s both; }

/* furniture: each piece gets its own delay from JS (back-to-front, ~70ms apart) */
.js .sr-place { animation: sr-place 0.5s var(--ease-quint) both; }

.js .mixer-stage .you-marker { animation: you-in 0.6s var(--ease-quint) 1.28s both; }
/* backwards (not both): once it lands, JS owns its opacity again (hides when a sound is added) */
.js .mixer-stage .mixer-empty { animation: empty-in 0.5s var(--ease-quint) 1.42s backwards; }

/* backwards (not both): after the entrance, transform reverts to none so :hover can lift the chip */
.js .hero .mixer-tray .tray-chip { animation: hero-rise 0.5s var(--ease-quint) backwards; }
.js .hero .mixer-tray .tray-chip:nth-child(1) { animation-delay: 1.20s; }
.js .hero .mixer-tray .tray-chip:nth-child(2) { animation-delay: 1.26s; }
.js .hero .mixer-tray .tray-chip:nth-child(3) { animation-delay: 1.32s; }
.js .hero .mixer-tray .tray-chip:nth-child(4) { animation-delay: 1.38s; }
.js .hero .mixer-tray .tray-chip:nth-child(5) { animation-delay: 1.44s; }
.js .hero .mixer-tray .tray-chip:nth-child(6) { animation-delay: 1.50s; }

.hero-copy { position: relative; z-index: 2; }
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.2rem;
}

.hero-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  align-self: center;
}
/* tray hugs the stage so the demo reads as one grouped unit */
.hero-stage .mixer-tray { justify-content: center; margin: 0 0 0.9rem; }
.hero-stage .mixer-stage { max-width: 100%; }

/* ---------- rooms composed from the app's real sprites (floor/wall tiles + furniture) ---------- */
/* one tile = 48px in a 780px-wide (5:4) room -> 6.1538% of the box, square */
.sr-floor, .sr-wall {
  position: absolute;
  left: 0; right: 0;
  background-repeat: repeat;
  background-size: 6.1538% auto;
  image-rendering: pixelated;
  pointer-events: none;
}
.sr-floor { inset: 0; }
.sr-wall { top: 0; height: 23.08%; }   /* ~3 tile rows, like the app's back wall */
.sr-furniture {
  position: absolute;
  transform: translate(-50%, -50%);
  image-rendering: pixelated;
  user-select: none; -webkit-user-drag: none;
}
.sr-grab { cursor: grab; touch-action: none; }
.sr-grab:hover { filter: brightness(1.08) drop-shadow(0 2px 6px rgb(0 0 0 / 0.5)); }
.sr-grab.grabbing { cursor: grabbing; filter: brightness(1.12) drop-shadow(0 6px 14px rgb(0 0 0 / 0.55)); }
/* the story-frame is a self-contained room canvas */
.sr-room { overflow: hidden; }

/* ---------- guide: numbered feature explainer (what Foyer does & why) ---------- */

/* warm lamplight behind the rooms, not flat black */
.guide {
  background:
    radial-gradient(60% 45% at 78% 30%, oklch(70% 0.15 55 / 0.10), transparent 72%),
    radial-gradient(50% 40% at 18% 78%, oklch(64% 0.08 55 / 0.05), transparent 74%),
    var(--ink-deep);
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
}

/* one feature per row: copy on one side, a framed room on the other */
.guide-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  width: min(1120px, calc(100% - clamp(2.5rem, 8vw, 7rem)));
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.guide-row + .guide-row,
.guide-rooms { border-top: 1px solid oklch(100% 0 0 / 0.07); }
/* alternate the visual to the left */
.guide-row--flip .guide-media { order: -1; }

.guide-num {
  font-family: "Silkscreen", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--ember);
  margin-bottom: 1.05rem;
}
.guide-copy h2 { margin-bottom: 0.3rem; }
.guide-copy .sub { margin-top: 1rem; max-width: 40ch; }
.guide-copy em { font-style: normal; color: var(--cream); font-weight: 600; }

/* the framed room visual reuses .story-frame / .story-room-name below */
.guide-media { display: grid; justify-items: center; }

/* feature 03: full-width band — centred copy over a rail of room cards */
.guide-rooms {
  width: min(1120px, calc(100% - clamp(2.5rem, 8vw, 7rem)));
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 6rem);
  text-align: center;
}
.guide-copy--center { max-width: 46ch; margin-inline: auto; }
.guide-copy--center .sub { margin-inline: auto; max-width: 52ch; }
.rooms-rail {
  margin-top: clamp(2.2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.1rem, 3vw, 2.2rem);
  align-items: start;
}
.guide-card { position: relative; }
.guide-card .story-frame { max-width: none; }
.guide-card .story-room-name { max-width: none; }

/* entrance: the rooms are set down one after another, like placing furniture.
   the block fades (opacity only); the cards carry the staggered rise. */
html.js .guide-rooms.reveal { transform: none; }
html.js .guide-rooms .guide-card { opacity: 0; transform: translateY(22px) scale(0.985); }
html.js .guide-rooms.in .guide-card {
  opacity: 1; transform: none;
  transition: opacity 0.6s var(--ease-quint), transform 0.7s var(--ease-quint);
}
html.js .guide-rooms.in .guide-card:nth-child(2) { transition-delay: 0.12s; }
html.js .guide-rooms.in .guide-card:nth-child(3) { transition-delay: 0.24s; }

/* signature loop: focus drifts from room to room, like switching rooms in the
   notch. the active room lifts into warm light; the others rest dim. */
.guide-card .story-frame {
  transition: transform 0.75s var(--ease-quint), box-shadow 0.75s var(--ease-quart), filter 0.75s var(--ease-quart);
}
.guide-card.is-active .story-frame {
  transform: translateY(-7px);
  box-shadow:
    0 44px 84px rgb(0 0 0 / 0.5),
    0 0 0 1px oklch(70% 0.15 55 / 0.5),
    0 14px 38px oklch(60% 0.14 50 / 0.3);
  filter: brightness(1.06);
}
.guide-rooms.is-cycling .guide-card:not(.is-active) .story-frame { filter: brightness(0.78) saturate(0.92); }

.guide-card .story-room-name { transition: color 0.6s var(--ease-quart), opacity 0.6s var(--ease-quart); }
.guide-rooms.is-cycling .guide-card:not(.is-active) .story-room-name { opacity: 0.55; }
.guide-card.is-active .story-room-name { color: var(--cream); }
.guide-card.is-active .story-room-name .h { text-shadow: 0 0 9px oklch(70% 0.15 55 / 0.8); }

/* a now-playing equaliser sits in reserved space (no layout shift), fades in when active */
.gc-eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 13px; height: 9px; margin-left: 0.1rem; vertical-align: -1px; opacity: 0; transition: opacity 0.45s var(--ease-quart); }
.gc-eq i { width: 2px; flex: 1; background: var(--ember); border-radius: 1px; transform-origin: bottom; height: 100%; animation: sceq 0.85s ease-in-out infinite; }
.gc-eq i:nth-child(1) { height: 50%; }
.gc-eq i:nth-child(2) { animation-delay: 0.2s; }
.gc-eq i:nth-child(3) { height: 70%; animation-delay: 0.4s; }
.guide-card.is-active .gc-eq { opacity: 1; }

/* ---------- closing pricing + download ---------- */
.close {
  width: min(720px, calc(100% - clamp(2.5rem, 8vw, 7rem)));
  margin-inline: auto;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(5rem, 11vw, 8rem);
  text-align: center;
}
.close .sub { margin-inline: auto; max-width: 50ch; }
.close-cta { display: grid; justify-items: center; gap: 0.9rem; margin-top: clamp(1.8rem, 4vw, 2.6rem); }
.close-cta .cta-note { margin: 0; }

/* ---------- feature diagrams (01 spatial field, 02 position = mix) ----------
   These two don't show furniture: they show the idea, built from the app's own
   spatial parts — the listener at the centre, sounds placed around, real floor. */
.diagram { position: absolute; inset: 0; overflow: hidden; }
.dg-floor {
  position: absolute; inset: 0;
  background: url(/assets/sprites/floors/floor_walnut.png) repeat;
  background-size: 7.2% auto;
  image-rendering: pixelated;
  opacity: 0.42;
}
.dg-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(64% 58% at 50% 48%, oklch(70% 0.15 55 / 0.10), transparent 60%),
    radial-gradient(60% 56% at 50% 50%, transparent 36%, oklch(13% 0.015 60 / 0.84));
}
.dg-bearings { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.dg-bearings line { stroke: oklch(92% 0.02 85 / 0.15); stroke-width: 0.35; stroke-dasharray: 1.6 1.9; }

/* the listener, at the centre of both diagrams */
.dg-you {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 30;
  font-family: "Silkscreen", monospace; font-size: 0.52rem; letter-spacing: 0.18em;
  color: oklch(92% 0.02 85 / 0.92);
  text-shadow: 0 0 6px rgb(0 0 0 / 0.9);
}
.dg-you-ring {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;
  transform: translate(-50%, -50%);
  border: 1.5px solid oklch(100% 0 0 / 0.34); border-radius: 50%;
}

/* 01 — each sound sits somewhere around you and radiates its own field */
.dg-source { position: absolute; transform: translate(-50%, -50%); z-index: 20; --tint: var(--ember); }
.dg-source[data-snd="fire"]   { --tint: var(--snd-fire); }
.dg-source[data-snd="rain"]   { --tint: var(--snd-rain); }
.dg-source[data-snd="stream"] { --tint: var(--snd-stream); }
.dg-source[data-snd="birds"]  { --tint: var(--snd-birds); }
.dg-dot {
  position: absolute; left: 50%; top: 50%; width: 11px; height: 11px;
  transform: translate(-50%, -50%);
  background: var(--tint); border-radius: 50%;
  box-shadow: 0 0 10px color-mix(in oklab, var(--tint) 80%, transparent), 0 0 0 3px oklch(13% 0.015 60 / 0.55);
}
.dg-ring {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  margin: -7px 0 0 -7px; border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--tint) 65%, transparent);
  opacity: 0; animation: dg-emanate 3.8s ease-out infinite;
}
.dg-ring:nth-child(2) { animation-delay: 1.9s; }
@keyframes dg-emanate {
  0%   { transform: scale(0.5); opacity: 0; }
  16%  { opacity: 0.7; }
  100% { transform: scale(5.2); opacity: 0; }
}
.dg-tag {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 9px;
  transform: translateX(-50%);
  font-family: "Silkscreen", monospace; font-size: 0.46rem; letter-spacing: 0.1em;
  text-transform: uppercase; white-space: nowrap;
  color: color-mix(in oklab, var(--tint) 50%, var(--cream));
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.9);
}

/* 02 — one sound travels; its distance is the volume, its angle is the pan */
.dg-puck {
  position: absolute; transform: translate(-50%, -50%); z-index: 25;
  --tint: var(--snd-fire); --glow: 1.2;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.55rem; border-radius: 999px;
  background: oklch(20% 0.02 55 / 0.94);
  border: 1px solid color-mix(in oklab, var(--tint) 60%, transparent);
  color: var(--cream); font: 600 0.72rem "Bricolage Grotesque", sans-serif;
  white-space: nowrap; box-shadow: 0 6px 16px rgb(0 0 0 / 0.5);
}
.dg-puck::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 116px; height: 116px; transform: translate(-50%, -50%) scale(var(--glow));
  background: radial-gradient(circle, color-mix(in oklab, var(--tint) 22%, transparent), transparent 66%);
  border-radius: 50%; z-index: -1; pointer-events: none;
}
.dg-puck .pk-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; width: 11px; }
.dg-puck .pk-eq i { width: 3px; flex: 1; background: var(--tint); border-radius: 1px; transform-origin: bottom; height: 100%; animation: sceq 0.85s ease-in-out infinite; }
.dg-puck .pk-eq i:nth-child(1) { height: 55%; }
.dg-puck .pk-eq i:nth-child(2) { animation-delay: 0.2s; }
.dg-puck .pk-eq i:nth-child(3) { height: 70%; animation-delay: 0.4s; }

/* the two controls a mixer hides in sliders — here they just read the position */
.dg-hud {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
  z-index: 40; width: min(74%, 290px);
  display: grid; gap: 0.5rem;
  padding: 0.65rem 0.75rem; border-radius: 10px;
  background: oklch(13% 0.015 60 / 0.82);
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.06);
}
.dg-gauge { display: grid; grid-template-columns: 3.3rem 1fr; align-items: center; gap: 0.55rem; }
.dg-gk { font-family: "Silkscreen", monospace; font-size: 0.44rem; letter-spacing: 0.12em; color: var(--cream-dim); }
.dg-vol { position: relative; height: 7px; border-radius: 999px; background: oklch(100% 0 0 / 0.09); overflow: hidden; }
.dg-vol b { position: absolute; inset: 0 auto 0 0; width: 64%; border-radius: 999px; background: linear-gradient(90deg, var(--ember-deep), var(--ember)); transition: width 0.08s linear; }
.dg-pan { display: flex; align-items: center; gap: 0.45rem; }
.dg-pan i { font-family: "Silkscreen", monospace; font-size: 0.44rem; color: var(--cream-dim); font-style: normal; }
.dg-pan-track { position: relative; flex: 1; height: 7px; border-radius: 999px; background: oklch(100% 0 0 / 0.09); }
.dg-pan-track::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: oklch(100% 0 0 / 0.2); }
.dg-pan-track b { position: absolute; top: 50%; left: 66%; width: 11px; height: 11px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--ember); box-shadow: 0 0 8px var(--ember); transition: left 0.08s linear; }

.story-frame {
  position: relative;
  width: 100%;
  max-width: clamp(340px, 42vw, 520px);
  margin-inline: auto;
  aspect-ratio: 5 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink);
  box-shadow:
    0 50px 100px rgb(0 0 0 / 0.55),
    0 8px 24px rgb(0 0 0 / 0.45),
    inset 0 0 0 1px oklch(100% 0 0 / 0.05);
}
/* the room reads as lit from within: a soft warm glow breathes over it */
.story-frame::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 5;
  background: radial-gradient(70% 60% at 50% 42%, oklch(72% 0.15 60 / 0.12), transparent 72%);
  mix-blend-mode: screen;
  animation: ember-breathe 7.5s ease-in-out infinite;
}
/* the room's name, tying it to the notch's "my rooms" */
.story-room-name {
  margin: 1.15rem auto 0;
  max-width: clamp(340px, 42vw, 520px);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: "Silkscreen", monospace;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cream-dim);
  transition: opacity 0.45s var(--ease-quart);
}
.story-room-name .h { color: var(--ember); font-size: 0.95em; }
.story-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- live notch (interactive, like the app) ---------- */

.notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 300px;
  max-width: calc(100% - 2rem);
  background: var(--island);
  color: var(--cream);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.5);
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.notch:hover, .notch:focus-within { box-shadow: 0 28px 64px rgb(0 0 0 / 0.62); }

.notch-compact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem 0.6rem;
}
.np-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 30px; height: 24px;
  display: grid; place-items: center;
  color: var(--cream);
}
.np-btn .pp { font-size: 0.85rem; line-height: 1; }
.np-btn[aria-pressed="true"] .pp { color: var(--ember); }
.notch-room { flex: 1; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* expand on hover / keyboard focus, animating grid rows (not layout) */
.notch-panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.notch:hover .notch-panel-wrap,
.notch:focus-within .notch-panel-wrap { grid-template-rows: 1fr; }
.notch-panel {
  overflow: hidden;
  min-height: 0;
  padding: 0 0.7rem 0.7rem;
}

.notch-play {
  width: 100%;
  display: flex; align-items: center; gap: 0.6rem;
  background: oklch(100% 0 0 / 0.08);
  border: 0; border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin: 0.2rem 0 0.7rem;
  color: var(--cream);
  font: 600 0.92rem "Bricolage Grotesque", sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}
.notch-play[aria-pressed="true"] { background: oklch(70% 0.15 55 / 0.16); }
.notch-play .pp { font-size: 0.85rem; }
.notch-play[aria-pressed="true"] .pp { color: var(--ember); }
.notch-play .lbl { flex: 1; text-align: left; }

.notch .rooms-label {
  font-family: "Silkscreen", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--cream-faint);
  font-weight: 400;
  margin: 0 0 0.4rem 0.2rem;
}
.notch-rooms { display: flex; flex-direction: column; gap: 1px; }
.nr {
  display: flex; align-items: center; gap: 0.5rem;
  background: none; border: 0; border-radius: 7px;
  padding: 0.45rem 0.5rem;
  color: var(--cream);
  font: 500 0.9rem "Bricolage Grotesque", sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.nr:hover { background: oklch(100% 0 0 / 0.06); }
.nr .h { color: var(--cream-faint); width: 1rem; text-align: center; }
.nr .nm { flex: 1; }
.nr .ct { color: var(--cream-faint); font-size: 0.78rem; }
.nr[aria-pressed="true"] { background: oklch(100% 0 0 / 0.1); }
.nr[aria-pressed="true"] .h { color: var(--ember); }
.nr[aria-pressed="true"] .nm { font-weight: 700; }

.notch-edit {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  margin-top: 0.55rem;
  padding: 0.55rem;
  border-radius: 9px;
  background: oklch(100% 0 0 / 0.08);
  color: var(--cream);
  text-decoration: none;
  font-weight: 600; font-size: 0.85rem;
}
.notch-edit:hover { background: oklch(70% 0.15 55 / 0.18); color: var(--cream); }

.notch-tip {
  color: var(--ember);
  font-family: "Silkscreen", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  animation: tippulse 2.6s ease-in-out infinite;
}
@keyframes tippulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* legacy island (still used by the notch explainer section illustration) */
.island {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  background: var(--island);
  color: var(--cream);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.55);
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 1.4rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.island .pp { color: var(--ember); }

.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.bars i { width: 3px; background: var(--ember); animation: eq 1.1s ease-in-out infinite; }
.bars i:nth-child(1) { height: 9px; animation-delay: 0s; }
.bars i:nth-child(2) { height: 14px; animation-delay: 0.25s; }
.bars i:nth-child(3) { height: 7px; animation-delay: 0.5s; }
@keyframes eq {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.45); }
}
.bars.paused i { animation-play-state: paused; transform: scaleY(0.45); }

/* ---------- sections ---------- */

section { position: relative; }

.band {
  padding-block: clamp(5rem, 14vh, 9rem);
}
.band + .band { padding-top: clamp(2rem, 6vh, 4rem); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.split > .copy { max-width: 34rem; }
.split.flip > .copy { order: 2; }
.split.flip > .stage { order: 1; }

/* ---------- spatial mixer (the main feature) ---------- */
.mixer-intro { max-width: 42rem; }
.mixer-intro .sub { max-width: 40rem; }

.mixer-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2.2rem 0 1.4rem;
}
/* each sound carries its own quiet colour, drawn from the app's sprite palette,
   so the row reads as six distinct sounds rather than six amber clones */
.tray-chip {
  --tint: var(--ember);
  position: relative;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: oklch(22% 0.02 55 / 0.7);
  border: 1px solid oklch(100% 0 0 / 0.1);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  color: var(--cream);
  font: 600 0.95rem "Bricolage Grotesque", sans-serif;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s,
              box-shadow 0.22s var(--ease-quart), transform 0.22s var(--ease-quart);
}
.tray-chip[data-add="fire"]   { --tint: var(--snd-fire); }
.tray-chip[data-add="rain"]   { --tint: var(--snd-rain); }
.tray-chip[data-add="city"]   { --tint: var(--snd-city); }
.tray-chip[data-add="birds"]  { --tint: var(--snd-birds); }
.tray-chip[data-add="chimes"] { --tint: var(--snd-chimes); }
.tray-chip[data-add="stream"] { --tint: var(--snd-stream); }

/* hover: warm it, like holding the sound near the fire */
.tray-chip:hover {
  background: oklch(26% 0.025 55 / 0.85);
  border-color: color-mix(in oklab, var(--tint) 55%, transparent);
  box-shadow: 0 6px 18px color-mix(in oklab, var(--tint) 20%, transparent);
  transform: translateY(-2px);
}
.tray-chip:active { transform: translateY(0); }
.tray-chip .tc-sign { color: var(--tint); font-weight: 700; display: inline-block; transition: transform 0.18s var(--ease-quart); }

/* lit: the sound is alive in the room */
.tray-chip[aria-pressed="true"] {
  background: color-mix(in oklab, var(--tint) 15%, oklch(22% 0.02 55 / 0.7));
  border-color: color-mix(in oklab, var(--tint) 60%, transparent);
}
.tray-chip[aria-pressed="true"] .tc-sign { transform: rotate(45deg); } /* + reads as x when placed */

/* a struck-match spark when a sound is first lit (JS toggles .just-lit) */
@keyframes chip-spark {
  from { opacity: 0.65; transform: scale(0.72); }
  to   { opacity: 0; transform: scale(1.45); }
}
.tray-chip.just-lit::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  border: 1.5px solid var(--tint);
  opacity: 0; pointer-events: none;
  animation: chip-spark 0.45s var(--ease-quint) forwards;
}

/* lit chips breathe, like a pilot light (specificity beats the entrance rule) */
@keyframes chip-breathe {
  0%, 100% { box-shadow: 0 0 12px color-mix(in oklab, var(--tint) 16%, transparent); }
  50%      { box-shadow: 0 0 18px color-mix(in oklab, var(--tint) 30%, transparent); }
}
.js .hero .mixer-tray .tray-chip[aria-pressed="true"] {
  animation: chip-breathe 3.8s ease-in-out infinite;
}
/* comfortable tap target on touch devices (44px min) */
@media (pointer: coarse) {
  .tray-chip { min-height: 44px; padding-block: 0.6rem; }
}

.mixer-stage {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  aspect-ratio: 5 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: var(--ink-deep);
  box-shadow: 0 36px 80px rgb(0 0 0 / 0.5), inset 0 0 0 1px oklch(100% 0 0 / 0.06);
  touch-action: pan-y;
}
/* in the hero, the sprite room is the backdrop; YOU + sound pucks float above it.
   (kept at full opacity so the hero-fade entrance, which fills to 1, has no end-snap) */
.mixer-stage::after { /* center vignette so pucks pop */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(62% 56% at 50% 50%, transparent, oklch(16% 0.015 60 / 0.6));
  pointer-events: none;
}

.you-marker {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 150;
  font-family: "Silkscreen", monospace;
  font-size: 0.58rem; letter-spacing: 0.2em;
  color: oklch(92% 0.02 85 / 0.85);
  text-shadow: 0 0 6px rgb(0 0 0 / 0.85), 0 1px 2px rgb(0 0 0 / 0.9);
  pointer-events: none;
}
.you-ring {
  position: absolute; left: 50%; top: -10px;
  width: 40px; height: 20px;
  transform: translateX(-50%);
  border: 1.5px solid oklch(100% 0 0 / 0.32);
  border-radius: 50%;
}

.mixer-empty {
  position: absolute; left: 50%; top: 64%;
  transform: translateX(-50%);
  z-index: 160;
  color: var(--cream);
  font-family: "Silkscreen", monospace;
  font-size: 0.68rem; letter-spacing: 0.12em;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: oklch(14% 0.015 60 / 0.82);
  box-shadow: inset 0 0 0 1px oklch(70% 0.15 55 / 0.35), 0 4px 16px rgb(0 0 0 / 0.45);
  pointer-events: none;
  transition: opacity 0.3s;
}

.puck {
  --tint: var(--ember);   /* a puck wears the colour of its sound (matches the tray chip) */
  position: absolute;
  z-index: 200;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: oklch(20% 0.02 55 / 0.92);
  border: 1px solid color-mix(in oklab, var(--tint) 60%, transparent);
  border-radius: 999px;
  padding: 0.38rem 0.6rem 0.38rem 0.55rem;
  color: var(--cream);
  font: 600 0.82rem "Bricolage Grotesque", sans-serif;
  cursor: grab; white-space: nowrap; touch-action: none;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
}
.puck.grabbing { cursor: grabbing; }
.puck::before { /* audio footprint glow, tinted to the sound */
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 130px; height: 130px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, color-mix(in oklab, var(--tint) 18%, transparent), transparent 68%);
  border-radius: 50%; z-index: -1; pointer-events: none;
}
.puck .pk-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; width: 13px; }
.puck .pk-eq i { width: 3px; flex: 1; background: var(--tint); border-radius: 1px; transform-origin: bottom; height: 100%; animation: sceq 0.85s ease-in-out infinite; }
.puck .pk-eq i:nth-child(1) { height: 55%; }
.puck .pk-eq i:nth-child(2) { animation-delay: 0.2s; }
.puck .pk-eq i:nth-child(3) { height: 70%; animation-delay: 0.4s; }
.puck .pk-close { color: var(--cream-faint); font-size: 0.85rem; line-height: 1; }
.puck:hover .pk-close { color: var(--tint); }

/* a puck wears the colour of its sound (matches the tray chip) */
.puck[data-sound="fire"]   { --tint: var(--snd-fire); }
.puck[data-sound="rain"]   { --tint: var(--snd-rain); }
.puck[data-sound="city"]   { --tint: var(--snd-city); }
.puck[data-sound="birds"]  { --tint: var(--snd-birds); }
.puck[data-sound="chimes"] { --tint: var(--snd-chimes); }
.puck[data-sound="stream"] { --tint: var(--snd-stream); }
@keyframes sceq { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.4); } }
.mixer-stage.paused .pk-eq i { animation-play-state: paused; transform: scaleY(0.4); }

/* still pucks used to mock a furnished room in the "A room for the day" cards:
   the same puck, scaled to the smaller frame, without the drag/close affordances */
.puck--static {
  cursor: default; pointer-events: none;
  padding: 0.26rem 0.5rem; gap: 0.3rem;
  font-size: 0.66rem;
}
.puck--static .pk-eq { height: 11px; width: 11px; }
.puck--static::before { width: 88px; height: 88px; }
/* only the room that's currently "playing" (active) keeps its sounds animating */
.guide-rooms.is-cycling .guide-card:not(.is-active) .pk-eq i { animation-play-state: paused; transform: scaleY(0.4); }

.mixer-note {
  margin: 0.4rem 0 1.8rem;
  color: var(--cream-faint);
  font-size: 0.95rem;
  max-width: 62ch;
}
.mixer-note .hp { color: var(--cream-dim); font-weight: 600; }

/* ---------- notch scroll: Foyer folds up into the MacBook notch ---------- */
.notch-scroll { position: relative; }
.ns-track { height: 240vh; }                /* scroll distance that drives the dock */
.ns-sticky {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(1.2rem, 4vh, 2.6rem);
  padding: clamp(2rem, 6vh, 4rem) 1.25rem;
  overflow: hidden;
}
.ns-copy {
  text-align: center;
  max-width: 40rem;
  opacity: clamp(0.12, calc(1 - var(--p, 0) * 0.95), 1);
  transform: translateY(calc(var(--p, 0) * -12px));
}
.ns-copy .kicker { justify-content: center; }
.ns-copy .sub { margin-inline: auto; max-width: 34rem; }

/* the laptop */
.macbook { width: min(840px, 94vw); }
.mb-screen {
  position: relative;
  aspect-ratio: 16 / 10.2;
  border: 8px solid #15130f;
  border-radius: 20px;
  background: #050505;
  overflow: hidden;
  box-shadow: 0 44px 90px rgb(0 0 0 / 0.6), inset 0 0 0 1px oklch(100% 0 0 / 0.05);
}
.mb-wall {
  position: absolute; inset: 0;
  background: url(/assets/rooms/evening.png) center/cover no-repeat;
  filter: saturate(1.05) brightness(0.66);
}
.mb-wall::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(125% 95% at 50% -5%, transparent 38%, rgb(0 0 0 / 0.6) 100%);
}
.mb-menubar {
  position: absolute; top: 0; left: 0; right: 0; height: 26px;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0 0.85rem;
  background: oklch(18% 0.01 60 / 0.5);
  backdrop-filter: blur(8px);
  font: 600 0.72rem "Bricolage Grotesque", sans-serif;
  color: var(--cream-dim);
  z-index: 2;
}
.mb-menubar .mb-spacer { flex: 1; }
.mb-menubar .mb-apple { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--ember); }
.mb-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: clamp(150px, 25%, 212px); height: 26px;
  background: #000;
  border-radius: 0 0 13px 13px;
  z-index: 4;
}

/* the island that docks into the notch — driven by --p (0 = floating, 1 = docked) */
.dock-island {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: calc(44% - 44% * var(--p, 0));
  width: calc(360px - 152px * var(--p, 0));
  max-width: 88%;
  background: var(--island);
  border-radius: 0 0 22px 22px;
  padding: calc(10px - 4px * var(--p, 0)) 12px calc(13px - 9px * var(--p, 0));
  box-shadow: 0 calc(24px - 14px * var(--p, 0)) 60px rgb(0 0 0 / 0.6);
  z-index: 5;                                 /* above the notch: it becomes the notch */
}
.di-bar {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%;
  background: oklch(70% 0.15 55 / 0.16);
  border: 0; cursor: pointer;
  border-radius: 9px;
  padding: calc(9px - 3px * var(--p, 0)) 12px;
  color: var(--cream);
  font: 600 calc(1rem - 0.14rem * var(--p, 0)) "Bricolage Grotesque", sans-serif;
}
.di-bar .pp { color: var(--ember); }
.di-bar .lbl { flex: 1; text-align: left; }
.di-rooms {
  overflow: hidden;
  max-height: calc(260px * (1 - var(--p, 0)));
  opacity: clamp(0, calc(1 - var(--p, 0) * 1.8), 1);
  margin-top: calc(8px * (1 - var(--p, 0)));
}
.di-label {
  font-family: "Silkscreen", monospace;
  font-size: 0.62rem; letter-spacing: 0.2em;
  color: var(--cream-faint);
  margin: 0.2rem 0 0.5rem 0.25rem;
}

.mb-hinge {
  height: 14px;
  width: 102%; margin: -2px -1% 0;
  background: linear-gradient(#26231f, #0e0c0a);
  border-radius: 0 0 10px 10px;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.5);
}
.mb-hinge::after {
  content: ""; display: block;
  width: 14%; height: 4px; margin: 0 auto;
  background: #050403; border-radius: 0 0 6px 6px;
}

.ns-hint {
  font: 600 0.8rem "Bricolage Grotesque", sans-serif;
  color: var(--cream-faint);
  letter-spacing: 0.02em;
  transition: opacity 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .ns-track { height: auto; }
  .ns-sticky { position: static; height: auto; }
  .ns-hint { display: none; }
}

/* skip link */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--ember);
  color: var(--ink-deep);
  font: 700 0.9rem "Bricolage Grotesque", sans-serif;
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  transition: top 0.15s ease-out;
}
.skip-link:focus { top: 0.75rem; color: var(--ink-deep); }

/* audio failure notice in the mixer */
.mixer-error {
  margin-top: 1rem;
  color: var(--gold);
  font-size: 0.92rem;
}
.mixer-error[hidden] { display: none; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid oklch(100% 0 0 / 0.07);
  padding: clamp(2.5rem, 6vh, 4rem) 0 clamp(3rem, 7vh, 4.5rem);
  color: var(--cream-faint);
  font-size: 0.95rem;
}
footer .cols {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 3rem;
  align-items: baseline;
  justify-content: space-between;
}
footer nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
footer a { color: var(--cream-dim); text-decoration: none; }
footer a:hover { color: var(--cream); text-decoration: underline; }
footer .fine { margin-top: 1.6rem; font-size: 0.85rem; }

/* ---------- prose pages (privacy / support) ---------- */

.prose-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.prose-page main {
  flex: 1;
  width: min(46rem, calc(100% - clamp(2.5rem, 8vw, 6rem)));
  margin-inline: auto;
  padding: clamp(7rem, 16vh, 9rem) 0 clamp(4rem, 8vh, 6rem);
}
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.6rem; }
.prose .meta { color: var(--cream-faint); font-size: 0.95rem; margin-bottom: 2.5rem; }
.prose .lede { font-size: clamp(1.25rem, 2vw, 1.5rem); color: var(--cream); max-width: 34rem; }
.prose h2 {
  font-size: 1.35rem;
  margin: 2.6rem 0 0.8rem;
}
.prose p, .prose li { color: var(--cream-dim); max-width: 65ch; }
.prose p + p { margin-top: 0.9rem; }
.prose ul { padding-left: 1.2rem; margin-top: 0.6rem; }
.prose li + li { margin-top: 0.45rem; }
.prose strong { color: var(--cream); }

details {
  border: 1px solid oklch(100% 0 0 / 0.08);
  padding: 1rem 1.2rem;
  margin-top: 0.8rem;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--cream);
  list-style-position: outside;
}
details[open] summary { margin-bottom: 0.6rem; }
details p + p { margin-top: 0.7rem; }

/* ---------- 404 ---------- */

.lost {
  min-height: 100svh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
}
.lost .code {
  font-family: "Silkscreen", monospace;
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--ember);
  text-shadow: 0 0 40px oklch(70% 0.15 55 / 0.4);
}
.lost p { color: var(--cream-dim); }

/* ---------- reveals ---------- */

/* Hidden only while JS is active. With no JS (or if main.js fails to load),
   .reveal stays visible so the page can never blank below the fold. */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 6.5rem;
    gap: 2.5rem;
  }
  .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip > .copy { order: 1; }
  .split.flip > .stage { order: 2; }
  .tiers { grid-template-columns: 1fr; }
  .island { font-size: 0.85rem; padding: 0.45rem 1.1rem 0.6rem; }

  /* guide: stack copy over its room visual, one feature at a time */
  .guide-row { grid-template-columns: 1fr; gap: clamp(1.6rem, 6vw, 2.4rem); }
  .guide-row--flip .guide-media { order: 0; }  /* keep copy-then-visual on mobile */
  .guide-copy .sub { max-width: none; }
  .story-frame { max-width: min(78vw, 360px); }
  .rooms-rail { grid-template-columns: 1fr; max-width: 360px; margin-inline: auto; gap: 1.8rem; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .story-layer { transition: none; }
  .story-frame::after { animation: none; }
  .story-room-name { transition: none; }
  .bars i, .puck .pk-eq i, .dg-puck .pk-eq i { animation: none; }
  /* diagrams: the field becomes a single resting ring per source, no pulse */
  .dg-ring { animation: none; opacity: 0.4; transform: scale(2.6); }
  .dg-ring:nth-child(2) { display: none; }
  .notch-tip { animation: none; opacity: 0.85; }
  .px-btn { transition: none; }
  /* hero entrance + ambient become static finals */
  .hero::after { animation: none; }
  .hero .notch, .hero-steps li, .hero .mixer-tray .tray-chip,
  .mixer-stage .sr-floor, .mixer-stage .sr-wall,
  .mixer-stage .you-marker, .mixer-stage .mixer-empty,
  .sr-place { animation: none !important; }
  .tray-chip { transition: background 0.18s, border-color 0.18s; }  /* keep colour, drop the lift */
  .tray-chip:hover { transform: none; }
  .tray-chip.just-lit::after { animation: none; }  /* spark stays invisible (base opacity 0) */
}
