@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}

:root {
  --bg: #f2eee2;
  --bg-2: #e7e0cd;
  --ink: #1c1e1a;
  --ink-2: #37392f;
  --ink-3: #5b5c4e;
  --rule: rgba(28, 30, 26, 0.16);
  --line-soft: rgba(28, 30, 26, 0.22);
  --accent: #8a6420;
  --accent-ink: #6b4d15;
  --link: #6b4d15;
  --glass: rgba(9, 14, 22, 0.9);
  --glass-ink: #f1eee2;
  --glass-ink-2: #cfc9b8;
  --glass-rule: rgba(241, 238, 226, 0.2);
  --glass-accent: #ffd27a;
  --bar-bg: rgba(242, 238, 226, 0.94);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Fraunces", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --bar-h: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111413; --bg-2: #1a1e1c; --ink: #efead9; --ink-2: #d9d3c2; --ink-3: #b9b29e;
    --rule: rgba(239, 234, 217, 0.16); --line-soft: rgba(239, 234, 217, 0.26);
    --accent: #ffd27a; --accent-ink: #ffe1a8; --link: #ffe1a8;
    --bar-bg: rgba(17, 20, 19, 0.94); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111413; --bg-2: #1a1e1c; --ink: #efead9; --ink-2: #d9d3c2; --ink-3: #b9b29e;
  --rule: rgba(239, 234, 217, 0.16); --line-soft: rgba(239, 234, 217, 0.26);
  --accent: #ffd27a; --accent-ink: #ffe1a8; --link: #ffe1a8;
  --bar-bg: rgba(17, 20, 19, 0.94); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; background: #101820; color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 0.18em; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--glass-accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: 30; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--bar-bg); border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 13px; color: var(--ink); }
.topbar a { color: var(--ink); text-decoration: none; }
.topbar .home { font-weight: 600; white-space: nowrap; }
.topnav { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { white-space: nowrap; padding: 12px 0; border-bottom: 2px solid transparent; }
.topnav a[aria-current="true"] { border-bottom-color: var(--accent); }
.spacer { flex: 1; }
.chip { border: 1px solid var(--rule); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
section[id] { scroll-margin-top: calc(var(--bar-h) + 12px); }

/* ---------- the scene ---------- */
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; pointer-events: none; background: #0b1118; }
.no-webgl #scene, .no-webgl #hud, .no-webgl #explore, .no-webgl #labels, .no-js #scene, .no-js #hud, .no-js #explore, .no-js #labels { display: none; }
#scene-fallback { display: none; position: fixed; inset: 0; z-index: 0; background: #0b1118; }
#scene-fallback img { width: 100%; height: 100%; object-fit: cover; }
#scene-fallback p { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; font-family: var(--mono); font-size: 13px; color: var(--glass-ink); background: var(--glass); border: 1px solid var(--glass-rule); border-radius: 10px; padding: 8px 12px; }
.no-webgl #scene-fallback, .no-js #scene-fallback { display: block; }
.scene-ready #scene-fallback { display: none; }

#hud { position: fixed; left: 16px; top: calc(var(--bar-h) + 12px); z-index: 20; font-family: var(--mono); font-size: 13px; line-height: 1.35; color: var(--glass-ink); background: var(--glass); border: 1px solid var(--glass-rule); border-radius: 10px; padding: 8px 12px; max-width: calc(100vw - 32px); opacity: 0; transition: opacity .4s; }
.scene-ready #hud { opacity: 1; }
.hud-date { font-weight: 600; color: var(--glass-accent); }
.hud-level { white-space: pre-line; }
body.paper-on #hud { opacity: 0; pointer-events: none; }

/* ---------- story ---------- */
.story { position: relative; z-index: 10; padding: 0 0 30vh; }
.step { position: relative; width: min(430px, calc(100vw - 32px)); margin: 0 0 88vh 5vw; padding: 20px 22px 22px; background: var(--glass); color: var(--glass-ink); border: 1px solid var(--glass-rule); border-radius: 14px; font-size: 17px; line-height: 1.55; }
.step:first-child { margin-top: 62vh; }
.step p { margin: 0 0 0.8em; }
.step p:last-child { margin-bottom: 0; }
.step h2 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 0.55em; font-weight: 600; }
.step .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--glass-accent); margin: 0 0 8px; }
.step a { color: var(--glass-accent); }
.step.right { margin-left: auto; margin-right: 5vw; }
.step.wide { width: min(560px, calc(100vw - 32px)); }
.step.where { width: min(640px, calc(100vw - 32px)); }

