/* ==========================================================================
   Richmailing — styles.css
   Instrument Serif headlines, Geist UI/body, Geist Mono code (self-hosted).
   Themes: light default; [data-theme="dark"], or system dark when nothing is stored.
   Motion: continuous while in view ([data-live].is-live), paused off-screen,
   transform/opacity/clip-path only; prefers-reduced-motion renders final states.
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-normal-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-normal-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-italic-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-italic-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("assets/fonts/geist-normal-400-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("assets/fonts/geist-normal-400-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/geistmono-normal-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/geistmono-normal-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Fallback"; src: local("Arial"); ascent-override: 95.94%; descent-override: 28.16%; line-gap-override: 0%; size-adjust: 104.76%; }
@font-face { font-family: "Instrument Fallback"; src: local("Times New Roman"), local("Times"); ascent-override: 88%; descent-override: 22%; line-gap-override: 0%; size-adjust: 92%; }

/* ---------- Tokens ---------- */
:root {
  --ink: #12131a; --paper: #f6f5f2; --gold: #d4b483; --gold-hover: #e0c598; --indigo: #4f46e5; --indigo-deep: #4338ca;
  --bg: var(--paper); --surface: #ffffff; --surface-2: #faf9f6; --line: #e9e6df; --line-strong: #d6d2c8;
  --text: var(--ink); --text-muted: #5b5e6e; --text-soft: #7b7e8c;
  --accent: var(--indigo); --accent-hover: var(--indigo-deep); --accent-text: #4f46e5; --accent-soft: #ecebfd; --on-accent: #fff; --focus: #4f46e5;
  --ok: #1b6b43; --ok-bg: #e4f3ea; --warn: #8a5a00; --warn-bg: #fbf1dc;
  --inverse-bg: var(--ink); --inverse-text: var(--paper); --inverse-muted: #b9bac6; --inverse-line: rgba(246,245,242,.14);
  --letter-fill: var(--ink); --logo-bg: var(--ink); --code-str: #a5b4fc; --mark: var(--text-muted);
  --glow: rgba(79,70,229,.10);
  --shadow-s: 0 1px 2px rgba(18,19,26,.05); --shadow-m: 0 1px 2px rgba(18,19,26,.04), 0 18px 44px -22px rgba(18,19,26,.24); --shadow-l: 0 2px 4px rgba(18,19,26,.05), 0 40px 80px -40px rgba(18,19,26,.35);
  --r-s: 6px; --r-m: 12px; --r-l: 18px;
  --font: "Geist", "Geist Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Instrument Serif", "Instrument Fallback", Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22,1,.36,1); --spring: cubic-bezier(.34,1.4,.64,1); --d-fast: 160ms; --d: 320ms; --d-slow: 640ms; --header-h: 60px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #101117; --surface: #171821; --surface-2: #1d1f2a; --line: #262836; --line-strong: #353848;
  --text: #f3f2ee; --text-muted: #a9abbb; --text-soft: #8d90a0;
  --accent-text: #a5b4fc; --accent-soft: rgba(165,180,252,.14);
  --ok: #6fcf97; --ok-bg: rgba(111,207,151,.14); --warn: #e3b65a; --warn-bg: rgba(227,182,90,.14);
  --inverse-bg: #0b0c11; --inverse-line: rgba(246,245,242,.1);
  --letter-fill: #2a2b3f; --logo-bg: #2a2b3f; --mark: var(--gold); --glow: rgba(212,180,131,.12);
  --shadow-s: 0 1px 2px rgba(0,0,0,.35); --shadow-m: 0 1px 2px rgba(0,0,0,.3), 0 18px 44px -22px rgba(0,0,0,.7); --shadow-l: 0 2px 4px rgba(0,0,0,.4), 0 40px 80px -40px rgba(0,0,0,.8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101117; --surface: #171821; --surface-2: #1d1f2a; --line: #262836; --line-strong: #353848;
    --text: #f3f2ee; --text-muted: #a9abbb; --text-soft: #8d90a0;
    --accent-text: #a5b4fc; --accent-soft: rgba(165,180,252,.14);
    --ok: #6fcf97; --ok-bg: rgba(111,207,151,.14); --warn: #e3b65a; --warn-bg: rgba(227,182,90,.14);
    --inverse-bg: #0b0c11; --inverse-line: rgba(246,245,242,.1);
    --letter-fill: #2a2b3f; --logo-bg: #2a2b3f; --mark: var(--gold); --glow: rgba(212,180,131,.12);
    --shadow-s: 0 1px 2px rgba(0,0,0,.35); --shadow-m: 0 1px 2px rgba(0,0,0,.3), 0 18px 44px -22px rgba(0,0,0,.7); --shadow-l: 0 2px 4px rgba(0,0,0,.4), 0 40px 80px -40px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a, button, summary, input { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
#main:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: var(--r-s); font-weight: 500; }
.skip-link:focus { top: 12px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic--thin { stroke-width: 1.25; }
/* Continuous animations run only while their block is in view */
[data-live]:not(.is-live) *, [data-live]:not(.is-live)::before, [data-live]:not(.is-live) *::after { animation-play-state: paused !important; }

/* ---------- Type ---------- */
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; line-height: 1; text-wrap: balance; }
h3 { font-weight: 500; font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; vertical-align: 2px; margin-left: 6px; font-size: .6875rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); border: 1px solid var(--line-strong); border-radius: 3px; padding: 1px 5px; font-family: var(--font); }
.mail { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--mono); font-size: .9375rem; color: var(--text-muted); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--line-strong); }
.mail:hover { color: var(--text); text-decoration-color: currentColor; }
.mail--inverse { color: var(--inverse-muted); text-decoration-color: var(--inverse-line); }
.mail--inverse:hover { color: var(--inverse-text); }
.mail--nav { font-size: .8125rem; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 28px; } }
@media (min-width: 1024px) { .container { padding-inline: 40px; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-s); border: 1px solid transparent; font-weight: 500; line-height: 1; white-space: nowrap; transition: background-color var(--d-fast) ease, border-color var(--d-fast) ease, color var(--d-fast) ease, transform var(--d-fast) ease; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1.0625rem; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { border-color: var(--text); color: var(--text); }
.btn--secondary:hover { background: var(--text); color: var(--bg); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-hover); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) { .site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); } }
.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; margin-right: auto; }
.brand svg { width: 26px; height: 26px; }
.lg-bg { fill: var(--logo-bg); } .lg-fg { fill: none; stroke: #f6f5f2; } .lg-dot { fill: var(--gold); }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav__list { display: flex; gap: 2px; }
.site-nav__list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; color: var(--text-muted); transition: color var(--d-fast) ease; }
.site-nav__list a:hover { color: var(--text); }
.site-nav__list a[aria-current="true"] { color: var(--text); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1.5px; }
.site-nav__actions { display: flex; align-items: center; gap: 14px; }
.tools { display: flex; align-items: center; gap: 4px; }
.lang { display: inline-flex; align-items: center; font-size: .8125rem; letter-spacing: .06em; font-weight: 500; color: var(--text-soft); }
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text-muted); }
.lang a:hover { color: var(--text); }
.lang a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1.5px; }
.theme-toggle, .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-s); color: var(--text-muted); transition: color var(--d-fast) ease, background-color var(--d-fast) ease; }
.theme-toggle:hover, .nav-toggle:hover { color: var(--text); background: var(--accent-soft); }
.theme-toggle svg, .nav-toggle svg { width: 20px; height: 20px; }
.theme-toggle svg { transition: transform .5s var(--spring); }
.theme-toggle:active svg { transform: rotate(-40deg); }
.theme-toggle .i-sun, .nav-toggle .i-close { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; } [data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
.nav-toggle { display: none; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; } .nav-toggle[aria-expanded="true"] .i-close { display: block; }
.no-js .theme-toggle { display: none; }
@media (max-width: 1099px) { .mail--nav { display: none; } }
@media (max-width: 879px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 12px; padding: 8px 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-m); }
  .site-nav.is-open { display: flex; }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__list a { min-height: 48px; font-size: .9375rem; }
  .site-nav__actions { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
  .site-nav__actions .btn { width: 100%; }
  .mail--nav { display: inline-flex; justify-content: center; }
}

