/* VANTAGE & VELLUM main stylesheet. Layout, components, motion.
   Tokens live in tokens.css. Component vocabulary is cartographic:
   plates, cartouches, waymarks, legs, stations, benchmarks, seals. */

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-weight: 430;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

::selection { background: var(--ochre-deep); color: var(--vellum); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: var(--vellum);
  border-radius: var(--r-1);
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 650;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(calc(-100% - 1.5rem));
}
.skip-link:focus-visible { transform: none; }

/* ---------- text roles ---------- */
.headline,
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.h1 { font-size: var(--t-h1); line-height: var(--lh-tight); }
.h2 { font-size: var(--t-h2); }
.h3 { font-size: var(--t-h3); }

.lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-lead);
  line-height: 1.45;
  max-width: var(--measure);
  text-wrap: pretty;
}
.fieldnote { max-width: var(--measure); color: var(--muted); text-wrap: pretty; }
.fieldnote strong { color: var(--fg); font-weight: 620; }

/* waymark: the label role. A survey stake driven into the page. */
.waymark {
  display: inline-flex;
  gap: 0.75em;
  align-items: center;
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 680;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.waymark::before {
  content: "";
  width: 1.5em;
  border-top: 2px solid var(--accent);
}
.waymark--bare::before { display: none; }
.waymark--muted { color: var(--muted); }
.waymark--accent { color: var(--accent); }

/* the guide's voice: italic serif commentary */
.commentary {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1.5;
  max-width: 44rem;
  text-wrap: pretty;
}

.accent { color: var(--accent); }
.dim { color: var(--muted); }

/* sample chip: honesty marker for placeholder content */
.sample-chip {
  display: inline-block;
  padding: 0.2em 0.65em;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
}

/* ---------- layout primitives ---------- */
.folio {
  width: min(100% - 2 * var(--edge), var(--max-w));
  margin-inline: auto;
}

.sheet {
  position: relative;
  padding-block: var(--section-pad);
  background: var(--bg);
  color: var(--fg);
}
.sheet--flush { padding-block: 0; }
.sheet--ruled { border-top: 1px solid var(--line); }

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

/* ---------- bearing bar (site header) ---------- */
.bearing-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-chrome);
  background: var(--vellum);
  color: var(--ink);
  border-bottom: var(--rule-double);
}
.bearing-bar .folio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-3);
}
.masthead {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.masthead .amp { font-style: italic; color: var(--accent); }
.masthead svg { width: 26px; height: 26px; }

/* the inked north needle, in the masthead mark and on the plate's compass rose */
.rose-needle { fill: var(--accent); }

.bearing-nav { display: flex; gap: var(--s-5); }
.bearing-nav a {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 620;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.78;
  transition: opacity var(--dur-1) ease;
}
.bearing-nav a:hover, .bearing-nav a[aria-current="true"] { opacity: 1; }
.bearing-nav a[aria-current="true"] { color: var(--accent); }

/* live coordinates of the plate's view centre; decorative for AT */
.bearing-readout {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 560;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: var(--s-4);
  white-space: nowrap;
  min-width: 17ch;
}

.bearing-right { display: flex; align-items: center; gap: var(--s-4); }

.folio-btn {
  display: none;
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 650;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  padding: var(--s-2) var(--s-4);
  border: 1.5px solid currentColor;
  border-radius: var(--r-1);
}

/* ---------- folio overlay (mobile menu) ---------- */
.folio-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-folio);
  background: var(--ink);
  color: var(--vellum);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-8) var(--edge) var(--s-6);
}
.folio-overlay.is-open { display: flex; overflow-y: auto; overscroll-behavior: contain; }
.folio-overlay nav { display: flex; flex-direction: column; gap: var(--s-3); }
.folio-overlay nav a {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 3.6rem);
  font-weight: 700;
  text-decoration: none;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
}
.folio-overlay nav a .waymark { color: var(--drab-2); }
.folio-overlay nav a .waymark::before { border-color: var(--ochre); }
.folio-close {
  position: absolute;
  top: var(--s-5);
  right: var(--edge);
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 650;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  padding: var(--s-2) var(--s-4);
  border: 1.5px solid rgba(245, 239, 226, 0.5);
  border-radius: var(--r-1);
}
.folio-overlay .commentary { color: var(--drab-2); font-size: 1.05rem; }

