@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}
/* refugiu theme: warm paper, oxblood accent, railway-ink map. */
:root {
  color-scheme: light;
  --bg: #f5efe3;
  --bg-deep: #eae1cf;
  --ink: #1a1712;
  --ink-soft: #3a332a;
  --muted: #6d604c;
  --line: #d8cdb6;
  --line-strong: #b5a78d;
  --card: #fbf7ec;
  --accent: #7c1f1a;
  --accent-ink: #fff8ee;
  --accent-soft: #7c1f1a22;
  --held: #2e7d32;
  --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;
  --map-bg: #efe6d2;
  --stop: #fbf7ec;
  --stop-stroke: #6b5e4c;
  --route: #4a4238;
  --route-hot: #7c1f1a;
  --region: #e6d3ac;
  --region-stroke: #a8957a;
  --hatch-bg: #e6d3ac;
  --hatch-line: #b89a5b;
  --river: #4a7fa5;
  --river-label: #38617f;
  --label: #2a241d;
  --label-halo: #efe6d2;
  --capital: #fbf7ec;
  --tag-card: #fbf7ec;
  --tag-ink: #7c1f1a;
  --tag-string: #6b5e4c;
  --shadow: 0 1px 2px #1a171214, 0 8px 24px #1a171212;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110d;
  --bg-deep: #1d1914;
  --ink: #f1e9dc;
  --ink-soft: #ddd3c3;
  --muted: #b3a586;
  --line: #3a3226;
  --line-strong: #5a4f41;
  --card: #1f1a13;
  --accent: #e0513c;
  --accent-ink: #1a0f0b;
  --accent-soft: #e0513c26;
  --held: #9ccc65;
  --map-bg: #1c1813;
  --stop: #2c2519;
  --stop-stroke: #8f826b;
  --route: #8f826b;
  --route-hot: #e0513c;
  --region: #2e2718;
  --region-stroke: #5c4f3e;
  --hatch-bg: #2e2718;
  --hatch-line: #6e5a37;
  --river: #6fa3c9;
  --river-label: #8fb8d4;
  --label: #ddd3c3;
  --label-halo: #1c1813;
  --capital: #e0513c;
  --tag-card: #241f17;
  --tag-ink: #ff9d86;
  --tag-string: #8f826b;
  --shadow: 0 1px 2px #00000066, 0 8px 24px #00000055;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.65;
  font-size: 1.06rem;
  overflow-x: clip;
}
main > * > *, .atlas-text > * { min-width: 0; }
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip {
  position: absolute; left: 0.6rem; top: -3rem; z-index: 50;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.4rem 0.8rem; border-radius: 0.4rem; transition: top 0.15s;
}
.skip:focus { top: 0.6rem; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; border-radius: 0.5rem; }
h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 100;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 1rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
  font-family: var(--sans); font-size: 0.92rem;
}
.topbar .home { font-weight: bold; text-decoration: none; white-space: nowrap; color: var(--ink); }
.topnav { display: flex; gap: 0.7rem; overflow-x: auto; }
.topnav a { text-decoration: none; white-space: nowrap; color: var(--ink-soft); }
.spacer { flex: 1; }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 0.5rem;
  color: var(--ink); padding: 0.3rem 0.45rem; cursor: pointer;
}
#theme svg[hidden] { display: none; }
.langmenu { position: relative; }
.langmenu summary { cursor: pointer; list-style: none; display: flex; gap: 0.3rem; align-items: center; color: var(--ink); }
.langmenu ul {
  position: absolute; right: 0; top: 1.6rem; margin: 0; padding: 0.4rem 0; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; min-width: 8rem;
}
.langmenu li a { display: block; padding: 0.3rem 0.9rem; text-decoration: none; color: var(--ink); }
/* ---------- reading rail ---------- */
.rail {
  position: fixed; right: 0.7rem; top: 30%; display: none; flex-direction: column;
  gap: 0.55rem; z-index: 15;
}
@media (min-width: 76rem) { .rail { display: flex; } }
.rail-dot { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; position: relative; }
.rail-dot::after { content: ""; position: absolute; inset: -0.5rem; }
.rail-dot .dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--muted); opacity: 0.55; }
.rail-label {
  display: none; position: absolute; right: 100%; margin-right: 0.5rem;
  font-size: 0.8rem; font-family: var(--sans); color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 0.4rem;
  padding: 0.15rem 0.5rem; white-space: nowrap;
}
.rail-dot:hover .rail-label, .rail-dot:focus .rail-label { display: inline; }
/* ---------- hero ---------- */
.hero {
  max-width: 72rem; margin: 0 auto; padding: 2.4rem 1.1rem 1rem;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: start;
}
.hero-text { max-width: 34rem; }
.kicker {
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.82rem; font-family: var(--sans); font-weight: 600; margin: 0 0 0.6rem;
  font-variant-numeric: tabular-nums;
}
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); max-width: 24ch; margin: 0 0 1rem; font-weight: 700; }
.deck { font-size: 1.18rem; line-height: 1.55; max-width: 62ch; }
.byline { color: var(--muted); font-size: 0.9rem; font-family: var(--sans); }
.figure { margin: 1.6rem 0; }
.figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; font-family: var(--sans); }
.credit { white-space: normal; }
.hero-doc { margin: 0; }
.hero-doc img { box-shadow: var(--shadow); }
.luggage-tag { width: 13rem; max-width: 60%; height: auto; margin-top: 1.2rem; transform: rotate(2deg); }
.tag-card { fill: var(--tag-card); stroke: var(--tag-ink); stroke-width: 2.5; }
.tag-hole { fill: var(--bg); stroke: var(--tag-ink); stroke-width: 2.5; }
.tag-string { stroke: var(--tag-string); stroke-width: 2; }
.tag-dest { fill: var(--tag-ink); font-family: var(--sans); font-weight: 800; font-size: 26px; letter-spacing: 0.08em; text-anchor: middle; }
.tag-sub { fill: var(--tag-ink); font-family: var(--sans); font-size: 15px; letter-spacing: 0.18em; text-anchor: middle; }
.cast-wrap { grid-column: 1 / -1; }
.cast-heading { font-size: 1.1rem; letter-spacing: 0; }
.cast { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.7rem; }
.cast a {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 0.6rem; padding: 0.7rem 0.9rem; text-decoration: none; color: var(--ink);
}
.cast-name { display: block; font-weight: bold; font-family: var(--display); font-size: 1.05rem; }
.cast-years { display: block; color: var(--muted); font-size: 0.85rem; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.seal {
  display: inline-block; min-width: 1.5rem; text-align: center;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 50%;
  font-size: 0.8rem; padding: 0.1rem 0.3rem; margin-right: 0.4rem;
  font-family: var(--sans);
}
.seal-lg { font-size: 1rem; }
/* ---------- sections ---------- */
.centerpiece, .game, .moments, .numbers, .myths, .sources { padding: 3rem 0; border-top: 1px solid var(--line); }
.centerpiece h2, .game h2, .moments h2, .numbers h2, .myths h2, .sources h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 0.8rem; font-weight: 650;
}
.section-intro { color: var(--muted); max-width: 66ch; }
/* ---------- map ---------- */
.map-frame { background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.6rem; box-shadow: var(--shadow); }
.map { width: 100%; height: auto; }
.map text { font-family: var(--sans); }
.map-bg { fill: var(--map-bg); }
.hatch-bg { fill: var(--hatch-bg); }
.hatch-line { stroke: var(--hatch-line); stroke-width: 1.4; }
.phase-region { fill: url(#hatch); stroke: var(--region-stroke); stroke-width: 2; }
.sector.lit .phase-region { stroke: var(--route-hot); stroke-width: 3.5; }
.phase-name { fill: var(--label); font-size: 17px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: var(--label-halo); stroke-width: 4px; }
.sector .sub { font-size: 13px; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.route-line { fill: none; stroke: var(--route); stroke-width: 3.5; stroke-linecap: round; }
.route-line.branch { stroke-dasharray: 7 5; stroke-width: 2.6; }
.sector.lit .route-line { stroke: var(--route-hot); }
.stop { fill: var(--stop); stroke: var(--stop-stroke); stroke-width: 2; }
.sector.lit .stop { stroke: var(--route-hot); }
.stop-label { fill: var(--label); font-size: 14.5px; paint-order: stroke; stroke: var(--label-halo); stroke-width: 4px; }
.town-label { fill: var(--muted); font-size: 12.5px; font-style: italic; paint-order: stroke; stroke: var(--label-halo); stroke-width: 3px; }
.capital-node { fill: var(--capital); stroke: var(--route-hot); stroke-width: 3; }
.sector.lit .capital-node { stroke-width: 5; }
.capital-name { fill: var(--label); font-size: 24px; font-weight: 800; text-anchor: middle; paint-order: stroke; stroke: var(--label-halo); stroke-width: 5px; }
.river { fill: none; stroke: var(--river); stroke-width: 3; stroke-linecap: round; opacity: 0.85; }
.river-label { fill: var(--river-label); font-size: 14px; font-style: italic; }
.compass, .note { fill: var(--muted); font-size: 14px; }
.note { font-style: italic; }
.hud { display: flex; justify-content: space-between; align-items: baseline; padding: 0.4rem 0.3rem 0; font-family: var(--sans); }
.hud-name { margin-right: 0.6rem; }
.hud-years { color: var(--muted); font-variant-numeric: tabular-nums; }
.scrub { margin-top: 1rem; }
.scrub label { font-family: var(--sans); font-size: 0.92rem; }
.scrub input[type="range"] { width: 100%; accent-color: var(--accent); }
.day-line { font-weight: bold; font-variant-numeric: tabular-nums; }
.day-event { background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem 1rem; }
.day-event.now-mark { border-color: var(--accent); }
.spine { text-align: center; font-size: 1.5rem; font-style: italic; margin: 1.6rem 0 0.6rem; font-family: var(--display); }
.event-list { margin: 0.6rem 0; padding-left: 1.2rem; }
.event-list li { margin: 0.7rem 0; }
.event-list li::marker { color: var(--accent); }
.event-list li.now { background: var(--card); border-radius: 0.5rem; }
.ev-title { font-weight: bold; }
.map-nojs { color: var(--muted); font-size: 0.9rem; font-family: var(--sans); }
/* ---------- chapters ---------- */
.atlas-text { max-width: 44rem; margin: 0 auto; padding: 0 1.1rem; }
.chapter { padding: 3rem 0; border-top: 1px solid var(--line); }
.atlas-intro { padding-top: 3rem; }
.atlas-intro h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.chapter h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0.4rem 0 0.2rem; font-weight: 700; }
.ch-num { color: var(--muted); margin: 0; font-family: var(--sans); }
.ch-dates { color: var(--muted); margin: 0.2rem 0 0; font-variant-numeric: tabular-nums; }
.ch-role { margin: 0.1rem 0 0; font-style: italic; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; margin: 1rem 0; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 0.7rem; }
.stats dt { font-size: 0.8rem; color: var(--muted); font-family: var(--sans); }
.stats dd { margin: 0; font-weight: bold; font-variant-numeric: tabular-nums; }
.scene { border-left: 3px solid var(--accent); margin: 1.4rem 0; padding: 0.2rem 0 0.2rem 1rem; }
.scene p { font-style: italic; margin: 0 0 0.3rem; }
.scene cite { color: var(--muted); font-size: 0.88rem; font-style: normal; font-family: var(--sans); }
.meanwhile { background: var(--card); border: 1px dashed var(--line); border-radius: 0.6rem; padding: 0.7rem 1rem; }
.meanwhile-label { font-weight: bold; }
/* ---------- game ---------- */
.game .luggage-tag { width: 9rem; margin: 0 0 0.6rem; }
.allocs { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.8rem; }
.alloc { background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem; }
.alloc label { display: block; font-weight: bold; margin-bottom: 0.3rem; font-family: var(--display); }
.alloc input {
  width: 100%; font-size: 1.1rem; padding: 0.3rem 0.5rem;
  border: 1px solid var(--line-strong); border-radius: 0.4rem;
  background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums;
}
.verdict { min-height: 1.6em; margin: 0.4rem 0 0; font-weight: bold; }
.verdict.held { color: var(--held); }
.verdict.lost { color: var(--accent); }
.btn {
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 0.5rem; padding: 0.5rem 1rem; font-size: 1rem; cursor: pointer; margin: 0.4rem 0.4rem 0 0;
  font-family: var(--sans);
}
.btn.ghost { background: none; color: var(--accent); }
.card-answer { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem 1rem; }
.card-answer summary { cursor: pointer; font-weight: bold; }
/* ---------- data moments ---------- */
.moment {
  min-height: 92vh; display: flex; flex-direction: column; justify-content: center;
  padding: 3rem 0; border-top: 1px solid var(--line);
}
.moment:first-of-type { border-top: none; }
.moment-big {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 6rem); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0 0 1rem; font-variant-numeric: tabular-nums; text-wrap: balance;
}
.moment-arrow { color: var(--accent); }
.moment-small { font-size: clamp(1.15rem, 2.6vw, 1.5rem); max-width: 30ch; margin: 0 0 0.8rem; }
.moment-note { color: var(--muted); font-size: 0.95rem; max-width: 62ch; font-family: var(--sans); }
.moment.reveal .moment-big, .moment.reveal .moment-small { animation: rise 0.7s ease-out both; }
.moment.reveal .moment-small { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(1.2rem); } to { opacity: 1; transform: none; } }
/* ---------- numbers / myths / sources ---------- */
.num-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.8rem; }
.num-grid div { background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem 1rem; }
.num-grid dt { font-size: 1.8rem; font-weight: 800; font-family: var(--display); font-variant-numeric: tabular-nums; }
.num-grid dd { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }
.gold { margin-top: 1.4rem; border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.7rem 1rem; background: var(--card); }
.myth-list { list-style: none; margin: 0; padding: 0; counter-reset: myth; }
.myth-list li { counter-increment: myth; margin: 1.4rem 0; }
.myth-list h3 { font-size: 1.25rem; }
.myth-list h3::before { content: counter(myth) ". "; color: var(--muted); }
.src-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.src-group h3 { font-size: 1rem; margin-bottom: 0.3rem; font-family: var(--sans); letter-spacing: 0; }
.src-group ul, .img-credits { margin: 0; padding-left: 1.1rem; }
.src-group li, .img-credits li { margin: 0.35rem 0; font-size: 0.94rem; }
.site-footer { border-top: 1px solid var(--line); padding: 1.4rem 1.1rem 2rem; text-align: center; color: var(--muted); font-family: var(--sans); font-size: 0.92rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .moment.reveal .moment-big, .moment.reveal .moment-small { animation: none; }
}
@media print { .rail, .topbar { display: none; } }
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-doc { max-width: 44rem; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .topnav { display: none; }
  .deck { font-size: 1.08rem; }
  .moment-big { font-size: clamp(2.2rem, 12vw, 3.2rem); }
}
