/* ─── The home page ─────────────────────────────────────────────────────────
   What a first visit to thesoundinator.com sees, painted from index.html
   before the studio's 2 MB module graph has arrived, and reopened by the logo.

   Design plan (FRONTEND_DESIGN_STANDARD §1.8; a standalone page, so the
   frontend-design skill's literal reading applies, steered by the owner's pick
   of the first UI overhaul's "ink" look, 2026-09-24):
   - Colour: a cast-grain black ground; panels pure black with white
     hairlines; white, grey and dim grey text. ONE accent, the studio's own
     amber (the logo tile), only for what is playing and the primary action —
     overhaul one used #ff4f00, but this page's job is to hand over to a studio
     whose accent is amber.
   - Type: Unbounded for the headline and section names, Schibsted Grotesk for
     everything else (both self-hosted, OFL). Tabular numerals on times.
   - Layout: left-aligned. A headline over most of the width, then the one
     bold object — a listening deck that plays five of the studio's starters
     the moment you press play — then the four sections as plain rows with a
     real screenshot each, and the community. */

@font-face {
  font-family: 'Unbounded'; font-style: normal; font-display: swap;
  font-weight: 200 900;
  src: url('/fonts/unbounded-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Schibsted Grotesk'; font-style: normal; font-display: swap;
  font-weight: 400 900;
  src: url('/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

.home {
  --h-ground: #070707;
  --h-panel: #000;
  --h-raise: #111;
  --h-line: rgba(255, 255, 255, 0.82);
  --h-line-soft: rgba(255, 255, 255, 0.16);
  --h-ink: #fff;
  --h-ink2: #c2c2c2;
  --h-ink3: #8a8a8a;
  --h-accent: #f5a623;
  --h-accent-ink: #000;
  --h-wave: rgba(255, 255, 255, 0.28);
  --h-grid: rgba(255, 255, 255, 0.07);
  --h-t1: #3d9df6;
  --h-t2: #4fc47f;
  --h-t3: #9d7bf0;
  --h-t4: #e5688f;
  --h-t5: #38bdf8;
  --h-t6: #a0dc32;
  --h-past: rgba(255, 255, 255, 0.62);
  --h-next: rgba(255, 255, 255, 0.3);
  --h-title: 'Unbounded', 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --h-font: 'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --h-gutter: clamp(16px, 4vw, 56px);
  --h-max: 1240px;
  /* the cast surface: a fine grain over a slow mottle (overhaul one's edge
     texture, felt rather than seen) */
  --h-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/></filter><rect width='220' height='220' filter='url(%23g)'/></svg>");
  --h-mottle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='640' height='640'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/></filter><rect width='640' height='640' filter='url(%23m)'/></svg>");

  /* above the studio's floating panels (≤3000), below its overlays and
     dialogs (≥4100), so sign-up opens over this page */
  position: fixed; inset: 0; z-index: 3500;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--h-grain), var(--h-mottle), var(--h-ground);
  background-size: 220px 220px, 640px 640px, auto;
  color: var(--h-ink);
  font: 400 16px/1.55 var(--h-font);
  -webkit-font-smoothing: antialiased;
}
.home[hidden] { display: none; }
html.home-open, html.home-open body { overflow: hidden; }
html.home-open .app-credit { display: none; }

/* resets at zero specificity, so every component rule below wins over them */
:where(.home) *, :where(.home) *::before, :where(.home) *::after { box-sizing: border-box; }
.home :focus-visible { outline: 2px solid var(--h-accent); outline-offset: 3px; }
:where(.home) button { font: inherit; color: inherit; cursor: pointer; }
:where(.home) img { display: block; max-width: 100%; }

.home-wrap { width: 100%; max-width: var(--h-max); margin: 0 auto; padding: 0 var(--h-gutter); }

/* ── the reel behind the headline ── */
.hero-reel {
  position: absolute; left: 0; right: 0; top: 0; height: min(100vh, 900px); z-index: 0; overflow: hidden; pointer-events: none;
}
.hero-reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; filter: saturate(0.85); }
/* the overlay: dark where the words are (left), lifting to the right, and
   fading into the page ground at the bottom so the reel has no hard edge */
.hero-reel::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(7, 7, 7, 0.55) 0, rgba(7, 7, 7, 0) 22%, rgba(7, 7, 7, 0) 60%, var(--h-ground) 100%),
    linear-gradient(to right, rgba(7, 7, 7, 0.94) 0, rgba(7, 7, 7, 0.86) 38%, rgba(7, 7, 7, 0.45) 72%, rgba(7, 7, 7, 0.3) 100%);
}
.home-bar, .home-wrap { position: relative; z-index: 1; }
.home-hero { min-height: calc(min(100vh, 900px) - 120px); display: flex; flex-direction: column; justify-content: center; }

