@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 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+2000-206F, U+2074, 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: 100 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: italic;
  font-weight: 100 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+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 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: "Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/IBMPlexMono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/IBMPlexMono-400-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: "Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/IBMPlexMono-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/IBMPlexMono-600-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: "Plex Sans";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(fonts/IBMPlexSans-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: "Plex Sans";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(fonts/IBMPlexSans-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;
}

:root {
  --bg: #f4efe6;
  --bg2: #eae3d5;
  --card: #fcf9f3;
  --ink: #171614;
  --ink2: #312e28;
  --muted: #5a554c;
  --line: #8f887b;
  --line-soft: #d5cdbe;
  --accent: #8f3414;
  --accent-ink: #ffffff;
  --survey: #0e5a72;
  --heritage: #9a660c;
  --fallback: #7a838b;
  --stage-bg: #11141a;
  --stage-ink: #f3ede2;
  --stage-muted: #b7b1a6;
  --map-land: #e2dacb;
  --map-land-hover: #d3c7b2;
  --map-line: #a49b8c;
  --map-focus: #8f3414;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --bar: 2.75rem;
  --safe-top: var(--browser-safe-top, env(safe-area-inset-top));
  --to-top-bg: #f4efe6;
  --to-top-fg: #171614;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1217;
    --bg2: #161a21;
    --card: #1b2028;
    --ink: #ede7dc;
    --ink2: #cfc8ba;
    --muted: #a19b8f;
    --line: #5b6270;
    --line-soft: #2a303b;
    --accent: #e58356;
    --accent-ink: #1a0c04;
    --survey: #59bede;
    --heritage: #e5b75a;
    --fallback: #7c8591;
    --stage-bg: #0b0d12;
    --stage-ink: #f3ede2;
    --stage-muted: #b3ada2;
    --map-land: #1f252e;
    --map-land-hover: #2b3340;
    --map-line: #404856;
    --map-focus: #e58356;
    --to-top-bg: #0f1217;
    --to-top-fg: #ede7dc;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1217;
  --bg2: #161a21;
  --card: #1b2028;
  --ink: #ede7dc;
  --ink2: #cfc8ba;
  --muted: #a19b8f;
  --line: #5b6270;
  --line-soft: #2a303b;
  --accent: #e58356;
  --accent-ink: #1a0c04;
  --survey: #59bede;
  --heritage: #e5b75a;
  --fallback: #7c8591;
  --stage-bg: #0b0d12;
  --stage-ink: #f3ede2;
  --stage-muted: #b3ada2;
  --map-land: #1f252e;
  --map-land-hover: #2b3340;
  --map-line: #404856;
  --map-focus: #e58356;
  --to-top-bg: #0f1217;
  --to-top-fg: #ede7dc;
  color-scheme: dark;
}

html.in-story {
  --to-top-bg: #11141a;
  --to-top-fg: #ede7dc;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
svg[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.map-status { margin-top: .5rem; font: 500 .8rem/1.3 var(--mono); color: var(--muted); min-height: 1.1em; }
.ans-share { margin-top: .8rem; }
.err-main { padding: 4rem 1rem; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.06rem/1.62 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: var(--accent); text-underline-offset: .16em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: .5rem 1rem;
  z-index: 120;
  font-family: var(--ui);
}
.skip:focus { left: 8px; top: 8px; }

section[id] { scroll-margin-top: calc(var(--bar) + var(--safe-top) + 12px); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.14; margin: 0; text-wrap: balance; font-optical-sizing: auto; }
p { margin: 0 0 1em; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }
.wide { max-width: 76rem; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: calc(var(--bar) + var(--safe-top));
  padding: var(--safe-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: .65rem;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  font: 500 .88rem/1 var(--ui);
  transition: background .2s, border-color .2s, color .2s;
}
html.in-story .topbar {
  background: color-mix(in srgb, var(--stage-bg) 88%, transparent);
  border-bottom-color: rgba(255, 255, 255, .1);
  color: var(--stage-ink);
}
html.in-story .topbar .home,
html.in-story .topbar .chip,
html.in-story .topbar .icon-btn {
  color: var(--stage-ink);
  border-color: rgba(255, 255, 255, .24);
}
html.in-story .topbar .topnav {
  opacity: 0;
  pointer-events: none;
}

.home {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: .01em;
}
.home svg { color: var(--accent); flex: none; }

.topnav {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 0 1 auto;
  margin-left: .5rem;
  transition: opacity .2s;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--ink2);
  text-decoration: none;
  white-space: nowrap;
  padding: .8rem .1rem;
}
.topnav a:hover,
.topnav a[aria-current="true"] { color: var(--accent); }

.spacer { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--ui);
  font-weight: 600;
  font-size: .82rem;
  white-space: nowrap;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none !important; }

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--accent);
}
.progress i {
  position: absolute;
  top: -8px;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  will-change: transform;
  color: var(--accent);
}
.progress i svg { display: block; }