/* ---------- seals (buttons) ---------- */
.seal {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.95em 1.7em;
  border-radius: var(--r-1);
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--vellum);
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
}
.seal:hover { background: var(--ink); border-color: var(--ink); color: var(--vellum); }
/* on ink surfaces --accent is the bright strength, which carries vellum
   lettering at only 2.60:1. Ink lettering on the same fill reads 5.04:1. */
[data-theme="ink"] .seal:not(.seal--trace) { color: var(--ink); }
[data-theme="ink"] .seal:hover { background: var(--vellum); border-color: var(--vellum); color: var(--ink); }
.seal--trace {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--fg);
}
.seal--trace:hover { background: transparent; border-color: var(--fg); color: var(--fg); }
.seal .seal-arrow { transition: transform var(--dur-2) var(--ease-out); }
.seal:hover .seal-arrow { transform: translateX(4px); }

/* ---------- the atlas (map-first hero) ---------- */
.atlas { padding-top: clamp(1.5rem, 4vh, 3rem); }
.atlas-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.atlas-head .lead { max-width: 46rem; }

/* plate/list switch: two survey flags */
.plate-or-list {
  display: inline-flex;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-1);
  overflow: hidden;
}
.plate-or-list button {
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 650;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
}
.plate-or-list button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--vellum);
}
html:not(.js) .plate-or-list { display: none; }

/* the plate itself */
.plate-frame {
  position: relative;
  border: var(--rule-double);
  border-radius: var(--r-plate);
  background: var(--vellum-2);
  box-shadow: var(--shadow-plate);
  overflow: hidden;
}
.plate-scope {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  max-height: min(76vh, 46rem);
  touch-action: none;
  overscroll-behavior: contain;
}
html:not(.js) .plate-scope { touch-action: auto; cursor: default; }
.js .plate-scope { cursor: grab; }
.js .plate-scope.is-panning { cursor: grabbing; }
.plate-scope svg { width: 100%; height: 100%; }

/* plate furniture: SVG-side classes */
.plate-toponym {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  fill: var(--ink-3);
  letter-spacing: 0.14em;
}
.plate-streetname {
  font-family: var(--font-body);
  font-weight: 560;
  fill: var(--ink-3);
  letter-spacing: 0.22em;
}
.route-inking {
  fill: none;
  stroke: var(--ochre-deep);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
  transition: stroke-width var(--dur-1) ease, opacity var(--dur-1) ease;
}
.plate-frame[data-lit="1"] .route-inking[data-route="1"],
.plate-frame[data-lit="2"] .route-inking[data-route="2"],
.plate-frame[data-lit="3"] .route-inking[data-route="3"],
.plate-frame[data-lit="4"] .route-inking[data-route="4"] { stroke-width: 8; opacity: 1; }

.pin { cursor: pointer; }
.pin circle.pin-disc {
  fill: var(--ochre-deep);
  stroke: var(--vellum);
  stroke-width: 3;
  transition: r var(--dur-1) ease;
}
.pin:hover circle.pin-disc, .pin:focus circle.pin-disc { r: 19; }
.pin text {
  fill: var(--vellum);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  text-anchor: middle;
  pointer-events: none;
}
.pin:focus { outline: none; }
.pin:focus-visible circle.pin-disc { stroke: var(--focus); stroke-width: 4; }

