:root {
  --bg: #141210;
  --bg-2: #1d1a17;
  --paper: #ece7de;
  --ink: #ece7de;
  --muted: #9a9084;
  --line: rgba(196, 176, 148, 0.18);
  --accent: #c4a574;
  --accent-deep: #c4a574;
  --gold-glow: rgba(196, 165, 116, 0.25);
  --night: #0d0b0a;
  --cream: #ece7de;
  --cream-dim: rgba(236, 231, 222, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav: 4.25rem;
  --measure: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
}
body {
  margin: 0; background: var(--bg); color: var(--ink);
  overflow-x: clip;
  font-family: "Zen Kaku Gothic New", "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem; line-height: 1.5;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, video, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: #c4a574; color: #141210; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92em; background: rgba(196,165,116,.12); padding: 0.1em 0.35em; border-radius: 4px; }

.nav { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; height: var(--nav); padding: 0 max(1.25rem, calc((100% - var(--measure)) / 2)); transition: background 0.4s var(--ease), border-color 0.4s; border-bottom: 1px solid transparent; }
.nav.is-on { background: rgba(20, 18, 16, 0.85); backdrop-filter: blur(16px); border-bottom-color: var(--line); }
.nav__brand, .nav__lab { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; letter-spacing: -0.02em; }
.nav__brand { font-family: Fraunces, "Spectral", serif; font-weight: 650; font-size: 1.2rem; }
.nav__lab { font-size: 0.92rem; color: var(--muted); }
.nav__lab:hover { color: var(--ink); }
.nav__right { display: flex; align-items: center; gap: 1rem; }
.mark { width: 1.55rem; height: 1.55rem; flex: 0 0 auto; }

/* BUY BUTTONS */
.buy { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-top: 1.6rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.35rem; border-radius: 999px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn--gumroad { background: var(--accent); color: #141210; box-shadow: 0 12px 32px rgba(196,165,116,.25); }
.btn--boosty { background: transparent; color: #f15f2c; border-color: rgba(241,95,44,.55); }
.btn--boosty:hover { background: rgba(241,95,44,.12); }
.buy__note { flex-basis: 100%; margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }
.buy--bottom { margin-top: 2.6rem; }
.buy--bottom .btn { font-size: 1.05rem; padding: 0.95rem 1.7rem; }

.hero { position: relative; min-height: 100vh; padding: calc(var(--nav) + 5vh) max(1.25rem, calc((100% - var(--measure)) / 2)) 0; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20%; background: url("media/bg-hero.webp") center / cover no-repeat; transform: translate3d(0, var(--hero-py, 0px), 0); will-change: transform; pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(20, 18, 16, 0.8), rgba(20, 18, 16, 0.88)); pointer-events: none; }
.hero__glow { position: absolute; z-index: 1; width: min(70vw, 820px); height: min(50vw, 560px); right: -8vw; top: 8vh; background: radial-gradient(closest-side, var(--gold-glow), transparent 72%); filter: blur(6px); pointer-events: none; }
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: stretch; }
.kicker { margin: 0 0 1.25rem; color: var(--accent); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.kicker a { color: inherit; text-decoration: none; }
h1, .display, .mega, .billboard__line, .quartet p, .close h2 { font-family: Fraunces, "Spectral", serif; font-optical-sizing: auto; font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; }
h1 { margin: 0; font-size: clamp(2.9rem, 6vw, 5.4rem); }
h1 span { display: block; animation: rise 1.15s var(--ease) both; }
h1 span:nth-child(2) { animation-delay: 0.08s; } h1 span:nth-child(3) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.lede { max-width: 34rem; margin: 1.8rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.5; }
.lede strong { color: var(--ink); font-weight: 700; }
.gesture-row { display: flex; flex-wrap: wrap; gap: 0.55rem 0.8rem; align-items: center; margin: 1.6rem 0 0; font-weight: 500; letter-spacing: -0.03em; }
.gesture-row span[aria-hidden="true"] { color: var(--accent); }

/* DEMO */
.demo { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.4); display: flex; flex-direction: column; height: 100%; }
.demo__bar { display: flex; gap: 0.6rem; align-items: center; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
.demo__search { flex: 1; background: #141210; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 0.55rem 0.8rem; font: inherit; font-size: 0.92rem; outline: none; }
.demo__search:focus { border-color: var(--accent); }
.demo__count { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo__wrap { position: relative; flex: 0 1 auto; min-height: 320px; aspect-ratio: 1 / 1; }
#graphDemo, #graphDemo2 { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
#graphDemo:active, #graphDemo2:active { cursor: grabbing; }
.demo__card { margin: 0.7rem 0.7rem 0; background: rgba(20,18,16,.88); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; font-size: 0.88rem; line-height: 1.45; }
.demo__card h3 { margin: 0 0 0.2rem; font-family: Fraunces, "Spectral", serif; font-size: 1.15rem; }
.demo__card .pos { display: inline-block; font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.55rem; margin-left: 0.5rem; color: var(--muted); }
.demo__card .links { color: var(--muted); }
.demo__link { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.demo__link:hover { color: var(--ink); }
.demo__hint { margin: 0; color: var(--muted); }
.demo__legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; padding: 0.65rem 0.9rem 0.85rem; color: var(--muted); font-size: 0.8rem; }
.demo__legend i { display: inline-block; width: 0.65em; height: 0.65em; border-radius: 50%; background: var(--c); margin-right: 0.3em; vertical-align: baseline; }

.chapter { padding: 8vh max(1.25rem, calc((100% - var(--measure)) / 2)) 10vh; }
.manifesto { padding-top: 0; text-align: center; }
.manifesto .display { width: fit-content; max-width: none; margin-left: auto; margin-right: auto; font-size: clamp(1.35rem, 5vw, 4.2rem); }
.manifesto .display:last-child { margin-top: -8.5vh; margin-bottom: 9vh; }
/* inverted tagline: full-bleed beige band, dark type, generous even air */
.manifesto .tag {
  display: block; width: auto; max-width: none;
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  margin-top: -0.5vh; margin-bottom: 13.5vh;
  background: var(--accent); color: #141210;
  padding: 0.6em 1rem; border-radius: 0;
}
/* BAKED TUNE v1.41 (from ?tune=1 readout) + tablet downscale */
.manifesto .display:not(.tag):not(:last-child) { margin-top: 10vh; margin-bottom: 5.5vh; }
/* centered film block, no frame: bg matches the video's own backdrop.
   --film-gap adds air around it (positive via padding so nothing collapses,
   negative pulls the film over the type). --film-size grows the layout box
   itself with compensating margins, so total footprint never moves, the film
   slides under the type when enlarged, and the adjustment layer below always
   matches the content exactly (no overflow mismatch at any scale) */
.manifesto { --film-gap: 0vh; --film-size: 1.6; --tune-adj: none; position: relative; background: #1c1c1c; }
.ambient { --w: min(34rem, 82%); position: relative; left: 50%; transform: translateX(-50%); width: calc(var(--w) * var(--film-size)); margin-top: calc(-10vh + var(--w) * (1 - var(--film-size)) / 2); margin-bottom: calc(-10vh + var(--w) * (1 - var(--film-size)) / 2); padding-block: 0; pointer-events: none; }
.ambient__stage { position: relative; aspect-ratio: 1; background: #1c1c1c; }
/* single adjustment layer over the WHOLE chapter: grades the composited
   film+surround as one, so no seam can appear anywhere (blur samples
   across every boundary). text stays above it via z-index. */
.manifesto::after { content: ""; position: absolute; inset: 0; pointer-events: none; backdrop-filter: var(--tune-adj, brightness(1.07) contrast(1.02) saturate(2)); -webkit-backdrop-filter: var(--tune-adj, brightness(1.07) contrast(1.02) saturate(2)); }
@media (max-width: 860px) {
  .manifesto { --film-size: 1.15; }
  .manifesto .tag { margin-top: 0; margin-bottom: 6vh; }
  .manifesto .display:not(.tag):not(:last-child) { margin-top: 4vh; margin-bottom: 3vh; }
  .manifesto .display:last-child { margin-top: -4vh; margin-bottom: 4vh; }
}
.ambient__vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; filter: url(#ambient-crisp); }
.ambient__vid.is-on { opacity: 1; }
/* DEV ONLY (?edit=1): click-to-edit affordances */
body.is-editing main p:hover, body.is-editing main h1:hover,
body.is-editing main h2:hover, body.is-editing main h3:hover,
body.is-editing main li:hover, body.is-editing main figcaption:hover,
body.is-editing main dt:hover, body.is-editing main dd:hover {
  outline: 1px dashed rgba(196, 165, 116, 0.7);
  outline-offset: 3px;
  cursor: text;
}
.is-live { outline: 1px solid #c4a574 !important; outline-offset: 3px; }
.edit-bar {
  position: fixed; left: 12px; bottom: 12px; z-index: 100;
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(20, 18, 16, 0.92); border: 1px solid rgba(196, 165, 116, 0.55);
  border-radius: 10px; padding: 0.5rem 0.7rem;
  font-size: 0.72rem; color: var(--ink);
}
.edit-bar button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 0.2rem 0.5rem; cursor: pointer; font-size: 0.72rem; }
.ambient-tune {
  position: fixed; right: 76px; top: 50%; transform: translateY(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 0.45rem;
  background: rgba(20, 18, 16, 0.92); border: 1px solid rgba(196, 165, 116, 0.55);
  border-radius: 10px; padding: 0.7rem 0.8rem; width: 172px; max-height: 84vh; overflow-y: auto;
  font-size: 0.68rem; color: var(--ink);
}
.ambient-tune b { font-size: 0.62rem; letter-spacing: 0.1em; color: var(--muted); margin-top: 0.2rem; }
.ambient-tune .mrows { display: flex; flex-direction: column; gap: 0.45rem; }
.ambient-tune label { display: flex; align-items: center; gap: 0.5rem; letter-spacing: 0.08em; }
.ambient-tune input { flex: 1; min-width: 0; accent-color: #c4a574; }
.ambient-tune code { font-size: 0.62rem; color: var(--muted); word-break: break-all; }
.ambient-tune button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 0.2rem; cursor: pointer; font-size: 0.68rem; }
@media (max-width: 860px) { .ambient-tune { right: 52px; } }
.manifesto > :not(.ambient) { position: relative; z-index: 1; }
.scrub { will-change: transform, opacity; }
.display { max-width: 11.5em; margin: 0 0 22vh; font-size: clamp(2.1rem, 5vw, 4.2rem); }
.display em { font-style: italic; }
.nos { list-style: none; margin: 0 0 22vh; padding: 0.2rem 0 0.2rem 1.1rem; max-width: 28rem; border-left: 1px solid var(--line); }
.nos li { padding: 0.45rem 0; color: var(--muted); font-size: clamp(1.2rem, 2.2vw, 1.7rem); letter-spacing: -0.03em; line-height: 1.25; }
.scrub.is-hot.nos { border-left-color: var(--accent); }

.story { position: relative; height: 420vh; }
.story__pin { position: sticky; top: 0; height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: var(--nav) max(1.25rem, calc((100% - var(--measure)) / 2)) 6vh; }
.beats-wrap { position: relative; }
.beats { list-style: none; margin: 0; padding: 0 0 0 1.4rem; }
.beats li { margin: 0; padding: 0.42rem 0; color: rgba(236,231,222,.25); font-family: Fraunces, "Spectral", serif; font-size: clamp(1.5rem, 2.8vw, 2.4rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.12; transition: color 0.55s var(--ease); }
.beats li.is-past { color: rgba(236,231,222,.5); }
.beats li.is-on { color: var(--ink); }
.dot { display: inline-block; width: 0.42em; height: 0.42em; margin-right: 0.28em; border-radius: 50%; background: #e81123; opacity: 0; vertical-align: 0.05em; transition: opacity .4s; }
.is-on .dot { opacity: 1; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(232,17,35,0); } 100% { box-shadow: 0 0 0 0 rgba(232,17,35,0); } }
.rail { position: absolute; left: 0; top: 0.4rem; bottom: 0.4rem; width: 1px; background: var(--line); }
.rail span { display: block; width: 100%; height: 0; background: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.media { margin: 0; }
.media figcaption { margin-top: 0.85rem; color: var(--muted); font-size: 0.92rem; }
.media--stack .media__slide { display: none; min-width: 0; }
.media--stack { min-width: 0; }
.media--stack .media__slide.is-on { display: block; animation: slidein .5s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.media--night .media__stage { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)), #141210; }
.story__pin--split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); }
/* stronger than .story--night .story__pin (flex) so the night split stays 2-col */
.story.story--night .story__pin--split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); align-items: center; gap: clamp(1.5rem, 4vw, 4.5rem); }
.media__stage { position: relative; border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), var(--bg-2); border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0,0,0,.35); overflow: hidden; aspect-ratio: var(--ratio, 4 / 5); }
.media__stage img, .media__stage video { width: 100%; height: 100%; object-fit: cover; }
.media__empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.15rem 1.2rem; }
.media__stage.has-file .media__empty,
.media__stage.has-file .media__visual { display: none; }
.media__visual { position: absolute; inset: 0; display: grid; place-items: center; padding: 12% 10% 22%; }
.kind { display: inline-flex; align-self: flex-start; margin-bottom: 0.45rem; padding: 0.2rem 0.5rem; border-radius: 999px; background: var(--accent); color: #141210; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; }
.file { font-family: ui-monospace, monospace; font-size: 0.9rem; }
.spec, .note { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.35; }
.ants { width: min(100%, 280px); height: auto; }

.quote { padding: 22vh max(1.25rem, calc((100% - 980px) / 2)); text-align: center; }
.quote p { margin: 0 auto; max-width: none; font-size: clamp(1.4rem, 4.6vw, 3.9rem); }
.billboard { background: var(--accent); color: #141210; padding: 24vh max(1.25rem, calc((100% - 980px) / 2)); text-align: center; }
.billboard .kicker { color: #141210; }
.billboard__line { margin: 0.6rem auto 0; max-width: 11em; font-size: clamp(1.8rem, 5.4vw, 4.8rem); font-style: italic; font-weight: 520; }
/* source: square table of the 1000 most frequent hanzi */
.source { text-align: center; position: relative; }
.source .display, .source .prose { margin-inline: auto; }
.source > :not(.hanzi):not(canvas) { position: relative; z-index: 1; }
.source > canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.source .display { margin-bottom: 5vh; }
.source .prose { margin-top: 12vh; }
.cloth-cap { margin: 5vh auto 0; font-size: 0.75rem; letter-spacing: 0.04em; opacity: 0.3; }
.cloth-cap a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.hanzi { display: grid; grid-template-columns: repeat(25, 1fr); gap: 2px; width: min(100%, 34rem); aspect-ratio: 25 / 39; margin: 2.5rem auto 0; }
.hanzi span { display: grid; place-items: center; font-family: "Noto Serif SC", serif; font-size: clamp(0.7rem, 2.6vw, 1.15rem); line-height: 1; color: var(--ink); }
/* standalone beige band (numbers legend moved out of the night story) */
.band { background: var(--accent); color: #141210; text-align: center; padding: 12vh max(1.25rem, calc((100% - var(--measure)) / 2)); }
.band p { margin: 0 auto; max-width: none; font-family: Fraunces, "Spectral", serif; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; font-size: clamp(1.8rem, 4.6vw, 3.6rem); }

.story--night { background: linear-gradient(rgba(13, 11, 10, 0.8), rgba(13, 11, 10, 0.87)), url("media/bg-night.webp") center / cover no-repeat; border-top: 1px solid var(--line); height: 320vh; }
.story--night .story__pin { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0.4rem; }
.story--night .kicker { color: var(--accent); margin-bottom: 0.4rem; }
.count { margin: 0; color: var(--cream-dim); letter-spacing: 0.14em; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.mega { margin: 0; font-size: clamp(4.4rem, 15vw, 11rem); }
.mega.swap { animation: swap 0.7s var(--ease); }
@keyframes swap { from { opacity: 0.2; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.mega-sub { margin: 0.2rem auto 0; max-width: 18em; color: var(--cream-dim); font-size: clamp(1.2rem, 2.2vw, 1.7rem); letter-spacing: -0.03em; }
.story--night .story__pin--split > div:first-child { text-align: center; }
.story--night .mega { width: fit-content; margin-inline: auto; }
.words-static { display: none; margin: 1rem 0 0; padding: 0; list-style: none; font-family: Fraunces, "Spectral", serif; font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.25; }
.quartet { background: var(--night); border-bottom: 1px solid var(--line); padding: 8vh max(1.25rem, calc((100% - var(--measure)) / 2)) 20vh; }
.quartet p { margin: 0; max-width: 12em; font-size: clamp(2.2rem, 5.6vw, 4.6rem); }

.versus { background: linear-gradient(rgba(20, 18, 16, 0.86), rgba(20, 18, 16, 0.92)), url("media/bg-billboard.webp") center / cover no-repeat; }
.versus .display { margin-bottom: 1rem; }
.versus .prose, .prose { max-width: 36rem; margin: 0; color: var(--muted); font-size: 1.1rem; }
.vtable { border-top: 1px solid var(--line); max-width: 60rem; margin-top: 2rem; }
.vrow { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 1rem; align-items: baseline; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.vrow span:first-child { color: var(--muted); font-size: 0.95rem; }
.vrow--head span { font-family: Fraunces, "Spectral", serif; font-size: 1.2rem; font-weight: 600; }
.vrow--head span:nth-child(2) { color: var(--accent); }

.interface { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.close .interface { align-items: stretch; }
.interface .display { margin-bottom: 1rem; }
.modes__head { margin-bottom: 2rem; } .modes__head .display { margin-bottom: 0.6rem; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.audio-line { display: flex; flex-wrap: wrap; gap: 0.4rem 0.3rem; margin: 2.4rem 0 0; padding: 0; list-style: none; font-family: Fraunces, "Spectral", serif; font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: -0.03em; }
.audio-line li:not(:last-child)::after { content: "·"; color: var(--accent); margin-left: 0.35rem; }
.film .display { margin-bottom: 1.4rem; }
.play { width: 4.2rem; height: 4.2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(236,231,222,.85); }
.play svg { width: 1rem; margin-left: 0.15rem; }

.close { padding-top: 16vh; padding-bottom: 24vh;
  background: linear-gradient(rgba(20, 18, 16, 0.82), rgba(20, 18, 16, 0.9)), url("media/bg-billboard.webp") center / cover no-repeat; }
.close h2 { margin: 0; max-width: 12em; font-size: clamp(1.8rem, 4.4vw, 3rem); }
.close h2 span { display: block; }
.close .after { margin: 2rem 0 0; max-width: 20em; color: var(--muted); font-size: 1.15rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 2.5rem auto 0; padding: 0; max-width: 46rem; }
.facts-block .facts { margin: 0 auto; }
.facts-block .kicker { text-align: center; }
.facts div { background: var(--bg-2); padding: 1rem 1.2rem; }
.facts dt { color: var(--accent); font-size: 0.78rem; letter-spacing: .12em; text-transform: uppercase; }
.facts dd { margin: 0.3rem 0 0; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding: 1.5rem max(1.25rem, calc((100% - var(--measure)) / 2)) 2.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.footer a { color: var(--accent); text-decoration: none; }
.footer__love { margin: 0; }

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero { padding-bottom: 8vh; }
  .demo__wrap { min-height: 260px; }
  .hero .demo, .close .demo { width: min(70%, 32rem); margin-right: auto; }
}
@media (max-width: 860px) {
  .story { height: 360vh; }
  .story__pin, .story__pin--split, .story--night .story__pin--split, .interface, .mode-grid { grid-template-columns: 1fr; }
  .story__pin { align-content: center; }
  .story__pin .media__stage { max-height: 34vh; aspect-ratio: 16 / 10; }
  .vrow { grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; }
  .vrow > span:first-child { grid-column: 1 / -1; }
  .vrow > span:nth-child(2)::before,
  .vrow > span:nth-child(3)::before { display: block; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.1rem; }
  .vrow > span:nth-child(2)::before { content: "WordWeb"; }
  .vrow > span:nth-child(3)::before { content: "Обычный"; }
  .vrow--head { display: none; }
  .facts { grid-template-columns: 1fr; }
  .display { margin-bottom: 14vh; }
}

/* ===== Section scrubber (ported from Vacancy filter). Desktop only. ===== */
#section-scrubber {
  position: fixed;
  right: 0;
  top: 25%;
  height: 50%;
  z-index: 60;
  width: 64px;
  --track-cx: 23px; /* track center from right edge: ticks + thumb align here */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: ns-resize;
  pointer-events: auto;
}
#section-scrubber[hidden] { display: none !important; }
#section-scrubber::before {
  content: "";
  position: absolute;
  right: 22px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: rgba(196, 165, 116, 0.25);
  pointer-events: none;
}
#section-scrubber .scrub-tick {
  position: absolute;
  right: calc(var(--track-cx) - 3.5px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(196, 165, 116, 0.5);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transform: translateY(-50%) scale(var(--scrub-scale, 1));
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
  pointer-events: none;
}
#section-scrubber .scrub-tick.is-near {
  background: rgba(196, 165, 116, 0.9);
  box-shadow: 0 0 5px rgba(196, 165, 116, 0.4);
  z-index: 2;
}
#section-scrubber .scrub-tick.is-active {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(196, 165, 116, 0.6);
  transform: translateY(-50%) scale(1.6);
  z-index: 2;
}
/* hovered ball never scales: the title pill must stay the same size */
#section-scrubber .scrub-tick.is-hover {
  transform: translateY(-50%) scale(1);
}
#section-scrubber .scrub-thumb {
  position: absolute;
  top: 0;
  right: calc(var(--track-cx) - 20px);
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(196, 165, 116, 0.45);
  transition: width 0.35s ease, height 0.35s ease, right 0.35s ease, box-shadow 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
#section-scrubber.is-scrubbing .scrub-thumb {
  width: 48px;
  height: 48px;
  right: calc(var(--track-cx) - 24px);
  box-shadow: 0 0 0 3px rgba(20, 18, 16, 0.55), 0 0 22px rgba(196, 165, 116, 0.7);
}
#section-scrubber .scrub-label {
  position: absolute;
  top: 0;
  right: 56px;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.92);
  border: 1px solid rgba(196, 165, 116, 0.55);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#section-scrubber .scrub-label.is-on {
  opacity: 1;
}
@media (max-width: 860px) {
  #section-scrubber { width: 44px; --track-cx: 15px; }
  #section-scrubber::before { right: 14px; }
  #section-scrubber .scrub-label { right: 38px; }
}

#scrubDebug {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 200;
  background: rgba(0, 0, 0, 0.82);
  color: #7dff9a;
  font: 11px/1.5 ui-monospace, monospace;
  padding: 6px 9px;
  border-radius: 6px;
  pointer-events: none;
  max-width: 92vw;
}

/* ===== DEV ONLY: shared autosave badge (?crop=1 / ?tune=1 / ?edit=1). ===== */
.save-badge {
  position: fixed; z-index: 100; top: 0.7rem; right: 0.7rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(20, 18, 16, 0.92); color: #ece7de;
  border: 1px solid rgba(196, 165, 116, 0.55); border-radius: 999px;
  padding: 0.5rem 0.95rem; font: 600 0.82rem "Zen Kaku Gothic New", sans-serif;
  cursor: pointer; backdrop-filter: blur(8px);
}
.save-badge.is-saving { border-color: #c4a574; }
.save-badge.is-saved { border-color: #2ecc71; color: #2ecc71; }
.save-badge .spinner {
  width: 0.85em; height: 0.85em; border-radius: 50%;
  border: 2px solid rgba(196, 165, 116, 0.35); border-top-color: #c4a574;
  animation: cropSpin 0.7s linear infinite;
}
@keyframes cropSpin { to { transform: rotate(360deg); } }
.media__stage.crop-on { outline: 1px dashed rgba(196, 165, 116, 0.6); outline-offset: -1px; touch-action: none; }
.media__stage.crop-on img { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