@media (max-width: 860px) {
  .topnav { display: none; }
}
@media (pointer: coarse) {
  .chip { min-height: 44px; padding: 0 .9rem; }
  .icon-btn { width: 44px; height: 44px; }
}

/* Reading rail: gutter beside widest 76rem column */
.rail { display: none; }
@media (min-width: 1320px) {
  .rail {
    --col: 76rem;
    --gut: 1.1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: calc(50% + var(--col) / 2 + var(--gut));
    transform: translateY(-50%);
    z-index: 60;
    margin: 0;
    padding: .4rem 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  html.rail-on .rail { opacity: 1; pointer-events: auto; }
  .rail::before {
    content: "";
    position: absolute;
    left: calc(.875rem - .5px);
    top: 1.1rem;
    bottom: 1.1rem;
    width: 1px;
    background: var(--line-soft);
  }
  .rail-dot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    text-decoration: none;
    border-radius: 50%;
  }
  .rail-dot .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform .2s, background .2s, box-shadow .2s;
    flex: none;
  }
  .rail-dot:hover .dot,
  .rail-dot:focus-visible .dot { background: var(--accent); transform: scale(1.35); }
  .rail-dot[aria-current="true"] .dot {
    background: var(--accent);
    transform: scale(1.55);
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px color-mix(in srgb, var(--accent) 38%, transparent);
  }
  .rail-label {
    position: absolute;
    right: calc(100% + .35rem);
    top: 50%;
    transform: translate(6px, -50%);
    padding: .22rem .65rem;
    border: 1px solid var(--line-soft);
    border-radius: .5rem;
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
    font: 600 .78rem/1.3 var(--ui);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, transform .15s;
  }
  .rail-dot:hover .rail-label,
  .rail-dot:focus-visible .rail-label { opacity: 1; transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .rail, .rail .dot, .rail-label { transition: none; }
}

