/* ──────────────────────────────────────────────────────────────
   Orvandel · Vein-Survey Codex
   tokens → reset → layout → masthead → vein-rail → folio → utilities
   ────────────────────────────────────────────────────────────── */

:root {
  /* palette */
  --stone-deep:   #0F1117;
  --stone-mid:    #161A22;
  --stone-elev:   #1E2330;
  --chalk:        #E8E4D5;
  --chalk-soft:   rgba(232, 228, 213, 0.72);
  --chalk-mute:   rgba(232, 228, 213, 0.48);
  --chalk-faint:  rgba(232, 228, 213, 0.18);
  --hairline:     rgba(232, 228, 213, 0.08);
  --vein-gold:    #C9A24B;
  --vein-glow:    rgba(201, 162, 75, 0.55);
  --vein-dim:     rgba(201, 162, 75, 0.22);
  --vein-blue:    #5B7FA3;
  --signal:       #D6584E;

  /* type */
  --font-serif: "Newsreader", "Source Serif Pro", Georgia, serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* scale */
  --measure: 36rem;
  --rail-w:  16rem;
}

/* ── reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--stone-deep);
  color: var(--chalk);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.62;
  font-weight: 380;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201, 162, 75, 0.04), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(91, 127, 163, 0.03), transparent 60%);
  min-height: 100vh;
}

a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--vein-gold); color: var(--stone-deep); }

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

/* ── shell ─────────────────────────────────────────────────── */
.shell {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) 4rem;
  min-height: 100vh;
}

/* ── masthead ──────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.masthead__brand {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--chalk);
}
.masthead__mark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--vein-gold);
  text-transform: uppercase;
}
.masthead__title {
  font-family: var(--font-serif);
  font-weight: 460;
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  letter-spacing: 0.005em;
  line-height: 1;
}
.masthead__sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  margin-left: 0.5rem;
}
.masthead__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-mute);
}

/* ── page (rail + folio) ───────────────────────────────────── */
.page {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* ── vein rail (the signature) ─────────────────────────────── */
.rail {
  position: sticky;
  top: 2rem;
  padding: 0.5rem 0;
}

.vein {
  position: relative;
  padding: 0.75rem 0;
}

/* the hairline itself */
.vein::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.55rem;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--vein-dim) 8%,
    var(--vein-dim) 92%,
    transparent 100%
  );
}

.vein__step {
  position: relative;
  padding: 1.25rem 0 1.25rem 2rem;
}

.vein__link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--chalk-soft);
  transition: color 220ms ease;
}
.vein__link:hover { color: var(--chalk); }

.vein__roman {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  color: var(--chalk-mute);
  text-transform: uppercase;
  font-weight: 500;
}
.vein__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 460;
  letter-spacing: 0.005em;
  line-height: 1.15;
}

/* the node — sits centred on the hairline */
.vein__node {
  position: absolute;
  left: 0.55rem;
  top: 1.65rem;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  background: var(--stone-deep);
  border: 1px solid var(--vein-dim);
  border-radius: 50%;
  transition: all 280ms ease;
}

.vein__step--active .vein__link { color: var(--chalk); }
.vein__step--active .vein__roman { color: var(--vein-gold); }
.vein__step--active .vein__node {
  background: var(--vein-gold);
  border-color: var(--vein-gold);
  box-shadow:
    0 0 0 3px rgba(15, 17, 23, 1),
    0 0 0 4px var(--vein-dim),
    0 0 12px var(--vein-glow),
    0 0 24px var(--vein-glow);
  animation: pulse 6.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(15, 17, 23, 1),
      0 0 0 4px var(--vein-dim),
      0 0 10px var(--vein-glow),
      0 0 18px var(--vein-glow);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(15, 17, 23, 1),
      0 0 0 4px rgba(201, 162, 75, 0.4),
      0 0 18px var(--vein-glow),
      0 0 36px rgba(201, 162, 75, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vein__step--active .vein__node { animation: none; }
  * { transition: none !important; }
}

.rail__note {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--chalk-mute);
  text-transform: uppercase;
  margin: 2rem 0 0 2rem;
  line-height: 1.6;
}

/* ── folio ─────────────────────────────────────────────────── */
.folio {
  max-width: var(--measure);
  padding-bottom: 4rem;
}

