@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; 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; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; 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: italic; font-weight: 200 900; 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+2000-206F; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; 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+1E00-1E9F; }

:root {
  --bg: #0a100e; --bg2: #0e1512; --ink: #e9e4d6; --ink2: #b8b2a2; --line: #2a352f;
  --accent: #ff6a4d; --teal: #57c8b4; --card: rgba(10, 17, 14, .88); --card-line: #33413a;
  --stage: #060b0e;
}
html[data-theme="light"] {
  --bg: #e9e7de; --bg2: #dfdcd0; --ink: #182019; --ink2: #4c554d; --line: #b9bdae;
  --accent: #c63f22; --teal: #0d6b58; --card: rgba(241, 238, 228, .93); --card-line: #a7ae9c;
  --stage: #d8d5c8;
}
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #e9e7de; --bg2: #dfdcd0; --ink: #182019; --ink2: #4c554d; --line: #b9bdae;
    --accent: #c63f22; --teal: #0d6b58; --card: rgba(241, 238, 228, .93); --card-line: #a7ae9c;
    --stage: #d8d5c8;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.55; }
a { color: var(--teal); }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { position: fixed; inset: 0 0 auto 0; z-index: 40; height: 44px; display: flex; align-items: center;
  gap: .9rem; padding: 0 .9rem; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif; font-size: .82rem; }