/* Hero band */
.hero {
  background: var(--stage-bg);
  color: var(--stage-ink);
  padding: clamp(1.6rem, 4vw, 3.2rem) 0 clamp(1.6rem, 4vw, 2.6rem);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.kicker {
  display: inline-block;
  font: 600 .76rem/1.2 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f3bfa3;
  margin-bottom: .75rem;
}
.hero h1 {
  font-weight: 380;
  font-size: clamp(1.85rem, 4.4vw, 3.35rem);
  letter-spacing: -.02em;
  line-height: 1.07;
  max-width: 24ch;
  font-variation-settings: "opsz" 144;
}
.deck {
  font-size: clamp(1.02rem, 1.8vw, 1.24rem);
  line-height: 1.48;
  max-width: 44rem;
  margin: .95rem 0 0;
  color: #e6dfd2;
  font-weight: 360;
}

.hero-stats {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  max-width: 56rem;
}
.hero-stats li {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: .75rem .9rem;
}
.stat-val {
  display: block;
  font: 380 clamp(1.45rem, 3vw, 2.05rem)/1.05 var(--serif);
  color: #f5b995;
}
.stat-lbl {
  display: block;
  margin-top: .28rem;
  font: 500 .78rem/1.3 var(--ui);
  color: var(--stage-muted);
}
@media (max-width: 780px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.share-strip {
  background: #171b23;
  color: var(--stage-ink);
  padding: .65rem 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.share-label {
  font: 500 .78rem/1 var(--mono);
  color: var(--muted);
  margin-right: .25rem;
}
.share-strip .share-label { color: var(--stage-muted); }
.sh {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.share-strip .sh { border-color: rgba(255, 255, 255, .2); color: var(--stage-ink); }
.share-strip .copied { color: var(--stage-muted); }
.sh:hover, .sh:focus-visible { color: var(--accent); border-color: var(--accent); }
.share-strip .sh:hover, .share-strip .sh:focus-visible { color: #f5b995; border-color: #f5b995; }
@media (pointer: coarse) { .sh { width: 44px; height: 44px; } }
.copied { font: 500 .78rem/1.2 var(--mono); color: var(--muted); margin-left: .2rem; min-height: 1em; }

/* 3D Stage & Scrollytelling */
.stage-section {
  background: var(--stage-bg);
  color: var(--stage-ink);
  padding: 1rem 0 2.5rem;
}
.stage-grid {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 24rem);
  gap: 1.5rem;
  align-items: start;
}

.stage-col {
  position: sticky;
  top: calc(var(--bar) + var(--safe-top) + 10px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.stage-frame {
  position: relative;
  width: 100%;
  height: min(calc(var(--vh, 1vh) * 72), 640px);
  min-height: 360px;
  background: #090b0f;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
}

#stage-gl,
#stage-2d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#stage-2d { display: none; }
html.no-webgl #stage-gl { display: none; }
html.no-webgl #stage-2d { display: block; }

/* Screen-aligned optical glass-plate overlay when locked on tripod */
.plate-wipe-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}
.plate-wipe-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: opacity .15s linear;
}
.plate-wipe-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f5b995;
  box-shadow: 0 0 10px rgba(245, 185, 149, .85);
  pointer-events: none;
}
.plate-wipe-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: .2rem .45rem;
  border-radius: 4px;
  background: rgba(11, 13, 18, .78);
  color: #f3ede2;
  font: 600 .7rem/1.2 var(--mono);
  letter-spacing: .04em;
  pointer-events: none;
}

/* Landmark pins over canvas */
.stage-pins {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.pin-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .5rem;
  min-height: 28px;
  max-width: min(220px, 72vw);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(14, 17, 24, .86);
  color: #f7f3eb;
  font: 600 .72rem/1 var(--ui);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
  transition: transform .15s, border-color .15s, background .15s;
}
.pin-label { overflow: hidden; text-overflow: ellipsis; }
.pin-btn:hover,
.pin-btn[aria-expanded="true"] {
  border-color: #f5b995;
  background: #8f3414;
  z-index: 5;
  transform: translate(-50%, -50%) scale(1.06);
}
.pin-btn.is-compact {
  padding: 0;
  width: 24px;
  height: 24px;
  min-height: 24px;
  justify-content: center;
  background: rgba(14, 17, 24, .78);
  border-color: rgba(255, 255, 255, .58);
}
.pin-btn.is-compact .pin-label { display: none; }
.pin-btn.is-compact:hover,
.pin-btn.is-compact:focus-visible {
  width: auto;
  padding: .22rem .5rem;
  min-height: 28px;
}
.pin-btn.is-compact:hover .pin-label,
.pin-btn.is-compact:focus-visible .pin-label { display: inline; }
.pin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #59bede;
  flex: none;
}
.pin-btn[data-status="surviving"] .pin-btn.is-compact {
  padding: 0;
  width: 24px;
  height: 24px;
  min-height: 24px;
  justify-content: center;
  background: rgba(14, 17, 24, .78);
  border-color: rgba(255, 255, 255, .58);
}
.pin-btn.is-compact .pin-label { display: none; }
.pin-btn.is-compact:hover,
.pin-btn.is-compact:focus-visible {
  width: auto;
  padding: .22rem .5rem;
  min-height: 28px;
}
.pin-btn.is-compact:hover .pin-label,
.pin-btn.is-compact:focus-visible .pin-label { display: inline; }
.pin-dot { background: #e5b75a; }
.pin-btn[data-status="lost"] .pin-btn.is-compact {
  padding: 0;
  width: 24px;
  height: 24px;
  min-height: 24px;
  justify-content: center;
  background: rgba(14, 17, 24, .78);
  border-color: rgba(255, 255, 255, .58);
}
.pin-btn.is-compact .pin-label { display: none; }
.pin-btn.is-compact:hover,
.pin-btn.is-compact:focus-visible {
  width: auto;
  padding: .22rem .5rem;
  min-height: 28px;
}
.pin-btn.is-compact:hover .pin-label,
.pin-btn.is-compact:focus-visible .pin-label { display: inline; }
.pin-dot { background: #ef6f6c; }
.pin-btn[data-status="terrain_ridge"] .pin-btn.is-compact {
  padding: 0;
  width: 24px;
  height: 24px;
  min-height: 24px;
  justify-content: center;
  background: rgba(14, 17, 24, .78);
  border-color: rgba(255, 255, 255, .58);
}
.pin-btn.is-compact .pin-label { display: none; }
.pin-btn.is-compact:hover,
.pin-btn.is-compact:focus-visible {
  width: auto;
  padding: .22rem .5rem;
  min-height: 28px;
}
.pin-btn.is-compact:hover .pin-label,
.pin-btn.is-compact:focus-visible .pin-label { display: inline; }
.pin-dot { background: #7dd88a; }

/* Stage HUD (non-blocking) */
.stage-hud {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
}
.hud-pill {
  pointer-events: auto;
  background: rgba(11, 13, 18, .82);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: .38rem .65rem;
  font: 500 .74rem/1.35 var(--mono);
  color: #e6dfd2;
}
.hud-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}
.lg-item { display: inline-flex; align-items: center; gap: .3rem; }
.lg-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.lg-measured { background: #6495a8; }
.lg-heritage { background: #e5b75a; }
.lg-fallback { background: transparent; border: 1px dashed #939da8; }

/* Stage controls bar */
.stage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .85rem;
  background: #171b23;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: .55rem .8rem;
  font: 500 .8rem/1.2 var(--ui);
}
.ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.ctrl-group label { color: var(--stage-muted); font-family: var(--mono); font-size: .74rem; }
.ctrl-group input[type="range"] {
  width: 98px;
  accent-color: #e58356;
  cursor: pointer;
}
.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 34px;
  padding: .3rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .05);
  color: var(--stage-ink);
  cursor: pointer;
  font: 600 .78rem/1 var(--ui);
  white-space: nowrap;
}
.ctrl-btn:hover { border-color: #e58356; color: #f5b995; }
html.exploring .ctrl-btn.orbit-btn {
  background: #8f3414;
  border-color: #f5b995;
  color: #ffffff;
}
.zoom-btns { display: inline-flex; gap: .25rem; }
.zoom-btns .ctrl-btn { min-width: 34px; justify-content: center; padding: .3rem .5rem; }

/* In-view landmark detail card & witness panel */
.stage-inspector {
  background: #171b23;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  padding: .8rem .95rem;
  font-family: var(--ui);
  font-size: .84rem;
  line-height: 1.45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .85rem;
}
@media (max-width: 640px) {
  .stage-inspector { grid-template-columns: 1fr; }
}
.insp-card {
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, .1);
  padding-right: .85rem;
}
@media (max-width: 640px) {
  .insp-card { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); padding-right: 0; padding-bottom: .75rem; }
}
.insp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .35rem;
}
.insp-kicker {
  font: 600 .7rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #f5b995;
}
.insp-title { font: 600 .98rem/1.25 var(--serif); color: #fff; margin: .15rem 0; }
.insp-meta { font: 400 .76rem/1.35 var(--mono); color: var(--stage-muted); margin-top: .3rem; }
.close-x {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: transparent;
  color: var(--stage-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
@media (pointer: coarse) { .close-x { width: 44px; height: 44px; } }

.witness-box {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
}
.witness-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .18);
  flex: none;
  background: #0d1016;
}
.witness-info { min-width: 0; font-size: .78rem; color: #d9d2c5; }
.witness-info a { color: #f5b995; }

/* Story cards column */
.story-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 10;
}
.story-step {
  background: #171b23;
  border: 1px solid rgba(255, 255, 255, .12);
  border-left: 3px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  padding: 1.05rem 1.15rem;
  color: #ded8cc;
  transition: border-color .2s, background .2s;
  scroll-margin-top: calc(var(--bar) + var(--safe-top) + 12px);
}
.story-step.is-active {
  background: #1f2530;
  border-color: rgba(245, 185, 149, .45);
  border-left-color: #e58356;
  color: #f7f2e8;
}
.step-tag {
  font: 600 .72rem/1.2 var(--mono);
  color: #f5b995;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.story-step h3 {
  font-size: 1.24rem;
  margin: .3rem 0 .45rem;
  color: #fff;
}
.step-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .7rem;
  margin: .65rem 0 0;
  font: 500 .74rem/1.3 var(--mono);
  color: var(--stage-muted);
}
.step-select {
  margin-top: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: transparent;
  color: #f3ede2;
  font: 600 .76rem/1 var(--ui);
  cursor: pointer;
}
.step-select:hover { border-color: #f5b995; color: #f5b995; }

/* Mobile sticky stage layout (FM-543, FM-637) */
.insp-close { display: none; }
@media (max-width: 960px) {
  .insp-close { display: grid; }
  .stage-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .9rem;
  }
  .stage-col {
    top: calc(var(--bar) + var(--safe-top));
    background: var(--stage-bg);
    padding-bottom: .55rem;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 10px 24px rgba(10, 12, 18, .85);
  }
  .story-col { padding-top: .5rem; }
  .stage-frame {
    height: calc(var(--vh, 1vh) * 35);
    min-height: 210px;
    max-height: 310px;
  }
  .stage-controls {
    padding: .42rem .55rem;
    gap: .38rem .5rem;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .ctrl-group input[type="range"] { width: 78px; }
  .stage-inspector {
    display: none;
    max-height: 170px;
    overflow-y: auto;
  }
  .stage-inspector.is-open-mobile {
    display: grid;
  }
  .story-step {
    scroll-margin-top: calc(var(--bar) + var(--safe-top) + var(--vh, 1vh) * 44 + 28px);
  }
  .hud-legend { display: none; }
}

/* Main Editorial Bands */
.band { padding: clamp(2.4rem, 5.5vw, 4.2rem) 0; }
.band.alt { background: var(--bg2); }
.band h2 {
  font-weight: 400;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  letter-spacing: -.015em;
  margin-bottom: .9rem;
  max-width: 30ch;
}
.band h2 a { color: inherit; text-decoration: none; }
.band h2 a:hover { text-decoration: underline; }
.lead { font-size: 1.15rem; line-height: 1.5; color: var(--ink2); max-width: 44rem; }

/* Romania Tripod Atlas & Search */
.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 1fr);
  gap: 1.4rem;
  margin-top: 1.4rem;
  align-items: start;
}
@media (max-width: 920px) {
  .atlas-layout { grid-template-columns: minmax(0, 1fr); }
}

.map-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: .9rem;
}
.map-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
  font: 500 .8rem/1.3 var(--ui);
}
.map-frame {
  position: relative;
  width: 100%;
}
.ro-svg {
  width: 100%;
  height: auto;
  display: block;
}
.ro-country { fill: var(--map-land); stroke: var(--map-line); stroke-width: 1.4; }
.ro-county {
  fill: var(--map-land);
  stroke: var(--map-line);
  stroke-width: .75;
  cursor: pointer;
  transition: fill .12s;
}
.ro-county:hover,
.ro-county:focus-visible { fill: var(--map-land-hover); outline: none; }
.ro-county.is-selected { fill: color-mix(in srgb, var(--accent) 22%, var(--map-land)); stroke: var(--accent); stroke-width: 1.5; }