.folio__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  color: var(--vein-gold);
  text-transform: uppercase;
  margin: 0 0 1.5rem;
  font-weight: 500;
}
.folio__eyebrow .sep {
  color: var(--chalk-faint);
  margin: 0 0.7em;
}

.folio__title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5.5vw, 3.6rem);
  font-weight: 380;
  letter-spacing: -0.012em;
  line-height: 1.02;
  margin: 0 0 1.5rem;
  color: var(--chalk);
}

.folio__lede {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.5;
  font-style: italic;
  font-weight: 400;
  color: var(--chalk-soft);
  margin: 0 0 3rem;
  max-width: 32rem;
}

.folio section {
  margin-top: 2.5rem;
}

.folio h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--chalk);
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
}
.folio h2::before {
  content: attr(data-mark);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  color: var(--vein-gold);
  font-weight: 500;
  text-transform: uppercase;
}

.folio p {
  margin: 0 0 1rem;
  color: var(--chalk-soft);
}
.folio p strong { color: var(--chalk); font-weight: 520; }
.folio p em { font-style: italic; color: var(--chalk); }

.folio__pull {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--chalk-soft);
  border-left: 1px solid var(--vein-dim);
  padding-left: 1rem;
  margin: 0 0 1.25rem !important;
}
.folio__pull em { color: var(--chalk); }

.folio__hero {
  position: relative;
  margin: 0 0 2.5rem;
  border: 1px solid var(--hairline);
  background: var(--stone-mid);
  overflow: hidden;
}
.folio__hero img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 280ms ease, transform 600ms ease;
}
.folio__hero__btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  position: relative;
}
.folio__hero__btn:hover img { opacity: 0.85; transform: scale(1.012); }
.folio__hero__btn:focus-visible { outline: none; }
.folio__hero__btn:focus-visible img { opacity: 0.85; }

.folio__hero__hint {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.35rem 0.6rem;
  background: rgba(15, 17, 23, 0.78);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(6px);
  color: var(--chalk-soft);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease, color 220ms ease, border-color 220ms ease;
  pointer-events: none;
}
.folio__hero__btn:hover .folio__hero__hint,
.folio__hero__btn:focus-visible .folio__hero__hint {
  opacity: 1;
  transform: translateY(0);
  color: var(--vein-gold);
  border-color: var(--vein-dim);
}
.folio__hero__hint__glyph {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0;
}

/* ── lightbox dialog ──────────────────────────────────────── */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--chalk);
  inset: 0;
}
.lightbox::backdrop {
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(201, 162, 75, 0.06), transparent 70%),
    rgba(15, 17, 23, 0.94);
  backdrop-filter: blur(6px);
}
.lightbox[open] {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 4.5rem 3rem 3rem;
  animation: lightbox-in 220ms ease-out;
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__frame {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  max-width: min(100%, 88rem);
  max-height: 100%;
  min-height: 0;
}
.lightbox__map-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: calc(100vh - 13rem);
  margin: 0 auto;
  overflow: hidden;
  line-height: 0;
  border: 1px solid var(--hairline);
  box-shadow:
    0 0 0 1px rgba(201, 162, 75, 0.10),
    0 24px 60px -18px rgba(0, 0, 0, 0.55),
    0 0 0 6px rgba(15, 17, 23, 0.4);
  cursor: default;
}
.lightbox__map-wrap.is-panning { cursor: grabbing; }
.lightbox__map {
  position: relative;
  display: inline-block;
  line-height: 0;
  transform-origin: 0 0;
  transform: translate(0px, 0px) scale(1);
  transition: transform 180ms ease;
  will-change: transform;
}
.lightbox__map-wrap.is-panning .lightbox__map { transition: none; }
.lightbox__map img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 13rem);
  width: auto;
  height: auto;
  border: 0;
  box-shadow: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* zoom toolbar */