/* title cartouche pinned over the plate */
.title-cartouche {
  position: absolute;
  top: clamp(0.9rem, 2.5vw, 2rem);
  left: clamp(0.9rem, 2.5vw, 2rem);
  max-width: min(26rem, 62%);
  background: var(--vellum);
  border: var(--rule-double);
  border-radius: var(--r-plate);
  padding: clamp(1rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-plate);
}
.title-cartouche .h1 { font-size: clamp(1.6rem, 3.4vw, 2.8rem); }
.title-cartouche .waymark { margin-bottom: var(--s-3); }
.title-cartouche p { margin-top: var(--s-3); font-size: var(--t-small); color: var(--muted); }
.title-cartouche .sample-chip { margin-top: var(--s-3); }

/* plate controls: bottom-right button stack */
.plate-controls {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  display: grid;
  gap: var(--s-2);
}
html:not(.js) .plate-controls { display: none; }
.plate-controls button {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  background: var(--vellum);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-1);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow-plate);
  transition: background-color var(--dur-1) ease;
}
.plate-controls button:hover { background: var(--vellum-3); }

/* route cartouche: the card a pin opens */
.route-cartouche {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  width: min(24rem, calc(100% - 2 * clamp(0.75rem, 2vw, 1.5rem)));
  background: var(--vellum);
  border: var(--rule-double);
  border-radius: var(--r-plate);
  padding: var(--s-5);
  box-shadow: var(--shadow-plate);
}
.route-cartouche[hidden] { display: none; }
.route-cartouche .h3 { margin-top: var(--s-2); padding-right: var(--s-7); }
.route-cartouche .fieldnote { margin-top: var(--s-2); font-size: var(--t-small); }
.cartouche-close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  font-size: 1rem;
  line-height: 1;
}
.cartouche-close:hover { background: var(--vellum-2); }
.leg-figures {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
}
.leg-figures span { color: var(--muted); }
.leg-figures strong { font-weight: 650; color: var(--fg); }
.cartouche-acts { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-4); }
.cartouche-acts .seal { padding: 0.7em 1.2em; }

/* plate caption: keys + legend */
.plate-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-3);
  font-size: var(--t-small);
  color: var(--muted);
}
.plate-keys { font-variant-numeric: tabular-nums; }
html:not(.js) .plate-keys { display: none; }

/* ---------- the waybook (list view / no-JS itinerary) ---------- */
.waybook { margin-top: var(--s-6); }
.js .atlas[data-view="plate"] .waybook { display: none; }
.js .atlas[data-view="list"] .plate-frame,
.js .atlas[data-view="list"] .plate-caption { display: none; }

.waybook > .waymark { margin-bottom: var(--s-5); }
.waybook-legs { border-top: 1px solid var(--line); counter-reset: leg; }
.waybook-leg {
  border-bottom: 1px solid var(--line);
  padding-block: clamp(1.5rem, 3.5vh, 2.4rem);
  display: grid;
  grid-template-columns: 5ch minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: var(--gutter);
  align-items: baseline;
}
.waybook-leg::before {
  counter-increment: leg;
  content: counter(leg, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 700;
  color: var(--accent);
}
.waybook-leg .h3 a { text-decoration: none; }
.waybook-leg .h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.waybook-leg .fieldnote { font-size: var(--t-small); margin-top: var(--s-2); }
.waybook-leg .leg-figures { border-top: 0; padding-top: 0; margin-top: 0; align-self: center; flex-direction: column; gap: var(--s-1); }
.waybook-leg .cartouche-acts { margin-top: 0; align-self: center; }

/* ---------- the guide ---------- */
.guide-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.guide-spread .commentary { margin-block: var(--s-5); }
.guide-marginalia {
  border-left: 3px solid var(--accent);
  padding-left: clamp(1.1rem, 2.5vw, 2rem);
  display: grid;
  gap: var(--s-5);
}
.guide-marginalia dt {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 680;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-1);
}
.guide-marginalia dd { font-variant-numeric: tabular-nums; }

/* ---------- stations (how a walk runs) ---------- */
.station-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
}
.station {
  position: relative;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.station::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--accent);
  transition: background-color var(--dur-2) ease;
}
.station.is-inview::before { background: var(--accent); }
.station .waymark { margin-bottom: var(--s-3); }
.station .h3 { margin-bottom: var(--s-2); }
.station p { color: var(--muted); font-size: var(--t-small); }