.pool-dot {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 45%, transparent);
  stroke-width: 0.9;
}
.tripod-wedge {
  fill: color-mix(in srgb, var(--survey) 32%, transparent);
  stroke: var(--survey);
  stroke-width: 1;
  pointer-events: none;
}
.tripod-wedge.is-active {
  fill: color-mix(in srgb, var(--accent) 42%, transparent);
  stroke: var(--accent);
  stroke-width: 1.6;
}
.tripod-pin {
  fill: var(--survey);
  stroke: var(--card);
  stroke-width: 1.5;
  cursor: pointer;
}
.tripod-pin.is-active {
  fill: var(--accent);
  r: 7;
}
.tripod-hit {
  fill: transparent;
  cursor: pointer;
}

.map-tip {
  position: absolute;
  pointer-events: none;
  z-index: 15;
  padding: .35rem .55rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font: 500 .76rem/1.3 var(--ui);
  max-width: 220px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.map-tip small { display: block; opacity: .8; font-size: .7rem; margin-top: .12rem; }

/* In-map popup card (interaction.md map click rule) */
.map-pop {
  position: absolute;
  z-index: 20;
  width: min(290px, calc(100% - 16px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
  font: 400 .84rem/1.4 var(--ui);
  color: var(--ink);
}
.map-pop h4 { font-size: 1.02rem; margin: 0 0 .25rem; }
.map-pop .pop-sub { font: 500 .75rem/1.3 var(--mono); color: var(--muted); margin-bottom: .45rem; }
.map-pop .pop-actions { display: flex; flex-direction: column; gap: .4rem; margin-top: .55rem; }
.pop-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
@media (max-width: 520px) {
  .map-pop {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    top: auto !important;
    width: auto;
  }
}

/* Search & Filter Panel */
.lookup-panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.search-wrap { position: relative; }
.search-label {
  display: block;
  font: 600 .8rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .35rem;
}
.search-input {
  width: 100%;
  min-height: 44px;
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
}
.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin: .25rem 0 0;
  padding: .25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
}
.suggest-list button {
  width: 100%;
  text-align: left;
  padding: .48rem .65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: 500 .85rem/1.3 var(--ui);
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.suggest-list button:hover,
.suggest-list button:focus-visible { background: var(--bg2); }
.suggest-meta { font: 400 .75rem/1.3 var(--mono); color: var(--muted); }

.try-row,
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.pill-btn {
  min-height: 34px;
  padding: .3rem .72rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  color: var(--ink2);
  font: 500 .79rem/1.1 var(--ui);
  cursor: pointer;
}
.pill-btn:hover,
.pill-btn[aria-pressed="true"],
.pill-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}
@media (pointer: coarse) { .pill-btn { min-height: 44px; } }

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 36px;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: 600 .8rem/1 var(--ui);
  cursor: pointer;
}
.reset-btn:hover { background: var(--accent); color: var(--accent-ink); }
@media (pointer: coarse) { .reset-btn { min-height: 44px; } }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  padding: .45rem .95rem;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 .84rem/1 var(--ui);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.08); }

