/* ORDERS OF MAGNITUDE
 * Deep-space-first, with a palette that travels the whole descent.
 * Two families only: Newsreader carries the wonder, IBM Plex Mono the data.
 */

:root {
  --bg: #05060a;
  --ink: #e9e5dc;
  --dim: #7b8496;
  --dim-text: #a3acbd;   /* dim at reading size, AA-safe on --bg */
  --acc: #7d9ac4;
  --hair: rgba(233, 229, 220, 0.13);
  --hair-soft: rgba(233, 229, 220, 0.07);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --gut: clamp(20px, 5vw, 86px);
  --sh: 78vh;
  --stations: 32;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-weight: 300; margin: 0; letter-spacing: -0.012em; }
p { margin: 0; }
a { color: inherit; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: -60px; left: 12px; z-index: 90;
  background: var(--ink); color: #06070c; padding: 9px 16px;
  font: 500 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; transition: top 0.2s;
}
.skip:focus { top: 12px; }

:where(a, button):focus-visible {
  outline: 1.5px solid var(--acc);
  outline-offset: 3px;
}

/* ============================ the field ============================ */
#stage {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0; transition: opacity 0.7s ease;
  pointer-events: none;
}
#stage.is-live { opacity: 1; }
html.booting #stage { opacity: 0; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
/* a permanent scrim under the instrument column, so the data always reads */
#overlay::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0;
  width: min(430px, 42vw);
  background: linear-gradient(to left, rgba(3, 4, 8, 0.86) 0%, rgba(3, 4, 8, 0.5) 44%, rgba(3, 4, 8, 0) 100%);
}
/* a vignette and a scrim, so type always sits on something */
#stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 62% 58% at 16% 88%, rgba(2, 3, 6, 0.68) 0%, rgba(2, 3, 6, 0) 72%),
    radial-gradient(ellipse 46% 74% at 100% 50%, rgba(2, 3, 6, 0.5) 0%, rgba(2, 3, 6, 0) 70%),
    radial-gradient(ellipse 120% 120% at 50% 50%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.42) 100%);
  opacity: 0; transition: opacity 0.5s ease;
}
#stage.in-journey::after { opacity: 1; }

/* corner registration marks */
.reg { position: absolute; width: 15px; height: 15px; opacity: 0.4; }
.reg::before, .reg::after { content: ""; position: absolute; background: var(--ink); }
.reg::before { width: 100%; height: 1px; top: 0; left: 0; }
.reg::after { width: 1px; height: 100%; top: 0; left: 0; }
.reg-tl { top: 20px; left: 20px; }
.reg-tr { top: 20px; right: 20px; transform: scaleX(-1); }
.reg-bl { bottom: 20px; left: 20px; transform: scaleY(-1); }
.reg-br { bottom: 20px; right: 20px; transform: scale(-1); }

/* ---------------------------- captions ---------------------------- */
#captions {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.45s ease;
}
#captions::before {
  content: ""; position: absolute;
  left: 0; bottom: 0; width: min(920px, 76vw); height: min(88vh, 900px);
  /* one radial only: a linear component would terminate at the box edge and
     leave a visible vertical seam straight down the middle of the artwork */
  background: radial-gradient(ellipse 76% 72% at 1% 99%,
    rgba(2, 3, 7, 0.93) 0%, rgba(2, 3, 7, 0.78) 26%, rgba(2, 3, 7, 0.5) 50%,
    rgba(2, 3, 7, 0.2) 74%, rgba(2, 3, 7, 0) 100%);
  pointer-events: none;
}
#stage.in-journey #captions { opacity: 1; }
.cap {
  position: absolute; z-index: 1;
  left: var(--gut);
  bottom: clamp(74px, 12vh, 132px);
  width: min(37ch, calc(100vw - 2 * var(--gut) - 150px));
  margin: 0;
  will-change: opacity, transform;
}
.cap-meta {
  display: flex; align-items: center; gap: 12px;
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 14px;
}
.cap-no { position: relative; padding-right: 12px; }
.cap-no::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 1px; height: 9px; background: currentColor; opacity: 0.5;
  transform: translateY(-50%);
}
.cap-zone { color: var(--dim); }
.cap-name {
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  line-height: 1.02;
  font-weight: 200;
  margin-bottom: 10px;
}
.cap-scale {
  font: 500 0.66rem/1.4 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 16px;
}
.cap-text {
  font-style: italic;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.62;
  color: var(--ink);
  opacity: 0.94;
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.75), 0 0 60px rgba(0, 0, 0, 0.5);
}