.hero { padding: 26px 26px 24px; width: min(620px, calc(100vw - 32px)); }
.hero h1 { font-family: var(--display); font-size: clamp(2.2rem, 5.4vw, 3.9rem); line-height: 1.04; margin: 0 0 16px; font-weight: 600; letter-spacing: -0.01em; }
.hero .deck { font-size: 1.12rem; color: var(--glass-ink); }
.hero .cue { font-family: var(--mono); font-size: 13px; color: var(--glass-accent); margin-top: 14px; }
.hero .byline { font-family: var(--mono); font-size: 12px; color: var(--glass-ink-2); }

/* ---------- locator ---------- */
.loc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 4px; }
.loc figcaption { grid-column: 1 / -1; font-family: var(--mono); font-size: 11.5px; color: var(--glass-ink-2); }
.loc-svg { width: 100%; height: auto; background: rgba(241, 238, 226, 0.06); border: 1px solid var(--glass-rule); border-radius: 8px; }
.lc-land { fill: none; stroke: var(--glass-ink-2); stroke-width: 1.4; }
.lc-county { fill: rgba(255, 210, 122, 0.22); stroke: var(--glass-accent); stroke-width: 1.2; }
.lc-city { fill: var(--glass-ink-2); }
.lc-lake { fill: var(--glass-accent); }
.lc-closed { fill: none; stroke: var(--glass-ink-2); stroke-width: 2; }
.lc-ring { fill: rgba(255, 210, 122, 0.12); stroke: var(--glass-accent); stroke-width: 1.6; stroke-dasharray: 6 4; }
.lc-t { font-family: var(--mono); font-size: 13px; fill: var(--glass-ink); }
.lc-strong { font-weight: 600; }
.lc-line { stroke: var(--glass-accent); stroke-width: 1.6; stroke-dasharray: 5 4; }
.lc-scale line { stroke: var(--glass-ink-2); stroke-width: 2; }
.lc-scale text { font-family: var(--mono); font-size: 12px; fill: var(--glass-ink-2); }

/* ---------- explore ---------- */
#explore { position: relative; z-index: 10; min-height: 100vh; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 90px; }
#explore .panel { pointer-events: auto; background: var(--glass); color: var(--glass-ink); border: 1px solid var(--glass-rule); border-radius: 14px; padding: 16px 18px; width: min(640px, 100%); }
#explore h2 { margin: 0 0 6px; font-size: 1.3rem; }
#explore p { margin: 0 0 10px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chips button { font: 13px/1 var(--mono); color: var(--glass-ink); background: transparent; border: 1px solid var(--glass-rule); border-radius: 999px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--glass-ink); color: #15130f; }