/* ── bar ── */
.home-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 22px; padding-bottom: 22px;
}
.home-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--h-ink); text-decoration: none; }
.home-brand img { width: 34px; height: 34px; border-radius: 7px; }
.home-brand span { font: 700 1.05rem var(--h-title); letter-spacing: -0.01em; }
.home-bar-actions { display: flex; align-items: center; gap: 8px; }
.home-bar .home-btn { white-space: nowrap; }

/* ── buttons: square, a hairline, one filled ── */
.home-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  background: var(--h-panel); border: 1px solid var(--h-line); border-radius: 0;
  font-weight: 600; font-size: 0.98rem; letter-spacing: 0;
  transition: background-color 120ms ease, color 120ms ease;
}
.home-btn:hover { background: var(--h-raise); }
.home-btn-primary { background: var(--h-accent); border-color: var(--h-accent); color: var(--h-accent-ink); }
.home-btn-primary:hover { background: var(--h-ink); border-color: var(--h-ink); }
.home-btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }
.home-link {
  background: none; border: 0; padding: 8px 10px; min-height: 38px;
  color: var(--h-ink2); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--h-line-soft); text-underline-offset: 4px;
}
.home-link:hover { color: var(--h-ink); text-decoration-color: currentColor; }

/* "Open the studio" pressed before the studio has arrived: say so, and keep
   the button where it is — the studio opens the moment it is ready. */
