/* sucidava-328: terracotta and river-silt. Display Cormorant, body Georgia. */
@font-face {
  font-family: "Cormorant";
  src: url("fonts/Cormorant.woff2?v=09515caf46") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("fonts/Cormorant-Italic.woff2?v=163033751d") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --paper: #f6f1e5;
  --surface: #efe6d2;
  --ink: #241a12;
  --ink-2: #5d5041;
  --line-soft: #d5c8ab;
  --accent: #7c421a;
  --accent-soft: #a86a35;
  --stone: #6e6350;
  --timber: #6e4a26;
  --water: #3f5a4e;
  --chalk: #fbf7ec;
  --terracotta: #b4562f;
  --glass: rgba(246, 241, 229, 0.92);
  --scrim: rgba(23, 16, 10, 0.55);
  --shadow: 0 1px 2px rgba(36, 26, 18, 0.12), 0 4px 18px rgba(36, 26, 18, 0.1);
  --serif: "Cormorant", Georgia, "Times New Roman", serif;
  --body: Georgia, "Times New Roman", serif;
  --wrap: 66ch;
}
:root[data-theme="dark"] {
  --paper: #171310;
  --surface: #221b14;
  --ink: #f0e8d8;
  --ink-2: #c0b39b;
  --line-soft: #443a2b;
  --accent: #e8a05c;
  --accent-soft: #c98d4e;
  --stone: #a89c80;
  --timber: #d29c5f;
  --water: #8fb5a2;
  --chalk: #fbf7ec;
  --terracotta: #d98a55;
  --glass: rgba(23, 19, 16, 0.92);
  --scrim: rgba(10, 8, 6, 0.62);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 18px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.075rem;
  line-height: 1.65;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 0.4em 0 0.3em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 0.5em; }
h3 { font-size: 1.3rem; margin: 0 0 0.3em; }
a { color: var(--accent); }
a:hover { color: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip {
  position: absolute; left: 0.6rem; top: -4rem; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; border-radius: 0 0 6px 6px;
  transition: top 0.15s;
}
.skip:focus { top: 0; color: var(--paper); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.1rem; }
.wrap-wide { max-width: 76rem; }

/* ---------- topbar / progress / rail ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.35rem;
  min-height: 2.9rem; padding: 0 0.7rem;
  background: var(--glass); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .home { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 0.4rem; }
.topbar .home svg { width: 1.15em; height: 1.15em; }
.topnav { display: flex; gap: 0.15rem; margin-left: 0.6rem; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 0.92rem; padding: 0.35rem 0.5rem; border-radius: 6px; white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="true"] { color: var(--accent); font-weight: bold; }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { color: var(--ink); cursor: pointer; list-style: none; padding: .6rem .4rem; white-space: nowrap; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: " ▾"; }
.mobile-nav[open] summary::after { content: " ▴"; }
.mobile-nav summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mobile-nav nav { position: absolute; top: calc(100% + .25rem); left: 0; width: max-content; max-width: calc(100vw - 1.2rem); padding: .35rem; display: grid; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 6px; box-shadow: var(--shadow); z-index: 60; }
.mobile-nav nav a { display: block; padding: .7rem .85rem; color: var(--ink); text-decoration: none; line-height: 1.25; white-space: nowrap; }
.mobile-nav nav a:hover { color: var(--accent); }
.spacer { flex: 1 1 auto; }
.chip { border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.85rem; text-decoration: none; color: var(--ink); }
.icon-btn {
  flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1px solid var(--line-soft); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 55; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; background: var(--terracotta); transform-origin: 0 50%; transform: scaleX(0); }
#pstamp { position: absolute; top: 5px; left: 0; width: 18px; height: 16px; color: var(--terracotta); }
#pstamp svg { width: 100%; height: 100%; display: block; }
.rail {
  position: fixed; right: 0.9rem; top: 50%; transform: translateY(-50%); z-index: 40;
  display: none; flex-direction: column; gap: 0.55rem;
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.6rem 0.42rem;
}
@media (min-width: 80rem) { .rail { display: flex; } }
.rail a { position: relative; display: block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--line-soft); }
.rail a span {
  position: absolute; right: 1.3rem; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--paper); font-size: 0.8rem; padding: 0.15rem 0.55rem; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }
.rail a.on { background: var(--terracotta); }

/* ---------- 3D stage (fullscreen canvas, cards over it) ---------- */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100lvh; z-index: 0;
  display: block; touch-action: pan-y;
}
.no-webgl #scene, .no-js #scene { display: none; }
.scene-done #scene { visibility: hidden; }
.hud {
  position: fixed; z-index: 2; left: 1rem; bottom: 1rem;
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 0.45rem 0.8rem; font-size: 0.9rem; max-width: 19rem;
  box-shadow: var(--shadow);
}
.scene-done .hud, .no-webgl .hud, .no-js .hud { display: none; }
.hud .hud-date { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; display: block; }
.hud .hud-level { color: var(--ink-2); font-size: 0.82rem; display: block; }
.explorebar {
  position: fixed; z-index: 2; right: 1rem; bottom: 1rem; display: flex; gap: 0.4rem; align-items: center;
  background: var(--glass); border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.3rem 0.45rem;
  box-shadow: var(--shadow);
}
.scene-done .explorebar, .no-webgl .explorebar, .no-js .explorebar { display: none; }
.explorebar button {
  min-height: 2.75rem; min-width: 2.75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink); font-size: 0.9rem; padding: 0 0.7rem;
}
.explorebar button:hover { border-color: var(--line-soft); }
.explorebar button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.exploring .explorebar .ex-toggle { background: var(--ink); color: var(--paper); }

