:root {
  --bg: #f7f3ea;
  --bg-surface: #ffffff;
  --bg-raised: #efe8d8;
  --text-primary: #201a12;
  --text-secondary: #4a4030;
  --text-muted: #6b5f4a;
  --accent: #8a4a1f;
  --accent-strong: #6b3814;
  --border: #d8cdb4;
  --border-strong: #b8a97f;
  --map-land: #e4d9bd;
  --map-outline: #8a4a1f;
  --map-pin: #8a4a1f;
  --map-pin-caveat: #6b5f4a;
  --shadow: 0 1px 3px rgba(40, 30, 10, 0.12);
  --focus: #1d5fae;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171310;
    --bg-surface: #1f1a15;
    --bg-raised: #262019;
    --text-primary: #f3ecdd;
    --text-secondary: #cdc0a2;
    --text-muted: #a99b7d;
    --accent: #e0a15c;
    --accent-strong: #f0b876;
    --border: #3a3226;
    --border-strong: #514736;
    --map-land: #2c261c;
    --map-outline: #e0a15c;
    --map-pin: #e0a15c;
    --map-pin-caveat: #a99b7d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --focus: #7ab4ff;
  }
}

:root[data-theme="dark"] {
  --bg: #171310;
  --bg-surface: #1f1a15;
  --bg-raised: #262019;
  --text-primary: #f3ecdd;
  --text-secondary: #cdc0a2;
  --text-muted: #a99b7d;
  --accent: #e0a15c;
  --accent-strong: #f0b876;
  --border: #3a3226;
  --border-strong: #514736;
  --map-land: #2c261c;
  --map-outline: #e0a15c;
  --map-pin: #e0a15c;
  --map-pin-caveat: #a99b7d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --focus: #7ab4ff;
}

* { 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(--text-primary);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.6;
}
a { color: var(--accent-strong); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

section, .site-card { scroll-margin-top: 3.6rem; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  height: 3.1rem; padding: 0 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.topbar .home { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.topbar .home:hover { color: var(--accent-strong); }
.topnav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-family: -apple-system, sans-serif; font-size: 0.85rem; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; color: var(--text-secondary); padding: 0.3rem 0; }
.topnav a[aria-current="true"], .topnav a:hover { color: var(--accent-strong); border-bottom: 2px solid var(--accent-strong); }
.spacer { flex: 1; }
.chip { font-family: -apple-system, sans-serif; font-size: 0.78rem; text-decoration: none; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.25rem 0.7rem; white-space: nowrap; }
.chip:hover { color: var(--accent-strong); border-color: var(--accent-strong); }
.icon-btn { width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { color: var(--accent-strong); border-color: var(--accent-strong); }
.icon-btn svg[hidden] { display: none; }

main { max-width: 44rem; margin: 0 auto; padding: 0 1.3rem; }
.wide { max-width: 64rem; }

.hero { padding: 3.4rem 0 1.6rem; }
.kicker { font-family: -apple-system, sans-serif; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.18; margin: 0.5rem 0 1rem; }
.deck { font-size: 1.2rem; color: var(--text-secondary); margin: 0 0 1.2rem; }
.byline { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); }

h2 { font-size: 1.5rem; margin: 2.6rem 0 0.9rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
p { margin: 0 0 1.05rem; }
.lede { font-size: 1.08rem; }

.callout { background: var(--bg-raised); border-left: 3px solid var(--accent); border-radius: 0.3rem; padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: 0.98rem; }
.callout.caveat { border-left-color: var(--map-pin-caveat); }

.map-wrap { margin: 1.6rem 0; }
.map-svg { width: 100%; height: auto; display: block; background: var(--bg-raised); border-radius: 0.5rem; }
.map-svg .land { fill: var(--map-land); stroke: var(--map-outline); stroke-width: 1.4; }
.map-svg .pin { fill: var(--map-pin); cursor: pointer; }
.map-svg .pin.caveat { fill: var(--map-pin-caveat); }
.map-svg .pin-label { font-family: -apple-system, sans-serif; font-size: 13px; fill: var(--text-primary); pointer-events: none; }
.map-caption { font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.6rem; }

.site-subtitle { font-weight: 400; color: var(--text-muted); font-size: 1rem; }
.site-card { margin: 2.4rem 0; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.site-card:last-child { border-bottom: none; }
.site-figure { margin: 0 0 1rem; }
.site-figure img { width: 100%; height: auto; border-radius: 0.4rem; display: block; box-shadow: var(--shadow); }
.site-figure figcaption { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.45rem; }
.site-meta { font-family: -apple-system, sans-serif; font-size: 0.86rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0.9rem 0 1rem; }
.site-meta strong { color: var(--text-primary); }
.site-sources { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); }
.site-sources a { color: var(--text-muted); }

table.visit-table { width: 100%; border-collapse: collapse; font-family: -apple-system, sans-serif; font-size: 0.88rem; margin: 1.4rem 0; }
table.visit-table th, table.visit-table td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.visit-table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

.sources-list { font-size: 0.92rem; }
.sources-list li { margin-bottom: 0.5rem; }

footer.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.6rem 0 2.4rem; font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); }
footer.site-footer a { color: var(--text-muted); }
footer.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.8rem; }

.rail { position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 0.85rem; z-index: 20; }
.rail a { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.rail .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--border-strong); transition: transform 0.15s, background 0.15s; }
.rail a[aria-current="true"] .dot { background: var(--accent-strong); transform: scale(1.45); }
.rail .label { font-family: -apple-system, sans-serif; font-size: 0.76rem; color: var(--text-secondary); opacity: 0; transform: translateX(4px); transition: opacity 0.15s, transform 0.15s; white-space: nowrap; }
.rail a:hover .label, .rail a:focus-visible .label { opacity: 1; transform: translateX(0); }

@media (min-width: 76rem) {
  .rail { display: flex; }
}
@media (max-width: 75.99rem) {
  .rail { display: none; }
}
@media print { .rail, .topbar { display: none; } }

@media (max-width: 30rem) {
  main { padding: 0 1rem; }
  .hero { padding-top: 2.2rem; }
}