.home-btn[data-state="waiting"] { cursor: progress; }
.home-btn[data-state="waiting"] .home-btn-label::after { content: "…"; }
.home-btn-load {
  position: absolute; left: -1px; right: -1px; bottom: -1px; height: 3px;
  background: var(--h-accent-ink); transform-origin: left; transform: scaleX(0);
  opacity: 0;
}
.home-btn[data-state="waiting"] .home-btn-load { opacity: 0.55; animation: home-load 1.6s ease-in-out infinite; }
@keyframes home-load { 0% { transform: scaleX(0); } 70% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* ── hero ── */
.home-hero { padding-top: clamp(28px, 6vh, 84px); padding-bottom: clamp(28px, 5vh, 56px); }
.home-title {
  margin: 0; max-width: 12.5em;
  font: 800 clamp(2.5rem, 6.6vw, 5.9rem)/0.98 var(--h-title);
  letter-spacing: -0.045em;
  text-wrap: balance;
}
/* the headline rises into place once, line by line, on arrival */
.home-title .ht-line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.home-title .ht-line > span { display: inline-block; animation: ht-rise 1000ms cubic-bezier(0.2, 0.75, 0, 1) both; }
.home-title .ht-line + .ht-line > span { animation-delay: 110ms; }
@keyframes ht-rise { from { transform: translateY(108%); } to { transform: none; } }
.home-lede {
  display: grid; grid-template-columns: minmax(0, 34rem) auto; align-items: end; gap: 20px 48px;
  margin-top: clamp(24px, 3vw, 40px);
}
.home-lede p { margin: 0; color: var(--h-ink2); font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.45; max-width: 26em; }
.home-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.home-note { grid-column: 1 / -1; font-size: 0.9rem !important; color: var(--h-ink3) !important; }

/* ── the listening deck ── */
.home-deck { background: var(--h-panel); border: 1px solid var(--h-line); }
.deck-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 16px;
  padding: 12px 16px;
}
.deck-play {
  width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--h-accent); border: 0; border-radius: 50%; color: var(--h-accent-ink);
  transition: transform 120ms ease;
}
.deck-play:hover { transform: scale(1.05); }
.deck-play:active { transform: scale(0.97); }
.deck-play svg { width: 20px; height: 20px; fill: currentColor; }
.deck-play .i-pause { display: none; }
.home-deck.playing .deck-play .i-play { display: none; }
.home-deck.playing .deck-play .i-pause { display: block; }
.home-deck.loading .deck-play { cursor: progress; }
.deck-now { min-width: 0; }
.deck-name { display: block; font: 700 clamp(1.05rem, 1.8vw, 1.3rem)/1.15 var(--h-title); letter-spacing: -0.02em; }
.deck-line { display: block; margin-top: 2px; color: var(--h-ink2); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-time { color: var(--h-ink3); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deck-time .deck-pos { color: var(--h-ink); }
.deck-open { font-size: 0.88rem; }

/* the space: every part where it stands around the listener, with sound
   travelling from each part as it plays; the parts' names ride on top */
.deck-body { position: relative; border-top: 1px solid var(--h-line-soft); }
.deck-space { position: relative; height: clamp(240px, 27vw, 360px); cursor: grab; }
.deck-space:active { cursor: grabbing; }
.deck-space canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.deck-side { padding: 8px 16px 6px; border-top: 1px solid var(--h-line-soft); }
.deck-side-h { display: none; }
/* the parts' names: one row under the view, scrolling sideways if it must */
.deck-threads { list-style: none; margin: 0; padding: 0 0 2px; display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.deck-threads::-webkit-scrollbar { display: none; }
.deck-threads li { flex: none; display: flex; align-items: center; gap: 6px; color: var(--h-ink3); font-size: 0.8rem; transition: color 160ms ease; }
.deck-threads li i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--c); flex: none; transition: background-color 160ms ease; }
.deck-threads li.on { color: var(--h-ink); }
.deck-threads li.on i { background: var(--c); }
.deck-side-note { display: none; }

/* the whole piece as a strip of peaks: where you are, and how you seek */
.deck-wave {
  position: relative; height: 26px;
  margin: 0 16px 8px; cursor: pointer; touch-action: none;
}
.deck-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.deck-wave:focus-visible { outline-offset: -2px; }

/* the pieces: one row of tabs (it scrolls sideways inside itself on a phone) */
.deck-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid var(--h-line);
}
.deck-list::-webkit-scrollbar { display: none; }
.deck-list li { flex: 1 0 auto; min-width: 0; }
.deck-list li + li { border-left: 1px solid var(--h-line-soft); }
.deck-track {
  position: relative; width: 100%; height: 100%; text-align: left; white-space: nowrap;
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 14px 10px; background: none; border: 0;
  transition: background-color 120ms ease;
}
.deck-track:hover { background: var(--h-raise); }
.deck-track b { font-weight: 600; font-size: 0.9rem; line-height: 1.25; }
.deck-track span { color: var(--h-ink3); font-size: 0.78rem; line-height: 1.35; }
.deck-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px;
  background: var(--h-accent); transform: scaleX(0); transform-origin: left;
  transition: transform 160ms ease;
}
.deck-track[aria-current="true"]::before { transform: scaleX(1); }
.deck-track[aria-current="true"] b { color: var(--h-accent); }

.deck-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  margin-top: 14px; color: var(--h-ink3); font-size: 0.9rem;
}
.deck-foot p { margin: 0; max-width: 46em; }
.deck-foot .home-link { padding-left: 0; padding-right: 0; }

.home-h2 { margin: 0 0 clamp(20px, 3vw, 32px); font: 800 clamp(1.8rem, 4vw, 3rem)/1.02 var(--h-title); letter-spacing: -0.035em; text-wrap: balance; }