/* Answer card */
.answer-card {
  margin-top: 1.2rem;
  scroll-margin-top: calc(var(--bar-h) + 14px);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, .9fr);
  gap: 1.1rem;
  align-items: start;
}
@media (max-width: 780px) {
  .answer-card { grid-template-columns: 1fr; }
}
.ans-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .5rem;
}
.ans-kicker { font: 600 .74rem/1.2 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .07em; }
.ans-title { font-size: 1.5rem; margin: .15rem 0; }
.ans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: .75rem 0;
}
.ans-stat {
  background: var(--bg2);
  border-radius: 8px;
  padding: .5rem .65rem;
  font: 500 .78rem/1.3 var(--mono);
}
.ans-stat strong { display: block; font-size: 1rem; color: var(--ink); font-family: var(--serif); }
.ans-media { display: flex; flex-direction: column; gap: .5rem; }
.ans-plate {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: var(--stage-bg);
}
.ans-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-top: .7rem;
}

/* Corpus table */
.table-wrap {
  margin-top: 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--card);
}
.corpus-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 .86rem/1.4 var(--ui);
}
.corpus-table th,
.corpus-table td {
  padding: .58rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.corpus-table th {
  font: 600 .75rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--bg2);
}
.corpus-table tr[hidden] { display: none !important; }
.table-open-btn {
  margin-top: .75rem;
}

