@font-face{font-family:'Fraunces';font-style:italic;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-italic-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Fraunces';font-style:italic;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-italic-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Fraunces';font-style:normal;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Fraunces';font-style:normal;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-italic-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-italic-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --paper: #f3ecdf;
  --paper-deep: #e9e0cf;
  --surface: #fbf7ef;
  --ink: #1c1814;
  --ink-soft: #3a332b;
  --ink-muted: #473f35;
  --rule: #d6cab4;
  --rule-strong: #b5a78d;
  --accent: #a8261c;
  --accent-text: #801b13;
  --on-accent: #fff8ef;
  --gold: #634306;
  --sea: #dbe3df;
  --land: #f1e8d6;
  --coast: #8f826b;
  --river: #7d9aa3;
  --grat: #c3cdc8;
  --route: #b3261e;
  --route-2: #1d5fa8;
  --route-3: #6a4fa3;
  --route-4: #8a6a1c;
  --label: #2a241d;
  --label-halo: #f1e8d6;
  --shadow: 0 1px 2px #1c181414, 0 8px 24px #1c181412;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --bar: 2.75rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #14110d;
    --paper-deep: #1d1914;
    --surface: #1f1a15;
    --ink: #f1e9dc;
    --ink-soft: #ddd3c3;
    --ink-muted: #c2b7a5;
    --rule: #3a3229;
    --rule-strong: #5a4f41;
    --accent: #e0513c;
    --accent-text: #ff9d86;
    --on-accent: #1a0f0b;
    --gold: #e0b45c;
    --sea: #10181b;
    --land: #231e18;
    --coast: #5f5343;
    --river: #3f6068;
    --grat: #1e282b;
    --route: #ff6b50;
    --route-2: #6aa8ff;
    --route-3: #b79bff;
    --route-4: #e0b45c;
    --label: #efe6d6;
    --label-halo: #231e18;
    --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14110d;
  --paper-deep: #1d1914;
  --surface: #1f1a15;
  --ink: #f1e9dc;
  --ink-soft: #ddd3c3;
  --ink-muted: #c2b7a5;
  --rule: #3a3229;
  --rule-strong: #5a4f41;
  --accent: #e0513c;
  --accent-text: #ff9d86;
  --on-accent: #1a0f0b;
  --gold: #e0b45c;
  --sea: #10181b;
  --land: #231e18;
  --coast: #5f5343;
  --river: #3f6068;
  --grat: #1e282b;
  --route: #ff6b50;
  --route-2: #6aa8ff;
  --route-3: #b79bff;
  --route-4: #e0b45c;
  --label: #efe6d6;
  --label-halo: #231e18;
  --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.65;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); margin: 0.4rem 0 1rem; font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 1rem; font-weight: 600; }
h3 { font-size: 1.2rem; margin: 0 0 0.4rem; }
a { color: var(--accent-text); }
a:hover { color: var(--accent); }
img { max-width: 100%; }
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 var(--gutter); }
section { scroll-margin-top: 4.5rem; }
.section-intro { max-width: 44rem; color: var(--ink-soft); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip {
  position: absolute; left: 0.6rem; top: -3rem; z-index: 60;
  background: var(--accent); color: var(--on-accent);
  padding: 0.4rem 0.9rem; border-radius: 0.4rem; text-decoration: none;
}
.skip:focus { top: 0.6rem; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--bar); padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(6px);
}
.home { font-family: var(--display); font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topnav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; }
.topnav a { text-decoration: none; color: var(--ink-soft); white-space: nowrap; font-size: 0.95rem; }
.topnav a:hover { color: var(--accent); }
.spacer { flex: 1; }
@media (max-width: 50rem) { .topnav { display: none; } }
.langmenu { position: relative; }
.langmenu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.9rem; color: var(--ink-soft); border: 1px solid var(--rule);
  border-radius: 999px; padding: 0.2rem 0.7rem; background: var(--surface);
}
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); margin: 0; padding: 0.35rem;
  list-style: none; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 0.6rem; box-shadow: var(--shadow); min-width: 8rem;
}
.langmenu li a { display: block; padding: 0.3rem 0.6rem; border-radius: 0.4rem; text-decoration: none; color: var(--ink); }
.langmenu li a[aria-current="true"] { background: var(--paper-deep); font-weight: 700; }
.icon-btn {
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  border-radius: 999px; width: 2rem; height: 2rem; display: grid; place-items: center; cursor: pointer;
}