/* ── section heads ── */
.hs-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 12px 48px; align-items: end; margin: clamp(56px, 10vh, 120px) 0 clamp(20px, 3vw, 32px); }
.hs-head .home-h2 { margin: 0; }
.hs-head p { margin: 0; color: var(--h-ink2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 28em; }

/* ── the patch grid: tap a tile, hear it, watch its notes ── */
.pg { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 0; border: 1px solid var(--h-line); background: var(--h-panel); }
/* the tiles are keys: a raised face on a darker lip; pressing sinks it, and
   the one playing stays down, lit, its icon running */
.pg-grid {
  --key-face: #141414; --key-face-hover: #1a1a1a; --key-lip: #050505; --key-edge: rgba(255, 255, 255, 0.09);
  --key-lit: color-mix(in srgb, var(--h-accent) 10%, #141414);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; align-content: start;
}
.pg-tile {
  --i-ink: rgba(255, 255, 255, 0.86); --i-soft: rgba(255, 255, 255, 0.4); --i-acc: var(--h-accent); --i-ground: var(--key-face);
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px;
  padding: 8px 12px 8px 8px; min-height: 0; text-align: left;
  background: var(--key-face); border: 1px solid var(--key-edge); border-radius: 6px;
  box-shadow: 0 4px 0 var(--key-lip), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(0);
  transition: transform 90ms ease, box-shadow 90ms ease, background-color 160ms ease, border-color 160ms ease;
}
.pg-tile:hover { background: var(--key-face-hover); --i-ground: var(--key-face-hover); }
.pg-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--key-lip), inset 0 1px 0 rgba(255, 255, 255, 0.03); }
.pg-tile[aria-pressed="true"] {
  transform: translateY(3px);
  background: var(--key-lit); --i-ground: var(--key-lit);
  border-color: var(--h-accent);
  box-shadow: 0 1px 0 var(--key-lip), inset 0 0 0 1px color-mix(in srgb, var(--h-accent) 45%, transparent);
}
.pg-icon { display: block; width: 52px; height: 52px; margin: 0; grid-row: 1 / span 2; }
.pg-icon rect { fill: var(--h-ink2); transition: fill 160ms ease; }
.pg-tile b { align-self: end; font-weight: 600; font-size: 0.9rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-tile span { align-self: start; color: var(--h-ink3); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-tile[aria-pressed="true"] b { color: var(--h-accent); }
/* a little lamp in the key's corner: dark at rest, amber while it plays */
.pg-tile::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); transition: background-color 160ms ease;
}
.pg-tile[aria-pressed="true"]::after { background: var(--h-accent); }
.pg-stage { display: flex; flex-direction: column; border-left: 1px solid var(--h-line); }
.pg-now { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 18px 20px; border-bottom: 1px solid var(--h-line-soft); }
.pg-name { font: 700 clamp(1.15rem, 2vw, 1.5rem)/1.15 var(--h-title); letter-spacing: -0.02em; }
.pg-kind { grid-column: 1; color: var(--h-ink2); font-size: 0.95rem; }
.pg-time { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--h-ink3); font-variant-numeric: tabular-nums; }
.pg-roll { position: relative; flex: 1; min-height: 170px; cursor: pointer; }
.pg-roll canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg-wave { position: relative; height: 34px; margin: 0 20px 10px; cursor: pointer; touch-action: none; }
.pg-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pg-open { align-self: flex-start; margin: 0 12px 10px; }

/* ── the machine ──────────────────────────────────────────────────────────
   A pinned stage. The machine (machine-v2.svg, scripts/draw_home_machine.py)
   fills it; the camera is its viewBox, moved by story.js from part to part as the
   page scrolls. Note marks drift behind at different depths. */
.hm-tour {
  position: relative; height: 900vh;
  margin-top: clamp(40px, 8vh, 96px);
}
.hm-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
/* the drawing fades out at its edges rather than ending on a cut line, and
   on the right where the window takes over */