/* ---------- paper sections ---------- */
.paper { position: relative; z-index: 12; background: var(--bg); color: var(--ink); padding: 72px 16px 64px; border-top: 1px solid var(--rule); }
.paper > * { max-width: 700px; margin-left: auto; margin-right: auto; }
.paper h2 { font-family: var(--display); font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.15; margin: 0 0 18px; }
.paper h3 { font-size: 1.15rem; margin: 1.8em auto 0.4em; }
.paper p, .paper li { color: var(--ink-2); }
.paper figure { max-width: 900px; margin: 28px auto; }
.paper figcaption { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.sources { font-size: 15.5px; }
.sources li { margin-bottom: 0.5em; }
footer.site { position: relative; z-index: 12; background: var(--bg-2); color: var(--ink-2); padding: 28px 16px 40px; font-family: var(--mono); font-size: 13px; text-align: center; border-top: 1px solid var(--rule); }
footer.site a { color: var(--ink); }

/* ---------- quiz ---------- */
.quiz { list-style: none; padding: 0; margin: 20px auto; counter-reset: q; }
.quiz > li { counter-increment: q; border-top: 1px solid var(--rule); padding: 12px 0 12px 2.2em; position: relative; }
.quiz > li::before { content: counter(q); position: absolute; left: 0; top: 12px; font-family: var(--display); font-weight: 600; color: var(--accent-ink); font-size: 1.2rem; }
.quiz > li:last-child { border-bottom: 1px solid var(--rule); }
.q-btns button { font: 13px/1 var(--mono); color: var(--ink); background: transparent; border: 1px solid var(--line-soft); border-radius: 999px; padding: 10px 14px; min-height: 44px; cursor: pointer; margin-right: 8px; }
.q-btns button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.q-btns button.right { border-color: #2e7d4f; }
.q-btns button.wrong { border-color: #b3402a; }
.q-why { font-size: 15.5px; border-left: 3px solid var(--accent); padding-left: 12px; }
.quiz-score { font-family: var(--mono); font-size: 15px; font-weight: 600; }

/* ---------- share row ---------- */
.share-row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.share-label { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.share-row { display: inline-flex; gap: 8px; }
.share-row a, .share-row button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-soft); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.share-row a:hover, .share-row button:hover { border-color: var(--accent); color: var(--accent-ink); }
.share-row svg { width: 18px; height: 18px; display: block; }
.share-status { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); flex-basis: 100%; min-height: 1.2em; }
@media (pointer: coarse) { .share-row a, .share-row button { width: 44px; height: 44px; } }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .step, .step.right, .step.where { margin: 0 auto 92vh; width: calc(100vw - 32px); font-size: 16px; padding: 16px 16px 18px; }
  .step:first-child { margin-top: 60vh; }
  .hero h1 { font-family: var(--display); font-size: 2.15rem; }
  .loc { grid-template-columns: 1fr; }
  #hud { left: 0; right: 0; transform: none; bottom: auto; top: var(--bar-h); max-width: none; border-radius: 0; border-width: 0 0 1px; background: rgba(9, 14, 22, 0.94); font-size: 11.5px; padding: 5px 16px; display: flex; justify-content: space-between; gap: 10px; }
  #hud br { display: none; }
  .hud-level { white-space: normal; text-align: right; }
  .topbar { gap: 10px; }
  .weigh { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- labels over the scene ---------- */
#labels { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; font: 600 12px/1.2 var(--mono); color: #141a17; background: rgba(242, 238, 226, 0.88); padding: 2px 6px; border-radius: 4px; white-space: nowrap; margin: -9px 0 0 8px; transition: opacity .3s; will-change: transform; }
.lbl.site { background: #8a6420; color: #f6efe4; }
body.paper-on #labels { opacity: 0; }
.lbl.depth { color: #9fb2c8; background: rgba(11, 17, 24, 0.75); font-weight: 400; }

.safety h3 { margin-top: 0; }

table { border-collapse: collapse; width: 100%; margin: 24px auto; font-size: 16.5px; }
caption { font-family: var(--mono); font-size: 13px; color: var(--ink-3); text-align: left; margin-bottom: 8px; }
th, td { border-top: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; color: var(--ink-2); }
thead th { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); border-top: none; border-bottom: 2px solid var(--line-soft); }
tbody th { color: var(--ink); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
footer { position: relative; z-index: 12; background: var(--bg-2); color: var(--ink-2); padding: 28px 16px 40px; font-family: var(--mono); font-size: 13px; text-align: center; border-top: 1px solid var(--rule); }
footer a { color: var(--ink); }
body.notfound { background: var(--bg); }

/* Keep chamber columns within narrow phone screens. */
@media (max-width: 400px) {
  th, td { padding: 10px 6px; overflow-wrap: anywhere; }
}
.step[id] { scroll-margin-top: calc(var(--bar-h) + 64px); }
.paper :focus-visible, .topbar :focus-visible, footer :focus-visible { outline-color: var(--accent-ink); }

.term { font: inherit; color: inherit; padding: 0; border: 0; background: transparent; text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }
.term-definition { position: fixed; inset: auto; margin: 0; width: min(320px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--serif); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
