/* Suntide · Your tide. Page styles on top of the untouched scroll-craft engine. */

:root {
  --sc-canvas: #070b18;
  --sc-surface: #101731;
  --sc-ink: #f5f0e6;
  --sc-ink-soft: #c5cad9;
  --sc-accent: #ffc46b;
  --sc-accent-ink: #1b1305;
  --sc-font-display: "Outfit", system-ui, sans-serif;
  --sc-font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc-shadow-color: 228 60% 4%;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px;
  --rail-h: 3.75rem;
  /* The geometry of the instrument. The line lives in the sky, the copy on
     the sand; the horizon is where the two meet. tide.js reads these. */
  --lz-top: 14svh; --lz-h: 31svh; --lz-x: 5vw; --hz: 50svh;
  --line-op: 1; --ground: 0.5; --veil: 0; --reeds: 1; --clip: 0; --still: 0;
  --px: 0; --py: 0;
}
@media (max-width: 860px) {
  :root { --rail-h: 3.4rem; --lz-top: 11svh; --lz-h: 26svh; --lz-x: 6vw; --hz: 42svh; }
}
html { scroll-padding-top: var(--rail-h); }
body { background: var(--sc-canvas); }
h1, h2, h3, p, ol, ul, figure, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--sc-accent); color: var(--sc-accent-ink); padding: 0.75rem 1rem; border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 0.6rem; }

