:root {
  color-scheme: dark;
  --page: #0b1719;
  --surface: #102124;
  --surface-raised: #172b2e;
  --ink: #f1f1e9;
  --ink-soft: #c6d0c8;
  --ink-muted: #a6b6ae;
  --rule: #304548;
  --rule-strong: #536a69;
  --accent: #e1b36d;
  --accent-text: #f1cd91;
  --water: #61c1bb;
  --water-deep: #1f6a70;
  --settlement: #d78b65;
  --contour: #6e8579;
  --ground: #34443d;
  --ground-light: #627261;
  --ground-low: #35483f;
  --ground-high: #657a69;
  --ground-wet: #406667;
  --terrain-plate: #142726;
  --terrain-edge: #829b8c;
  --focus: #ffe3a8;
  --header-height: 54px;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f2eee2;
  --surface: #e8e2d4;
  --surface-raised: #ded8c8;
  --ink: #202a29;
  --ink-soft: #334442;
  --ink-muted: #3e514a;
  --rule: #b0b5a6;
  --rule-strong: #77887d;
  --accent: #805017;
  --accent-text: #68400e;
  --water: #147478;
  --water-deep: #13575d;
  --settlement: #97513a;
  --contour: #788d7d;
  --ground: #a7aa8e;
  --ground-light: #c5c1a1;
  --ground-low: #8f987f;
  --ground-high: #c5c5a5;
  --ground-wet: #5e8d8a;
  --terrain-plate: #ddd6c6;
  --terrain-edge: #687a6d;
  --focus: #713c0b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 18px); }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: 7px; left: 12px; padding: 10px 14px; background: var(--ink); color: var(--page); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); min-height: var(--header-height); padding: 0 clamp(16px, 3.5vw, 52px); background: color-mix(in srgb, var(--page) 94%, transparent); border-bottom: 1px solid var(--rule); backdrop-filter: blur(14px); }
.brand { flex: 0 0 auto; text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .045em; }
.brand span { padding: 0 .35em; color: var(--accent); }
.topnav { display: flex; align-items: center; gap: clamp(13px, 2.4vw, 34px); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a, .language-link { flex: 0 0 auto; color: var(--ink-muted); text-decoration: none; font-size: 11px; letter-spacing: .04em; }
.topnav a:hover, .language-link:hover { color: var(--ink); }
.bar-spacer { flex: 1 1 auto; }
.language-link { color: var(--ink); font-weight: 700; letter-spacing: .1em; }
.theme-toggle { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.45; }
.story-layout { display: grid; grid-template-columns: minmax(310px, .82fr) minmax(0, 1.18fr); align-items: start; gap: clamp(22px, 4.5vw, 70px); max-width: 1780px; margin-inline: auto; padding: 0 clamp(18px, 4vw, 68px); }
.chapters { grid-column: 1; grid-row: 1; min-width: 0; }
.chapter { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 90svh; padding: clamp(58px, 9vh, 110px) 0; border-bottom: 1px solid var(--rule); opacity: .54; transition: opacity .5s ease; scroll-margin-top: calc(var(--header-height) + 12px); }
.chapter.is-active { opacity: 1; }
.chapter--opening { min-height: min(92svh, 900px); padding-top: clamp(54px, 9vh, 100px); }
.chapter--interactive { justify-content: flex-start; padding-top: clamp(48px, 8vh, 78px); }
.chapter--method { min-height: 88svh; justify-content: flex-start; padding-top: clamp(64px, 11vh, 110px); }
.eyebrow, .chapter-index, .stage-index { margin: 0; color: var(--ink-muted); font-size: 10px; font-weight: 700; letter-spacing: .15em; line-height: 1.55; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(23px, 4vh, 40px); }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--water); box-shadow: 0 0 16px color-mix(in srgb, var(--water) 60%, transparent); }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { max-width: 11ch; margin-bottom: clamp(23px, 4vh, 40px); font-size: clamp(3.35rem, 6vw, 7rem); letter-spacing: -.064em; line-height: .96; }
h1 em { color: var(--accent-text); font-style: normal; }
.dek { max-width: 36rem; margin-bottom: 22px; color: var(--ink-soft); font-size: clamp(17px, 1.55vw, 21px); line-height: 1.58; }
.dek strong, .chapter strong { color: var(--ink); font-weight: 680; }
.opening-source { max-width: 33rem; margin: 0; color: var(--ink-muted); font-size: 12px; line-height: 1.65; }
.read-cue { display: flex; align-items: center; gap: 11px; width: fit-content; margin-top: clamp(36px, 7vh, 66px); color: var(--ink); text-decoration: none; font-size: 11px; }
.cue-line { display: block; width: 36px; height: 1px; background: var(--accent); }
.read-cue svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.3; transition: transform .2s ease; }
.read-cue:hover svg { transform: translateY(4px); }
.chapter-index { display: flex; align-items: center; gap: 11px; margin-bottom: clamp(20px, 4vh, 36px); }
.chapter-index > span:first-child { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.index-rule { display: block; width: 38px; height: 1px; background: var(--rule-strong); }
.chapter h2 { max-width: 18ch; margin-bottom: 23px; font-size: clamp(2.3rem, 4.1vw, 4.45rem); letter-spacing: -.055em; line-height: 1.02; }
.chapter p:not(.eyebrow):not(.chapter-index):not(.opening-source):not(.small-note):not(.range-help) { max-width: 41rem; color: var(--ink-soft); font-size: clamp(15px, 1.25vw, 18px); line-height: 1.72; }
.small-note { max-width: 38rem; color: var(--ink-muted); font-size: 12px; line-height: 1.65; }
.name-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 13px; max-width: 34rem; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.name-pair span { display: flex; flex-direction: column; gap: 7px; color: var(--accent-text); font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.name-pair span:last-child { text-align: right; }
.name-pair b { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(14px, 1.5vw, 18px); font-weight: 400; letter-spacing: 0; }
.name-pair i { width: 36px; height: 1px; background: linear-gradient(90deg, var(--water), var(--accent)); }
.stream-stats { display: flex; flex-wrap: wrap; gap: 16px 35px; max-width: 37rem; margin: 7px 0 27px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.stream-stats > span { display: flex; flex-direction: column; gap: 4px; color: var(--ink-muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.stream-stats strong { color: var(--water); font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 400; letter-spacing: -.03em; text-transform: none; }
.timeline-control { max-width: 38rem; padding-top: 16px; border-top: 1px solid var(--rule); }
.timeline-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 15px; color: var(--ink-muted); font-size: 11px; }
.timeline-heading output { color: var(--accent-text); font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 30px; margin: 8px 0 0; accent-color: var(--water); background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--water-deep), var(--water), var(--accent)); }
input[type="range"]::-moz-range-track { height: 2px; background: linear-gradient(90deg, var(--water-deep), var(--water), var(--accent)); }
input[type="range"]::-webkit-slider-thumb { margin-top: -7px; appearance: none; width: 16px; height: 16px; border: 3px solid var(--page); border-radius: 50%; background: var(--water); box-shadow: 0 0 0 1px var(--water); }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 3px solid var(--page); border-radius: 50%; background: var(--water); box-shadow: 0 0 0 1px var(--water); }
.range-ticks { display: flex; justify-content: space-between; color: var(--ink-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.range-help { margin: 10px 0 0; color: var(--ink-muted); font-size: 11px; line-height: 1.55; }
.depth-bars { display: grid; gap: 21px; max-width: 38rem; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.depth-bars > div { display: grid; grid-template-columns: minmax(122px, 1fr) minmax(75px, 1.1fr) auto; align-items: center; gap: 11px; color: var(--ink-soft); font-size: 11px; }
.depth-bars b { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.depth-range { display: block; position: relative; height: 3px; background: var(--rule-strong); }
.depth-range::before { position: absolute; top: -4px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--water); content: ""; }
.depth-range--high::before { left: 78%; width: 24px; border-radius: 2px; background: var(--accent); }
.closing-link { display: inline-flex; align-items: center; gap: 12px; width: fit-content; padding: 12px 0; color: var(--accent-text); text-decoration-color: var(--rule-strong); text-underline-offset: 4px; font-size: 12px; }
.closing-link span { font-size: 16px; }
.sources-panel { max-width: 43rem; margin-top: 24px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
.sources-panel summary { padding: 14px 0; color: var(--accent-text); cursor: pointer; font-size: 12px; }
.sources-panel ol { padding: 0 0 10px 20px; color: var(--ink-muted); font-size: 11px; line-height: 1.65; }
.sources-panel li { padding: 0 0 9px 3px; }
.sources-panel a { color: var(--ink-soft); text-decoration-color: var(--rule-strong); text-underline-offset: 2px; }
.sources-panel a:hover { color: var(--accent-text); }
.stage { position: sticky; z-index: 4; top: calc(var(--header-height) + 1px); grid-column: 2; grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; height: calc(100svh - var(--header-height) - 1px); max-height: 1020px; padding: clamp(18px, 2vw, 30px) 0 clamp(20px, 3vh, 36px); }
.stage::before { position: absolute; z-index: -1; inset: 0 calc(-1 * clamp(18px, 4vw, 68px)) 0 0; background: radial-gradient(ellipse at 52% 48%, color-mix(in srgb, var(--surface) 79%, transparent), transparent 70%); content: ""; }
.stage-heading { position: relative; z-index: 3; display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 0 12px 0 0; }
.stage-index { display: flex; justify-content: space-between; gap: 14px; }
.stage-index span { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.stage-heading h2 { max-width: 13ch; margin: 10px 0 0; font-size: clamp(22px, 2.1vw, 32px); letter-spacing: -.04em; line-height: 1.02; }
.terrain-wrap { position: relative; flex: 1 1 auto; min-height: 0; margin: 10px -1vw 6px 0; overflow: hidden; }
#terrainCanvas, .terrain-fallback { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; }
.terrain-fallback { overflow: visible; }
.has-terrain .terrain-fallback { display: none; }
.terrain-fallback text { fill: var(--ink); font-family: Inter, Arial, sans-serif; font-size: 12px; }
.fallback-ground { fill: var(--ground); stroke: var(--contour); stroke-width: 1; }
.fallback-contour { fill: none; stroke: var(--contour); stroke-width: 1.3; opacity: .72; }
.fallback-stream { fill: none; stroke: var(--water); stroke-width: 8; stroke-linecap: round; }
.fallback-prut { fill: none; stroke: var(--water-deep); stroke-width: 22; stroke-linecap: round; }
.fallback-pin { fill: var(--settlement); stroke: var(--page); stroke-width: 4; }
.fallback-north { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.no-terrain #terrainCanvas { display: none; }
.no-terrain .terrain-fallback { display: block; }
.stage-callout { position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: color-mix(in srgb, var(--page) 84%, transparent); border-left: 1px solid var(--rule-strong); pointer-events: none; }
.stage-callout i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--settlement); box-shadow: 0 0 11px color-mix(in srgb, var(--settlement) 75%, transparent); }
.stage-callout--mouth i { background: var(--accent); }
.stage-callout--prut i { background: var(--water); }
.stage-callout span { display: flex; flex-direction: column; gap: 2px; }
.stage-callout strong { color: var(--ink); font-size: 10px; font-weight: 700; }
.stage-callout small { color: var(--ink-muted); font-size: 8px; letter-spacing: .03em; }
.stage-callout--village { top: 38%; left: 21%; }
.stage-callout--mouth { top: 55%; right: 11%; }
.stage-callout--prut { top: 23%; right: 2%; }
.map-north { position: absolute; z-index: 3; top: 5%; left: 4%; color: var(--ink-muted); font-size: 10px; letter-spacing: .1em; }
.stage-data { position: absolute; z-index: 3; bottom: 7%; left: 4%; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.stage-data strong { color: var(--accent-text); font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 4vw, 56px); font-weight: 400; letter-spacing: -.045em; line-height: .95; }
.stage-data span { max-width: 25ch; color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.stage-loading { position: absolute; z-index: 4; right: 18px; bottom: 19px; color: var(--ink-muted); font-size: 10px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.stage--loading .stage-loading { opacity: 1; }
.stage-bottom { position: relative; z-index: 3; display: flex; align-items: flex-end; justify-content: space-between; gap: 19px; padding-right: 56px; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 11px; min-width: 140px; }
.stage-legend > span { display: flex; align-items: center; gap: 5px; color: var(--ink-muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.stage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--water); }
.legend-village i { background: var(--settlement); }
.legend-border i { width: 10px; height: 2px; border-radius: 0; background: var(--accent); }
.stage figcaption { max-width: 30rem; color: var(--ink-muted); font-size: 10px; line-height: 1.55; text-align: right; }
.stage-controls { position: absolute; z-index: 5; right: 0; bottom: clamp(18px, 3vh, 36px); display: flex; gap: 5px; }
.stage-controls button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--page); color: var(--ink); cursor: pointer; }
.stage-controls button:hover { border-color: var(--water); color: var(--water); }
.stage-controls svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 30px; padding: 24px clamp(18px, 4vw, 68px) 34px; border-top: 1px solid var(--rule); color: var(--ink-muted); font-size: 10px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); }
@media (max-width: 900px) {
  .story-layout { grid-template-columns: minmax(270px, .92fr) minmax(0, 1.08fr); gap: 24px; padding-inline: 20px; }
  h1 { font-size: clamp(3.1rem, 7.4vw, 5.5rem); }
  .chapter h2 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
  .stage-bottom { align-items: flex-start; flex-direction: column; gap: 9px; }
  .stage figcaption { max-width: 30rem; text-align: left; }
}
@media (max-width: 720px) {
  :root { --header-height: 48px; }
  .topbar { gap: 12px; padding-inline: 14px; }
  .brand { font-size: 11px; }
  .topnav { gap: 15px; }
  .topnav a { font-size: 10px; }
  .story-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 18px; }
  .stage { position: sticky; z-index: 8; top: var(--header-height); grid-column: 1; grid-row: 1; height: min(41svh, 320px); min-height: 240px; max-height: 320px; margin: 0 -18px; padding: 10px 17px 11px; border-bottom: 1px solid var(--rule-strong); background: color-mix(in srgb, var(--page) 97%, transparent); }
  .stage::before { inset: 0; background: linear-gradient(180deg, var(--page), color-mix(in srgb, var(--page) 82%, transparent)); }
  .stage-heading { align-items: center; }
  .stage-index { font-size: 8px; letter-spacing: .1em; }
  .stage-heading h2 { max-width: 13ch; margin-top: 4px; font-size: 19px; }
  .terrain-wrap { margin: -4px -4px 0 0; }
  .stage-callout { gap: 5px; padding: 5px 6px; }
  .stage-callout--village { top: 37%; left: 16%; }
  .stage-callout--mouth { top: 53%; right: 10%; }
  .stage-callout--prut { top: 18%; right: 1%; }
  .stage-callout strong { font-size: 9px; }
  .stage-callout small { font-size: 8px; }
  .stage-data { left: 4%; bottom: 6%; }
  .stage-data strong { font-size: 30px; }
  .stage-data span { max-width: 23ch; font-size: 8px; }
  .stage-bottom { display: none; }
  .stage-controls { right: 16px; bottom: 9px; gap: 4px; }
  .stage-controls button { width: 30px; height: 30px; }
  .stage-controls svg { width: 15px; height: 15px; }
  .stage-loading { right: 12px; bottom: 16px; font-size: 8px; }
  .chapters { grid-column: 1; grid-row: 2; }
  .chapter { min-height: 71svh; padding: 56px 0; opacity: .68; }
  .chapter--opening { min-height: 68svh; padding-top: clamp(30px, 5vh, 45px); }
  .chapter--interactive { min-height: 110svh; padding-top: 46px; }
  .chapter--method { min-height: 90svh; }
  h1 { max-width: 11ch; margin-bottom: 22px; font-size: clamp(2.8rem, 12vw, 4.9rem); }
  .eyebrow { margin-bottom: 20px; font-size: 9px; }
  .dek { margin-bottom: 15px; font-size: 16px; line-height: 1.5; }
  .opening-source { font-size: 11px; }
  .read-cue { margin-top: 26px; }
  .chapter-index { margin-bottom: 21px; }
  .chapter h2 { max-width: 17ch; margin-bottom: 17px; font-size: clamp(2.15rem, 8.8vw, 3.15rem); }
  .chapter p:not(.eyebrow):not(.chapter-index):not(.opening-source):not(.small-note):not(.range-help) { font-size: 15px; line-height: 1.66; }
  .name-pair { gap: 8px; }
  .name-pair b { font-size: 14px; }
  .name-pair i { width: 20px; }
  .stream-stats { gap: 13px 25px; }
  .timeline-heading { font-size: 10px; }
  .timeline-heading output { max-width: 58%; text-align: right; }
  .range-help { font-size: 10px; }
  .depth-bars > div { grid-template-columns: minmax(100px, 1fr) minmax(52px, .8fr) auto; gap: 8px; font-size: 10px; }
  .site-footer { flex-direction: column; gap: 11px; padding: 22px 18px 28px; }
}
@media (max-width: 380px) {
  .topbar { gap: 9px; padding-inline: 10px; }
  .brand { font-size: 10px; }
  .topnav { gap: 11px; }
  .topnav a { font-size: 9px; }
  .theme-toggle { flex-basis: 31px; width: 31px; height: 31px; }
  .stage-callout--village { left: 12%; }
  .stage-callout--mouth { right: 6%; }
  .name-pair { grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); }
  .depth-bars > div { grid-template-columns: minmax(85px, .9fr) minmax(43px, .7fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