.lightbox__zoom {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 auto 0.85rem;
  padding: 0.25rem 0.4rem;
  background: var(--stone-mid);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
}
.lightbox__zoom button {
  padding: 0.25rem 0.6rem;
  min-width: 2rem;
  background: var(--stone-deep);
  border: 1px solid var(--hairline);
  color: var(--chalk-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.lightbox__zoom button:hover {
  color: var(--vein-gold);
  border-color: var(--vein-dim);
  background: var(--stone-elev);
}
.lightbox__zoom__level {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vein-gold);
  min-width: 3.2rem;
  text-align: center;
}
.lightbox__zoom__reset {
  font-size: 0.6rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem !important;
}
.lightbox__zoom__hint {
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  margin-left: 0.4rem;
}

/* ── hotspot overlay ──────────────────────────────────────── */
.lightbox__hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.lightbox__hotspots a {
  pointer-events: auto;
  cursor: pointer;
  outline: none;
}
.lightbox__hotspots .hotspot {
  fill: rgba(201, 162, 75, 0);
  stroke: rgba(201, 162, 75, 0);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill 220ms ease, stroke 220ms ease;
}
.lightbox__hotspots a:hover .hotspot,
.lightbox__hotspots a:focus-visible .hotspot {
  fill: rgba(201, 162, 75, 0.18);
  stroke: var(--vein-gold);
}

.lightbox__map__readout {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.4rem 0.95rem;
  background: rgba(15, 17, 23, 0.88);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--vein-gold);
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 200ms ease, transform 200ms ease;
  white-space: nowrap;
}
.lightbox__map__readout--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── map tuning mode (?edit=1) ────────────────────────────── */
.lightbox__hotspots--edit .hotspot {
  fill: rgba(201, 162, 75, 0.10);
  stroke: var(--vein-gold);
  stroke-width: 1;
  stroke-dasharray: 2 1.5;
  vector-effect: non-scaling-stroke;
}
.lightbox__hotspots--edit a:hover .hotspot,
.lightbox__hotspots--edit a:focus-visible .hotspot {
  fill: rgba(201, 162, 75, 0.28);
  stroke-dasharray: 0;
}

.lightbox__map__labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.hotspot__label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.18rem 0.45rem;
  background: rgba(15, 17, 23, 0.92);
  border: 1px solid var(--vein-dim);
  color: var(--vein-gold);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}

.map-tuner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.9rem;
  background: var(--stone-mid);
  border: 1px solid var(--hairline);
  z-index: 10;
  font-family: var(--font-mono);
}
.map-tuner__label {
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--chalk-mute);
}
.map-tuner__value {
  font-size: 0.95rem;
  color: var(--vein-gold);
  font-variant-numeric: tabular-nums;
}
.map-tuner__hint {
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-faint);
  margin-top: 0.15rem;
}

/* ── trace mode ───────────────────────────────────────────── */
.map-tuner__readout { display: flex; flex-direction: column; gap: 0.2rem; }
.map-tuner__trace {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  width: 18rem;
  max-width: 32vw;
}
.map-tuner--tracing .map-tuner__readout { display: none; }
.map-tuner--tracing .map-tuner__trace { display: flex; }

.map-tuner__points {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  padding: 0.45rem 0.6rem;
  background: var(--stone-deep);
  border: 1px solid var(--hairline);
  color: var(--vein-gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  word-break: break-all;
}
.map-tuner__points:focus-visible { outline: 1px solid var(--vein-dim); outline-offset: 0; }
.map-tuner__points::placeholder {
  color: var(--chalk-faint);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.6rem;
}

.map-tuner__actions { display: flex; gap: 0.35rem; }
.map-tuner__actions button,
.map-tuner__toggle {
  padding: 0.35rem 0.7rem;
  background: var(--stone-deep);
  border: 1px solid var(--hairline);
  color: var(--chalk-soft);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}
.map-tuner__actions button:hover,
.map-tuner__toggle:hover {
  color: var(--vein-gold);
  border-color: var(--vein-dim);
  background: var(--stone-elev);
}
.map-tuner__toggle {
  margin-top: 0.15rem;
  align-self: flex-start;
}
.map-tuner__toggle--on {
  color: var(--vein-gold);
  border-color: var(--vein-gold);
  background: var(--stone-elev);
}

/* trace overlay svg sits on top of the image and hotspots */
.trace-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
.trace-overlay .trace-line {
  fill: none;
  stroke: #000;
  stroke-width: 0.6;
  stroke-linejoin: round;
  stroke-opacity: 0.7;
  vector-effect: non-scaling-stroke;
}

/* HTML dots (kept circular regardless of map aspect ratio) */
.trace-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.trace-dot {
  position: absolute;
  width:  calc(4px * var(--dot-scale, 1));
  height: calc(4px * var(--dot-scale, 1));
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 0 0 calc(0.5px * var(--dot-scale, 1)) rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* While tracing: dim hotspots, make them click-through, switch cursor */
.lightbox__map.is-tracing { cursor: crosshair; }
.lightbox__map.is-tracing .lightbox__hotspots {
  opacity: 0.35;
  pointer-events: none;
}
.lightbox__map.is-tracing .lightbox__map__labels { opacity: 0.4; }
.lightbox__caption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  color: var(--vein-gold);
  text-transform: uppercase;
  text-align: center;
  margin-top: 1rem;
}
.lightbox__caption .sep {
  color: var(--chalk-faint);
  margin: 0 0.7em;
}

.lightbox__close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.95rem 0.45rem 0.8rem;
  background: var(--stone-mid);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--chalk-soft);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}