/* ---------------------------- instrument ---------------------------- */
.instrument {
  position: absolute;
  right: clamp(18px, 2.6vw, 46px);
  top: 50%; transform: translateY(-50%);
  width: 252px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 20px;
  text-align: right;
}
.readout { width: 100%; display: grid; gap: 12px; }
.ro-block { padding-top: 11px; border-top: 1px solid var(--hair); }
.ro-b1 { border-top: 0; padding-top: 0; }
.ro-lab {
  font: 500 0.6rem/1 var(--mono);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 8px;
}
.ro-idx { color: var(--acc); margin-left: 4px; }
.ro-big {
  font: 400 1.42rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.ro-x { opacity: 0.42; margin: 0 0.24em; font-size: 0.82em; }
.ro-exp { font-size: 0.98em; }
.ro-u { color: var(--dim); margin-left: 0.34em; font-size: 0.72em; }
.ro-h {
  font: 400 0.7rem/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--acc);
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}
.ro-name {
  font-size: 1.06rem; line-height: 1.2; font-weight: 300;
  font-style: italic; color: var(--ink);
}
.ro-zone {
  font: 500 0.58rem/1 var(--mono);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--acc); margin-top: 6px;
}
.ro-words {
  font: 400 0.63rem/1.5 var(--mono);
  color: var(--dim); margin-top: 8px;
  letter-spacing: 0.02em;
}
.ro-desc {
  font: 400 0.78rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink); opacity: 0.9;
}

/* the logarithmic rail */
.rail { position: relative; width: 96px; height: min(48vh, 430px); }
#rail-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rail-spine { stroke: var(--hair); stroke-width: 1; }
.rail-tick { stroke: rgba(233, 229, 220, 0.22); stroke-width: 1; }
.rail-tick.maj { stroke: rgba(233, 229, 220, 0.45); }
.rail-num {
  fill: var(--dim); font: 500 9.5px var(--mono);
  letter-spacing: 0.04em; text-anchor: end; dominant-baseline: middle;
}
.rail-node { fill: var(--ink); opacity: 0.42; }
.rail-bar {
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px;
  background: var(--hair-soft);
}
.rail-bar span {
  display: block; width: 100%; height: 100%;
  background: var(--acc); transform-origin: top center;
  transform: scaleY(0);
}
#playhead {
  position: absolute; top: 0; left: 0; width: 96px; height: 0;
  will-change: transform;
}
.ph-line {
  position: absolute; right: 15px; top: 0; width: 52px; height: 1px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, var(--acc) 70%);
  transform: translateY(-0.5px);
}
.ph-dot {
  position: absolute; right: 11px; top: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc);
  transform: translateY(-3.5px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent);
}

/* horizontal rail, used on narrow screens */
.hrail { display: none; }

/* ============================ controls ============================ */
#controls {
  position: fixed; z-index: 20;
  right: var(--gut); bottom: clamp(20px, 3.4vh, 34px);
  display: flex; gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
body.desc-active #controls, body.atlas-mode #controls { opacity: 1; pointer-events: auto; }
.ctl {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(8, 9, 14, 0.62);
  border: 1px solid var(--hair);
  color: var(--ink);
  font: 500 0.63rem/1 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 9px 13px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.ctl:hover { border-color: var(--acc); color: #fff; }
.b-dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--dim); background: transparent;
  transition: background 0.25s, border-color 0.25s;
}
.b-box {
  width: 7px; height: 7px;
  border: 1px solid var(--dim); background: transparent;
  transition: background 0.25s, border-color 0.25s;
}
.ctl[aria-pressed="true"] { border-color: var(--acc); }
.ctl[aria-pressed="true"] .b-dot,
.ctl[aria-pressed="true"] .b-box { background: var(--acc); border-color: var(--acc); }
.ctl[aria-pressed="true"] .b-dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============================ page content ============================ */
#main { position: relative; z-index: 1; }