.hm-camera {
  position: absolute; left: 0; width: 100%; top: 10vh; bottom: 27vh;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%), linear-gradient(to right, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%), linear-gradient(to right, #000 78%, transparent 100%);
  mask-composite: intersect;
}
.hm-tour .hm-camera {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%);
}
.hm-camera { transition: width 700ms cubic-bezier(0.2, 0.75, 0, 1); }
.hm-camera svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.hm-depth { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hm-depth .hm-note { fill: var(--h-ink); stroke: var(--h-ink); }

/* the opening step: its title sits above the machine, introducing it, with a
   cue below that there is more to scroll through */
.hm-tour:not(.windowed) .hm-copy { top: 7vh; bottom: auto; }
.hm-tour:not(.windowed) .hm-step { top: 0; bottom: auto; }
.hm-tour:not(.windowed) .hm-camera { top: 24vh; bottom: 14vh; }
.hm-cue {
  position: absolute; left: 50%; bottom: 4vh; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 6px; color: var(--h-ink3); font-size: 0.82rem;
  opacity: 0; transition: opacity 300ms ease; pointer-events: none;
}
.hm-tour.at-start .hm-cue { opacity: 1; }
.hm-cue svg { width: 22px; height: 22px; fill: none; stroke: var(--h-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: hm-cue 1.6s ease-in-out infinite; }
@keyframes hm-cue { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(6px); opacity: 1; } }

/* the interface window: the real control a part stands for, playing */
.hm-tour.windowed .hm-camera {
  width: 58%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%), linear-gradient(to right, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%), linear-gradient(to right, #000 80%, transparent 100%);
  mask-composite: intersect;
}
.hm-camera { transition: width 700ms cubic-bezier(0.2, 0.75, 0, 1); }
.hm-window {
  position: absolute; margin: 0; right: var(--h-gutter); width: 40%;
  top: 50%; transform: translateY(calc(-50% - 6vh + 16px)); opacity: 0;
  transition: opacity 450ms ease, transform 600ms cubic-bezier(0.2, 0.75, 0, 1);
}
.hm-tour.windowed .hm-window { opacity: 1; transform: translateY(calc(-50% - 6vh)); }
/* the screens turn like cards: the outgoing one swings away on its edge while
   the next swings in from the other side, crossfading so the frame is never
   empty; scrolling back up turns them the other way */
.hm-screens { position: relative; aspect-ratio: 16 / 9; perspective: 1400px; }
.hm-screen {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top;
  background: var(--h-panel); border: 1px solid var(--h-line);
  opacity: 0; transform: translateX(16%) rotateY(-34deg) scale(0.86); transform-origin: 50% 50%;
  transition: transform 700ms cubic-bezier(0.2, 0.75, 0, 1), opacity 500ms ease;
  backface-visibility: hidden;
}
.hm-screen.out { opacity: 0; transform: translateX(-16%) rotateY(34deg) scale(0.86); }
.hm-window.back .hm-screen:not(.on):not(.out) { transform: translateX(-16%) rotateY(34deg) scale(0.86); }
.hm-window.back .hm-screen.out { transform: translateX(16%) rotateY(-34deg) scale(0.86); }
.hm-screen.on { opacity: 1; transform: none; z-index: 1; }
.hm-cap { margin-top: 14px; display: grid; gap: 4px; }
.hm-title { font: 700 clamp(1rem, 1.5vw, 1.2rem)/1.25 var(--h-title); letter-spacing: -0.015em; color: var(--h-ink); }
.hm-where { color: var(--h-ink3); font-size: 0.86rem; }
.hm-where::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--h-accent); vertical-align: 1px; }

/* step through the machine without scrolling */
.hm-nav { position: absolute; right: var(--h-gutter); bottom: 6vh; display: flex; gap: 8px; z-index: 2; }
.hm-nav-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--h-panel); border: 1px solid var(--h-line-soft); border-radius: 50%; color: var(--h-ink);
  transition: border-color 120ms ease, color 120ms ease, opacity 160ms ease;
}
.hm-nav-btn:hover { border-color: var(--h-accent); color: var(--h-accent); }
.hm-nav-btn[disabled] { opacity: 0.3; cursor: default; border-color: var(--h-line-soft); color: var(--h-ink); }
.hm-nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hm-leader { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; opacity: 0; transition: opacity 300ms ease; }
.hm-tour.windowed .hm-leader { opacity: 1; }
.hm-leader path { fill: none; stroke: var(--h-accent); stroke-width: 1; }
.hm-leader circle { fill: var(--h-accent); }

.hm-copy { position: absolute; left: 0; right: 0; bottom: 6vh; }
.hm-steps { list-style: none; margin: 0; padding: 0; position: relative; min-height: 9.5rem; }
.hm-step {
  position: absolute; left: 0; bottom: 0; max-width: min(52rem, 100%);
  opacity: 0; transform: translateY(18px);
  transition: opacity 380ms ease, transform 520ms cubic-bezier(0.2, 0.75, 0, 1);
}
.hm-step.on { opacity: 1; transform: none; }
.hm-h { margin: 0 0 10px; font: 800 clamp(2.2rem, 5.4vw, 4.6rem)/0.98 var(--h-title); letter-spacing: -0.04em; }
.hm-step p { margin: 0; color: var(--h-ink2); font-size: clamp(1.05rem, 1.5vw, 1.3rem); }
.hm-progress { position: absolute; right: calc(var(--h-gutter) / 2); top: 18vh; bottom: 18vh; width: 1px; background: var(--h-line-soft); }
.hm-progress i { position: absolute; left: -1px; top: 0; width: 3px; height: 100%; background: var(--h-accent); transform-origin: top; transform: scaleY(var(--p, 0)); }