/* ---------- provisions ---------- */
.provision-rows { border-top: 1px solid var(--line); }
.provision {
  display: grid;
  grid-template-columns: minmax(10rem, 18rem) minmax(0, 1fr);
  gap: var(--gutter);
  padding-block: clamp(1.1rem, 2.4vh, 1.7rem);
  border-bottom: 1px solid var(--line);
}
.provision dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.provision dd { color: var(--muted); max-width: var(--measure); }

/* ---------- benchmarks (site survey stats) ---------- */
.benchmark-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
}
.benchmark {
  padding: var(--s-6) var(--s-5);
  border-inline-start: 1px solid var(--line);
}
.benchmark:first-child { border-inline-start: 0; }
.benchmark-figure {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.benchmark .waymark { margin-top: var(--s-3); }
.benchmark-note {
  display: block;
  margin-top: var(--s-2);
  font-size: var(--t-small);
  color: var(--muted);
  max-width: 26ch;
}

/* ---------- commissions band (ink) ---------- */
.commission-band .commentary { color: var(--drab-2); margin-top: var(--s-5); }
.commission-band .h2 { max-width: 24ch; }
.commission-acts { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-6); }

/* ---------- the waybill (form kit): the slip written up as a survey docket ---------- */
/* the standing note about the rough copy kept on the visitor's own machine */
.waybill-ledger-note { margin-bottom: var(--s-6); }
/* the sure path when no script is running: the form posts to the mail app,
   and the notice carries the address and the number in plain sight. */
.waybill-unscripted { display: none; }
html:not(.js) .waybill-unscripted {
  display: block;
  margin: 0;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-1);
  background: var(--bg-2);
  max-width: var(--measure);
}
.waybill-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.waybill { display: grid; gap: var(--s-5); }
.waybill-field { display: grid; gap: var(--s-2); }
.waybill-field label {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 680;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.waybill-hint { font-size: var(--t-small); color: var(--muted); margin: 0; }
.waybill-field input,
.waybill-field textarea {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: var(--s-3) 0;
  transition: border-color var(--dur-1) ease;
}
.waybill-field input:focus-visible,
.waybill-field textarea:focus-visible {
  outline: none;
  border-bottom: 2px solid var(--accent);
}
.waybill-field textarea { resize: vertical; min-height: 6rem; }
.waybill-field select {
  font: inherit;
  color: var(--fg);
  background-color: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: var(--s-3) 1.6rem var(--s-3) 0;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23635A4C' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  transition: border-color var(--dur-1) ease;
}
.waybill-field select:focus-visible { outline: none; border-bottom: 2px solid var(--accent); }
.waybill-field.is-invalid input,
.waybill-field.is-invalid select,
.waybill-field.is-invalid textarea { border-bottom-color: var(--accent); }
.waybill-error {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 650;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.waybill-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.waybill-errors {
  border: 1.5px solid var(--accent);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
}
.waybill-errors p { margin: 0 0 var(--s-2); font-weight: 620; }
.waybill-errors ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-1); }
.waybill-errors a { color: var(--accent); }
.waybill-status { color: var(--fg); max-width: var(--measure); }
.waybill-status:empty { display: none; }
.waybill[aria-busy="true"] .seal { opacity: 0.6; pointer-events: none; }
.waybill-fallback {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-4);
}
/* display:grid outranks the UA rule for [hidden], so the copy-out panel has to
   be told to stay shut until a send actually fails */