/* -------- hero -------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7.5vh var(--gut) clamp(96px, 15vh, 180px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 78% 78% at 18% 52%, rgba(3, 4, 8, 0.9) 0%, rgba(3, 4, 8, 0.62) 42%, rgba(3, 4, 8, 0) 80%),
    linear-gradient(to bottom, rgba(3, 4, 8, 0.55) 0%, rgba(3, 4, 8, 0) 24%);
}
.hero-inner { position: relative; max-width: 1080px; }
.kicker {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--acc);
  margin-bottom: clamp(22px, 4vh, 40px);
}
.k-rule { width: 46px; height: 1px; background: var(--hair); }
.title {
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.84;
  font-weight: 200;
  letter-spacing: -0.035em;
  margin-bottom: clamp(20px, 3.6vh, 40px);
}
.title-of {
  font-style: italic; font-weight: 200;
  color: var(--acc);
  font-size: 0.62em;
  letter-spacing: -0.02em;
  margin-right: 0.1em;
}
.lede {
  font-style: italic;
  font-size: clamp(1.1rem, 1.9vw, 1.62rem);
  line-height: 1.5;
  max-width: 46ch;
  color: var(--ink);
  opacity: 0.92;
}
.hero-meta {
  list-style: none; margin: clamp(24px, 4vh, 40px) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid var(--hair);
  max-width: 640px;
}
.hero-meta li {
  flex: 1 1 auto; min-width: 116px;
  padding: 16px 18px 16px 0;
  font: 500 0.6rem/1.5 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
}
.hero-meta span {
  display: block;
  font-family: var(--serif); font-style: normal; font-weight: 300;
  font-size: 1.68rem; line-height: 1; letter-spacing: -0.02em;
  color: var(--ink); text-transform: none;
  font-variant-numeric: tabular-nums;
  margin-bottom: 7px;
}
.hero-act {
  margin-top: clamp(26px, 4.6vh, 44px);
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.begin {
  display: inline-flex; align-items: center; gap: 11px;
  border: 1px solid var(--ink);
  padding: 13px 22px;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.begin::after { content: "↓"; font-size: 1.05em; }
.begin:hover { background: var(--ink); color: #05060a; }
.hero-note {
  font: 400 0.66rem/1.5 var(--mono);
  color: var(--dim); max-width: 30ch;
}
.scroll-cue {
  position: absolute; right: var(--gut); bottom: clamp(24px, 5vh, 48px);
  display: flex; align-items: center; gap: 12px;
  font: 500 0.6rem/1 var(--mono);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--dim);
}
.cue-line {
  width: 54px; height: 1px; background: var(--hair);
  position: relative; overflow: hidden;
}
.cue-line::after {
  content: ""; position: absolute; inset: 0;
  background: var(--acc);
  animation: sweep 2.6s ease-in-out infinite;
}
@keyframes sweep {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* -------- section chrome -------- */
.sec-head { margin-bottom: clamp(34px, 5vw, 62px); max-width: 62ch; }
.sec-no {
  font: 500 0.62rem/1 var(--mono);
  letter-spacing: 0.24em; color: var(--acc);
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hair);
}
.sec-head h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1.02; font-weight: 200;
  letter-spacing: -0.03em;
}
.sec-sub {
  margin-top: 20px;
  font-style: italic;
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  line-height: 1.62;
  color: var(--ink); opacity: 0.72;
  max-width: 52ch;
}

.legend { padding: clamp(80px, 14vh, 170px) var(--gut) clamp(70px, 12vh, 140px); position: relative; }
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: clamp(26px, 3vw, 52px);
  max-width: 1240px;
}
.legend-grid article { border-top: 1px solid var(--hair); padding-top: 20px; }
.legend-grid h3 {
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 15px;
}
.legend-grid p { font-size: 1.02rem; line-height: 1.68; opacity: 0.84; }
.legend-grid sup { font-size: 0.72em; }

/* -------- the descent: pure scroll length -------- */
#journey {
  position: relative;
  height: calc(var(--stations) * var(--sh));
}
.atlas-note { display: none; }