.display { font-family: var(--sc-font-display); font-weight: 400; letter-spacing: -0.03em; line-height: 1; text-wrap: balance; }
.lede { font-size: var(--sc-t-lg); line-height: 1.42; letter-spacing: -0.008em; max-width: 36ch; text-wrap: pretty; }
.small { font-size: var(--sc-t-sm); line-height: 1.5; color: var(--sc-ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 3.2rem; padding: 0 1.4rem; border: 0; border-radius: var(--r-md);
  background: var(--sc-accent); color: var(--sc-accent-ink);
  font-family: var(--sc-font-text); font-weight: 600; font-size: 1rem; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px hsl(var(--sc-shadow-color) / 0.5), 0 10px 24px -10px hsl(var(--sc-shadow-color) / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.45);
  transition: transform 140ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn--sm { min-height: 2.6rem; padding: 0 1rem; font-size: 0.92rem; border-radius: 12px; }
.btn--quiet { background: rgb(8 12 26 / 0.55); color: var(--sc-ink); box-shadow: inset 0 0 0 1.5px rgb(245 240 230 / 0.42); }
@media (hover: hover) and (pointer: fine) {
  .btn:not([disabled]):hover { transform: translateY(-1px); background: #ffd28c; }
  .btn--quiet:not([disabled]):hover { background: rgb(8 12 26 / 0.7); box-shadow: inset 0 0 0 1.5px var(--sc-ink); }
}

/* ------------------------------------------------------------ the world -- */
.world { position: fixed; inset: 0; z-index: -2; overflow: clip; background: #070b18; }
.world > * { position: absolute; inset: 0; }
.world__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8) saturate(0.92);
  -webkit-mask-image: linear-gradient(90deg, transparent var(--a, -20%), #000 var(--b, -10%), #000 var(--c, 12%), transparent var(--d, 28%));
          mask-image: linear-gradient(90deg, transparent var(--a, -20%), #000 var(--b, -10%), #000 var(--c, 12%), transparent var(--d, 28%)); }
.world__poster picture:first-child img { -webkit-mask-image: none; mask-image: none; }
@media (max-width: 860px) { .world__poster img { transform: scale(1.18) translateY(-6.8%); } }
.world__gl { width: 100%; height: 100%; opacity: 0; transition: opacity 500ms var(--sc-ease-out); }
.gl .world__gl { opacity: 1; }
.gl .world__poster { visibility: hidden; }
.world__clip, .world__still img { width: 100%; height: 100%; object-fit: cover; }
.world__clip { opacity: var(--clip); }
.world__still { opacity: var(--still); }
.world__veil { background: #070b18; opacity: var(--veil); }
.world__reeds { inset: auto -4vw -3vh auto; width: min(58vw, 66rem); height: auto; max-width: none; opacity: var(--reeds);
  transform: translate3d(calc(var(--px) * -26px), calc(var(--py) * -10px + (1 - var(--reeds)) * 22vh), 0); transform-origin: 80% 100%; filter: blur(1px) brightness(2.6) saturate(0.7); will-change: transform; }
.world__ground { inset: var(--hz) 0 0 0; background: linear-gradient(to bottom, rgb(5 8 18 / 0) 0%, rgb(5 8 18 / 0.5) 12%, rgb(5 8 18 / 0.7) 36%, rgb(5 8 18 / 0.9) 100%); opacity: var(--ground); }
@media (max-width: 860px) { .world__reeds { display: none; } }

/* ------------------------------------------------------------- the line -- */
.line { position: fixed; z-index: -1; left: var(--lz-x); right: var(--lz-x); top: var(--lz-top); height: var(--lz-h); opacity: var(--line-op); pointer-events: none;
  transform: translate3d(calc(var(--px) * -9px), calc(var(--py) * -5px), 0); }
.line__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line__area { fill: url(#lineFill); }
.line__ghost { fill: none; stroke: rgb(255 244 220 / 0.34); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.line__path { fill: none; stroke: #fff3d6; stroke-width: var(--lw, 2.5); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 5px rgb(40 20 0 / 0.5)); }
.line__top { position: absolute; inset: 0; clip-path: inset(-3rem calc(var(--played, 0) * 100%) -3rem -3rem); }
.line__dots i { position: absolute; left: 0; top: 0; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: #fff3d6; box-shadow: 0 0 0 1.5px rgb(20 14 4 / 0.55), 0 2px 6px rgb(0 0 0 / 0.4); opacity: var(--dots, 1); will-change: transform; }
.line__dots i.is-focus { box-shadow: 0 0 0 2px #0b1020, 0 0 0 4.5px var(--sc-accent); width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; }
.line__dots i b { position: absolute; left: 50%; bottom: 1.25rem; translate: -50% 0; white-space: nowrap; font: 600 0.8rem/1 var(--sc-font-text); color: #fff; background: rgb(8 12 26 / 0.82); padding: 0.35rem 0.5rem; border-radius: 6px; opacity: 0; }
.line__dots i.is-focus b { opacity: 1; }
.line__sun { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; opacity: var(--sun-op, 1);
  background: radial-gradient(circle, #fffdf2 0 34%, #ffe2a6 52%, rgb(255 196 107 / 0.55) 68%, rgb(255 196 107 / 0) 74%); will-change: transform; }
.line__mark, .line__dip { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 320ms var(--sc-ease-out); will-change: transform; }
.line__mark.is-on, .line__dip.is-on { opacity: 1; }
.line__mark i, .line__dip i { position: absolute; left: -1px; top: 0; width: 2px; height: 2.4rem; background: linear-gradient(to bottom, rgb(255 243 214 / 0.95), rgb(255 243 214 / 0)); }
.line__dip i { height: 3.4rem; background: linear-gradient(to bottom, rgb(170 205 255 / 0.95), rgb(170 205 255 / 0)); }
.line__mark span, .line__dip span, .line__stamp { position: absolute; white-space: nowrap; font: 600 0.82rem/1 var(--sc-font-text); letter-spacing: 0.005em; color: #fff; background: rgb(8 12 26 / 0.8); padding: 0.4rem 0.55rem; border-radius: 6px; }
.line__mark span, .line__dip span { left: 0; top: 2.5rem; translate: var(--al, -50%) 0; }
.line__dip span { top: 3.5rem; color: #d5e6ff; }
.line__stamp { left: 0; top: 0; translate: var(--al, -50%) -2.6rem; opacity: 0; transition: opacity 300ms var(--sc-ease-out); will-change: transform; }
.line__stamp.is-on { opacity: 1; }
.line__hint { position: absolute; left: 0.5rem; top: 0; font: 600 0.85rem/1 var(--sc-font-text); color: #fff; background: rgb(8 12 26 / 0.8); padding: 0.5rem 0.7rem; border-radius: 999px; transition: opacity 400ms var(--sc-ease-out); }
.line__hint.is-off, .line__hint.is-away { opacity: 0; }
.line__hours { position: absolute; left: 0; right: 0; top: calc(var(--hz) - var(--lz-top) + 0.55rem); height: 1rem; list-style: none; padding: 0; font: 500 0.74rem/1 var(--sc-font-text); letter-spacing: 0.02em; color: rgb(245 240 230 / 0.86); font-variant-numeric: tabular-nums; }
.line__hours li { position: absolute; top: 0; translate: -50% 0; white-space: nowrap; text-shadow: 0 1px 6px rgb(0 0 0 / 0.9); }
.line__hours li:nth-child(1) { left: 0; translate: 0 0; } .line__hours li:nth-child(2) { left: 12.5%; } .line__hours li:nth-child(3) { left: 25%; }
.line__hours li:nth-child(4) { left: 37.5%; } .line__hours li:nth-child(5) { left: 50%; } .line__hours li:nth-child(6) { left: 62.5%; }
.line__hours li:nth-child(7) { left: 75%; } .line__hours li:nth-child(8) { left: 87.5%; } .line__hours li:nth-child(9) { left: 100%; translate: -100% 0; }
@media (max-width: 860px) { .line__hours li:nth-child(even) { display: none; } }
html:not(.js) .line__dots, html:not(.js) .line__sun, html:not(.js) .line__hint { display: none; }

/* The drawing surface: the sky itself. A horizontal stroke draws; a vertical
   swipe still scrolls the page. */
.pad { position: fixed; z-index: 2; left: 0; right: 0; top: var(--rail-h); height: calc(var(--hz) - var(--rail-h)); touch-action: pan-y; cursor: crosshair; display: none; }
.pad-on .pad { display: block; }
.pad.is-drawing { cursor: grabbing; }

/* ---------------------------------------------------------------- rail --- */
.rail { position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome); height: var(--rail-h); padding-inline: var(--sc-gutter); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgb(7 11 24 / 0.78); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: inset 0 -1px 0 rgb(245 240 230 / 0.1); }
.mark { font-family: var(--sc-font-display); font-weight: 500; font-size: 1.4rem; letter-spacing: -0.035em; color: var(--sc-ink); text-decoration: none; padding: 0.5rem 0; }
.rail__nav { display: flex; align-items: center; gap: 0.2rem; }
.rail__strip { width: 5.5rem; height: 1.5rem; margin-right: 0.9rem; overflow: visible; }
.rail__strip path { fill: none; stroke: var(--sc-accent); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rail__nav a { color: var(--sc-ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 0.75rem 0.7rem; border-radius: 8px; transition: color 160ms var(--sc-ease-out); }
.rail__nav a[aria-current="true"] { color: var(--sc-ink); box-shadow: inset 0 -2px 0 var(--sc-accent); border-radius: 0; }
@media (hover: hover) and (pointer: fine) { .rail__nav a:hover { color: var(--sc-ink); } }
@media (max-width: 860px) {
  .rail__nav a { display: none; }
  .rail__strip { width: 4.2rem; margin: 0; }
  .mark { font-size: 1.25rem; }
  .btn--sm { min-height: 2.75rem; }
}

/* ------------------------------------------------------------ 1 · draw --- */
section { position: relative; }
.draw { min-height: 100svh; display: flex; }
.draw__copy { margin-top: calc(var(--hz) + 2.9rem); padding: 0 var(--sc-gutter) 2.5rem; width: min(46rem, 100%); opacity: var(--hero, 1); }
.draw h1 { font-size: clamp(3rem, 1.6rem + 4.6vw, 5.8rem); font-weight: 300; white-space: nowrap; }
.draw .lede { margin-top: 1.1rem; max-width: 40ch; }
.draw__actions { margin-top: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.25rem; }
.draw__points { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.js .draw__copy > * { animation: rise 900ms var(--sc-ease-out) both; }
.js .draw__copy > :nth-child(2) { animation-delay: 110ms; } .js .draw__copy > :nth-child(3) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@media (max-width: 860px) {
  .draw__copy { margin-top: calc(var(--hz) + 2.4rem); }
  .draw h1 { font-size: clamp(2.9rem, 13.5vw, 4rem); }
  .draw .lede { font-size: 1.08rem; margin-top: 0.8rem; }
  .draw__actions { margin-top: 1.1rem; }
}

/* ---------------------------------------------------------- 2 · rhythm --- */
.rhythm__copy { position: absolute; left: var(--sc-gutter); right: var(--sc-gutter); top: calc(var(--hz) + 3rem); height: 14rem; }
.rhythm__copy > * { position: absolute; left: 0; top: 0; }
.rhythm h2 { font-size: clamp(2.6rem, 1.5rem + 4.4vw, 5.4rem); font-weight: 300; }
.beat { font-size: clamp(1.25rem, 1rem + 1.1vw, 1.9rem); line-height: 1.32; letter-spacing: -0.012em; max-width: 34ch; text-wrap: pretty; }
.beat b { display: block; font-family: var(--sc-font-display); font-weight: 400; font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.6rem); letter-spacing: -0.03em; line-height: 1; margin-bottom: 0.7rem; }
.beat__you { display: block; margin-top: 0.8rem; font-size: var(--sc-t-sm); font-weight: 600; letter-spacing: 0; color: var(--sc-accent); }
@media (max-width: 860px) { .rhythm__copy { top: calc(var(--hz) + 2.4rem); } }

/* ------------------------------------------------------------ 3 · tune --- */
.tune { min-height: 135svh; outline: none; padding-top: calc(var(--hz) + 2.4rem); }
.tune__panel { position: sticky; top: calc(var(--hz) + 2.4rem); z-index: 3; width: 100%; padding: 0 var(--lz-x) 2rem; }
.tune__top { display: flex; align-items: baseline; gap: 1rem; }
.tune__top h2 { font: 600 var(--sc-t-sm)/1 var(--sc-font-text); letter-spacing: 0.01em; color: var(--sc-accent); }
.tune__count { font-size: var(--sc-t-sm); color: var(--sc-ink); text-shadow: 0 1px 8px rgb(0 0 0 / 0.8); font-variant-numeric: tabular-nums; }
.tune__deck { display: grid; margin-top: 0.9rem; }
.q { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0); transition: opacity 220ms var(--sc-ease-out), transform 260ms var(--sc-ease-out), visibility 0s linear 220ms; }
.q.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 60ms, 60ms, 0s; }
.q legend { padding: 0; font-family: var(--sc-font-display); font-weight: 400; font-size: clamp(1.6rem, 1.15rem + 1.7vw, 2.5rem); letter-spacing: -0.025em; line-height: 1.08; text-wrap: balance; outline-offset: 6px; }
.q__help { margin-top: 0.5rem; font-size: var(--sc-t-sm); line-height: 1.45; color: var(--sc-ink-soft); max-width: 52ch; }
.q--done .btn { margin-top: 1.2rem; }

.shapes, .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin-top: 1.1rem; max-width: 62rem; }
.shape, .tile, .chip { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shape input, .tile input, .chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.shape { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 1rem 1rem; border-radius: var(--r-md); background: rgb(10 15 32 / 0.66); box-shadow: inset 0 0 0 1.5px rgb(245 240 230 / 0.2); font-size: 0.98rem; line-height: 1.3; font-weight: 500; transition: background-color 160ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out), transform 120ms var(--sc-ease-out); }
.shape svg { width: 100%; height: 2.6rem; overflow: visible; }
.shape svg path { fill: none; stroke: var(--sc-ink-soft); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.shape:has(input:checked), .tile:has(input:checked) { background: rgb(255 196 107 / 0.16); box-shadow: inset 0 0 0 2px var(--sc-accent); }
.shape:has(input:checked) svg path { stroke: var(--sc-accent); }
.shape:has(input:focus-visible), .tile:has(input:focus-visible), .chip:has(input:focus-visible) span { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
.shape:active, .tile:active { transform: scale(0.985); }
.tile { display: flex; align-items: flex-end; min-height: 5.2rem; padding: 0.9rem 1rem; border-radius: var(--r-md); background: rgb(10 15 32 / 0.66); box-shadow: inset 0 0 0 1.5px rgb(245 240 230 / 0.2); font-family: var(--sc-font-display); font-size: 1.2rem; line-height: 1.12; letter-spacing: -0.015em; transition: background-color 160ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out), transform 120ms var(--sc-ease-out); }
@media (hover: hover) and (pointer: fine) { .shape:hover, .tile:hover { background: rgb(20 28 54 / 0.8); } .chip:hover span { background: rgb(20 28 54 / 0.8); } }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.95rem; }
.chips__l { flex: 0 0 100%; font-size: var(--sc-t-base); font-weight: 500; margin-bottom: 0.1rem; }
.chip span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; border-radius: 999px; background: rgb(10 15 32 / 0.66); box-shadow: inset 0 0 0 1.5px rgb(245 240 230 / 0.24); font-size: 0.98rem; font-weight: 500; transition: background-color 160ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out); }
.chip input:checked + span { background: var(--sc-accent); color: var(--sc-accent-ink); box-shadow: none; }

/* Sliders. Native ranges under the styling, so keys and screen readers work. */
.slide { display: flex; align-items: center; gap: 1rem; margin-top: 1.3rem; max-width: 40rem; }
.slide--day { display: block; max-width: none; margin-inline: 0; }
.slide__end { flex: none; font-size: var(--sc-t-sm); font-weight: 500; color: var(--sc-ink-soft); }
.slide input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; width: 100%; height: 2.75rem; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.slide input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgb(245 240 230 / 0.28), rgb(245 240 230 / 0.6)); }
.slide input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: rgb(245 240 230 / 0.45); }
.slide input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.9rem; height: 1.9rem; margin-top: calc(-0.95rem + 1.5px); border-radius: 50%; border: 0; background: radial-gradient(circle, #fffdf2 0 38%, #ffd58f 70%, #ffc46b 100%); box-shadow: 0 0 0 2px #0b1020, 0 3px 10px rgb(0 0 0 / 0.5); }
.slide input[type="range"]::-moz-range-thumb { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 0; background: radial-gradient(circle, #fffdf2 0 38%, #ffd58f 70%, #ffc46b 100%); box-shadow: 0 0 0 2px #0b1020, 0 3px 10px rgb(0 0 0 / 0.5); }
.slide--day input[type="range"]::-webkit-slider-thumb { background: radial-gradient(circle, #f4f8ff 0 38%, #b9d4ff 70%, #8fb6f2 100%); }
.slide--day input[type="range"]::-moz-range-thumb { background: radial-gradient(circle, #f4f8ff 0 38%, #b9d4ff 70%, #8fb6f2 100%); }
.slide input[type="range"]:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; border-radius: 8px; }
.slide input[type="range"]:disabled { opacity: 0.35; }
.slide output { display: block; margin-top: 0.1rem; font-family: var(--sc-font-display); font-size: 1.35rem; letter-spacing: -0.02em; }
.switch { display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 0.9rem; min-height: 2.75rem; font-size: 0.98rem; font-weight: 500; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 2.9rem; height: 1.7rem; margin: 0; left: 0; cursor: pointer; }
.switch i { flex: none; width: 2.9rem; height: 1.7rem; border-radius: 999px; background: rgb(10 15 32 / 0.7); box-shadow: inset 0 0 0 1.5px rgb(245 240 230 / 0.4); position: relative; transition: background-color 160ms var(--sc-ease-out); }
.switch i::after { content: ""; position: absolute; left: 0.22rem; top: 0.22rem; width: 1.26rem; height: 1.26rem; border-radius: 50%; background: var(--sc-ink); transition: transform 180ms var(--sc-ease-out); }
.switch input:checked + i { background: var(--sc-accent); box-shadow: none; }
.switch input:checked + i::after { transform: translate3d(1.2rem, 0, 0); background: var(--sc-accent-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--sc-accent); outline-offset: 3px; }

.tune__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.3rem; }
.tune__nav .btn { min-width: 7.5rem; }
.tune__note { flex: 1 1 16rem; max-width: 44ch; margin-left: 0.5rem; }
.nj { margin-top: 2rem; display: grid; gap: 0.75rem; max-width: 46rem; }
@media (max-width: 860px) {
  .tune { padding-top: calc(var(--hz) + 2rem); }
  .tune__panel { top: calc(var(--hz) + 2rem); }
  .shapes, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.8rem; }
  .shape { padding: 0.6rem 0.7rem 0.7rem; font-size: 0.9rem; gap: 0.35rem; } .shape svg { height: 1.7rem; }
  .tile { min-height: 4.2rem; font-size: 1.05rem; padding: 0.7rem 0.8rem; }
  .q legend { font-size: 1.55rem; }
  .slide { margin-top: 1rem; } .slide__end { font-size: 0.8rem; max-width: 4.6rem; line-height: 1.2; }
  .tune__note { flex-basis: 100%; margin-left: 0; font-size: 0.8rem; }
  .tune__nav { margin-top: 1rem; }
}

/* -------------------------------------------------- 4 · result (peak) ---- */
.result { --n1: clamp(0, calc((var(--sc-p, 0) - 0.4) / 0.06), 1); --n2: clamp(0, calc((var(--sc-p, 0) - 0.425) / 0.06), 1); }
.result__pre { position: absolute; left: var(--sc-gutter); top: calc(var(--hz) + 3rem); font-family: var(--sc-font-display); font-weight: 300; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.8rem); letter-spacing: -0.025em; }
.result__copy { position: absolute; z-index: var(--sc-z-copy); left: var(--sc-gutter); top: calc(var(--hz) + 3.1rem); width: min(52rem, 60vw); }
.result__label { font-size: var(--sc-t-sm); font-weight: 600; color: var(--sc-accent); letter-spacing: 0.01em; }
.result__name { margin-top: 0.35rem; font-size: clamp(3.2rem, 1.2rem + 6.4vw, 7.4rem); font-weight: 300; line-height: 0.94; letter-spacing: -0.045em; white-space: nowrap; width: fit-content; outline-offset: 8px; }
.result__name .w { display: inline-block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; vertical-align: top; }
.result__name .w > span { display: inline-block; transform: translate3d(0, calc((1 - var(--n1)) * 108%), 0); will-change: transform; }
.result__name .w + .w > span { transform: translate3d(0, calc((1 - var(--n2)) * 108%), 0); }
.result__cols { margin-top: 1.2rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 3rem); }
.result__line { font-size: var(--sc-t-lg); line-height: 1.36; letter-spacing: -0.01em; text-wrap: pretty; }
.result__try { padding-left: clamp(1rem, 2vw, 2rem); box-shadow: inset 1px 0 0 rgb(245 240 230 / 0.28); }
.result__try h3 { font: 600 var(--sc-t-sm)/1.2 var(--sc-font-text); letter-spacing: 0.01em; color: var(--sc-accent); }
.result__try p { margin-top: 0.4rem; line-height: 1.48; text-wrap: pretty; }
.result__cta { margin-top: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.result__cta[hidden] { display: none; }
.result__side { position: absolute; z-index: var(--sc-z-copy); right: var(--sc-gutter); top: calc(var(--hz) + 1.6rem); width: min(21rem, 25vw); }
.share { margin-top: 0.8rem; display: grid; gap: 0.4rem; }
.share .btn { width: 100%; }
.share__status { min-height: 1.4em; font-size: var(--sc-t-sm); font-weight: 500; text-align: center; overflow-wrap: anywhere; }

/* The share card: the visitor's own day in light, with their line over it. */
.pcard { border-radius: var(--r-lg); overflow: hidden; background: #0d1430; color: var(--sc-ink); box-shadow: 0 2px 4px rgb(0 0 0 / 0.4), 0 26px 50px -16px rgb(0 0 0 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.14); rotate: -1.5deg; }
.pcard__band { position: relative; aspect-ratio: 32 / 13; background: linear-gradient(90deg, #233f78 0%, #8fb7de 22%, #dfe9f4 42%, #f0d59c 62%, #d8744a 80%, #131c3d 100%); }
.pcard__band canvas, .pcard__band svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard__band svg { inset: 14% 4% 22% 4%; width: 92%; height: 64%; overflow: visible; }
.pcard__band path { fill: none; stroke: #fff6e0; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 3px rgb(30 15 0 / 0.6)); }
.pcard figcaption { padding: 0.9rem 1.1rem 1rem; }
.pcard__label { font-size: 0.78rem; font-weight: 600; color: var(--sc-accent); }
.pcard__name { margin-top: 0.15rem; font-family: var(--sc-font-display); font-weight: 400; font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.2rem); line-height: 1; letter-spacing: -0.035em; }
.pcard__line { margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.35; color: var(--sc-ink-soft); }
.pcard__foot { margin-top: 0.7rem; display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; font-weight: 600; }
.pcard__foot b { font-family: var(--sc-font-display); font-weight: 500; font-size: 1.05rem; letter-spacing: -0.035em; }
@media (max-width: 860px) {
  .result__pre { top: calc(var(--hz) + 2.4rem); right: var(--sc-gutter); }
  .result__copy { top: calc(var(--hz) + 2rem); width: auto; right: var(--sc-gutter); }
  .result__name { font-size: clamp(2.8rem, 14.5vw, 4.2rem); white-space: normal; }
  .result__name .w { display: block; }
  .result__cols { grid-template-columns: 1fr; gap: 0.8rem; margin-top: 0.8rem; }
  .result__line { font-size: 1.08rem; }
  .result__try { padding-left: 0; padding-top: 0.75rem; box-shadow: inset 0 1px 0 rgb(245 240 230 / 0.28); }
  .result__try p { font-size: 0.98rem; }
  .result__cta { margin-top: 0.8rem; }
  .result__side { right: auto; left: 50%; translate: -50% 0; top: calc(var(--hz) + 1.6rem); width: min(84vw, 21rem); }
  .pcard { rotate: none; }
}

/* ------------------------------------------------------------ 5 · keep --- */
.keep { padding: clamp(6rem, 12vw, 10rem) var(--sc-gutter) clamp(5rem, 9vw, 8rem); }
.keep__grid { max-width: 72rem; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; }
.keep h2 { font-size: clamp(2.5rem, 1.4rem + 4vw, 4.8rem); font-weight: 300; }
.keep .lede { margin-top: 1rem; }
.keep__pattern { margin-top: 0.9rem; font-weight: 600; color: var(--sc-accent); }
.keep__pattern[hidden] { display: none; }
.keep__fig { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3 / 4; box-shadow: var(--sc-e3); }
.keep__fig img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.form { margin-top: 1.6rem; display: grid; gap: 0.9rem; max-width: 31rem; }
.field label { display: block; font-size: var(--sc-t-sm); font-weight: 600; margin-bottom: 0.4rem; }
.field label span { font-weight: 400; color: var(--sc-ink-soft); }
.field input { width: 100%; min-height: 3.2rem; padding: 0 1rem; border: 0; border-radius: var(--r-md); background: rgb(245 240 230 / 0.09); box-shadow: inset 0 0 0 1.5px rgb(245 240 230 / 0.36); font: inherit; font-size: 1.05rem; color: var(--sc-ink); caret-color: var(--sc-accent); transition: box-shadow 160ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out); }
.field input:focus-visible { outline: none; background: rgb(245 240 230 / 0.14); box-shadow: inset 0 0 0 2px var(--sc-accent); }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #ff9d8a; }
.field__err { min-height: 1.3em; margin-top: 0.3rem; font-size: var(--sc-t-sm); font-weight: 500; color: #ffb3a4; }
.check { display: flex; gap: 0.75rem; align-items: flex-start; font-size: var(--sc-t-sm); line-height: 1.45; cursor: pointer; padding-block: 0.3rem; }
.check input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: #ffc46b; }
.form .btn { justify-self: start; }
.form__note { padding: 1rem 1.1rem; border-radius: var(--r-md); background: rgb(255 196 107 / 0.13); box-shadow: inset 0 0 0 1.5px rgb(255 196 107 / 0.6); font-size: var(--sc-t-sm); line-height: 1.5; font-weight: 500; }
.form__note[hidden] { display: none; }
@media (max-width: 860px) { .keep__grid { grid-template-columns: 1fr; } .keep__fig { aspect-ratio: 4 / 3.6; order: -1; } .form .btn { justify-self: stretch; } }

/* ------------------------------------------------------------ 6 · grow --- */
.grow__copy { position: absolute; left: var(--sc-gutter); bottom: clamp(2.5rem, 9vh, 6rem); width: min(40rem, 52vw); height: 17rem; }
.grow__copy > * { position: absolute; left: 0; bottom: 0; }
.grow__copy::before { content: none; }
.grow h2, .grow__big { font-size: clamp(2.5rem, 1.4rem + 4.2vw, 5rem); font-weight: 300; }
.grow .lede { margin-top: 1rem; max-width: 38ch; }
.grow [data-sc-stage]::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 85% at 0% 100%, rgb(5 8 18 / 0.86), rgb(5 8 18 / 0.6) 42%, transparent 74%); }
@media (max-width: 860px) {
  .grow__copy { width: auto; right: var(--sc-gutter); bottom: 2.25rem; height: 19rem; }
  .grow [data-sc-stage]::before { background: linear-gradient(to top, rgb(5 8 18 / 0.92), rgb(5 8 18 / 0.72) 38%, transparent 64%); }
}

/* ------------------------------------------------------------ 7 · what --- */
.what { padding: clamp(5rem, 10vw, 9rem) var(--sc-gutter) clamp(4.5rem, 9vw, 8rem); }
.what__wrap { max-width: 72rem; margin-inline: auto; }
.what__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2.5rem, 6vw, 7rem); }
.what h2 { font-size: clamp(2.2rem, 1.3rem + 3vw, 3.9rem); font-weight: 300; }
.what ul { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.what li { padding-block: 0.85rem; border-top: 1px solid rgb(245 240 230 / 0.2); font-size: var(--sc-t-lg); line-height: 1.3; letter-spacing: -0.01em; }
.what__not h2, .what__not li { color: var(--sc-ink-soft); }
.what__notes { margin-top: clamp(2.5rem, 5vw, 4.5rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 5vw, 5rem); }
.what__notes h3 { font: 600 var(--sc-t-base)/1.3 var(--sc-font-text); }
.what__notes p { margin-top: 0.4rem; color: var(--sc-ink-soft); max-width: 42ch; }
@media (max-width: 860px) { .what__grid, .what__notes { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------- 8 · close --- */
.close__copy { position: absolute; z-index: var(--sc-z-copy); left: var(--sc-gutter); top: calc(var(--hz) + 2.9rem); width: min(48rem, 64vw); }
.close h2 { font-size: clamp(2.6rem, 1.5rem + 4.4vw, 5.4rem); font-weight: 300; }
.close .lede { margin-top: 1rem; }
.close__cta { margin-top: 1.5rem; }
.foot { position: absolute; z-index: var(--sc-z-copy); inset: auto var(--sc-gutter) 1.2rem var(--sc-gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 2rem; font-size: 0.8rem; line-height: 1.45; color: #bcc3d6; }
.foot b { font-family: var(--sc-font-display); font-weight: 500; font-size: 1rem; letter-spacing: -0.035em; color: var(--sc-ink); }
.foot p { max-width: 62ch; }
@media (max-width: 860px) { .close__copy { top: calc(var(--hz) + 2.2rem); width: auto; right: var(--sc-gutter); } .close h2 { font-size: clamp(2.3rem, 11vw, 3.4rem); } .close .lede { font-size: 1.05rem; margin-top: 0.7rem; } .close__cta { margin-top: 1rem; } }

/* Cues the engine has not lit must not catch presses meant for what is under them. */
[data-sc-cue] { pointer-events: none; }

/* ------------------------------------------------------ reduced motion ---
   Fewer and gentler, not zero: the picture still answers the line, but
   nothing travels, sways or assembles. */
@media (prefers-reduced-motion: reduce) {
  .js .draw__copy > * { animation: none; }
  .line, .world__reeds { transform: none !important; }
  .result__name .w > span { transform: none !important; }
  .q, .q.is-on { transform: none; transition-duration: 1ms; }
  .btn, .shape, .tile, .switch i::after { transition: none; }
}