/* Method & Sources */
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}
@media (max-width: 720px) { .method-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.card h3 { font-size: 1.14rem; margin-bottom: .45rem; }
.src { list-style: none; margin: 0; padding: 0; }
.src li { margin: .45rem 0; font-size: .92rem; word-break: break-word; }

/* Footer */
footer {
  padding: 2rem max(16px, env(safe-area-inset-left)) 2.6rem;
  border-top: 1px solid var(--line-soft);
  background: var(--bg2);
  font: 400 .86rem/1.5 var(--ui);
  color: var(--muted);
}
.foot-in {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  align-items: center;
}
footer a { color: var(--ink); }

.map-legend { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin:8px 2px 0; font-size:12px; color:var(--muted); }
.map-legend .lg-wedge { width:14px; height:10px; background:color-mix(in srgb, var(--survey) 32%, transparent); border:1px solid var(--survey); clip-path:polygon(0 50%,100% 0,100% 100%); }
.map-legend .lg-pool { width:7px; height:7px; border-radius:50%; border:1px solid color-mix(in srgb, var(--ink) 45%, transparent); margin-left:6px; }

.pool-details summary { cursor:pointer; font-weight:600; margin:12px 0; }
.pool-table td:last-child { min-width:260px; color:var(--muted); }
.pool-table tr.has-reason td:last-child { color:var(--ink); }

.resid-layer { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:3; overflow:visible; }
.resid-layer line { stroke:#ffd166; stroke-width:1.6; }
.resid-layer .r-pred { fill:none; stroke:#ffd166; stroke-width:1.2; }
.resid-layer .r-obs { fill:#ff6b5a; stroke:#1b1b1b; stroke-width:0.8; }
.ctrl-btn.toggle-btn[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.stage-note { margin:8px 2px 0; font-size:12.5px; line-height:1.5; color:var(--stage-muted, var(--muted)); max-width:72ch; }

/* Desktop: landmark card floats over the viewer so it is visible while the stage is sticky */
@media (min-width: 961px) {
  .stage-frame { height: min(calc(var(--vh, 1vh) * 100 - var(--bar) - var(--safe-top) - 190px), 640px); min-height: 340px; }
  .stage-inspector {
    position: absolute;
    top: 12px;
    right: 12px;
    width: min(360px, 44%);
    max-height: calc(min(calc(var(--vh, 1vh) * 100 - var(--bar) - var(--safe-top) - 190px), 640px) - 24px);
    overflow-y: auto;
    grid-template-columns: 1fr;
    z-index: 6;
    background: rgba(18, 21, 28, .94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
    display: none;
  }
  .stage-inspector.is-open-mobile { display: grid; }
  .stage-inspector .insp-card { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .1); padding-right: 0; padding-bottom: .75rem; }
  .insp-close { display: grid; }
  .stage-note { font-size: 12px; }
}