/* -------- reflection -------- */
.reflect {
  position: relative;
  padding: clamp(96px, 20vh, 240px) var(--gut) clamp(80px, 14vh, 170px);
  background: linear-gradient(to bottom, rgba(5, 6, 10, 0) 0%, var(--bg) 34vh, var(--bg) 100%);
}
.prose { max-width: 60ch; }
.prose p { font-size: clamp(1.04rem, 1.35vw, 1.2rem); line-height: 1.78; margin-bottom: 1.5em; opacity: 0.88; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; color: var(--acc); }
.prose .drop { font-size: clamp(1.2rem, 1.9vw, 1.55rem); line-height: 1.55; font-style: italic; opacity: 1; }
.prose .ascend {
  margin-top: 2.2em; padding-top: 1.5em;
  border-top: 1px solid var(--hair);
  font: 500 0.7rem/1.8 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--acc); opacity: 1;
}

/* -------- atlas -------- */
#atlas { padding: clamp(70px, 12vh, 150px) var(--gut) clamp(70px, 12vh, 150px); background: var(--bg); }
.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: clamp(26px, 2.6vw, 44px);
  max-width: 1560px;
}
.plate { margin: 0; }
.plate-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--hair);
  background: #04050a;
  overflow: hidden;
}
.plate-c { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate-reg { position: absolute; width: 9px; height: 9px; opacity: 0.55; }
.plate-reg::before, .plate-reg::after { content: ""; position: absolute; background: var(--ink); }
.plate-reg::before { width: 100%; height: 1px; }
.plate-reg::after { width: 1px; height: 100%; }
.plate-reg.tl { top: 7px; left: 7px; }
.plate-reg.tr { top: 7px; right: 7px; transform: scaleX(-1); }
.plate-reg.bl { bottom: 7px; left: 7px; transform: scaleY(-1); }
.plate-reg.br { bottom: 7px; right: 7px; transform: scale(-1); }
.plate figcaption { padding-top: 16px; }
.plate-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font: 500 0.6rem/1 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 11px; border-bottom: 1px solid var(--hair-soft);
}
.plate-exp { color: var(--acc); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.plate h3 {
  font-size: 1.3rem; line-height: 1.14; font-weight: 300;
  margin: 13px 0 8px;
}
.plate-words {
  font: 400 0.63rem/1.55 var(--mono);
  color: var(--dim); letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.plate-cap {
  font-style: italic;
  font-size: 0.94rem; line-height: 1.6;
  opacity: 0.7; margin-bottom: 15px;
}
.plate-go {
  appearance: none; -webkit-appearance: none; background: none;
  border: 0; border-top: 1px solid var(--hair-soft);
  width: 100%; text-align: left;
  padding: 11px 0 0;
  color: var(--acc);
  font: 500 0.6rem/1 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s, letter-spacing 0.25s;
}
.plate-go::after { content: " ↘"; }
.plate-go:hover { color: var(--ink); letter-spacing: 0.19em; }

/* -------- ledger -------- */
#ledger { padding: clamp(60px, 10vh, 130px) var(--gut) clamp(60px, 10vh, 130px); background: var(--bg); }
.ledger-wrap { max-width: 1240px; overflow-x: auto; }
.ledger-table {
  width: 100%; min-width: 680px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.ledger-table thead th {
  text-align: left; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  font-size: 0.58rem; color: var(--dim);
  padding: 0 18px 12px 0;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
.ledger-table tbody tr { border-bottom: 1px solid var(--hair-soft); }
.ledger-table tbody tr:hover { background: rgba(233, 229, 220, 0.03); }
.ledger-table th, .ledger-table td { padding: 11px 18px 11px 0; vertical-align: baseline; }
.ledger-table th[scope="row"] { font-weight: 400; }
.lg-no { color: var(--dim); }
.lg-go {
  appearance: none; background: none; border: 0; padding: 0;
  color: var(--ink); font: inherit; text-align: left;
  cursor: pointer; letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.lg-go:hover { color: var(--acc); border-bottom-color: var(--acc); }
.lg-zone { color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.58rem; }
.lg-num { color: var(--acc); white-space: nowrap; }
.lg-words { color: var(--dim); }

/* -------- colophon -------- */
.colophon { padding: clamp(60px, 10vh, 130px) var(--gut) clamp(70px, 12vh, 150px); background: var(--bg); }
.colo-grid { max-width: 900px; }
.colo-grid dl { margin: 0; }
.colo-grid dt {
  font: 500 0.62rem/1 var(--mono);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--acc);
  padding-top: 22px; margin-bottom: 12px;
  border-top: 1px solid var(--hair);
}
.colo-grid dd {
  margin: 0 0 24px; font-size: 1rem; line-height: 1.72; opacity: 0.82;
  max-width: 62ch;
}
.colo-cta { margin-top: 34px; }
.ghost-link {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--hair);
  padding: 12px 20px;
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.25s, color 0.25s;
}
.ghost-link::after { content: "→"; }
.ghost-link:hover { border-color: var(--acc); color: var(--acc); }

/* -------- footer -------- */
.site-foot {
  position: relative; z-index: 1;
  background: var(--bg);
  border-top: 1px solid var(--hair);
  padding: clamp(46px, 8vh, 92px) var(--gut) clamp(60px, 9vh, 100px);
}
.foot-in { max-width: 1240px; display: grid; gap: 16px; }
.foot-mark {
  font-size: 1.5rem; font-weight: 200; letter-spacing: -0.02em;
  font-style: italic;
}
.foot-credit, .foot-links, .foot-note {
  font: 400 0.68rem/1.7 var(--mono);
  letter-spacing: 0.06em; color: var(--dim);
}
.foot-credit strong { color: var(--ink); font-weight: 500; }
.foot-links { display: flex; gap: 12px; flex-wrap: wrap; }
.foot-links a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair); padding-bottom: 2px; }
.foot-links a:hover { color: var(--acc); border-bottom-color: var(--acc); }
.foot-note { max-width: 52ch; font-style: normal; }
.foot-note em { font-family: var(--serif); font-style: italic; font-size: 1.16em; color: var(--ink); }

/* ============================ atlas mode ============================ */
body.atlas-mode #stage { display: none; }
body.atlas-mode #btn-travel { display: none; }
body.atlas-mode #btn-labels { display: none; }
body.atlas-mode #journey { height: auto; padding: clamp(80px, 14vh, 170px) var(--gut); }
body.atlas-mode .atlas-note {
  display: block;
  max-width: 58ch;
  border-left: 1px solid var(--acc);
  padding-left: clamp(18px, 2.4vw, 34px);
  font-size: 1.04rem; line-height: 1.7; opacity: 0.86;
}
body.atlas-mode .atlas-note span {
  display: block;
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 16px;
}
body.atlas-mode .atlas-note a {
  display: inline-block; margin-top: 18px;
  font: 500 0.64rem/1 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--acc); padding-bottom: 3px;
}
body.atlas-mode .reflect { background: var(--bg); }