/* ---------- rail ---------- */
.rail {
  position: fixed; right: 0.55rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 40;
}
.rail-dot { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.rail-label {
  font-size: 0.75rem; color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 0.4rem; padding: 0.05rem 0.45rem;
  opacity: 0; transition: opacity 0.15s; pointer-events: none; white-space: nowrap;
}
.rail-dot:hover .rail-label, .rail-dot.active .rail-label { opacity: 1; }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 2px solid var(--rule-strong); background: var(--paper); }
.rail-dot.active .dot { background: var(--accent); border-color: var(--accent); }
@media (max-width: 70rem) { .rail { display: none; } }

/* ---------- hero ---------- */
.hero { max-width: 72rem; margin: 0 auto; padding: 2.5rem var(--gutter) 1rem; }
.hero-text { max-width: 46rem; }
.kicker {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.8rem; color: var(--accent-text); margin: 0;
}
.deck { font-size: 1.2rem; color: var(--ink-soft); max-width: 44rem; }
.byline { font-size: 0.95rem; color: var(--ink-muted); }
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem;
  align-items: start;
}
@media (max-width: 55rem) { .hero-grid { grid-template-columns: 1fr; } }
.cast-wrap { margin-top: 1.5rem; }
.cast-heading { font-size: 1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); }
.cast { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
@media (max-width: 55rem) { .cast { grid-template-columns: repeat(2, 1fr); } }
.cast a {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 0.8rem; padding: 0.8rem 0.9rem;
}
.cast a:hover { border-color: var(--accent); }
.seal {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; background: var(--accent); color: var(--on-accent);
  font-family: var(--display); font-size: 0.95rem; margin-right: 0.5rem;
}
.cast-name { font-family: var(--display); font-weight: 600; }
.cast-years { display: block; font-size: 0.85rem; color: var(--ink-muted); }

/* ---------- figures ---------- */
.figure { margin: 1.5rem 0; }
.figure img { display: block; width: 100%; height: auto; border-radius: 0.6rem; box-shadow: var(--shadow); }
.figure figcaption { font-size: 0.9rem; color: var(--ink-muted); margin-top: 0.5rem; }
.credit { overflow-wrap: break-word; }

/* ---------- timeline ---------- */
.atlas { max-width: 72rem; margin: 0 auto; padding: 2rem var(--gutter); }
.map-frame {
  background: var(--land); border: 1px solid var(--rule-strong);
  border-radius: 0.8rem; box-shadow: var(--shadow); overflow: hidden;
}
.tl { display: block; width: 100%; height: auto; }
.tl-track { stroke: var(--rule-strong); stroke-width: 3; }
.tl-progress { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.tl-stop { cursor: pointer; }
.tl-stop circle { fill: var(--surface); stroke: var(--accent-text); stroke-width: 2.5; }
.tl-stop:hover circle, .tl-stop:focus-visible circle { fill: var(--accent); }
.tl-stop text {
  font-family: var(--sans); font-size: 11px; fill: var(--label);
  paint-order: stroke; stroke: var(--label-halo); stroke-width: 4px;
}
#tl-svg.armed .tl-stop { opacity: 0; }
#tl-svg.armed .tl-stop.on { opacity: 1; transition: opacity 0.25s; }
.tl-bar { display: flex; align-items: center; gap: 1rem; margin-top: 0.7rem; }
.tl-full { font-family: var(--display); font-weight: 700; color: var(--accent-text); }
.replay {
  font: inherit; font-size: 0.9rem; cursor: pointer; display: inline-flex;
  align-items: center; gap: 0.4rem; border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 0.35rem 0.9rem;
}
.replay:hover { border-color: var(--accent); }
.map-legend { font-size: 0.9rem; color: var(--ink-soft); }
.events { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.events li {
  display: grid; grid-template-columns: 4.6rem 1fr; gap: 0.8rem; align-items: baseline;
  scroll-margin-top: 5rem; border-radius: 0.5rem; padding: 0.25rem 0.5rem; margin: 0 -0.5rem;
}
.events li:target { background: var(--surface); outline: 1px solid var(--rule-strong); }
.events .ey { font-family: var(--display); font-weight: 700; color: var(--accent-text); }
@media (max-width: 40rem) { .events li { grid-template-columns: 3.8rem 1fr; } }
.vecin {
  margin: 1.2rem 0; padding: 0.8rem 1rem; background: var(--surface);
  border: 1px dashed var(--rule-strong); border-radius: 0.6rem; font-size: 0.98rem;
}

/* ---------- chapters ---------- */
.chapters { max-width: 62rem; margin: 0 auto; padding: 1rem var(--gutter); }
.chapter { padding: 2.2rem 0; border-top: 2px solid var(--rule-strong); }
.ch-head h2 { margin: 0.3rem 0 0.2rem; }
.ch-num { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--accent-text); margin: 0; }
.seal-lg { width: 2.6rem; height: 2.6rem; font-size: 1.4rem; margin: 0.4rem 0 0; }
.ch-dates { color: var(--ink-muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.2rem 0; }
@media (max-width: 45rem) { .stats { grid-template-columns: 1fr; } }
.stats div { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.6rem; padding: 0.6rem 0.8rem; }
.stats dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); }
.stats dd { margin: 0; font-family: var(--display); font-weight: 600; }
.scene {
  margin: 1.5rem 0; padding: 1rem 1.3rem; border-left: 4px solid var(--accent);
  background: var(--surface); border-radius: 0 0.6rem 0.6rem 0;
}
.scene p { margin: 0 0 0.5rem; font-size: 1.15rem; }
.scene cite { font-style: normal; font-size: 0.9rem; color: var(--ink-muted); }
.meanwhile { background: var(--paper-deep); border-radius: 0.6rem; padding: 0.8rem 1rem; font-size: 0.98rem; }
.meanwhile-label { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: var(--accent-text); margin-right: 0.5rem; }

/* ---------- game ---------- */
.game { background: var(--paper-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 2.5rem 0; margin-top: 2rem; }
.cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; counter-reset: card; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.8rem; padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.card-num { font-family: var(--display); color: var(--accent-text); font-weight: 700; margin: 0; }
.card-place { margin: 0.1rem 0 0.3rem; }
.card-situation { margin: 0 0 0.8rem; }
.card-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.card-buttons button {
  font: inherit; cursor: pointer; border: 1px solid var(--rule-strong);
  background: var(--paper); color: var(--ink); border-radius: 0.6rem; padding: 0.5rem 1rem;
}
.card-buttons button:hover { border-color: var(--accent); }
.card-buttons button.picked-correct { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.card-buttons button.picked-wrong { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.card[data-state="right"] { border-color: #2e7d32; }
.card[data-state="wrong"] { border-color: var(--accent); }
.card-answer { margin-top: 0.8rem; }
.card-answer summary { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.card-verdict { font-weight: 700; }
.scoreboard { margin-top: 1.2rem; }
.score { font-family: var(--display); font-size: 1.4rem; }
.btn {
  font: inherit; cursor: pointer; border-radius: 0.6rem; padding: 0.5rem 1.1rem;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
.btn.ghost { background: transparent; color: var(--accent-text); }
.score-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; }

/* ---------- plates ---------- */
.decoder { padding: 2.5rem 0; }
.phrases { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 1rem; }
.phrase { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.8rem; padding: 1rem 1.2rem; }
.phrase summary { cursor: pointer; list-style: none; }
.phrase summary::-webkit-details-marker { display: none; }
.phrase-tag { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: var(--accent-text); margin-right: 0.6rem; }
.phrase-old { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.scene-points { margin: 0.8rem 0 0; padding-left: 1.2rem; }
.scene-fig { margin: 1rem 0 0.4rem; }
.decoder-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.text-note { font-size: 0.9rem; color: var(--ink-muted); }

/* ---------- numbers / myths / sources ---------- */
.numbers { background: var(--paper-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 2.5rem 0; }
.num-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 1.2rem 0 0; }
@media (max-width: 45rem) { .num-grid { grid-template-columns: 1fr 1fr; } }
.num-grid div { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.6rem; padding: 0.8rem 1rem; }
.num-grid dt { font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: var(--accent-text); }
.num-grid dd { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }
.myths { padding: 2.5rem 0; }
.myth-list { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 1rem; counter-reset: myth; }
.myth-list li { counter-increment: myth; background: var(--surface); border: 1px solid var(--rule); border-radius: 0.8rem; padding: 1.1rem 1.3rem; }
.myth-list li::before { content: counter(myth, upper-roman); font-family: var(--display); color: var(--accent-text); font-weight: 700; }
.sources { padding: 2.5rem 0 3rem; border-top: 2px solid var(--rule-strong); }
.src-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.2rem; }
@media (max-width: 50rem) { .src-grid { grid-template-columns: 1fr; } }
.src-group { background: var(--surface); border: 1px solid var(--rule); border-radius: 0.6rem; padding: 0.8rem 1rem; }
.src-group h3 { font-size: 1rem; }
.src-group ul { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.95rem; }
.img-heading { margin-top: 1.5rem; }
.img-credits { font-size: 0.92rem; color: var(--ink-soft); }
.site-footer { border-top: 1px solid var(--rule); padding: 1.2rem var(--gutter) 2rem; text-align: center; color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- 404 ---------- */
.missing { max-width: 40rem; margin: 0 auto; padding: 4rem var(--gutter); text-align: center; }
