/* Homepage: one meeting, followed from the call to the disk.
   The page is a scroll story in four pinned scenes. A fixed "world" layer
   behind everything changes colour as the story moves through night (the
   call), forest (your own processor), paper (the transcript), a note-yellow
   desk, daylight, and dusk (the years after one payment).

   The two source colours carry meaning everywhere: violet is your
   microphone, teal is the meeting audio, as in the desktop app. Nothing else
   uses them.

   Under html.motion (set by /js/motion.js before first paint) the scenes pin
   and animate. Without JavaScript, or with reduced motion requested, the
   same markup renders as ordinary stacked sections with their own colours. */

@property --fg { syntax: "<color>"; inherits: true; initial-value: #f5f3ff; }
@property --fg-2 { syntax: "<color>"; inherits: true; initial-value: #cfcbe8; }
@property --fg-3 { syntax: "<color>"; inherits: true; initial-value: #a19dc2; }
@property --mic { syntax: "<color>"; inherits: true; initial-value: #b8a1ff; }
@property --sys { syntax: "<color>"; inherits: true; initial-value: #64d6d0; }

/* ---------- Tone ----------
   Light tone is dark ink on a pale world; dark tone is pale ink at night.
   home.js sets html[data-tone] from the luminance of the current world. */

.home,
html:not(.motion) .tone-light {
  --fg: #111020; --fg-2: #354052; --fg-3: #56637a;
  --hair: rgba(17, 16, 32, 0.12); --hair-2: rgba(17, 16, 32, 0.28);
  --mic: #7138ed; --sys: #087e87;
  --btn-bg: #10101f; --btn-fg: #ffffff;
  --glass: rgba(255, 255, 255, 0.62);
  color: var(--fg);
}
html[data-tone="dark"] .home,
html:not(.motion) .tone-dark {
  --fg: #f5f3ff; --fg-2: #d3cfea; --fg-3: #bdb9da;
  --hair: rgba(255, 255, 255, 0.13); --hair-2: rgba(255, 255, 255, 0.3);
  --mic: #b8a1ff; --sys: #64d6d0;
  --btn-bg: #f0efa9; --btn-fg: #10101f;
  --glass: color-mix(in srgb, var(--world) 42%, #0d0a24);
  color: var(--fg);
}
html { --world: #120f2e; }
.home {
  background: #120f2e;
}
html.motion .home { background: transparent; }

.world {
  position: fixed; inset: 0; z-index: -1;
  background: var(--world);
}
/* Film grain keeps the large flat worlds from looking like a colour swatch. */
.world-grain {
  position: absolute; inset: -50%;
  opacity: .07; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
html:not(.motion) .world { display: none; }

/* ---------- Navigation over a changing world ---------- */

.home .nav-wrap {
  background: color-mix(in srgb, var(--world) 90%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: var(--hair);
}
html:not(.motion) .home .nav-wrap { background: rgba(237, 245, 247, 0.92); }
.home .nav-brand-name { color: var(--fg); }
.home .nav-links a { color: var(--fg-2); }
.home .nav-links a:hover { background: var(--hair); color: var(--fg); }
.home .nav-toggle { color: var(--fg-2); }
.home .nav-cta { background: var(--btn-bg); color: var(--btn-fg); }
.home .nav-cta:hover { background: var(--btn-bg); filter: brightness(1.08); }
.home :focus-visible { outline-color: var(--fg); }

/* ---------- Chapter rail ---------- */

.rail {
  position: fixed; left: 26px; top: 50%; z-index: 20;
  display: grid; gap: 6px; transform: translateY(-50%);
  opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.rail.is-on { opacity: 1; pointer-events: auto; }
.rail a {
  display: flex; align-items: center; gap: 12px; min-height: 26px;
  color: var(--fg-3); font-size: 12.5px; text-decoration: none;
}
.rail i {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  border: 1px solid var(--fg-3); transition: background .3s, transform .3s, border-color .3s;
}
.rail span { opacity: 0; transform: translateX(-4px); transition: opacity .25s, transform .25s; white-space: nowrap; }
.rail a:hover span, .rail a:focus-visible span, .rail a.is-current span { opacity: 1; transform: none; }
.rail a.is-current { color: var(--fg); }
.rail a.is-current i { background: var(--fg); border-color: var(--fg); transform: scale(1.25); }
.rail a.is-past i { background: var(--fg-3); }
@media (max-width: 1180px) { .rail { display: none; } }
/* Between 1180 and 1500 the headings start close to the rail: show the
   current label only on hover or focus there. */
@media (max-width: 1500px) { .rail a.is-current:not(:hover):not(:focus-visible) span { opacity: 0; } }
html:not(.motion) .rail { display: none; }

/* ---------- Scenes ---------- */

.scene { position: relative; }
.bg-stop, .anchor, .chapter-mark {
  position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; visibility: hidden;
}
.anchor { visibility: visible; }

html.motion .scene { height: calc(var(--len) * 1vh); height: calc(var(--len) * 1svh); }
html.motion .stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
}
html.motion .panel {
  opacity: 0; will-change: opacity, transform;
}
html.motion .panel:not(.is-on) { pointer-events: none; }

html:not(.motion) .stage { position: relative; padding: 130px 0 96px; }
html:not(.motion) .panel + .panel { margin-top: 88px; }

.scene-title {
  font-family: var(--serif); font-weight: 680;
  font-size: clamp(34px, 4.3vw, 62px); line-height: .98; letter-spacing: -0.045em;
  max-width: 15ch; text-wrap: balance;
}
.panel p { max-width: 46ch; margin-top: 18px; color: var(--fg-2); font-size: 17px; line-height: 1.6; }
.panel .fine { margin-top: 16px; color: var(--fg-3); font-size: 14.5px; }
.panel-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: 26px; }
.home .link-arrow {
  color: var(--fg); font-size: 15px; font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--hair-2); text-underline-offset: 4px;
}
.home .link-arrow:hover { text-decoration-color: currentColor; }

/* Buttons that follow the tone of the world they sit in. */
.btn-glow { background: var(--btn-bg); color: var(--btn-fg); }
.btn-glow:hover { background: var(--btn-bg); filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--hair-2); }
.btn-ghost:hover { background: var(--hair); }
.home .btn svg { width: 16px; height: 16px; }

/* ---------- Scene 1: the signal ---------- */

html.motion .scene-signal .stage { display: flex; align-items: center; }
.signal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html:not(.motion) .signal-canvas { height: 100vh; height: 100svh; }
html:not(.motion) .scene-signal { background: #120f2e; }

.scene-signal .panel {
  position: absolute; left: max(24px, calc((100vw - 1200px) / 2 + 24px)); top: calc(50% + 40px);
  width: min(460px, calc(100vw - 48px)); transform: translateY(-50%);
}
html:not(.motion) .scene-signal .panel { position: relative; left: auto; top: auto; transform: none; margin-left: max(24px, calc((100vw - 1200px) / 2 + 24px)); }

.panel-hero { width: min(980px, calc(100vw - 48px)) !important; }
/* The category, stated plainly for readers and search engines; the slogan
   below it carries the page's voice. */
.hero-kind {
  margin: 0 0 18px; font-family: var(--sans); font-size: 15px; font-weight: 500;
  letter-spacing: 0; line-height: 1.4; color: var(--fg-2);
}
.hero-title, .panel .hero-title {
  margin: 0; max-width: none; color: var(--fg);
  font-family: var(--serif); font-weight: 720;
  font-size: clamp(46px, min(8.2vw, 11.5vh), 148px); line-height: .88; letter-spacing: -0.058em;
}
.hero-title > span { display: block; }
.hero-lead { max-width: 44ch !important; margin-top: 26px !important; font-size: clamp(17px, 1.5vw, 19px) !important; color: var(--fg-2); }
.panel-hero .btn-row { justify-content: flex-start; margin-top: 30px; gap: 10px; }
.panel-hero .hero-note { color: var(--fg-3); font-size: 13.5px; margin-top: 14px; }
.hero-fine { margin-top: 14px !important; font-size: 12.5px !important; color: var(--fg-3) !important; }
.scroll-cue {
  display: flex !important; align-items: center; gap: 12px;
  margin-top: 22px !important; font-size: 13px !important; color: var(--fg-3) !important;
}
.scroll-cue-line { position: relative; width: 1px; height: 38px; background: var(--hair-2); overflow: hidden; }
.scroll-cue-line::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--fg);
}
html:not(.motion) .scroll-cue { display: none !important; }

.facts { margin: 26px 0 0; padding: 0; list-style: none; display: grid; }
.facts li { padding: 14px 0; border-top: 1px solid var(--hair); color: var(--fg-2); font-size: 15px; line-height: 1.55; max-width: 46ch; }
.facts b { color: var(--fg); font-weight: 600; }
.facts .mic-ink { color: var(--mic); }
.facts .sys-ink { color: var(--sys); }

/* One-line captions that carry the story across the stretches where the
   illustration is doing the work. */
.panel-caption {
  width: min(560px, calc(100vw - 48px)) !important; margin: 0 !important;
  font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px) !important; font-weight: 600;
  line-height: 1.2 !important; letter-spacing: -0.03em; color: var(--fg) !important;
}
html:not(.motion) .panel-caption { display: none; }

/* The page's one orchestrated entrance: the headline lines rise out of blur. */
@media (prefers-reduced-motion: no-preference) {
  html.motion .hero-title > span { animation: rise 1.1s cubic-bezier(.2, .7, .1, 1) both; }
  html.motion .hero-title > span:nth-child(2) { animation-delay: .14s; }
  html.motion .hero-title > span:nth-child(3) { animation-delay: .28s; }
  html.motion .panel-hero > :not(.hero-title) { animation: fadeIn .9s ease .55s both; }
  html.motion .scroll-cue-line::after { animation: cue 2.2s cubic-bezier(.6, 0, .3, 1) infinite 1.4s; }
}
@keyframes rise { from { opacity: 0; filter: blur(14px); transform: translateY(.28em); } to { opacity: 1; filter: none; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cue { from { top: -40%; } to { top: 100%; } }

/* ---------- Scene 2: paper ---------- */

html:not(.motion) .scene-paper { background: #edf5f7; }
.paper-layout {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 64px; align-items: center;
  max-width: 1200px; height: 100%; margin: 0 auto; padding: 96px 24px 40px;
}
html:not(.motion) .paper-layout { height: auto; padding-top: 0; }
.paper-copy { position: relative; display: grid; }
html.motion .paper-copy > .panel { grid-area: 1 / 1; }

.desk { position: relative; padding-bottom: 70px; }
.sheet {
  position: relative; background: #fff; color: #111020;
  border: 1px solid #cdd6e1; border-radius: 14px;
  box-shadow: 0 40px 90px -30px rgba(6, 63, 43, 0.35), 0 2px 0 rgba(17, 16, 32, 0.03);
  transform-origin: 50% 100%;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid #e3e8ee;
}
.sheet-head b { font-family: var(--serif); font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.sheet-head span { font-family: var(--mono); font-size: 11.5px; color: #596779; }
.turns { margin: 0; padding: 8px 22px 12px; }
.turn { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid #eef1f5; }
.turn:last-child { border-bottom: 0; }
.turn dt { display: grid; align-content: start; gap: 3px; }
.who { font-size: 13px; font-weight: 600; color: #7138ed; min-height: 20px; white-space: nowrap; }
.who.is-empty::before {
  content: "Add name"; display: inline-block; padding: 0 6px; border: 1px dashed #b7c1cf; border-radius: 4px;
  color: #8793a6; font-weight: 400; font-size: 12px;
}
.who.is-typing::after {
  content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px;
  background: currentColor; animation: caret 1s steps(1) infinite;
}
.turn time { font-family: var(--mono); font-size: 11px; color: #596779; }
.sheet-caption { padding: 0 22px 16px; font-size: 12px; color: #596779; }
.finder-os { font-size: 11.5px; font-weight: 600; color: #596779; white-space: nowrap; }
.panel .tiers { margin-top: 16px; font-size: 15px; font-weight: 500; color: var(--fg); }
.hero-fine a { color: inherit; }
.turn dd { margin: 0; font-size: 15.5px; line-height: 1.55; color: #243042; }

.notes {
  position: absolute; right: -56px; bottom: -48px; width: min(340px, 78%);
  padding: 18px 20px 20px; border-radius: 12px;
  background: #fbfbe6; color: #111020; border: 1px solid #d4d9b9;
  box-shadow: 0 30px 60px -24px rgba(41, 80, 58, 0.45);
  transform: rotate(-1.6deg);
}
html:not(.motion) .notes { position: relative; right: auto; bottom: auto; width: auto; margin-top: 18px; transform: none; }
.notes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.notes-head b { font-family: var(--serif); font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.notes-head span { font-family: var(--mono); font-size: 11px; color: #5d6b45; }
.notes-text { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: #29313d; min-height: 4.6em; }
.notes-text.is-typing::after {
  content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px;
  background: #29313d; animation: caret 1s steps(1) infinite;
}
.notes-actions { display: flex; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 6px;
  border: 1px solid #c9ceb0; font-size: 12.5px; font-weight: 500; color: #29313d; background: #fff;
  transition: background .2s, color .2s, transform .2s;
}
.chip.is-pressed { background: #10101f; color: #fff; border-color: #10101f; transform: scale(.97); }
.notes-copied {
  margin-top: 12px; padding: 9px 12px; border-radius: 8px;
  background: #063f2b; color: #e6f0e9; font-size: 12.5px; line-height: 1.45;
}
.notes-copied b { color: #f0efa9; font-weight: 600; }
html.motion .notes-copied { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
html.motion .notes-copied.on { opacity: 1; transform: none; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Scene 3: the folder ---------- */

html:not(.motion) .scene-folder { background: #e5eff2; }
.folder-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center;
  max-width: 1200px; height: 100%; margin: 0 auto; padding: 96px 24px 40px;
}
html:not(.motion) .folder-layout { height: auto; padding-top: 0; }
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 30px; border-top: 1px solid var(--hair); }
.tally div { padding: 16px 14px 0 0; }
.tally b { display: block; font-family: var(--serif); font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -0.05em; }
.tally span { display: block; margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: var(--fg-3); }

.finder {
  background: #fff; color: #111020; border: 1px solid #cdd6e1; border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 90px -36px rgba(17, 16, 32, 0.35);
}
.finder-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #f4f8fa; border-bottom: 1px solid #e3e8ee; }
.finder-dots { display: flex; gap: 6px; }
.finder-dots i { width: 10px; height: 10px; border-radius: 50%; background: #d5dce5; }
.finder-bar code { font-family: var(--mono); font-size: 11.5px; color: #354052; }
.files { margin: 0; padding: 10px; list-style: none; display: grid; gap: 2px; }
.file {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px; border-radius: 8px;
  font-family: var(--mono); font-size: 14px; color: #111020;
}
.file-icon {
  width: 34px; height: 26px; border-radius: 5px; flex: none; background: #edf1f5;
  background-image: repeating-linear-gradient(90deg, var(--c, #8a97aa) 0 2px, transparent 2px 5px);
  -webkit-mask: linear-gradient(#000 0 0) center / 100% 100%, radial-gradient(#000 0 0);
  clip-path: polygon(0 40%, 12% 20%, 25% 55%, 37% 10%, 50% 45%, 62% 25%, 75% 60%, 87% 15%, 100% 40%, 100% 100%, 0 100%);
}
.file.is-mic .file-icon { --c: #7138ed; }
.file.is-sys .file-icon { --c: #087e87; }
.file.is-mix .file-icon { --c: #10101f; }
.file.is-mic { background: #f3eeff; }
.file.is-sys { background: #e6f6f6; }
.finder-label { padding: 6px 22px 0; font-size: 12.5px; color: #596779; }
.exports { margin: 0; padding: 10px 20px 22px; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.exports li { padding: 6px 11px; border-radius: 6px; border: 1px solid #cdd6e1; font-size: 13px; color: #354052; }

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

.day-section { padding: 140px 0 120px; }
html:not(.motion) .day-section { background: #edf5f7; }
.day-heading { max-width: 760px; margin-bottom: 44px; }
.day-heading p { margin-top: 18px; max-width: 58ch; color: var(--fg-2); font-size: 17px; }
.day-heading-spaced { margin-top: 140px; }
.day-section .panel-links { margin-top: 26px; }

.versus { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--hair); }
.versus-col { padding: 34px 36px 30px; }
.versus-col h3 { font-family: var(--serif); font-size: 26px; font-weight: 680; letter-spacing: -0.03em; margin-bottom: 18px; }
.versus dl { margin: 0; display: grid; }
.versus dl div { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--row-line, var(--hair)); }
.versus dt { font-size: 14px; color: var(--row-dt, var(--fg-3)); }
.versus dd { margin: 0; font-size: 16px; font-weight: 500; }
.versus-us { background: #063f2b; color: #fff; --row-line: rgba(255, 255, 255, 0.14); --row-dt: #c8dcd3; }
.versus-us h3 { color: #f0efa9; }
.versus-them { background: rgba(255, 255, 255, 0.5); color: #354052; }
.versus-them h3 { color: #596779; }
.versus-them dd { font-weight: 400; }

.rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hair-2); }
.room { display: block; padding: 26px 28px 30px 0; text-decoration: none; color: inherit; border-right: 1px solid var(--hair); }
.room + .room { padding-left: 28px; }
.room:last-child { border-right: 0; }
.room h3 { font-family: var(--serif); font-size: 23px; font-weight: 680; letter-spacing: -0.03em; }
.room p { margin-top: 10px; color: var(--fg-2); font-size: 15px; }
.room h3::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 10px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, 2px); transition: transform .2s ease; vertical-align: 3px; }
.room:hover h3::after { transform: rotate(45deg) translate(1px, -1px); }

/* ---------- Scene 4: the years ---------- */

html:not(.motion) .scene-years { background: #2b1f55; }
html:not(.motion) .sky { display: none; }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute; left: 50%; top: 0; width: min(22vmin, 220px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #fff6d6 0%, #ffd98a 38%, #f59a6a 70%, rgba(245, 154, 106, 0) 71%);
  box-shadow: 0 0 120px 40px rgba(255, 190, 120, calc(0.35 * (1 - var(--sun, 0))));
  transform: translate(-50%, calc(10vh + var(--sun, 0) * 66vh));
  opacity: calc(1 - var(--sun, 0) * 0.35);
}
.horizon {
  position: absolute; left: 0; right: 0; top: 70%; bottom: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--world) 78%, #000 22%), color-mix(in srgb, var(--world) 94%, #000 6%) 60%, var(--world));
  box-shadow: 0 -1px 0 rgba(255, 230, 190, 0.3), 0 -30px 60px -20px rgba(255, 200, 150, calc(0.35 * (1 - var(--sun, 0))));
}
.stars {
  position: absolute; inset: 0 0 30% 0; opacity: var(--stars, 0);
  background-image:
    radial-gradient(1.4px 1.4px at 32% 41%, #fff 50%, transparent 51%),
    radial-gradient(2.6px 2.6px at 94% 53%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 21% 14%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 4% 54%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 9% 31%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 37% 25%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 35% 30%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 84% 36%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 26% 24%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 39% 50%, #fff 50%, transparent 51%),
    radial-gradient(2.6px 2.6px at 79% 46%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 66% 34%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 33% 63%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 13% 41%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 39% 42%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 54% 57%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 57% 60%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 31% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 7% 13%, #fff 50%, transparent 51%),
    radial-gradient(2.6px 2.6px at 61% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 91% 46%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 88% 28%, #fff 50%, transparent 51%),
    radial-gradient(2.6px 2.6px at 54% 28%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 37% 26%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 57% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 43% 15%, #fff 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 92% 32%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 76% 33%, #fff 50%, transparent 51%);
}
.years-layout {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) min(22vmin, 220px) minmax(0, 1fr); gap: 0; align-items: center;
  max-width: 1200px; height: 100%; margin: 0 auto; padding: 96px 24px 40px;
}
html:not(.motion) .years-layout { height: auto; padding-top: 0; }
.years-layout > .panel, .meter {
  padding: 30px 32px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.years-layout .btn-ghost { min-height: 42px; }
.years-layout > .meter { grid-column: 3; }
.meter-readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.meter-readouts span { display: block; font-size: 13px; color: var(--fg-3); }
.meter-readouts b { display: block; margin-top: 6px; font-family: var(--sans); font-size: clamp(34px, 4vw, 56px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ledger-years { margin: 28px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--hair-2); }
.ledger-years li { padding: 14px 10px 0 0; }
.ledger-years b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 700; letter-spacing: -0.04em; }
.ledger-years span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--fg-3); }

/* ---------- Night: questions ---------- */

.night-section { padding: 140px 0 100px; }
html:not(.motion) .night-section { background: #120f2e; }
.night-faq { display: grid; grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
.night-help { margin-top: 22px; color: var(--fg-2); }
.home .night-section .faq { max-width: none; margin: 0; gap: 0; }
.home .night-section .faq details { background: transparent; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; padding: 0; }
.home .night-section .faq summary { color: var(--fg); font-size: 17px; padding: 20px 0; }
.home .night-section .faq summary::after { color: var(--fg-3); }
.home .night-section .faq details > p { color: var(--fg-2); }

/* ---------- Finale ---------- */

.finale { position: relative; min-height: 88vh; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 120px 0; }
html:not(.motion) .finale { background: #120f2e; }
.finale-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.finale-inner { position: relative; }
.finale-title {
  font-family: var(--serif); font-weight: 720; font-size: clamp(48px, 8.4vw, 132px);
  line-height: .9; letter-spacing: -0.058em; max-width: 12ch; margin: 0 auto; text-wrap: balance;
}
.finale p { max-width: 50ch; margin: 26px auto 0; color: var(--fg-2); font-size: 17.5px; }
.finale .btn-row { justify-content: center; }
.finale .finale-family { margin-top: 24px; font-size: 13.5px; color: var(--fg-3); }

/* ---------- Footer at night ---------- */

.home .footer { background: #0c0a22; border-top-color: rgba(255, 255, 255, 0.1); color: #f5f3ff; }
.home .footer h4 { color: #8f8bb0; }
.home .footer-col a, .home .footer-tagline, .home .footer-bottom { color: #c4c0de; }
.home .footer-col a:hover { color: #fff; }
.home .footer-bottom { border-top-color: rgba(255, 255, 255, 0.1); }
.home .footer :focus-visible { outline-color: #f0efa9; }

/* ---------- Narrow screens ---------- */

@media (max-width: 1100px) {
  .ledger-years { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  html.motion .notes { right: -18px; bottom: -8px; }
}

@media (max-width: 900px) {
  .paper-layout, .folder-layout, .years-layout { grid-template-columns: 1fr; gap: 26px; align-content: center; padding-top: 88px; }
  .years-layout > .meter { grid-column: auto; }
  .sun { left: 78%; }
  .night-faq { grid-template-columns: 1fr; gap: 28px; }
  .versus { grid-template-columns: 1fr; }
  .rooms { grid-template-columns: 1fr; }
  .room, .room + .room { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--hair); }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .scene-signal .panel { top: 104px; transform: none; }
  html.motion .scene-signal .panel { transform: none; }
  .scene-title { font-size: clamp(30px, 8.4vw, 44px); }
  .panel p { font-size: 15.5px; margin-top: 12px; }
  .panel .fine { font-size: 13.5px; }
  .facts { margin-top: 14px; }
  .facts li { padding: 9px 0; font-size: 13.5px; }
  .hero-lead { margin-top: 20px !important; }
  .scroll-cue { display: none !important; }
  .hero-fine { margin-top: 12px !important; }

  /* Pinned scenes must fit one phone screen, so the illustrations shrink and
     the copy keeps only what carries the chapter. */
  html.motion .paper-layout { gap: 18px; padding: 84px 18px 20px; align-content: start; }
  html.motion .desk { padding-bottom: 0; }
  html.motion .turns { padding: 2px 14px 6px; }
  html.motion .turn { grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
  .who.is-empty::before { font-size: 11px; padding: 0 4px; }
  .finder-dots { display: none; }
  html.motion .turn dd { font-size: 13px; }
  html.motion .sheet-head { padding: 10px 14px; }
  html.motion .notes { right: -6px; bottom: auto; top: 58%; width: 84%; padding: 14px 16px; }
  html.motion .notes-text { font-size: 13px; min-height: 0; }
  html.motion .folder-layout { gap: 18px; padding: 84px 18px 20px; align-content: start; }
  html.motion .tally { margin-top: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html.motion .tally b { font-size: 30px; }
  html.motion .tally span { font-size: 11px; }
  html.motion .file { padding: 8px 10px; font-size: 12.5px; }
  html.motion .exports { padding: 6px 14px 14px; }
  html.motion .years-layout { gap: 16px; padding: 84px 18px 20px; align-content: start; }
  html.motion .years-layout > .panel, html.motion .meter { padding: 20px 20px; }
  .ledger-years { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 6px; margin-top: 18px; }
  .ledger-years b { font-size: 21px; }
  .ledger-years span { font-size: 11px; }
  .day-section { padding: 96px 0 80px; }
  .day-heading-spaced { margin-top: 90px; }
  .versus-col { padding: 26px 22px; }
}

@media (max-width: 380px) {
  .panel .hero-title { font-size: 48px; }
  html.motion .scene-paper .panel p:not(.panel-links):not(:first-of-type) { display: none; }
}

/* Captions sit above the Stop button and the processor, not on them. */
@media (min-width: 821px) { .scene-signal .panel-caption { top: 30%; } }

/* Short laptop screens: the hero has to fit below the nav in one view. */
@media (min-width: 821px) and (max-height: 820px) {
  .scroll-cue { display: none !important; }
  .panel .hero-title { font-size: clamp(44px, min(8vw, 10vh), 120px); }
  .hero-lead { margin-top: 18px !important; }
  .panel-hero .btn-row { margin-top: 20px; }
  .hero-kind { margin-bottom: 12px; }
}

/* Phones: only the first scene pins. The transcript, folder and price scenes
   flow as ordinary sections, so their copy and illustrations never share a
   screen they don't fit on. home.js drives their animations per element. */
@media (max-width: 820px) {
  html.motion .scene-paper, html.motion .scene-folder, html.motion .scene-years { height: auto; }
  html.motion .scene-paper .stage, html.motion .scene-folder .stage, html.motion .scene-years .stage {
    position: relative; height: auto; overflow: hidden;
  }
  html.motion .scene-paper .panel, html.motion .scene-folder .panel, html.motion .scene-years .panel {
    opacity: 1 !important; transform: none !important; pointer-events: auto;
  }
  html.motion .paper-layout, html.motion .folder-layout, html.motion .years-layout {
    height: auto; padding: 72px 18px 64px; gap: 28px; align-content: start;
  }
  /* Transcript copy, the sheet, the notes copy, then the notes card. */
  html.motion .paper-copy, html.motion .desk { display: contents; }
  html.motion .paper-copy > .panel:first-child { order: 1; }
  html.motion .sheet { order: 2; }
  html.motion .paper-copy > .panel:last-child { order: 3; margin-top: 20px; }
  html.motion .notes { order: 4; position: relative; right: auto; top: auto; bottom: auto; width: auto; margin: 0 4px; }
  html.motion .turns { padding: 4px 16px 8px; }
  html.motion .turn { grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 10px 0; }
  html.motion .turn dd { font-size: 14px; }
  html.motion .notes-text { font-size: 14px; min-height: 4.6em; }
  html.motion .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.motion .tally b { font-size: 36px; }
  html.motion .tally span { font-size: 12px; }
  html.motion .file { padding: 10px 12px; font-size: 13px; }
  html.motion .years-layout > .panel, html.motion .meter { padding: 24px 22px; }
}

/* Short phones: the hero has to fit one screen above the fold. */
@media (max-width: 820px) and (max-height: 760px) {
  .scene-signal .panel { top: 90px; }
  .panel .hero-title { font-size: 40px; }
  .hero-kind { font-size: 13px; margin-bottom: 10px; }
  .hero-lead { font-size: 15px !important; margin-top: 14px !important; }
  .panel-hero .btn-row { margin-top: 16px; gap: 8px; }
  .panel-hero .btn { min-height: 42px; padding: 10px 15px; font-size: 14px; }
  .panel-hero .hero-note { font-size: 12px; margin-top: 10px; }
  .hero-fine { font-size: 11.5px !important; }
  .scene-signal .scene-title { font-size: 28px; }
  .scene-signal .panel p:not(.hero-title) { font-size: 14px; margin-top: 10px; }
  .facts li { padding: 6px 0; font-size: 12.5px; }
}