.topbar .home { color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
.topbar nav { display: flex; gap: .8rem; overflow: hidden; }
.topbar nav a { color: var(--ink2); text-decoration: none; white-space: nowrap; }
.topbar nav a:hover { color: var(--ink); }
.topbar .sp { flex: 1; }
.topbar button, .topbar .lang { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--ink);
  min-width: 36px; height: 32px; padding: 0 .55rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
#progress { position: fixed; top: 44px; left: 0; height: 2px; background: var(--accent); width: 0; z-index: 41; }

/* sticky map stage + story */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100svh; background: var(--stage); overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .legend { position: absolute; right: .9rem; bottom: .9rem; z-index: 3; max-width: min(21rem, 78vw);
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .74rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--card-line); padding: .5rem .65rem; }
.legend .bar { height: 8px; margin: .35rem 0 .25rem; background: linear-gradient(90deg, #f7d98b, #7fae7d 45%, #0b2e33 80%, #020608); }
.legend .ends { display: flex; justify-content: space-between; color: var(--ink2); }
.stage .mode-name { position: absolute; right: .9rem; top: 56px; z-index: 3; font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .74rem; letter-spacing: .06em; color: var(--ink2); text-transform: uppercase; }
.steps { position: relative; z-index: 2; margin-top: -100svh; pointer-events: none; }
.step { min-height: 108svh; display: flex; align-items: center; padding: 12svh 1rem; }
.step .card { pointer-events: auto; max-width: 33rem; background: var(--card); border: 1px solid var(--card-line);
  padding: 1.15rem 1.3rem 1.25rem; margin-left: clamp(0rem, 5vw, 4.5rem); }
.step h2 { font-size: 1.65rem; line-height: 1.15; margin: .1rem 0 .6rem; font-weight: 650; }
.step p { margin: .55rem 0; }
.step .big { font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.step .big small { font-size: 1rem; font-weight: 500; color: var(--ink2); }
.coords { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86rem; color: var(--teal); }
.card .note { color: var(--ink2); font-size: .92rem; }
.hero-step { align-items: flex-end; padding-bottom: 16svh; }
.hero-step .card { border: none; max-width: 44rem; padding: 1.3rem 1.5rem 1.3rem 1.2rem;
  background: linear-gradient(98deg, color-mix(in srgb, var(--bg) 80%, transparent) 62%, transparent);
  backdrop-filter: blur(3px); }
.hero-step h1 { font-size: clamp(2.2rem, 6.2vw, 4.3rem); line-height: 1.02; margin: 0 0 .8rem; font-weight: 720; letter-spacing: -.015em;
  text-shadow: 0 1px 22px rgba(0,0,0,.45); }
html[data-theme="light"] .hero-step h1 { text-shadow: 0 1px 18px rgba(255,255,255,.5); }
.hero-step .deck { font-size: clamp(1.05rem, 2.2vw, 1.3rem); max-width: 36rem; }
.hero-step .statline { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-top: 1rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.hero-step .statline b { display: block; font-size: 1.5rem; }
.hero-step .statline span { font-size: .8rem; color: var(--ink2); }

/* plain sections after the story */
.plain { background: var(--bg); position: relative; z-index: 3; border-top: 1px solid var(--line); }
.wrap { max-width: 72rem; margin: 0 auto; padding: 3.2rem 1.1rem 2.5rem; }
.plain h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.12; margin: 0 0 .8rem; max-width: 42rem; }
.plain .lead { max-width: 42rem; color: var(--ink); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.4rem; align-items: start; margin-top: 1.2rem; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
figure.mapbox { margin: 0; border: 1px solid var(--line); background: var(--stage); }
figure.mapbox canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
figure.mapbox figcaption { padding: .55rem .8rem; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .8rem; color: var(--ink2); }
.panel { border: 1px solid var(--line); padding: 1rem 1.1rem; background: var(--bg2); }
.panel h3 { margin: .1rem 0 .5rem; font-size: 1.15rem; }
.searchrow { display: flex; gap: .5rem; position: relative; }
.searchrow input { flex: 1; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 2px; }
.suggest { position: absolute; top: calc(100% + 2px); left: 0; right: 0; background: var(--bg); border: 1px solid var(--line);
  list-style: none; margin: 0; padding: .2rem 0; z-index: 5; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .9rem; }
.suggest li { padding: .4rem .7rem; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--bg2); }
.suggest .j { color: var(--ink2); font-size: .78rem; }
.btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: .5rem .8rem; border-radius: 2px; cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .86rem; min-height: 44px; }
.btn:hover { border-color: var(--accent); }
.result { margin-top: .9rem; }
.result .nums { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .7rem 0; font-family: ui-sans-serif, system-ui, sans-serif; }
.result .nums b { display: block; font-size: 1.45rem; font-family: "Source Serif 4", Georgia, serif; }
.result .nums span { font-size: .76rem; color: var(--ink2); }
.share-row { display: flex; align-items: center; gap: .45rem; margin-top: .9rem; flex-wrap: wrap;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .8rem; color: var(--ink2); }
.share-row a, .share-row button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: transparent; cursor: pointer; padding: 0; }
.share-row svg { width: 17px; height: 17px; fill: currentColor; }
.share-row a:hover, .share-row button:hover { border-color: var(--accent); color: var(--accent); }
@media (pointer: coarse) { .share-row a, .share-row button { width: 44px; height: 44px; } }

table.counties { width: 100%; border-collapse: collapse; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .9rem; margin-top: 1rem; }
table.counties th, table.counties td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); }
table.counties td.km { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
table.counties tr.hl td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.method { max-width: 44rem; }
.method h3 { margin-top: 1.6rem; }
.small { font-size: .88rem; color: var(--ink2); }
footer.foot { border-top: 1px solid var(--line); padding: 1.4rem 1.1rem 2.2rem; display: flex; gap: 1.2rem; flex-wrap: wrap;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .85rem; color: var(--ink2); max-width: 72rem; margin: 0 auto; }
footer.foot a { color: var(--ink); }

/* reading rail */
.rail { position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 39; display: flex; flex-direction: column; gap: 9px; }
.rail a { position: relative; width: 22px; height: 22px; display: block; }
.rail a::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px solid var(--ink2); }
.rail a[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); }
.rail .lab { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); white-space: nowrap; opacity: 0; pointer-events: none;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .72rem; color: var(--ink); background: var(--card);
  border: 1px solid var(--card-line); padding: .18rem .5rem; }
.rail a:hover .lab, .rail a:focus-visible .lab { opacity: 1; }
@media (max-width: 1100px) { .rail { display: none; } }
@media (max-width: 720px) {
  .stage { height: 54svh; top: 44px; }
  .steps { margin-top: -54svh; }
  .step { min-height: 92svh; align-items: flex-end; padding: 8svh .7rem; }
  .step .card { margin-left: 0; width: 100%; padding: .95rem 1rem; }
  .hero-step { padding-bottom: 6svh; }
  .topbar nav { display: none; }
  .stage .legend { display: none; }
  .hero-step .card { background: color-mix(in srgb, var(--bg) 82%, transparent); }
  .stage .mode-name { top: 8px; }
  body { font-size: 17.5px; }
}

html.js table.counties:not(.open) tr.extra { display: none; }