/* ── the last word ── */
.home-final { padding: clamp(96px, 18vh, 200px) 0 clamp(56px, 8vh, 96px); }
.hf-big {
  display: block; width: 100%; padding: 0; margin: 0 0 clamp(28px, 4vw, 48px);
  background: none; border: 0; text-align: left; cursor: pointer;
}
.hf-text {
  font: 800 clamp(2.8rem, 10vw, 9.2rem)/0.95 var(--h-title); letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1.5px var(--h-ink);
  background: linear-gradient(90deg, var(--h-ink) var(--fill, 0%), transparent var(--fill, 0%));
  -webkit-background-clip: text; background-clip: text;
}
.hf-big:hover .hf-text, .hf-big:focus-visible .hf-text {
  -webkit-text-stroke-color: var(--h-accent);
  background: linear-gradient(90deg, var(--h-accent) 100%, transparent 100%);
  -webkit-background-clip: text; background-clip: text;
}
.hf-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.hf-row p { margin: 0; color: var(--h-ink2); font-size: clamp(1.05rem, 1.5vw, 1.3rem); }

/* ── narrow screens ── */
@media (max-width: 900px) {
  /* portrait: the words span the width, so the overlay is even */
  .hero-reel::after {
    background:
      linear-gradient(to bottom, rgba(7, 7, 7, 0.6) 0, rgba(7, 7, 7, 0.78) 30%, rgba(7, 7, 7, 0.78) 70%, var(--h-ground) 100%);
  }
  .hero-reel video { object-position: 50% 30%; }
  .hs-head { grid-template-columns: minmax(0, 1fr); }
  .deck-space { height: clamp(220px, 56vw, 300px); }
  .deck-side-note { display: none; }
  .pg { grid-template-columns: minmax(0, 1fr); }
  .pg-stage { border-left: 0; border-top: 1px solid var(--h-line); order: -1; }
  /* narrow: the keys become a strip two deep that scrolls sideways, key by key */
  .pg-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto);
    grid-auto-columns: minmax(190px, 44%); gap: 8px; padding: 10px 10px 14px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 10px; scrollbar-width: thin;
  }
  .pg-tile { scroll-snap-align: start; }
  .pg-roll { flex: none; height: 150px; min-height: 0; }
  .pg-now { padding: 14px 16px; }
  .home-lede { grid-template-columns: minmax(0, 1fr); }
  .deck-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .deck-time { grid-column: 3; grid-row: 1; }
  .deck-open { grid-column: 2 / 4; grid-row: 2; justify-self: start; padding: 2px 0 0; min-height: 0; }
  /* narrow: the machine, its window and the words stack as one centred
     column, so nothing floats apart however tall the screen is */
  .hm-stage { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 64px 0 28px; }
  .hm-tour .hm-camera, .hm-tour.windowed .hm-camera {
    position: relative; inset: auto; flex: none; width: 100%; height: min(calc(100vw / 2.4), 30vh);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 88%, transparent 100%);
  }
  .hm-window, .hm-tour.windowed .hm-window {
    position: relative; inset: auto; flex: none; transform: none;
    width: min(calc(100% - 2 * var(--h-gutter)), calc((100vh - min(calc(100vw / 2.4), 30vh) - 330px) * 16 / 9));
    margin: 0 auto;
  }
  .hm-tour:not(.windowed) .hm-window { display: none; }
  /* the intro reads top-down like a page: title first, the machine under it */
  .hm-tour:not(.windowed) .hm-stage { justify-content: flex-start; padding-top: max(84px, 9vh); }
  .hm-tour:not(.windowed) .hm-copy { order: -1; top: auto; }
  .hm-tour:not(.windowed) .hm-camera { top: auto; bottom: auto; margin-top: 3vh; }
  .hm-cue { bottom: 18px; }
  .hm-where { display: none; }
  .hm-cap { margin-top: 8px; }
  .hm-copy { position: relative; inset: auto; flex: none; }
  .hm-steps { min-height: 0; height: 7.2rem; }
  .hm-step { top: 0; bottom: auto; }
  .hm-h { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  .hm-nav { bottom: auto; top: 14px; }
  .hm-progress, .hm-leader { display: none; }
}
@media (max-width: 620px) {

}
@media (max-width: 520px) {
  /* the hero's own button is right below: the bar keeps only Log in */
  .home-bar .home-btn { display: none; }
  .home-ctas .home-btn { flex: 1 1 100%; }
}
@media (pointer: coarse) {
  .home-link { min-height: 44px; }
  .home-btn-sm { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before, .home *::after { transition: none !important; animation: none !important; }
  .home-btn[data-state="waiting"] .home-btn-load { opacity: 0.55; transform: scaleX(1); }
}