/* ---------- Hero: centered type over a full-bleed live canvas ---------- */
.hero { position: relative; padding-top: clamp(28px, 3vw, 44px); overflow: hidden; }
.hero::before { content: ""; position: absolute; left: 50%; top: 42%; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--glow), transparent 62%); pointer-events: none; }
.hero__copy { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__title { font-size: clamp(2.625rem, 1rem + 4.8vw, 5.25rem); line-height: .94; letter-spacing: -0.015em; max-width: 18ch; }
.kinetic .w { display: inline-block; animation: rise .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(.35em) rotate(.5deg); } to { opacity: 1; transform: none; } }
.hero__lead { margin-top: 18px; font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); line-height: 1.5; max-width: 56ch; color: var(--text-muted); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.hero__copy .mail { margin-top: 6px; }
.hero__lead, .hero__cta, .hero__copy .mail { animation: rise .9s var(--ease) both .55s; }
.hero__cta { animation-delay: .65s; } .hero__copy .mail { animation-delay: .75s; }
.flow { position: relative; margin-top: clamp(10px, 1.5vw, 18px); height: clamp(260px, 28vw, 400px); animation: rise 1.1s var(--ease) both .4s; }
.flow__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-width: 1024px) and (max-height: 820px) {
  .hero { padding-top: 20px; }
  .hero__title { font-size: clamp(2.5rem, 1rem + 3.9vw, 4.25rem); max-width: 22ch; }
  .hero__lead { margin-top: 10px; max-width: 70ch; }
  .hero__cta { margin-top: 14px; }
  .flow { height: clamp(240px, 24vw, 330px); margin-top: 6px; }
}
.flow__tag { position: absolute; right: 16px; top: 8px; margin: 0; }
@media (min-width: 640px) { .flow__tag { right: 28px; } }
@media (min-width: 1024px) { .flow__tag { right: 40px; } }