.waybill-fallback[hidden] { display: none; }
.waybill-fallback textarea {
  font-family: var(--font-body);
  font-size: var(--t-small);
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
  width: 100%;
  resize: vertical;
}
.waybill-fallback-acts { display: flex; gap: var(--s-3); flex-wrap: wrap; }
/* honeypot: visually gone, skipped by keyboard and assistive tech */
.hp-copse {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.waybill-aside { display: grid; gap: var(--s-5); justify-items: start; }
.reserve-steps { display: grid; gap: var(--s-3); }
.reserve-steps li { display: flex; gap: var(--s-3); align-items: baseline; }
.reserve-steps .waymark { color: var(--accent); }

/* ---------- interior banner (tour page) ---------- */
.leaf-banner {
  padding-top: clamp(3rem, 8vh, 5rem);
  padding-bottom: clamp(2.5rem, 6vh, 4rem);
  border-bottom: var(--rule-double);
  background:
    linear-gradient(rgba(245, 239, 226, 0.86), rgba(245, 239, 226, 0.94)),
    repeating-linear-gradient(105deg, transparent 0 34px, rgba(43, 38, 32, 0.05) 34px 35px);
}
.leaf-crumbs {
  display: flex;
  gap: var(--s-2);
  font-size: var(--t-small);
  color: var(--muted);
  margin-bottom: var(--s-4);
}
.leaf-crumbs a { color: inherit; }
.leaf-crumbs a:hover { color: var(--fg); }
.leaf-banner .h1 { max-width: 18ch; }
.leaf-banner .lead { margin-top: var(--s-4); }
.leaf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin-top: var(--s-6);
  font-variant-numeric: tabular-nums;
}
.leaf-meta div { display: grid; gap: 2px; }
.leaf-meta dt {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 680;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
}
.leaf-meta dd { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }

/* elevation contour figure */
.contour-figure { display: grid; gap: var(--s-3); }
.contour-figure svg { width: 100%; height: auto; }
.contour-figure figcaption { font-size: var(--t-small); color: var(--muted); }
.contour-area { fill: var(--ochre-deep); opacity: 0.12; }
.contour-trace { fill: none; stroke: var(--ochre-deep); stroke-width: 2.5; stroke-linejoin: round; }
.contour-grid { stroke: var(--line); stroke-width: 1; }
.contour-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 560;
  fill: var(--muted);
}
.contour-stop { fill: var(--ink); }
.contour-stopname {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 650;
  fill: var(--ink);
}

/* stop-by-stop field notes on the tour page */
.stop-ledger { border-top: 1px solid var(--line); counter-reset: stop; }
.stop-entry {
  display: grid;
  grid-template-columns: 5ch minmax(0, 1fr);
  gap: var(--gutter);
  padding-block: clamp(1.6rem, 3.5vh, 2.6rem);
  border-bottom: 1px solid var(--line);
}
.stop-entry::before {
  counter-increment: stop;
  content: counter(stop, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 700;
  color: var(--accent);
}
.stop-entry .h3 { margin-bottom: var(--s-2); }
.stop-entry .fieldnote + .fieldnote { margin-top: var(--s-3); }
.stop-entry .commentary { margin-top: var(--s-4); font-size: 1.15rem; color: var(--ink-3); }

/* ---------- footer (the colophon) ---------- */
.colophon {
  border-top: var(--rule-double);
  padding-block: var(--s-8) var(--s-6);
}
.colophon-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  padding-bottom: var(--s-7);
}
.colophon-grid li { overflow-wrap: anywhere; }
.colophon-grid h2 {
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 680;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-4);
}
.colophon-grid ul { display: grid; gap: var(--s-2); }
.colophon-grid a { text-decoration: none; color: var(--fg); opacity: 0.85; }
.colophon-grid a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.colophon-note { max-width: 30rem; color: var(--muted); font-size: var(--t-small); margin-top: var(--s-4); }
.colophon-legal {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  font-size: var(--t-small);
  color: var(--muted);
}

/* ---------- reveal motion (shared bones) ---------- */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity var(--dur-3) ease, transform var(--dur-3) var(--ease-out);
}
.js .reveal.is-inview { opacity: 1; transform: none; }
/* rescue valve: the main.js script tag removes .js on error, restoring rest state */
.js .reveal[data-delay="1"] { transition-delay: 90ms; }
.js .reveal[data-delay="2"] { transition-delay: 180ms; }
.js .reveal[data-delay="3"] { transition-delay: 270ms; }