/* ============================ responsive ============================ */
@media (max-width: 1080px) {
  .cap { width: min(34ch, calc(100vw - 2 * var(--gut) - 120px)); }
  .instrument { width: 190px; }
  .rail { width: 66px; height: min(36vh, 300px); }
  #playhead { width: 66px; }
}

@media (max-width: 860px) {
  :root { --sh: 84vh; }
  body { font-size: 16px; }
  .instrument {
    top: 0; right: 0; left: 0; transform: none;
    width: auto; flex-direction: row; align-items: flex-start;
    justify-content: space-between; gap: 12px;
    padding: 16px var(--gut) 14px;
    text-align: left;
    background: linear-gradient(to bottom, rgba(4, 5, 9, 0.92) 0%, rgba(4, 5, 9, 0.7) 60%, rgba(4, 5, 9, 0) 100%);
  }
  .readout {
    width: 100%; display: flex; gap: 16px;
    align-items: flex-start; justify-content: space-between;
  }
  .ro-block { border-top: 0; padding-top: 0; }
  .ro-b2 { text-align: right; }
  .ro-b3 { display: none; }
  .ro-big { font-size: 1.1rem; }
  .ro-name { font-size: 0.94rem; }
  .ro-words { display: none; }
  .ro-lab { margin-bottom: 5px; }
  .rail { display: none; }
  .hrail {
    display: block; position: absolute;
    left: var(--gut); right: var(--gut); top: 8px; height: 1px;
    background: var(--hair);
  }
  .hrail span {
    position: absolute; top: 50%; left: 0;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--acc); transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 24%, transparent);
  }
  .reg-tl, .reg-tr { display: none; }
  .reg-bl { bottom: 92px; }
  .reg-br { bottom: 92px; }
  .cap {
    left: var(--gut); right: var(--gut);
    bottom: 96px; width: auto;
  }
  .cap-name { font-size: clamp(1.5rem, 7.6vw, 2.1rem); }
  .cap-text { font-size: 0.98rem; line-height: 1.58; }
  #controls {
    left: 0; right: 0; bottom: 0;
    justify-content: center;
    padding: 12px var(--gut) 14px;
    background: linear-gradient(to top, rgba(4, 5, 9, 0.94) 0%, rgba(4, 5, 9, 0.6) 70%, rgba(4, 5, 9, 0) 100%);
    justify-content: flex-start;
  }
  .hero { min-height: 100svh; padding-top: 22vh; padding-bottom: clamp(120px, 20vh, 200px); }
  .scroll-cue { display: none; }
  .hero-meta li { min-width: 50%; padding-right: 12px; }
  .reg { display: none; }
  #captions::before { width: 100%; height: min(72vh, 620px);
    background: radial-gradient(ellipse 120% 82% at 20% 100%, rgba(2,3,7,0.94) 0%, rgba(2,3,7,0.72) 34%, rgba(2,3,7,0.34) 66%, rgba(2,3,7,0) 100%); }
  .hero-act { gap: 14px; }
  .hero-note { max-width: none; }
}