/* Ticker (moves only while in view) */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.ticker__track { display: flex; width: max-content; align-items: center; padding-block: 14px; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--text-muted); white-space: nowrap; animation: ticker 36s linear infinite; }
.ticker__track i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin: 0 28px; flex: none; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Ink interludes ---------- */
.interlude { background: var(--inverse-bg); color: var(--inverse-text); border-block: 1px solid var(--inverse-line); padding-block: clamp(48px, 7vw, 96px); }
.interlude h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem); }
.film-grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .film-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; align-items: end; } }
.film__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: #0c0d12; border: 1px solid var(--inverse-line); cursor: pointer; }
.film__frame:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.film__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0c0d12; }
.film__glyph { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center; border-radius: 50%; background: rgba(246,245,242,.92); color: var(--ink); opacity: 1; transition: opacity var(--d) ease, transform var(--d) var(--ease); }
.film__glyph svg { width: 26px; height: 26px; margin-left: 3px; }
.film.is-playing .film__glyph { opacity: 0; transform: scale(.9); }

/* ---------- Story: rail + chapters ---------- */
.story { display: grid; }
@media (min-width: 1100px) { .story { grid-template-columns: 168px minmax(0, 1fr); column-gap: 64px; } }
.rail { display: none; }
@media (min-width: 1100px) {
  .rail { display: block; position: sticky; top: calc(var(--header-h) + 40px); align-self: start; padding-top: clamp(56px, 8vw, 104px); }
  .rail__list { position: relative; border-left: 1px solid var(--line); }
  .rail__list a { display: flex; gap: 12px; align-items: baseline; min-height: 44px; padding: 10px 0 10px 18px; font-size: .875rem; color: var(--text-muted); transition: color var(--d-fast) ease; }
  .rail__list a:hover { color: var(--text); }
  .rail__list a[aria-current="true"] { color: var(--text); font-weight: 500; }
  .rail__num { font-variant-numeric: tabular-nums; font-size: .75rem; width: 1.8em; flex: none; color: var(--mark); }
  .rail__marker { position: absolute; left: -1px; top: 0; width: 2px; height: 44px; background: var(--text); transform: translateY(var(--y, 0px)); transition: transform .5s var(--ease); }
}
.chapter { position: relative; padding-block: clamp(56px, 8vw, 104px); }
.wipe { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-strong); transform-origin: left; }
.js .wipe.reveal { opacity: 1; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.js .wipe.reveal.is-in { transform: scaleX(1); }
.chapters > .chapter:first-child .wipe { display: none; }
.chapter__head { display: grid; gap: 14px 56px; margin-bottom: clamp(28px, 5vw, 52px); }
@media (min-width: 880px) { .chapter__head { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); align-items: end; } }
.chapter__head h2 { font-size: clamp(2.25rem, 1.3rem + 3.2vw, 4rem); }
.chapter__lead { font-size: 1.125rem; color: var(--text-muted); max-width: 52ch; }
@media (min-width: 880px) { .chapter__lead { padding-bottom: 8px; } }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--font); font-size: .8125rem; font-weight: 500; color: var(--text); vertical-align: middle; transform: translateY(-.45em); margin-left: 10px; letter-spacing: 0; }
.badge::before { content: ""; width: 8px; height: 8px; background: var(--gold); border-radius: 1px; }