.lightbox__close:hover,
.lightbox__close:focus-visible {
  color: var(--vein-gold);
  border-color: var(--vein-dim);
  background: var(--stone-elev);
  outline: none;
}
.lightbox__close__x {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0;
}

.lightbox__hint {
  margin: 1.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  text-align: center;
}
.lightbox__hint kbd {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  padding: 0.12rem 0.4rem;
  margin: 0 0.15rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--stone-mid);
  color: var(--chalk-soft);
}

@media (max-width: 640px) {
  .lightbox[open] { padding: 4rem 1rem 2rem; }
  .lightbox__close { top: 1rem; right: 1rem; }
  .lightbox__frame img { max-height: calc(100vh - 9rem); }
}

/* ── sub-nav (for sections with children) ─────────────────── */
.subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  margin: 0 0 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
  max-width: var(--measure);
}
.subnav__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--chalk-mute);
  flex: 0 0 auto;
}
.subnav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.subnav__link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--chalk-mute);
  padding: 0.15rem 0;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}
.subnav__link:hover { color: var(--chalk); }
.subnav__link--active {
  color: var(--vein-gold);
  border-bottom-color: var(--vein-dim);
}

/* ── folio entry as link (used by overview pages) ─────────── */
.folio__entry--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 200ms ease;
}
.folio__entry--link:hover {
  background: var(--stone-mid);
}
.folio__entry--link:hover .folio__entry__tag {
  color: var(--chalk);
}

.folio__list {
  margin: 1rem 0 0;
  padding: 0;
}
.folio__list li {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: 0.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--hairline);
  color: var(--chalk-soft);
}
.folio__list li:last-child { border-bottom: 1px solid var(--hairline); }
.folio__list .mark {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--vein-gold);
  padding-top: 0.18rem;
  font-weight: 500;
}
.folio__list strong { color: var(--chalk); font-weight: 520; }

.folio__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  margin-top: 1.5rem;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.folio__card {
  background: var(--stone-deep);
  padding: 1.1rem 1.2rem;
}
.folio__card h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--vein-gold);
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.folio__card p {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  color: var(--chalk-soft);
}

/* rumours: one-per-row entries */
.folio__entries { margin-top: 1rem; }
.folio__entry {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--hairline);
}
.folio__entry:last-child { border-bottom: 1px solid var(--hairline); }
.folio__entry__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--vein-gold);
  text-transform: uppercase;
  font-weight: 500;
  padding-top: 0.15rem;
}
.folio__entry__body {
  margin: 0;
  color: var(--chalk-soft);
}

/* folio footer / colophon */
.folio__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--chalk-mute);
  text-transform: uppercase;
}

/* ── mobile ────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .rail {
    position: static;
    top: auto;
    padding: 0 0 0.5rem;
    min-width: 0;
    max-width: 100%;
  }
  .vein {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    gap: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .vein::-webkit-scrollbar { display: none; }
  .vein::before {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
    background: linear-gradient(to right,
      transparent, var(--vein-dim) 10%, var(--vein-dim) 90%, transparent);
  }
  .vein__step {
    padding: 0.5rem 1.5rem 1.25rem;
    flex: 0 0 auto;
  }
  .vein__node {
    left: 50%;
    top: auto;
    bottom: 0;
    margin-left: -3px;
    margin-bottom: -3px;
  }
  .vein__link { align-items: center; text-align: center; }
  .rail__note { display: none; }

  .masthead { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .masthead__meta { font-size: 0.62rem; }

  .folio__entry { grid-template-columns: 1fr; gap: 0.5rem; }
}