@media (max-width: 520px) {
  .atlas-grid { grid-template-columns: 1fr; }
  .hero-meta { max-width: none; }
  .ctl { padding: 8px 10px; font-size: 0.58rem; letter-spacing: 0.12em; }
  .cap-scale { font-size: 0.6rem; }
}

/* ============================ reduced motion ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cue-line::after { display: none; }
}

/* ==========================================================================
   THE PERSONAL LAYER
   Everything below was added when the exhibit became David Harder's site.
   It borrows the exhibit's own vocabulary on purpose: hairlines, mono labels,
   generous rag, nothing boxed unless the box means something. The museum
   restraint stays; the commerce is never more than a glance away.
   ========================================================================== */

.lede-2 {
  margin-top: 0.85em;
  font-size: clamp(1rem, 1.45vw, 1.28rem);
  max-width: 52ch;
  opacity: 0.88;
}

.begin-alt {
  border-color: var(--hair);
  color: var(--dim);
}
.begin-alt::after { content: "→"; }
.begin-alt:hover { background: transparent; border-color: var(--acc); color: var(--acc); }

/* ---------------------------- the portal ------------------------------- */
#portal {
  /* top centre is the only zone the exhibit leaves empty: the caption owns
     bottom-left, the instrument owns the right rail, the controls own
     bottom-right. Anywhere else and this sits on top of the writing. */
  position: fixed; z-index: 40;
  left: 50%; top: clamp(26px, 5vh, 54px);
  display: inline-flex; align-items: center; gap: 14px;
  padding: 13px 22px 13px 15px;
  background: rgba(6, 8, 14, 0.72);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  border: 1px solid rgba(233, 229, 220, 0.26);
  color: var(--ink);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.13em; text-transform: uppercase;
  cursor: pointer;
  opacity: 0; transform: translate(-50%, -10px);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s, background 0.3s;
}
#portal.is-in { opacity: 1; transform: translate(-50%, 0); }
#portal:hover { border-color: var(--ink); background: rgba(10, 13, 20, 0.88); }
.pt-ring, .pt-dot { position: absolute; left: 22px; border-radius: 50%; pointer-events: none; }
.pt-dot { width: 8px; height: 8px; margin-left: -4px; background: #d8b48c; }
.pt-ring {
  width: 8px; height: 8px; margin-left: -4px;
  border: 1px solid #d8b48c;
  animation: ptPulse 2.9s ease-out infinite;
}
@keyframes ptPulse {
  0%   { transform: scale(1);   opacity: 0.85; }
  70%  { transform: scale(4.4); opacity: 0; }
  100% { transform: scale(4.4); opacity: 0; }
}
.pt-label { padding-left: 22px; }

#vmodal { position: fixed; inset: 0; z-index: 120; }
.vm-scrim {
  position: absolute; inset: 0; background: rgba(2, 3, 6, 0.9);
  opacity: 0; transition: opacity 0.26s ease;
}
#vmodal.is-open .vm-scrim { opacity: 1; }
.vm-box {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -48%) scale(0.985);
  width: min(1020px, 92vw);
  opacity: 0; transition: opacity 0.26s ease, transform 0.26s ease;
}
#vmodal.is-open .vm-box { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.vm-box video {
  width: 100%; height: auto; max-height: 78vh;
  background: #05060a; border: 1px solid var(--hair);
}
.vm-x {
  display: block; margin: 16px 0 0 auto;
  background: none; border: 1px solid var(--hair); color: var(--dim);
  padding: 9px 18px; cursor: pointer;
  font: 500 0.66rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  transition: color 0.25s, border-color 0.25s;
}
.vm-x:hover { color: var(--ink); border-color: var(--ink); }