/* Index list */
.index { border-top: 1px solid var(--line); }
.index__item { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 32px; gap: 8px 16px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
@media (min-width: 880px) { .index__item { grid-template-columns: 4rem minmax(0, 5fr) minmax(0, 7fr) 40px; padding: 26px 0; } }
.index__num { font-family: var(--display); font-size: 1.25rem; color: var(--mark); padding-top: 2px; }
.index__item h3 { font-size: 1.25rem; }
.index__item p { color: var(--text-muted); grid-column: 2 / -1; }
@media (min-width: 880px) { .index__item p { grid-column: auto; } }
.index__icon { width: 28px; height: 28px; color: var(--text-muted); justify-self: end; grid-row: 1; grid-column: 3; transition: transform .4s var(--spring), color var(--d) ease; }
@media (min-width: 880px) { .index__icon { grid-column: 4; } }
@media (hover: hover) { .index__item:hover .index__icon { transform: translateX(-4px) rotate(-6deg); color: var(--text); } }

/* Panel (cycling feed with a cursor) */
.panelx { display: grid; gap: 24px; }
@media (min-width: 1024px) { .panelx { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; } }
.ticks { border-top: 1px solid var(--line); }
.ticks li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ticks svg { width: 20px; height: 20px; margin-top: 3px; color: var(--accent-text); }
.panelx__note { margin-top: 20px; color: var(--text-muted); }
.panel { position: relative; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-l); will-change: transform; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel__title { font-weight: 600; }
.panel__live { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-muted); white-space: nowrap; }
.pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 70%, 100% { transform: scale(1.4); opacity: 0; } }
.panel__list { display: flex; flex-direction: column; gap: 8px; }
.panel__row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); transition: opacity .35s ease, transform .4s var(--ease); }
.js .reveal:not(.is-in) .panel__row { opacity: 0; transform: translateY(10px); }
.panel__row.is-out { opacity: 0; transform: translateX(-14px); }
.panel__row.is-fresh { animation: row-in .6s var(--spring) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.panel__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.panel__dot--ok { background: var(--ok); } .panel__dot--run { background: var(--accent); } .panel__dot--wait { background: var(--warn); }
.panel__row strong { display: block; font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.panel__row .sub { display: block; font-size: .875rem; color: var(--text-muted); overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 4px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill--ok { background: var(--ok-bg); color: var(--ok); } .pill--run { background: var(--accent-soft); color: var(--accent-text); } .pill--wait { background: var(--warn-bg); color: var(--warn); } .pill--muted { background: var(--surface); color: var(--text-muted); border: 1px solid var(--line); }
.progress { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; animation: progress 5.2s var(--ease) infinite; }
@keyframes progress { 0% { transform: scaleX(.1); } 70%, 100% { transform: scaleX(.62); } }
.panel__toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-s); background: var(--inverse-bg); color: var(--inverse-text); border: 1px solid var(--inverse-line); font-size: .9375rem; font-weight: 500; opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .5s var(--spring); }
.panel__toast svg { width: 18px; height: 18px; color: var(--gold); }
.panel.show-toast .panel__toast { opacity: 1; transform: none; }
.panel__cursor { position: absolute; right: 14%; bottom: 8%; width: 22px; height: 22px; color: var(--ink); opacity: 0; pointer-events: none; }
.panel__cursor svg { width: 22px; height: 22px; }
.panel.show-cursor .panel__cursor { animation: cursor 2.4s var(--ease) 1 both; }
@keyframes cursor { 0% { opacity: 0; transform: translate(60px, 40px); } 15% { opacity: 1; } 55% { transform: translate(-8px, -6px) scale(1); } 65% { transform: translate(-8px, -6px) scale(.82); } 75% { transform: translate(-8px, -6px) scale(1); opacity: 1; } 100% { opacity: 0; transform: translate(-8px, -6px); } }

/* Railway: vertical ledger of steps with a filling track */
.railway { position: relative; max-width: 960px; }
.railway__track { position: absolute; left: 27px; top: 28px; width: 2px; height: var(--track-px, 0px); background: var(--line-strong); }
.railway__fill { position: absolute; inset: 0; background: var(--text); transform-origin: top; transform: scaleY(var(--p, 0)); }
.railway__dot { position: absolute; left: 50%; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); transform: translateY(calc(var(--p, 0) * var(--track-px, 0px))); }
.railway__dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--gold); opacity: 0; animation: pulse 2s ease-out infinite; }
.railway__steps { display: grid; gap: 28px; position: relative; }
.railway__step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 880px) { .railway__step { grid-template-columns: 56px minmax(0, 5fr) minmax(0, 7fr); gap: 28px; } .railway__step > div { display: contents; } }
.railway__num { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line-strong); font-family: var(--display); font-size: 1.5rem; transition: background-color .35s ease, border-color .35s ease, color .35s ease, transform .5s var(--spring); position: relative; z-index: 1; }
.railway__step.is-done .railway__num { background: var(--text); color: var(--bg); border-color: var(--text); transform: scale(1.06); }
.railway__step h3 { font-size: 1.375rem; padding-top: 12px; margin-bottom: 6px; }
@media (min-width: 880px) { .railway__step h3 { margin-bottom: 0; } .railway__step p { padding-top: 14px; } }
.railway__step p { color: var(--text-muted); }
.no-js .railway__track { display: none; }