/* ---------- styleguide page ---------- */
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--gutter); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; }
.sg-swatch-color { height: 6.5rem; }
.sg-swatch dl { padding: var(--s-4); display: grid; gap: var(--s-1); }
.sg-swatch dt { font-family: var(--font-body); font-size: var(--t-label); font-weight: 680; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.sg-swatch dd { font-variant-numeric: tabular-nums; font-size: var(--t-small); }
.sg-block { padding-block: var(--s-7); border-top: 1px solid var(--line); }
.sg-row { display: grid; grid-template-columns: 14rem 1fr; gap: var(--gutter); align-items: baseline; padding-block: var(--s-4); }
.sg-note { color: var(--muted); max-width: var(--measure); margin-top: var(--s-3); }
.sg-demo { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.sg-degrade { border-top: 1px solid var(--line); }
.sg-degrade div {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr);
  gap: var(--gutter);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--line);
}
.sg-degrade dt { font-weight: 650; }
.sg-degrade dd { color: var(--muted); max-width: var(--measure); }

/* ---------- error page (off the plate) ---------- */
.off-plate {
  min-height: calc(100svh - 8rem);
  display: grid;
  place-content: center;
  text-align: center;
  gap: var(--s-5);
  padding-block: var(--s-8);
}
.off-plate .headline {
  font-size: clamp(4.5rem, 22vw, 13rem);
  line-height: 1;
}
.off-plate .commentary { margin-inline: auto; }
.off-plate svg { margin-inline: auto; width: min(20rem, 70vw); height: auto; }
.off-plate-acts { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
/* the route that walks off the edge of the survey */
.lost-route { stroke: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 68rem) {
  .bearing-readout { display: none; }
}
@media (max-width: 63.9rem) {
  .bearing-nav { display: none; }
  .folio-btn { display: inline-flex; }
  /* no-JS (or failed-JS) fallback: static nav returns, dead menu button goes */
  html:not(.js) .bearing-nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); justify-content: flex-end; }
  html:not(.js) .folio-btn { display: none; }
  .bearing-cta { display: none; }
  .title-cartouche { position: static; max-width: none; border: 0; border-bottom: var(--rule-double); box-shadow: none; }
  .plate-scope { aspect-ratio: 4 / 3.4; }
  .waybook-leg { grid-template-columns: 4ch minmax(0, 1fr); }
  .waybook-leg .leg-figures { grid-column: 2; flex-direction: row; }
  .waybook-leg .cartouche-acts { grid-column: 2; }
  .guide-spread { grid-template-columns: 1fr; }
  .station-line { grid-template-columns: repeat(2, 1fr); row-gap: var(--s-7); }
  .benchmark-row { grid-template-columns: repeat(2, 1fr); }
  .benchmark:nth-child(odd) { border-inline-start: 0; }
  .benchmark:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .waybill-spread { grid-template-columns: 1fr; }
  .colophon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-6); }
  .sg-row { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .station-line { grid-template-columns: 1fr; }
  .benchmark-row { grid-template-columns: 1fr; }
  .benchmark { border-inline-start: 0; }
  .benchmark:nth-child(n + 2) { border-top: 1px solid var(--line); }
  .waybill-pair { grid-template-columns: 1fr; }
  .provision { grid-template-columns: 1fr; gap: var(--s-2); }
  .stop-entry { grid-template-columns: 3.5ch minmax(0, 1fr); }
  .route-cartouche { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; width: auto; }
}

/* ---------- cross-page transitions (progressive enhancement) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---------- preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .seal, .seal .seal-arrow, .station::before, .route-inking,
  .pin circle.pin-disc, .plate-or-list button { transition: none; }
  .station.is-inview::before { background: var(--accent); }
}

@media (forced-colors: active) {
  .seal, .folio-btn, .plate-controls button { border: 1px solid ButtonText; }
  .route-inking { stroke: CanvasText; }
  .waymark::before { border-color: CanvasText; }
}