/* ---------------------------- about ------------------------------------ */
.about { padding: clamp(80px, 14vh, 170px) var(--gut) clamp(60px, 10vh, 120px); background: var(--bg); position: relative; }
.about .prose strong { font-weight: 500; color: var(--ink); opacity: 1; }

/* ---------------------------- the work --------------------------------- */
.work { padding: clamp(70px, 12vh, 150px) var(--gut) clamp(80px, 13vh, 160px); background: var(--bg); position: relative; }
.sec-sub {
  margin-top: 16px; max-width: 58ch;
  font-size: 1.02rem; line-height: 1.7; color: var(--dim-text);
}
.case-list { display: grid; gap: clamp(46px, 6vw, 78px); max-width: 1180px; }
.case { border-top: 1px solid var(--hair); padding-top: clamp(24px, 3vw, 36px); }
.case-tag {
  font: 500 0.63rem/1 var(--mono); letter-spacing: 0.19em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 16px;
}
.case h3 {
  font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.2;
  max-width: 20ch; margin-bottom: 18px;
}
.case-sit { max-width: 62ch; font-size: 1.06rem; line-height: 1.75; opacity: 0.88; }
.case-dl {
  margin: 30px 0 0; display: grid; gap: 22px;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  align-items: start;
}
.case-dl dt {
  font: 500 0.66rem/1.5 var(--mono); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--dim); padding-top: 5px;
}
.case-dl dd { margin: 0; max-width: 62ch; font-size: 1rem; line-height: 1.72; opacity: 0.88; }
.case-live { margin-top: 26px; }
.case-priv {
  font: 400 0.72rem/1.5 var(--mono); letter-spacing: 0.06em;
  color: var(--dim-text); font-style: normal;
}

.proof { margin-top: clamp(70px, 10vw, 120px); border-top: 1px solid var(--hair); padding-top: clamp(30px, 4vw, 46px); }
.proof-h { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
.proof-sub { margin-top: 12px; color: var(--dim-text); font-size: 1rem; max-width: 52ch; }
.proof-list { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 2px; max-width: 1060px; }
.proof-list li {
  display: grid; grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: clamp(14px, 3vw, 40px); align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--hair-soft);
}
.proof-list a {
  font: 500 0.78rem/1.4 var(--mono); letter-spacing: 0.08em;
  text-decoration: none; border-bottom: 1px solid var(--hair);
  padding-bottom: 2px; justify-self: start;
  transition: color 0.25s, border-color 0.25s;
}
.proof-list a:hover { color: var(--acc); border-color: var(--acc); }
.proof-list span { font-size: 0.98rem; line-height: 1.68; opacity: 0.8; }