/* API: typed code loop + event chips */
.api { display: grid; gap: 24px; }
@media (min-width: 1024px) { .api { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; } }
.code { background: var(--inverse-bg); color: var(--inverse-text); border: 1px solid var(--inverse-line); border-radius: var(--r-m); overflow: hidden; font-family: var(--mono); font-size: .875rem; line-height: 1.65; box-shadow: var(--shadow-l); }
.code__bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--inverse-line); font-family: var(--font); font-size: .8125rem; color: var(--inverse-muted); }
.code pre { margin: 0; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; }
.ln { display: block; clip-path: inset(0 100% 0 0); animation: type 11s steps(28, end) infinite; animation-delay: calc(var(--i, 0) * .28s); }
@keyframes type { 0% { clip-path: inset(0 100% 0 0); } 5% { clip-path: inset(0 -2% 0 0); } 88% { clip-path: inset(0 -2% 0 0); } 90%, 100% { clip-path: inset(0 100% 0 0); } }
.tok-k { color: var(--gold); } .tok-s { color: var(--code-str); } .tok-c { color: var(--inverse-muted); }
.code__resp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 18px; border-top: 1px solid var(--inverse-line); animation: resp 11s var(--ease) infinite; }
@keyframes resp { 0%, 33% { opacity: 0; transform: translateY(6px); } 38%, 88% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; transform: translateY(6px); } }
.code__status { font-family: var(--font); font-size: .8125rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: rgba(111,207,151,.16); color: #6fcf97; }
.events { display: inline-flex; gap: 6px; margin-left: auto; }
.ev { font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--inverse-line); color: var(--inverse-muted); animation: ev 11s ease infinite; animation-delay: calc(var(--i, 0) * .5s); }
@keyframes ev { 0%, 38% { opacity: .35; transform: scale(.92); } 42%, 88% { opacity: 1; transform: none; color: var(--gold); border-color: rgba(212,180,131,.5); } 92%, 100% { opacity: .35; transform: scale(.92); } }
.api__facts { border-top: 1px solid var(--line); }
.api__facts li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.api__facts svg { width: 20px; height: 20px; margin-top: 3px; color: var(--accent-text); }
.api__facts code { font-family: var(--mono); font-size: .875em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.api__note { margin-top: 20px; color: var(--text-muted); font-size: .9375rem; }

/* Packages */
.selector { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); margin-bottom: 24px; }
.selector__top { display: grid; gap: 10px 32px; }
@media (min-width: 880px) { .selector__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
.selector label { font-weight: 500; display: block; }
.selector output { display: block; font-family: var(--display); font-size: clamp(2rem, 1.2rem + 2.4vw, 3rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.selector input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.selector input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; }
.selector input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; }
.selector__facts { display: grid; gap: 12px 24px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .selector__facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .selector__facts { grid-template-columns: repeat(4, 1fr); } }
.selector__facts dt { font-size: .8125rem; color: var(--text-muted); }
.selector__facts dd { font-family: var(--display); font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.selector__contact { margin-top: 14px; color: var(--text-muted); }
.selector__contact a { color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: .15em; }
.selector__facts dd.is-text { font-family: var(--font); font-size: 1.0625rem; font-weight: 600; padding-top: 6px; }
.ledger__contact { font-weight: 600; color: var(--accent-text); text-decoration: underline; text-underline-offset: .15em; white-space: nowrap; }
.no-js .selector { display: none; }
.ledger { position: relative; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); overflow: hidden; }
.ledger__marker { position: absolute; left: 0; top: 0; width: 3px; height: var(--h, 0px); background: var(--accent); transform: translateY(var(--y, 0px)); transition: transform .5s var(--spring), height .3s ease; }
.ledger table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th { text-align: left; font-size: .8125rem; font-weight: 500; color: var(--text-muted); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ledger td { padding: 20px 16px; border-bottom: 1px solid var(--line); vertical-align: top; transition: background-color .3s ease, opacity .3s ease; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger tr.is-rec td { background: var(--accent-soft); }
.ledger tr.is-dim td { opacity: .5; }
.ledger tr.is-dim td.ledger__cta { opacity: 1; }
.ledger__name { font-weight: 600; font-size: 1.0625rem; display: block; }
.ledger__tag { display: inline-block; margin-top: 6px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--ink); color: var(--gold); padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.ledger__mail { font-family: var(--display); font-size: 1.5rem; white-space: nowrap; }
.ledger__price { font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.ledger__per { white-space: nowrap; }
.ledger__inc { color: var(--text-muted); font-size: .9375rem; max-width: 34ch; }
.ledger .btn { padding: 0 14px; }
@media (max-width: 879px) {
  .ledger thead { display: none; }
  .ledger tr { display: block; padding: 16px; border-bottom: 1px solid var(--line); transition: opacity .3s ease; }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger td { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; border: 0; }
  .ledger tr.is-rec { background: var(--accent-soft); } .ledger tr.is-rec td { background: transparent; }
  .ledger tr.is-dim td { opacity: 1; } .ledger tr.is-dim { opacity: .55; }
  .ledger td[data-label]::before { content: attr(data-label); color: var(--text-muted); font-size: .875rem; flex: none; }
  .ledger td.ledger__cta { display: block; padding-top: 12px; } .ledger td.ledger__cta .btn { width: 100%; }
  .ledger__inc { max-width: none; text-align: right; }
}
.ledger__notes { margin-top: 20px; color: var(--text-muted); display: grid; gap: 6px; max-width: 70ch; }
.ledger__notes a { color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: .15em; padding-block: 12px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); max-width: 860px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; min-height: 56px; font-size: 1.0625rem; font-weight: 500; cursor: pointer; list-style: none; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q svg { width: 22px; height: 22px; color: var(--text-muted); transition: transform var(--d) var(--spring); }
.faq__item[open] .faq__q svg { transform: rotate(180deg); }
.faq__a { padding: 0 0 22px; color: var(--text-muted); max-width: 64ch; animation: rise .4s var(--ease); }

/* CTA */
.cta__grid { display: grid; gap: 28px; }
@media (min-width: 880px) { .cta__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 56px; } }
.cta h2 { font-size: clamp(2.5rem, 1.2rem + 4vw, 4.5rem); }
.cta p { color: var(--inverse-muted); margin-top: 18px; font-size: 1.125rem; max-width: 46ch; }
.cta__aside { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 880px) { .cta__aside { align-items: flex-end; } }

/* Footer */
.site-footer { padding: 40px 0 28px; }
.site-footer__grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer .brand { margin-right: 0; }
.site-footer__tagline { margin-top: 12px; color: var(--text-muted); max-width: 40ch; }
.site-footer__title { font-family: var(--font); font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; line-height: 1.6; }
.site-footer ul { display: flex; flex-direction: column; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--text-muted); overflow-wrap: anywhere; }
.site-footer li a:hover { color: var(--text); }
.site-footer__bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--text-muted); font-size: .9375rem; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- No-JS: final states ---------- */
.no-js .ln { clip-path: none; animation: none; } .no-js .code__resp, .no-js .ev { animation: none; opacity: 1; }
.no-js .progress i { animation: none; transform: scaleX(.5); }
.no-js .railway__num { background: var(--text); color: var(--bg); border-color: var(--text); }
.no-js .panel__toast { opacity: 1; transform: none; }

/* ---------- Reduced motion: static, final readable state ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .pulse::after, .panel__cursor, .railway__dot { display: none; }
  .reveal, .panel__row { opacity: 1 !important; transform: none !important; }
  .ln { clip-path: none; animation: none; } .code__resp, .ev { animation: none; opacity: 1; transform: none; }
  .progress i { animation: none; transform: scaleX(.5); }
  .kinetic .w, .hero__lead, .hero__cta, .hero__copy .mail, .flow { animation: none; opacity: 1; transform: none; }
  .ticker__track { animation: none; }
  .wipe { transform: none !important; }
  .railway__fill { transform: none !important; }
  .railway__num { background: var(--text); color: var(--bg); border-color: var(--text); }
  .panel__toast { opacity: 1; transform: none; }
}
