/* Cascada Niagara — the curtain and the gauge.
   Abyssal gorge-teal instrument panels against mist paper; brass marks
   only the reader's live position and every gauge mark. Per-chapter
   accents and per-grade stage skins keep all eight chapters distinct. */
@font-face {
  font-family: "Syne";
  src: url("syne-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("Newsreader.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("Newsreader-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --paper: #f4efe4;
  --paper-soft: #ece5d3;
  --ink: #14202a;
  --ink-soft: #3d4c58;
  --gorge: #0a141c;
  --gorge-abyss: #060d13;
  --gorge-panel: #10222c;
  --mist: #9fc8d8;
  --mist-bright: #e8f2f5;
  --brass: #c8a24a;
  --brass-deep: #8a6410;
  --rust: #b0512c;
  --line: #d8cfb8;
  --card: #fbf8f0;
  --stage-bg: #0e1d26;
  --glow: rgba(159, 200, 216, 0.16);
  color-scheme: light;
}
html[data-theme="dark"] {
  --paper: #0d161d;
  --paper-soft: #122029;
  --ink: #e8f0f2;
  --ink-soft: #a9bdc6;
  --line: #27404c;
  --card: #122029;
  --glow: rgba(200, 162, 74, 0.10);
  color-scheme: dark;
}
/* Per-chapter accents: the same curtain, a different gauge in each room. */
.story-chapter[data-chapter="cascadele"] { --accent: #7fb6cc; --wash: rgba(127, 182, 204, 0.10); }
.story-chapter[data-chapter="tratatul"] { --accent: #c8a24a; --wash: rgba(200, 162, 74, 0.10); }
.story-chapter[data-chapter="retragerea"] { --accent: #8fb8a8; --wash: rgba(143, 184, 168, 0.10); }
.story-chapter[data-chapter="energia"] { --accent: #e0a83e; --wash: rgba(224, 168, 62, 0.10); }
.story-chapter[data-chapter="temerarii"] { --accent: #d4653c; --wash: rgba(212, 101, 60, 0.10); }
.story-chapter[data-chapter="secarea"] { --accent: #b0a48c; --wash: rgba(176, 164, 140, 0.12); }
.story-chapter[data-chapter="vapoarele"] { --accent: #6fa8c8; --wash: rgba(111, 168, 200, 0.10); }
.story-chapter[data-chapter="gheata"] { --accent: #a9cfde; --wash: rgba(169, 207, 222, 0.12); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
}
/* The chapter wash: a faint mist glow that follows the reader down. */
body::before {
  content: "";
  position: fixed; inset: 0 0 auto 0; height: 46vh;
  pointer-events: none; z-index: 0;
  background: radial-gradient(60% 100% at 30% 0%, var(--chapter-wash, transparent), transparent 70%);
}
body[data-chapter="cascadele"] { --chapter-wash: rgba(127, 182, 204, 0.14); }
body[data-chapter="tratatul"] { --chapter-wash: rgba(200, 162, 74, 0.12); }
body[data-chapter="retragerea"] { --chapter-wash: rgba(143, 184, 168, 0.12); }
body[data-chapter="energia"] { --chapter-wash: rgba(224, 168, 62, 0.12); }
body[data-chapter="temerarii"] { --chapter-wash: rgba(212, 101, 60, 0.10); }
body[data-chapter="secarea"] { --chapter-wash: rgba(176, 164, 140, 0.14); }
body[data-chapter="vapoarele"] { --chapter-wash: rgba(111, 168, 200, 0.12); }
body[data-chapter="gheata"] { --chapter-wash: rgba(169, 207, 222, 0.16); }
main, .site-header, .site-footer, .reading-rail { position: relative; z-index: 1; }
h1, h2, h3, .eyebrow, .hero-stat strong, .stage-value {
  font-family: "Syne", "Newsreader", sans-serif;
}
.shell {
  max-width: 76rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 4.5rem;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--brass); color: #101010; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--brass); color: #101010;
  padding: 0.5rem 1rem; border-radius: 0.25rem;
  font-weight: 700; z-index: 60; transition: top 0.15s ease;
}
.skip-link:focus-visible { top: 0.75rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.78rem; font-weight: 700; color: var(--brass-deep);
  margin: 0 0 0.75rem;
}
html[data-theme="dark"] .eyebrow { color: var(--brass); }
/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding-top: 0.7rem; padding-bottom: 0.7rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.wordmark {
  font-family: "Syne", sans-serif; font-weight: 800;
  text-decoration: none; font-size: 1.05rem; letter-spacing: 0.02em;
}
.wordmark-short { display: none; }
.top-jumps { display: flex; gap: 0.9rem; margin-left: auto; font-size: 0.95rem; }
.top-jumps a { text-decoration: none; border-bottom: 2px solid transparent; }
.top-jumps a[aria-current] { border-color: var(--brass); font-weight: 700; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.language-switch { display: flex; gap: 0.35rem; font-size: 0.85rem; font-weight: 700; }
.language-switch a {
  text-decoration: none; padding: 0.15rem 0.5rem;
  border: 1px solid var(--line); border-radius: 999px;
}
#theme-control, #copy-link {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; width: 2.1rem; height: 2.1rem; cursor: pointer;
  font-size: 1rem; line-height: 1;
}
/* Hero: the curtain fills the first viewport. The copy lives inside the
   media frame now, so it can never collide with the gauge strip below. */
.hero { padding: 0 0 2.5rem; }
.hero-field { margin: 0; }
.hero-media {
  position: relative; overflow: hidden;
  display: grid;
  border-radius: 0 0 1.25rem 1.25rem;
  border: 1px solid var(--line); border-top: 0;
  box-shadow: 0 2.5rem 4rem -2.5rem rgba(6, 13, 19, 0.55);
  background: var(--gorge-abyss);
}
/* The frame grows past the photograph's minimum whenever the copy runs
   tall (narrow phones, short landscape heights), so the headline can
   never clip against the rounded top edge. */
.hero-falls {
  grid-area: 1 / 1; width: 100%; height: 100%;
  min-height: clamp(30rem, 82svh, 60rem); object-fit: cover;
}
.hero-curtain {
  grid-area: 1 / 1; height: 100%;
  min-height: clamp(30rem, 82svh, 60rem);
  background: linear-gradient(180deg, var(--gorge) 0%, var(--gorge-panel) 55%, var(--mist) 130%);
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,12,17,0.32) 0%, rgba(6,12,17,0.04) 32%, rgba(6,12,17,0.18) 55%, rgba(6,12,17,0.86) 100%);
}
/* Drifting curtain threads over the photograph: pure weather, no meaning. */
.hero-threads {
  position: absolute; inset: 0; opacity: 0.5; mix-blend-mode: screen;
  background: repeating-linear-gradient(90deg,
    transparent 0 26px, rgba(200, 226, 236, 0.10) 26px 29px,
    transparent 29px 64px, rgba(200, 226, 236, 0.06) 64px 71px, transparent 71px 110px);
  -webkit-mask-image: linear-gradient(180deg, black 30%, transparent 92%);
  mask-image: linear-gradient(180deg, black 30%, transparent 92%);
}
.hero-copy {
  grid-area: 1 / 1; align-self: end; position: relative; z-index: 2;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 4rem; color: #f4f8fa;
}
.hero-copy .eyebrow { color: var(--brass); }
.hero-kicker { display: flex; align-items: center; gap: 0.75rem; }
.hero-kicker::after {
  content: ""; height: 2px; width: clamp(3rem, 12vw, 9rem);
  background: linear-gradient(90deg, var(--brass), transparent);
}
.hero-seal { color: var(--brass); font-size: 1.4rem; }
.hero-copy h1 {
  font-size: clamp(2.2rem, 5.6vw, 4.4rem); line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0.25rem 0 0.9rem; max-width: 20ch;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(6, 12, 17, 0.75), 0 1px 3px rgba(6, 12, 17, 0.9);
}
.deck {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem); max-width: 62ch; margin: 0;
  text-shadow: 0 1px 10px rgba(6, 12, 17, 0.8);
}
.hero-cold-open {
  max-width: 62ch; margin: 0.9rem 0 0;
  font-style: italic;
  border-left: 3px solid var(--brass); padding: 0.6rem 1rem 0.6rem 0.9rem;
  background: rgba(6, 13, 19, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 0 0.5rem 0.5rem 0;
  text-shadow: 0 1px 8px rgba(6, 12, 17, 0.8);
}
/* The way down: a brass thread the reader can follow with a keypress. */
.scroll-cue {
  position: absolute; right: clamp(1.25rem, 4vw, 3rem); bottom: 3.6rem;
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--mist-bright); text-decoration: none;
  font-family: "Syne", sans-serif; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(6, 12, 17, 0.9);
}
.scroll-cue .cue-line {
  display: block; width: 2px; height: 2.6rem;
  background: linear-gradient(var(--brass), transparent);
}
.hero-stats {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem; padding: 0 clamp(1.25rem, 4vw, 3rem);
  margin-top: -2.75rem;
}
.hero-stat {
  background: linear-gradient(165deg, #16303d 0%, var(--gorge-panel) 55%, var(--gorge-abyss) 100%);
  color: var(--mist-bright);
  border-radius: 0.6rem; padding: 0.8rem 1rem;
  border: 1px solid #27404c;
  border-top: 3px solid var(--brass);
  box-shadow: 0 1.25rem 2rem -1.25rem rgba(6, 13, 19, 0.7);
  font-variant-numeric: tabular-nums;
}
.hero-stat strong { display: block; font-size: 1.35rem; letter-spacing: -0.01em; }
.hero-stat span { font-size: 0.92rem; color: var(--mist); }
.hero-caption {
  display: block; padding: 0.85rem clamp(1.25rem, 4vw, 3rem) 0;
  font-size: 0.95rem; color: var(--ink-soft);
}
/* Citations */
.citation {
  font-family: "Syne", sans-serif; font-size: 0.72rem; font-weight: 700;
  text-decoration: none; color: var(--brass-deep);
  border: 1px solid var(--brass); border-radius: 0.25rem;
  padding: 0 0.3rem; margin-left: 0.25rem; white-space: nowrap;
}
html[data-theme="dark"] .citation { color: var(--brass); }
.hero-copy .citation, .hero-stat .citation { color: var(--brass); border-color: var(--brass); }
.credit { display: block; font-size: 0.85rem; opacity: 0.85; margin-top: 0.25rem; }
/* Strand divider: five threads falling from one crest line. */
.strand { padding: 0.5rem 0; }
.strand svg { display: block; width: 100%; height: 3.5rem; overflow: visible; }
.strand-line { stroke: var(--brass); stroke-width: 3; }
.strand-flags line { opacity: 0.9; stroke-linecap: round; }
/* Chapters */
.story-chapter { padding: 2.5rem 0 1rem; scroll-margin-top: 5rem; }
.chapter-opening { position: relative; margin-bottom: 1.5rem; }
.chapter-ghost {
  position: absolute; right: 0; top: -2.2rem;
  font-family: "Syne", sans-serif; font-weight: 800;
  font-size: clamp(4rem, 10vw, 7rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 2px var(--line);
  opacity: 0.6; pointer-events: none;
}
.story-chapter[data-chapter="gheata"] .chapter-ghost {
  -webkit-text-stroke-color: var(--accent);
  opacity: 0.5;
}
.chapter-kicker { display: flex; align-items: center; gap: 0.6rem; }
.chapter-seal {
  display: inline-grid; place-items: center;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--gorge-panel); color: var(--accent, var(--brass));
  border: 1px solid var(--accent, var(--brass));
  font-size: 1.1rem; flex: none;
}
.chapter-opening h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.12; margin: 0.25rem 0 0.75rem; text-wrap: balance;
  letter-spacing: -0.01em;
}
.story-chapter[data-chapter="temerarii"] .chapter-opening h2,
.story-chapter[data-chapter="secarea"] .chapter-opening h2 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
}
.chapter-lead p { max-width: 68ch; }
.chapter-lead p:first-child::first-letter {
  font-family: "Syne", sans-serif; font-weight: 800;
  font-size: 2.6em; line-height: 0.9; float: left;
  padding: 0.08em 0.12em 0 0; color: var(--brass-deep);
}
html[data-theme="dark"] .chapter-lead p:first-child::first-letter { color: var(--brass); }
.chapter-opening blockquote {
  margin: 1.25rem 0 0; padding: 0.9rem 1.2rem;
  border-left: 4px solid var(--accent, var(--brass));
  background: var(--card); font-style: italic; max-width: 62ch;
  border-radius: 0 0.5rem 0.5rem 0;
}
.chapter-flip .chapter-opening blockquote {
  border-left: 0; border-right: 4px solid var(--accent, var(--brass));
  border-radius: 0.5rem 0 0 0.5rem;
}
/* The tap room and the dry room read their pull-lines off dark glass. */
.story-chapter[data-chapter="tratatul"] .chapter-opening blockquote,
.story-chapter[data-chapter="secarea"] .chapter-opening blockquote {
  background: linear-gradient(160deg, var(--gorge-panel), var(--gorge-abyss));
  color: var(--mist-bright);
  border: 1px solid #27404c;
  border-left: 4px solid var(--accent, var(--brass));
  box-shadow: 0 1.5rem 2.5rem -1.5rem rgba(6, 13, 19, 0.6);
}
.story-chapter[data-chapter="tratatul"] .chapter-opening blockquote .citation,
.story-chapter[data-chapter="secarea"] .chapter-opening blockquote .citation {
  color: var(--brass); border-color: var(--brass);
}
.chapter-layout {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem; align-items: start;
}
.chapter-flip .chapter-layout { direction: rtl; }
.chapter-flip .chapter-layout > * { direction: ltr; }
/* Sticky stage: one instrument, five skins, chosen per beat. */
.stage-column { position: sticky; top: 5.5rem; align-self: start; }
.stage-pin { position: static; }
.sticky-stage {
  background: var(--stage-bg); color: var(--mist-bright);
  border-radius: 0.9rem; padding: 1.25rem 1.25rem 1rem;
  border: 1px solid #27404c;
  border-top: 4px solid var(--brass);
  box-shadow: 0 2rem 3rem -2rem rgba(6, 13, 19, 0.65);
  font-variant-numeric: tabular-nums;
}
.sticky-stage[data-grade="mist"] {
  background: linear-gradient(170deg, #14313e 0%, var(--stage-bg) 60%, #081319 100%);
  box-shadow: 0 2rem 3rem -2rem rgba(6, 13, 19, 0.65), 0 0 3rem -1rem var(--glow);
}
.sticky-stage[data-grade="current"] {
  background: linear-gradient(170deg, #123038 0%, #0d2129 45%, #0a1a24 100%);
  border-top-color: var(--mist);
}
.sticky-stage[data-grade="gorge"] {
  background: linear-gradient(170deg, #0a151d 0%, var(--gorge-abyss) 70%);
  border-color: #16242e;
}
.sticky-stage[data-grade="night"] {
  background: linear-gradient(170deg, #101a33 0%, #0b1226 55%, #070b18 100%);
  border-color: #2b3a5e;
}
.sticky-stage[data-grade="paper"] {
  background: linear-gradient(170deg, #fffdf7, var(--card));
  color: var(--ink); border-color: var(--line);
}
.sticky-stage[data-grade="paper"] .stage-label,
.sticky-stage[data-grade="paper"] .stage-subline { color: var(--ink-soft); }
.sticky-stage[data-grade="paper"] .beat-art .g-thread { stroke: #3d6b7d; }
.sticky-stage[data-grade="paper"] .beat-art .g-aux { stroke: #9aa9b1; }
.sticky-stage[data-grade="paper"] .beat-art .g-wall { stroke: #3d6b7d; }
.sticky-stage[data-grade="paper"] .stage-note { color: var(--ink-soft); }
.stage-gesture {
  margin-bottom: 0.75rem; border-radius: 0.55rem;
  background: rgba(6, 13, 19, 0.35);
  border: 1px solid rgba(159, 200, 216, 0.14);
  padding: 0.35rem 0.35rem 0.1rem;
}
.sticky-stage[data-grade="paper"] .stage-gesture {
  background: rgba(20, 32, 42, 0.05);
  border-color: var(--line);
}
.beat-art { display: none; width: 100%; height: auto; }
.beat-art:first-child { display: block; }
.beat-art .g-thread { fill: none; stroke: var(--mist); stroke-width: 5; }
.beat-art .g-aux { fill: none; stroke: #5b7f8d; stroke-width: 3; }
.beat-art .g-mark { fill: none; stroke: var(--accent, var(--brass)); stroke-width: 4; }
.beat-art .g-dot { fill: var(--brass); }
.beat-art .g-wall { fill: none; stroke: var(--mist); stroke-width: 4; }
.beat-art .g-aux-dot { fill: var(--rust); }
.stage-note { font-size: 0.8rem; color: var(--mist); margin: 0 0 0.5rem; }
.stage-kicker {
  font-family: "Syne", sans-serif; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.18em; color: var(--brass); margin: 0;
}
.sticky-stage[data-grade="paper"] .stage-kicker { color: var(--brass-deep); }
html[data-theme="dark"] .sticky-stage[data-grade="paper"] .stage-kicker { color: var(--brass); }
.stage-value {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800;
  line-height: 1.05; margin: 0.25rem 0; letter-spacing: -0.01em;
}
.stage-value, .stage-label { text-wrap: balance; }
.stage-label { font-weight: 700; margin: 0; color: var(--mist); }
.stage-subline { font-size: 0.95rem; margin: 0.35rem 0 0; color: var(--mist); }
.stage-citations { margin-top: 0.5rem; }
.stage-citations .citation { color: var(--brass); border-color: var(--brass); }
.sticky-stage[data-grade="paper"] .stage-citations .citation {
  color: var(--brass-deep); border-color: var(--brass);
}
html[data-theme="dark"] .sticky-stage[data-grade="paper"] .stage-citations .citation {
  color: var(--brass);
}
.stage-progress { font-size: 0.8rem; opacity: 0.75; margin: 0.6rem 0 0; }
/* Steps */
.story-step {
  padding: 1.25rem 1.25rem 1.5rem; margin: 0 0 1rem;
  border: 1px solid var(--line); border-radius: 0.7rem;
  background: var(--card); scroll-margin-top: 6rem;
  box-shadow: 0 1rem 2rem -1.5rem rgba(20, 32, 42, 0.35);
}
/* Active marker is an INSET shadow, never a wider border: border-left
   1px→5px under border-box narrows the content box on activation and can
   reflow text +1 line, shifting beats below the reading line (067 root
   cause; same fix as everest). */
.story-step.is-active {
  border-color: var(--accent, var(--brass));
  box-shadow: inset 4px 0 0 var(--accent, var(--brass)),
    0 1.25rem 2.5rem -1.25rem rgba(20, 32, 42, 0.45);
}
.step-kicker {
  font-family: "Syne", sans-serif; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; color: var(--brass-deep); margin: 0 0 0.4rem;
}
html[data-theme="dark"] .step-kicker { color: var(--brass); }
.story-step h3 { margin: 0 0 0.4rem; font-size: 1.3rem; line-height: 1.25; }
.step-subline { font-weight: 700; margin: 0 0 0.5rem; }
.step-copy { margin: 0; }
/* Media galleries */
.chapter-media { margin-top: 1.5rem; }
.media-grid { display: grid; gap: 1.25rem; }
@media (min-width: 1100px) {
  .media-grid:has(> :nth-child(2)) { grid-template-columns: 1fr 1fr; }
  .media-grid:has(> :nth-child(2)) > :first-child { grid-column: 1 / -1; }
}
.media-grid figure { margin: 0; }
.photo-figure img, .map-figure img, .diagram-figure img {
  border-radius: 0.6rem; border: 1px solid var(--line);
  box-shadow: 0 1.5rem 2.5rem -1.75rem rgba(6, 13, 19, 0.55);
}
.map-figure img, .diagram-figure img {
  border-color: #27404c;
  box-shadow: 0 1.5rem 2.5rem -1.5rem rgba(6, 13, 19, 0.7);
}
.photo-figure figcaption, .map-figure figcaption, .diagram-figure figcaption {
  font-size: 0.92rem; color: var(--ink-soft); padding-top: 0.5rem;
  border-left: 2px solid var(--accent, var(--brass)); padding-left: 0.75rem;
  margin-top: 0.5rem;
}
/* Treaty-tap instrument (pure CSS state) */
.sounding {
  margin: 0 0 1.5rem; padding: 1.25rem;
  background: linear-gradient(165deg, #16303d 0%, var(--gorge-panel) 50%, var(--gorge-abyss) 100%);
  color: var(--mist-bright);
  border-radius: 0.9rem; border: 1px solid #27404c;
  border-top: 4px solid var(--brass);
  box-shadow: 0 2rem 3rem -2rem rgba(6, 13, 19, 0.7);
  font-variant-numeric: tabular-nums;
}
.sounding .eyebrow { color: var(--brass); }
.sounding h3 { margin: 0.25rem 0 0.5rem; font-size: 1.4rem; }
.sounding-note { font-size: 0.92rem; color: var(--mist); margin: 0 0 0.5rem; }
.dispute-tag { font-size: 0.9rem; margin: 0 0 1rem; }
.dispute-tag .citation { color: var(--brass); border-color: var(--brass); }
.sounding-instrument { border: 0; padding: 0; margin: 0; }
.snd-stop { position: absolute; opacity: 0; }
.snd-stops { position: relative; padding-left: 2rem; margin-bottom: 1rem; }
.snd-line {
  position: absolute; left: 0.6rem; top: 0.4rem; bottom: 0.4rem;
  border-left: 3px dashed var(--mist);
}
.snd-tick {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0.8rem; margin-bottom: 0.4rem;
  border: 1px solid #27404c; border-radius: 0.5rem; cursor: pointer;
}
.snd-tick-value { color: var(--brass); font-weight: 700; }
#snd-0:checked ~ .snd-stops label[for="snd-0"],
#snd-1:checked ~ .snd-stops label[for="snd-1"],
#snd-2:checked ~ .snd-stops label[for="snd-2"] {
  border-color: var(--brass); background: rgba(200, 162, 74, 0.12);
  box-shadow: 0 0 1.5rem -0.5rem rgba(200, 162, 74, 0.5);
}
.snd-read { display: none; border-top: 1px solid #27404c; padding-top: 0.9rem; }
#snd-0:checked ~ .snd-readouts [data-snd="0"],
#snd-1:checked ~ .snd-readouts [data-snd="1"],
#snd-2:checked ~ .snd-readouts [data-snd="2"] { display: block; }
.snd-value { font-family: "Syne", sans-serif; font-size: 1.9rem; font-weight: 800; margin: 0; }
.snd-label { font-weight: 700; color: var(--mist); margin: 0.25rem 0; }
.snd-label .citation, .snd-subline .citation { color: var(--brass); border-color: var(--brass); }
.snd-subline { font-size: 0.92rem; color: var(--mist); margin: 0; }
/* Sources, footer */
.sources { padding: 2.5rem 0; scroll-margin-top: 5rem; }
.sources h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.25rem 0 0.5rem; }
.sources ol { padding-left: 1.25rem; }
.sources li { margin-bottom: 1rem; }
.sources li::marker { color: var(--brass-deep); font-weight: 700; }
.sources li p { margin: 0.2rem 0; font-size: 0.95rem; color: var(--ink-soft); }
.sources li a { overflow-wrap: anywhere; font-size: 0.85rem; }
.source-status { font-family: "Syne", sans-serif; font-size: 0.75rem; font-weight: 700; }
.site-footer {
  border-top: 2px solid var(--line); padding: 1.5rem 0 3rem;
  display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: baseline;
  font-size: 0.95rem; color: var(--ink-soft);
}
.site-footer p { margin: 0; }
/* Reading rail */
.reading-rail {
  position: fixed; right: 0.55rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.22rem; z-index: 40;
  max-height: 86vh; overflow: hidden; padding: 0.5rem 0.25rem;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(6px);
}
.rail-river {
  position: absolute; left: 50%; top: 0.5rem; bottom: 0.5rem; width: 2px;
  background: var(--line); transform: translateX(-50%);
  border-radius: 2px; overflow: hidden;
}
.rail-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 0;
  background: linear-gradient(var(--mist), var(--brass));
}
.reading-rail a {
  position: relative; display: block; width: 1.6rem; height: 1.1rem;
  text-decoration: none;
}
.reading-rail a span {
  position: absolute; left: 50%; top: 50%;
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper); border: 2px solid var(--ink-soft);
}
.reading-rail a.rail-step span { width: 0.4rem; height: 0.4rem; }
.reading-rail a[aria-current] span {
  background: var(--brass); border-color: var(--brass-deep);
  box-shadow: 0 0 0.6rem rgba(200, 162, 74, 0.8);
}
.reading-rail a::after {
  content: attr(data-label);
  position: absolute; right: 1.9rem; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: 0.75rem; font-weight: 700;
  background: var(--gorge-panel); color: var(--mist-bright);
  padding: 0.15rem 0.55rem; border-radius: 0.3rem;
  opacity: 0; pointer-events: none;
}
.reading-rail a:hover::after, .reading-rail a:focus-visible::after { opacity: 1; }
.rail-marker {
  position: absolute; left: 50%; top: 0;
  width: 1rem; height: 1rem; border-radius: 50%;
  transform: translate(-50%, 0);
  border: 2px solid var(--brass); pointer-events: none;
}
/* To-top + status */
.to-top {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 40;
  display: flex; gap: 0.4rem; align-items: center;
  background: var(--gorge-panel); color: var(--mist-bright);
  border: 1px solid var(--brass); border-radius: 999px;
  padding: 0.55rem 1rem; cursor: pointer; font-size: 0.9rem;
}
.to-top[hidden] { display: none; }
#share-status:empty { display: none; }
#share-status {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  background: var(--gorge-panel); color: var(--mist-bright);
  padding: 0.5rem 1rem; border-radius: 0.4rem; z-index: 60;
}
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--brass); outline-offset: 2px;
}
.sounding-instrument:focus-within .snd-stops {
  outline: 3px solid var(--brass); outline-offset: 2px;
}
/* Choreography: everything stays visible unless motion is welcome AND
   JavaScript confirmed enhancement. Captures emulate reduced motion,
   and no-JS readers never set data-enhanced, so both keep full text. */
@media (prefers-reduced-motion: no-preference) {
  html[data-enhanced="true"] .chapter-opening,
  html[data-enhanced="true"] .story-step,
  html[data-enhanced="true"] .chapter-media figure,
  html[data-enhanced="true"] .sounding {
    opacity: 0; transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  html[data-enhanced="true"] .is-inview {
    opacity: 1; transform: none;
  }
  html[data-enhanced="true"] .story-steps > :nth-child(2) { transition-delay: 0.06s; }
  html[data-enhanced="true"] .story-steps > :nth-child(3) { transition-delay: 0.12s; }
  html[data-enhanced="true"] .story-steps > :nth-child(4) { transition-delay: 0.18s; }
  .hero-falls { animation: hero-settle 1.6s ease-out; }
  @keyframes hero-settle {
    from { transform: scale(1.045); } to { transform: scale(1); }
  }
  .hero-threads { animation: thread-drift 9s linear infinite; }
  @keyframes thread-drift {
    from { background-position-y: 0; } to { background-position-y: 220px; }
  }
  .scroll-cue .cue-line { animation: cue-drip 2.2s ease-in-out infinite; }
  @keyframes cue-drip {
    0% { transform: scaleY(0); transform-origin: top; }
    55% { transform: scaleY(1); transform-origin: top; }
    56% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
  }
  .strand-flags line { animation: strand-fall 2.8s ease-in-out infinite; }
  @keyframes strand-fall {
    0%, 100% { transform: translateY(-4px); opacity: 0.55; }
    50% { transform: translateY(5px); opacity: 1; }
  }
  .strand-line { animation: crest-shimmer 5s ease-in-out infinite; }
  @keyframes crest-shimmer {
    0%, 100% { opacity: 0.75; } 50% { opacity: 1; }
  }
  .beat-art .g-thread {
    stroke-dasharray: 11 9;
    animation: gauge-flow 1.8s linear infinite;
  }
  @keyframes gauge-flow {
    from { stroke-dashoffset: 0; } to { stroke-dashoffset: 40; }
  }
  .sticky-stage.is-swap [data-stage-kicker],
  .sticky-stage.is-swap [data-stage-value],
  .sticky-stage.is-swap [data-stage-label],
  .sticky-stage.is-swap [data-stage-subline] {
    animation: stage-in 0.45s ease;
  }
  .sticky-stage.is-swap [data-stage-label] { animation-delay: 0.05s; }
  .sticky-stage.is-swap [data-stage-subline] { animation-delay: 0.1s; }
  @keyframes stage-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  .sticky-stage.is-swap .stage-gesture { animation: stage-in 0.4s ease; }
}
@media (max-width: 900px) {
  .chapter-layout { grid-template-columns: 1fr; }
  .stage-column { position: sticky; top: 6rem; z-index: 5; }
  .top-jumps { display: none; }
}
@media (max-width: 740px) {
  body { font-size: 1.05rem; }
  .shell { padding-right: 3.4rem; }
  .site-header { gap: 0.5rem; }
  .wordmark { font-size: 0.85rem; white-space: nowrap; }
  .wordmark-full { display: none; }
  .wordmark-short { display: inline; }
  .header-actions { gap: 0.35rem; margin-left: auto; }
  html[lang="ro"] .language-switch a[lang="ro"],
  html[lang="en"] .language-switch a[lang="en"] { display: none; }
  #theme-control, #copy-link { width: 1.8rem; height: 1.8rem; font-size: 0.9rem; }
  .reading-rail { right: 0.25rem; }
  .reading-rail a.rail-step { display: none; }
  .hero, .story-chapter, .sources, .site-footer { margin-right: 3.4rem; }
  .hero-falls, .hero-curtain { min-height: clamp(26rem, 78svh, 44rem); }
  .hero-copy { padding-bottom: 3.6rem; }
  .scroll-cue { bottom: auto; top: 1rem; }
  .scroll-cue span:first-child { display: none; }
  .hero-stats { margin-top: -2.25rem; }
  .chapter-ghost { top: -1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