/* ---------------------------- trust ledger ----------------------------- */
.ledger-trust { padding: clamp(70px, 12vh, 150px) var(--gut) clamp(80px, 13vh, 160px); background: #070810; position: relative; }
.tl-grid {
  display: grid; gap: clamp(32px, 4vw, 56px); max-width: 1240px;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
}
.tl-col { border-top: 1px solid var(--hair); padding-top: 22px; }
.tl-col h3 {
  font: 500 0.7rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 20px;
}
.tl-yes h3 { color: #8fbf9b; }
.tl-human h3 { color: #d8b48c; }
.tl-never h3 { color: #c98b90; }
.tl-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.tl-col li {
  position: relative; padding-left: 20px;
  font-size: 1rem; line-height: 1.62; opacity: 0.88;
}
.tl-col li::before {
  content: ""; position: absolute; left: 0; top: 0.66em;
  width: 8px; height: 1px; background: currentColor; opacity: 0.5;
}
.tl-yes li::before { background: #8fbf9b; }
.tl-human li::before { background: #d8b48c; }
.tl-never li::before { background: #c98b90; }

.tl-fail {
  margin-top: clamp(56px, 8vw, 96px); max-width: 66ch;
  border-left: 1px solid #c98b90; padding: 4px 0 4px clamp(20px, 3vw, 36px);
}
.tl-fail-lab {
  font: 500 0.63rem/1 var(--mono); letter-spacing: 0.19em; text-transform: uppercase;
  color: #c98b90; margin-bottom: 14px;
}
.tl-fail h3 { font-size: clamp(1.4rem, 2.7vw, 1.9rem); margin-bottom: 20px; }
.tl-fail p { font-size: 1.02rem; line-height: 1.75; opacity: 0.86; margin-bottom: 1.15em; }
.tl-fail p:last-child { margin-bottom: 0; }
.tl-fail-close { font-style: italic; opacity: 1 !important; color: var(--ink); }

/* ---------------------------- the offer -------------------------------- */
.offer { padding: clamp(70px, 12vh, 150px) var(--gut) clamp(80px, 13vh, 170px); background: var(--bg); position: relative; }
.tiers {
  display: grid; gap: clamp(28px, 3.4vw, 48px); max-width: 1240px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}
.tier { border-top: 1px solid var(--hair); padding-top: 24px; display: flex; flex-direction: column; }
.tier-lead { border-top-color: #d8b48c; }
.tier-no {
  font: 500 0.66rem/1 var(--mono); letter-spacing: 0.18em; color: var(--dim); margin-bottom: 16px;
}
.tier-lead .tier-no { color: #d8b48c; }
.tier h3 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); margin-bottom: 16px; }
.tier-what { font-size: 1rem; line-height: 1.72; opacity: 0.87; }
.tier-keep {
  margin-top: 16px; font-size: 0.97rem; line-height: 1.66;
  font-style: italic; color: var(--acc); opacity: 0.95;
}
.tier-price {
  margin-top: auto; padding-top: 26px;
  font: 500 0.72rem/1.5 var(--mono); letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--dim-text);
}
.tier-lead .tier-price { color: #d8b48c; }

.invite {
  margin-top: clamp(60px, 8vw, 104px);
  border-top: 1px solid var(--hair); padding-top: clamp(30px, 4vw, 46px);
  max-width: 68ch;
}
.invite h3 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin-bottom: 20px; }
.invite p { font-size: 1.04rem; line-height: 1.75; opacity: 0.88; margin-bottom: 1.15em; }
.invite-act { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 34px; }
.invite-note { font: 400 0.74rem/1.6 var(--mono); letter-spacing: 0.05em; color: var(--dim-text); }

/* ---------------------------- footer tweak ----------------------------- */
.site-foot .foot-note a { color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--hair); }
.site-foot .foot-note a:hover { color: var(--acc); border-color: var(--acc); }

/* ---------------------------- narrow ----------------------------------- */
@media (max-width: 860px) {
  .case-dl { grid-template-columns: 1fr; gap: 8px; }
  .case-dl dt { padding-top: 14px; }
  .proof-list li { grid-template-columns: 1fr; gap: 8px; }
  #portal {
    top: clamp(18px, 3.5vh, 34px);
    font-size: 0.63rem; padding: 12px 18px 12px 13px;
    max-width: calc(100vw - 40px);
  }
}
@media (max-width: 520px) {
  .tl-fail { padding-left: 16px; }
  .invite-act { gap: 14px; }
}

/* Short phones (SE-class). The offer has to survive the first screen, so the
   exhibit's second breath gives way rather than the call to action. */
@media (max-width: 560px) and (max-height: 720px) {
  .hero { padding-top: 5vh; }
  .title { font-size: clamp(2.6rem, 13vw, 3.4rem); margin-bottom: 16px; }
  .kicker { margin-bottom: 16px; }
  .lede { font-size: 1.02rem; line-height: 1.45; }
  .lede-2 { display: none; }
  .hero-act { margin-top: 22px; }
  .hero-note { display: none; }
}