/* ---------- hero + steps over the scene ---------- */
main { position: relative; z-index: 1; }
#top { min-height: calc(100lvh - 2.9rem); display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 4rem; }
.hero-text { color: #fbf7ec; text-shadow: 0 1px 10px rgba(10, 8, 6, 0.8), 0 1px 2px rgba(10, 8, 6, 0.9); }
.no-webgl .hero-text, .no-js .hero-text { color: var(--ink); text-shadow: none; }
.kicker { font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.04em; margin: 0; color: inherit; opacity: 0.92; }
.deck { font-size: 1.2rem; line-height: 1.5; margin: 0.6em 0; max-width: 34rem; }
.near, .anniv { margin: 0.3em 0; font-size: 1rem; }
.hero-text a { color: inherit; }
.privacy { font-size: 0.82rem; opacity: 0.85; margin: 0.8em 0 0; }
.hero-still { display: none; margin: 1.2rem auto 0; max-width: 60rem; padding: 0 1.1rem; }
.no-webgl .hero-still, .no-js .hero-still { display: block; }
.hint { text-align: center; margin: 2rem 0 0; font-size: 0.95rem; color: #fbf7ec; text-shadow: 0 1px 6px rgba(10, 8, 6, 0.8); }
.hint span { display: inline-block; }
.no-webgl .hint, .no-js .hint { color: var(--ink-2); text-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .hint span { animation: bob 2.2s ease-in-out infinite; }
  @keyframes bob { 50% { transform: translateY(5px); } }
}
#apa { padding: 12lvh 0 20lvh; }
.steps { display: flex; flex-direction: column; gap: 42lvh; max-width: 27rem; margin: 0 auto 0 0; padding: 0 1.1rem; }
@media (min-width: 60rem) {
  .steps { margin-left: max(1.1rem, calc((100vw - 76rem) / 2)); }
}
.step {
  background: var(--glass); backdrop-filter: blur(6px);
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}
.step .yr-tag { font-family: var(--serif); font-weight: 700; color: var(--accent); margin: 0 0 0.2rem; font-size: 1.02rem; }
.step h3 { margin: 0 0 0.4rem; font-size: 1.45rem; }
.step p { margin: 0.4em 0; }
.step p.note { font-size: 0.92rem; color: var(--ink-2); }
.step blockquote.q { margin: 0.7em 0 0.2em; padding-left: 0.8rem; border-left: 3px solid var(--terracotta); font-style: italic; }
.step .qsrc { font-size: 0.85rem; color: var(--ink-2); margin-top: 0.1em; }

/* ---------- paper sections (cover the canvas) ---------- */
.paper { background: var(--paper); position: relative; z-index: 1; border-top: 1px solid var(--line-soft); }
.block { padding: 3.2rem 0 0.5rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 1.4rem; max-width: 40rem; }
.prose p { margin: 0.8em 0; }
.anchor { color: inherit; text-decoration: none; }
.anchor:hover { text-decoration: underline; }
figure.fig, figure.hero-fig { margin: 1.6rem 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 10px; }
figcaption { font-size: 0.88rem; color: var(--ink-2); margin-top: 0.5rem; }
figcaption .cr { display: block; font-size: 0.8rem; opacity: 0.9; }

/* ---------- the walk ---------- */
.walkfig { margin: 0 0 1.6rem; }
.walkfig svg.walk { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; }
.walk text { font-family: var(--serif); fill: var(--ink-2); }
.walk .band-flood { fill: var(--surface); }
.walk .band-water { fill: var(--water); opacity: 0.28; }
.walk .bed { fill: none; stroke: var(--ink-2); stroke-width: 1.4; opacity: 0.7; }
.walk .deck { stroke: var(--timber); stroke-width: 2.2; stroke-linecap: round; }
.walk .deck-stone { stroke: var(--stone); stroke-width: 3; stroke-linecap: butt; }
.walk .post { stroke: var(--timber); stroke-width: 1.6; }
.walk .anom { fill: none; stroke: var(--timber); stroke-width: 1.6; stroke-dasharray: 3 2; }
.walk .trace { stroke: var(--ink-2); stroke-width: 1.4; opacity: 0.75; }
.walk .giant { fill: var(--stone); opacity: 0.85; }
.walk .portal-n { fill: var(--stone); }
.walk .portal-s { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 5 3; }
.walk .trajan { stroke: var(--terracotta); stroke-width: 3; stroke-linecap: round; }
.walk .trajan-end { fill: var(--terracotta); }
.walk .walker { stroke: var(--accent); stroke-width: 2; }
.walk .walker-dot { fill: var(--accent); }
.walk .walker-hit { fill: transparent; stroke: none; cursor: ew-resize; }
.walk .wlabel { font-size: 5.2px; }
.walk .wlabel-sm { font-size: 4.4px; }
.walk .wzone { font-size: 4.6px; font-style: italic; }
.walk .scalebar { stroke: var(--ink-2); stroke-width: 1.2; }
.walk .honest { font-size: 4.2px; font-style: italic; }
@media (max-width: 40rem) {
  .walk .wlabel { font-size: 7px; }
  .walk .wlabel-sm { font-size: 6px; }
  .walk .wzone { font-size: 6.2px; }
  .walk .honest { font-size: 5.6px; }
}
.walk-ctl { display: flex; flex-wrap: wrap; gap: 0.6rem 0.9rem; align-items: center; margin: 0.9rem 0; }
.pace { display: flex; align-items: center; gap: 0.35rem; border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.2rem 0.35rem 0.2rem 0.8rem; }
.pace legend, .pace > span.lbl { font-size: 0.85rem; color: var(--ink-2); padding: 0; }
.pace label { display: inline-flex; align-items: center; gap: 0.2rem; min-height: 2.75rem; padding: 0 0.5rem; border-radius: 999px; cursor: pointer; font-size: 1rem; }
.pace input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.pace input[type="number"] { width: 3.4rem; min-height: 2.75rem; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 1rem; padding: 0 0.3rem; }
.btn {
  min-height: 2.75rem; padding: 0 1.2rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-soft); background: var(--surface); color: var(--ink);
  font-size: 1rem; font-family: var(--body);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn[hidden] { display: none; }
input[type="range"].scrub { flex: 1 1 12rem; min-height: 2.75rem; accent-color: var(--accent); }
.readouts { display: grid; gap: 0.15rem; margin: 0.4rem 0 0.2rem; font-size: 1.02rem; }
.readouts p { margin: 0.1em 0; }
.readouts .t-time { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.readouts .t-tally { font-weight: bold; }
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .static-times { display: none; }
.static-times { font-size: 0.95rem; color: var(--ink-2); }
.js .nojs-only { display: none; }
html:not(.js) .walk-ctl, html:not(.js) .piernav { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; list-style: none; margin: 0.7rem 0; padding: 0; font-size: 0.9rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .sw { width: 1.6rem; height: 0.55rem; border-radius: 2px; display: inline-block; }
.sw-stone { background: var(--stone); }
.sw-timber { background: var(--timber); }
.sw-water { background: var(--water); opacity: 0.55; }
.sw-lost { background: repeating-linear-gradient(45deg, var(--ink-2) 0 2px, transparent 2px 5px); border: 1px solid var(--line-soft); }
.sw-trajan { background: var(--terracotta); height: 0.3rem !important; }
details.what { margin: 0.6rem 0 0; }
details.what summary { cursor: pointer; color: var(--accent); min-height: 2.75rem; display: inline-flex; align-items: center; }
/* pier cards: buttons + panels (all readable without script) */
.piernav { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 0.6rem; }
.piernav button {
  min-height: 2.75rem; padding: 0 0.9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-soft); background: var(--paper); color: var(--ink); font-size: 0.95rem;
}
.piernav button .y { color: var(--ink-2); font-size: 0.82rem; }
.piernav button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.piernav button.on .y { color: inherit; opacity: 0.8; }
.piercards .pcard { border: 1px solid var(--line-soft); border-radius: 10px; padding: 0.8rem 1rem; margin: 0.5rem 0; background: var(--paper); }
.piercards .pcard h3 { font-size: 1.2rem; }
.piercards .pcard .pyear { font-family: var(--serif); color: var(--accent); font-weight: 700; margin: 0 0 0.15rem; }
.piercards .pcard p { margin: 0.3em 0; }
.piercards[data-js] .pcard { display: none; }
.piercards[data-js] .pcard.on { display: block; }
.piercards[data-all] .pcard { display: block !important; }

/* ---------- witnesses: a dated ledger ---------- */
.wits { list-style: none; margin: 0; padding: 0; }
.wits > li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0 1.1rem; padding: 1rem 0; border-top: 1px solid var(--line-soft); }
.wits > li:last-child { border-bottom: 1px solid var(--line-soft); }
.wits .wdate { font-family: var(--serif); font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.wits h3 { font-size: 1.3rem; margin: 0 0 0.25rem; }
.wits blockquote { margin: 0.5em 0; padding-left: 0.8rem; border-left: 3px solid var(--terracotta); font-style: italic; }
.wits p { margin: 0.35em 0; }
@media (max-width: 40rem) {
  .wits > li { grid-template-columns: 1fr; }
}

/* ---------- banks / ending / sources ---------- */
.duo { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 60rem) { .duo { grid-template-columns: 1fr 1fr; } }
.duo ul { margin: 0.4em 0; padding-left: 1.2rem; }
.duo li { margin: 0.45em 0; }
.fortline { border: 1px solid var(--line-soft); border-radius: 10px; padding: 0.8rem 1.1rem; margin: 1.2rem 0; background: var(--surface); }
.trip { list-style: none; margin: 0.8em 0; padding: 0; }
.trip li { margin: 0.5em 0; padding-left: 1.4rem; position: relative; }
.trip li::before { content: "›"; position: absolute; left: 0.2rem; color: var(--terracotta); font-weight: bold; }
.trip .km { color: var(--ink-2); }
ol.method { padding-left: 1.3rem; }
ol.method li { margin: 0.55em 0; }
.srcs { list-style: none; padding: 0; }
.srcs li { margin: 0.45em 0; padding-left: 1.2rem; position: relative; font-size: 0.96rem; }
.srcs li::before { content: "—"; position: absolute; left: 0; color: var(--ink-2); }
.src-h { font-size: 1.15rem; margin: 1.4em 0 0.3em; }
.see-also { margin-top: 1.6rem; }

/* ---------- share / footer / to-top ---------- */
.share-block { padding-bottom: 3rem; }
.foot { border-top: 1px solid var(--line-soft); padding: 1.4rem 0 2.4rem; position: relative; z-index: 1; background: var(--paper); }
.foot p { margin: 0.2em 0; font-size: 0.9rem; color: var(--ink-2); }
#toTop {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 45;
  width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-soft); background: var(--glass); color: var(--ink);
  font-size: 0.82rem; box-shadow: var(--shadow);
}
#toTop[hidden] { display: none; }
.notfound { padding: 4rem 1.1rem; }

/* ---------- short viewports / coarse pointers ---------- */
@media (max-height: 740px) {
  #apa { padding: 8lvh 0 14lvh; }
  .steps { gap: 30lvh; }
  .hud { bottom: 0.6rem; left: 0.6rem; }
  .explorebar { bottom: 0.6rem; right: 0.6rem; }
}
@media (pointer: coarse) {
  .topnav a { padding: 0.5rem 0.6rem; }
  .chip { padding: 0.35rem 0.8rem; }
  /* pinch covers zoom on touch (scene.js pointer handlers); the bar must fit one row */
  .explorebar [data-zoom] { display: none; }
}
@media (max-width: 59.99rem) {
  .topnav { display: none; }
  .mobile-nav { display: block; }
  .hud { bottom: auto; top: 3.4rem; left: 0.6rem; right: auto; max-width: calc(100vw - 1.2rem); }
  .explorebar { left: 0.6rem; right: 0.6rem; justify-content: center; flex-wrap: wrap; border-radius: 16px; }
  .explorebar [data-zoom] { display: none; }
  #top { padding-top: 6.5rem; padding-bottom: 6rem; }
}
@media print {
  #scene, .hud, .explorebar, .rail, .progress, .topbar, #toTop { display: none !important; }
  .paper { border: none; }
  .step { break-inside: avoid; }
}


/* share row (standards/v2/tools/share_row.py) */
.share-row{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.share-row .lab{font-size:.95rem;margin-inline-end:.3rem}
.share-row a,.share-row button{display:inline-grid;place-items:center;flex:none;width:2.5rem;height:2.5rem;padding:0;border-radius:50%;border:1px solid var(--sr-line,color-mix(in srgb,currentColor 28%,transparent));background:transparent;color:var(--sr-ink,inherit);text-decoration:none;cursor:pointer;font:inherit;transition:color .15s,border-color .15s}
.share-row a:hover,.share-row button:hover,.share-row a:focus-visible,.share-row button:focus-visible{color:var(--sr-acc,inherit);border-color:var(--sr-acc,currentColor)}
.share-row [hidden]{display:none}
@media (pointer:coarse){.share-row a,.share-row button{width:2.75rem;height:2.75rem}}
@media (max-width:30rem){.share-row .lab{flex-basis:100%;margin:0 0 .15rem}}
.share-status{font-size:.92rem;color:var(--sr-ok,inherit);min-height:1.2em;margin:.4rem 0 0}
.share-status:empty{display:none}
.share-field{display:block;width:100%;max-width:36rem;margin-top:.4rem;font:inherit;font-size:.9rem}
