/* GMD Labs. Instrument-panel look: bone paper or graphite, one signal colour per project,
   a condensed variable grotesque for the loud parts and a wide mono for the quiet ones. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/BricolageGrotesque.woff2') format('woff2');
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('/fonts/MartianMono.woff2') format('woff2');
  font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap;
}

:root {
  --font-d: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --font-m: 'Martian Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --top-h: 60px;
  --dock-h: 54px;
  --pad: clamp(18px, 4.2vw, 64px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --accent: var(--lab);
  --on-accent: var(--on-lab);
  /* thin strokes and small text in the accent colour need more contrast than fills do */
  --accent-line: color-mix(in oklab, var(--accent) 72%, var(--ink));
}
[data-theme='dark'] {
  --bg: #0a0c0b; --bg-2: #121614; --ink: #e9efe6; --ink-2: #93a096; --line: #e9efe624;
  --lab: #c8ff2e; --on-lab: #0a0c0b;
  color-scheme: dark;
}
[data-theme='light'] {
  --bg: #ece9e0; --bg-2: #dfdbce; --ink: #121511; --ink-2: #565d54; --line: #1215112b;
  --lab: #2a3cff; --on-lab: #f6f8f3;
  --accent-line: color-mix(in oklab, var(--accent) 62%, var(--ink));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-d);
  font-variation-settings: 'wdth' 100, 'opsz' 16;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript { position: relative; z-index: 5; padding: 120px var(--pad); }

/* ── fixed backdrop: particle field + column rules ── */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; will-change: opacity, transform; }
.columns {
  position: fixed; inset: 0 var(--pad); z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / 6));
  border-right: 1px solid var(--line);
  opacity: .55;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
@media (max-width: 760px) { .columns { background-size: 200% 100%; } }

/* ── top bar ── */
.top {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 40;
  display: flex; align-items: center; gap: 24px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.12rem/1 var(--font-d); font-variation-settings: 'wdth' 84; letter-spacing: .01em; text-transform: uppercase; }
.brand svg { width: 30px; height: 30px; overflow: visible; }
.brand i { font-style: normal; color: var(--accent-line); margin: 0 .08em; transition: color .5s; }
.brand-orbit { opacity: .5; transform-origin: 32px 32px; transition: transform .9s var(--ease); }
.brand-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; transform-origin: 32px 32px; transition: transform .9s var(--ease), fill .5s; }
.brand:hover .brand-dot { transform: rotate(360deg); }
.brand:hover .brand-orbit { transform: rotate(-148deg); }

.telemetry { margin: 0 0 0 auto; display: flex; gap: 22px; font: 400 .66rem/1 var(--font-m); letter-spacing: .12em; color: var(--ink-2); white-space: nowrap; }
.telemetry span:first-child::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 9px; background: var(--accent); animation: blink 2.4s steps(2, jump-none) infinite; transition: background .5s; }
@keyframes blink { 50% { opacity: .25; } }
@media (max-width: 760px) { .telemetry { display: none; } .switch { margin-left: auto; } }

.switch { display: inline-flex; align-items: center; gap: 9px; font: 500 .66rem/1 var(--font-m); letter-spacing: .12em; text-transform: uppercase; padding: 10px 0; }
.switch-track { width: 42px; height: 20px; border: 1px solid var(--ink); position: relative; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--ink); transition: transform .45s var(--ease), background .3s; }
[data-theme='light'] .switch-knob { transform: translateX(22px); }
.switch:hover .switch-knob { background: var(--accent-line); }
.switch-label { color: var(--ink-2); transition: color .3s; }
[data-theme='dark'] .switch-dark, [data-theme='light'] .switch-light { color: var(--ink); }
@media (max-width: 480px) { .switch-label { display: none; } }

/* theme change: the new theme grows as a circle out of the switch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal .75s cubic-bezier(.6, 0, .2, 1); }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--vt-x, 100%) var(--vt-y, 0)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 100%) var(--vt-y, 0)); }
}

/* ── main ── */
main { position: relative; z-index: 1; padding: var(--top-h) 0 var(--dock-h); outline: none; }

.eyebrow, .rule, .slab-num, .chip, .row-num, .stack, .cue, .onward-kicker, .foot, .shot figcaption, .shot-bar b, .diagram-wrap figcaption {
  font-family: var(--font-m); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; font-variation-settings: 'wdth' 100;
}

.hero {
  min-height: calc(100svh - var(--top-h) - var(--dock-h));
  padding: clamp(40px, 9vh, 110px) var(--pad) clamp(34px, 6vh, 70px);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
}
.eyebrow { margin: 0 0 clamp(16px, 3vh, 30px); color: var(--ink-2); display: flex; align-items: center; gap: 12px; min-height: 1.2em; }
.eyebrow::before { content: ''; width: 34px; height: 1px; background: var(--accent-line); flex: none; }

.mega {
  margin: 0; font-weight: 800; font-size: clamp(3.1rem, min(10.4vw, 16.5vh), 11.5rem); line-height: .88; letter-spacing: -.018em;
  font-variation-settings: 'wdth' 76, 'opsz' 96; text-wrap: balance; max-width: 14ch;
}
.mega .word { display: inline-block; overflow: hidden; padding: .08em .02em .1em 0; margin-bottom: -.14em; vertical-align: top; }
.mega .word > span { display: inline-block; transform: translateY(112%) rotate(4deg); transform-origin: 0 100%; animation: rise 1s var(--ease) calc(var(--i) * 70ms + 120ms) forwards; }
.mega .word:last-child > span { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
@supports not (-webkit-text-stroke: 1px red) { .mega .word:last-child > span { color: var(--accent-line); } }
@keyframes rise { to { transform: none; } }

.mega-title { font-size: clamp(3.4rem, min(13.5vw, 26vh), 14rem); max-width: none; white-space: nowrap; overflow: hidden; padding: .06em 0 .12em; margin-bottom: -.06em; }
.mega-title > span { display: inline-block; transform: translateY(105%); animation: rise-wide 1.1s var(--ease) calc(var(--i) * 34ms + 80ms) forwards; }
@keyframes rise-wide { from { transform: translateY(105%); font-variation-settings: 'wdth' 100, 'opsz' 96; } to { transform: none; font-variation-settings: 'wdth' 76, 'opsz' 96; } }

.lede { margin: clamp(20px, 3.4vh, 34px) 0 0; max-width: 44ch; font-size: clamp(1.08rem, 1.5vw, 1.42rem); line-height: 1.45; color: var(--ink-2); animation: fade-up .9s var(--ease) .5s both; }
.hero-project .lede { color: var(--ink); max-width: 36ch; font-size: clamp(1.2rem, 2vw, 1.8rem); line-height: 1.28; font-variation-settings: 'wdth' 90, 'opsz' 30; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }

.cue { margin-top: clamp(26px, 5vh, 54px); display: inline-flex; align-items: center; gap: 12px; text-decoration: none; padding: 12px 0; border-bottom: 1px solid var(--ink); animation: fade-up .9s var(--ease) .65s both; }
.cue span { display: inline-block; animation: nudge 1.8s var(--ease) infinite; }
.cue kbd { font: inherit; border: 1px solid var(--line); padding: 3px 7px; color: var(--ink-2); }
@keyframes nudge { 50% { transform: translateY(5px); } }
@media (hover: none) { .cue kbd { display: none; } }

.actions { margin-top: clamp(24px, 4.4vh, 46px); display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; animation: fade-up .9s var(--ease) .6s both; }
.cta {
  position: relative; display: inline-flex; align-items: center; gap: 18px; padding: 17px 22px 17px 24px; overflow: hidden; isolation: isolate;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font: 700 1.02rem/1 var(--font-d); font-variation-settings: 'wdth' 92; letter-spacing: .01em;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.cta::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: translateX(-101%); transition: transform .5s var(--ease); }
.cta:hover, .cta:focus-visible { color: var(--bg); }
.cta:hover::before, .cta:focus-visible::before { transform: none; }
.cta-arrow { display: inline-block; transition: transform .4s var(--ease); }
.cta:hover .cta-arrow { transform: translate(4px, -4px); }
.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-width: 46ch; }
.stack li { border: 1px solid var(--line); padding: 7px 9px; font-size: .62rem; color: var(--ink-2); background: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ── rule headers ── */
.rule { display: flex; justify-content: space-between; gap: 20px; margin: 0 var(--pad); padding: 14px 0; border-top: 1px solid var(--ink); color: var(--ink-2); }
.rule span:first-child { color: var(--ink); }

/* ── index rows ── */
.index { padding-top: clamp(30px, 6vh, 80px); }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative; isolation: isolate; display: grid; align-items: center;
  grid-template-columns: minmax(3.2rem, 8vw) minmax(0, 1fr) minmax(0, 26ch) auto; gap: 0 clamp(14px, 2.4vw, 40px);
  padding: clamp(14px, 2.6vh, 30px) var(--pad); text-decoration: none; border-top: 1px solid var(--line);
  transition: color .35s;
}
.rows li:last-child .row { border-bottom: 1px solid var(--line); }
.row::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease); }
.row:hover, .row:focus-visible { color: var(--on-accent); outline: none; }
.row:hover::before, .row:focus-visible::before { transform: none; }
.row-num { color: var(--ink-2); align-self: start; padding-top: 1.1em; transition: color .35s; }
.row-title {
  font-weight: 800; font-size: clamp(2.5rem, 8.2vw, 8.4rem); line-height: .92; letter-spacing: -.018em;
  font-variation-settings: 'wdth' 75, 'opsz' 96; transition: font-variation-settings .6s var(--ease), transform .6s var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: clip; padding: .04em 0 .1em;
}
.row:hover .row-title, .row:focus-visible .row-title { font-variation-settings: 'wdth' 100, 'opsz' 96; transform: translateX(.08em); }
.row-tag { color: var(--ink-2); font-size: clamp(.92rem, 1.15vw, 1.08rem); line-height: 1.35; transition: color .35s; }
.row-meta { display: flex; align-items: center; gap: 18px; }
.row-arrow { font-size: clamp(1.6rem, 3vw, 2.8rem); line-height: 1; transform: translateX(-14px); opacity: 0; transition: transform .5s var(--ease), opacity .3s; }
.row:hover .row-arrow, .row:focus-visible .row-arrow { transform: none; opacity: 1; }
.row:hover :is(.row-num, .row-tag), .row:focus-visible :is(.row-num, .row-tag) { color: inherit; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid currentColor; padding: 6px 9px; font-size: .62rem; white-space: nowrap; }
.chip i { width: 6px; height: 6px; background: var(--accent-line); animation: blink 2.4s steps(2, jump-none) infinite; }
.row:hover .chip i, .row:focus-visible .chip i { background: currentColor; }
@media (max-width: 900px) {
  .row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
  .row-tag { grid-column: 2 / -1; grid-row: 2; margin-top: 8px; max-width: 40ch; }
  .row-arrow { display: none; }
}

/* ── slabs: sticky heading on the left, text on the right ── */
.slab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 clamp(20px, 4vw, 70px); margin: 0 var(--pad); padding: clamp(40px, 9vh, 110px) 0; border-top: 1px solid var(--line); }
.slab-head { position: sticky; top: calc(var(--top-h) + 26px); align-self: start; margin: 0; font-weight: 700; font-size: clamp(1.5rem, 2.9vw, 2.8rem); line-height: 1; letter-spacing: -.02em; font-variation-settings: 'wdth' 80, 'opsz' 60; text-wrap: balance; }
.slab-num { display: block; margin-bottom: 16px; color: var(--accent-line); font-weight: 500; letter-spacing: .12em; }
.about { margin-top: clamp(40px, 9vh, 110px); border-top: 1px solid var(--ink); }
@media (max-width: 900px) { .slab { grid-template-columns: 1fr; } .slab-head { position: static; margin-bottom: 24px; } }

.prose { max-width: 68ch; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose table, .prose blockquote { margin: 0 0 1.25em; }
.prose-lg { font-size: clamp(1.25rem, 2.1vw, 1.95rem); line-height: 1.3; letter-spacing: -.01em; font-variation-settings: 'wdth' 92, 'opsz' 30; max-width: 34ch; }
.prose-lg p + p { color: var(--ink-2); font-size: .72em; line-height: 1.5; letter-spacing: 0; max-width: 52ch; }
.prose strong { font-weight: 700; }
.prose-lg strong { color: var(--ink); }
.prose a { text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { background: var(--accent); color: var(--on-accent); text-decoration-color: transparent; }
.prose ul, .prose ol { padding: 0; list-style: none; counter-reset: item; }
.prose li { position: relative; padding: 13px 0 13px 46px; border-top: 1px solid var(--line); counter-increment: item; }
.prose li:last-child { border-bottom: 1px solid var(--line); }
.prose li::before { position: absolute; left: 0; top: 17px; font: 500 .66rem/1.4 var(--font-m); letter-spacing: .1em; color: var(--accent-line); }
.prose ul > li::before { content: '→'; font-size: .86rem; top: 14px; }
.prose ol > li::before { content: counter(item, decimal-leading-zero); }
.prose code { font: 500 .8em var(--font-m); font-variation-settings: 'wdth' 88; background: color-mix(in srgb, var(--ink) 9%, transparent); padding: .16em .4em; overflow-wrap: anywhere; }
.prose pre { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 20px 22px; overflow-x: auto; font-size: .78rem; line-height: 1.7; tab-size: 2; }
.prose pre code { background: none; padding: 0; font-size: 1em; overflow-wrap: normal; white-space: pre; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; display: block; overflow-x: auto; }
.prose th { text-align: left; font: 500 .64rem/1.4 var(--font-m); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding: 10px 16px 10px 0; border-bottom: 1px solid var(--ink); }
.prose td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose td:first-child { font-weight: 700; white-space: nowrap; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); }

/* ── inline diagrams (content SVGs using the d-* classes) ── */
.diagram-wrap { margin: 2.2em 0; width: min(100%, 880px); max-width: none; }
.slab-body:has(.diagram-wrap) { max-width: min(100%, 880px); }
.slab-body:has(.diagram-wrap) > :not(.diagram-wrap) { max-width: 42rem; }
.diagram-wrap figcaption { margin-top: 12px; color: var(--ink-2); font-size: .62rem; }
.diagram { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 700px) { .diagram-wrap { overflow-x: auto; } .diagram { min-width: 640px; } }
.d-node rect { fill: color-mix(in srgb, var(--bg) 70%, transparent); stroke: var(--ink); stroke-width: 1.5; }
.d-node-acc rect { fill: var(--accent); stroke: var(--accent); }
.d-label { font: 500 10px var(--font-m); letter-spacing: .12em; fill: var(--ink-2); }
.d-title { font: 700 23px var(--font-d); font-variation-settings: 'wdth' 82; fill: var(--ink); }
.d-sub { font: 400 11px var(--font-m); fill: var(--ink-2); }
.d-node-acc :is(.d-label, .d-title, .d-sub) { fill: var(--on-accent); }
.d-note { font: 500 9.5px var(--font-m); letter-spacing: .14em; fill: var(--ink-2); }
.d-flow { fill: none; stroke: var(--accent-line); stroke-width: 2; stroke-dasharray: 7 6; animation: flow 1.1s linear infinite; }
.d-fill-acc { fill: var(--accent-line); }
.d-brace, .d-tick { fill: none; stroke: var(--line); stroke-width: 1.5; }
.d-tick { stroke-dasharray: 2 4; }
@keyframes flow { to { stroke-dashoffset: -13; } }

/* ── screenshots ── */
.gallery { padding-top: clamp(30px, 6vh, 70px); }
.shots { display: flex; gap: clamp(16px, 2.4vw, 34px); overflow-x: auto; padding: clamp(18px, 3vh, 34px) var(--pad) 28px; scroll-snap-type: x proximity; scroll-padding-left: var(--pad); cursor: grab; scrollbar-width: thin; scrollbar-color: var(--ink-2) transparent; }
.shots.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.shots.dragging .shot-frame { pointer-events: none; }
.shot { flex: none; width: min(78vw, 940px); margin: 0; scroll-snap-align: start; }
.shot-frame { display: block; width: 100%; border: 1px solid var(--ink); background: var(--bg-2); cursor: zoom-in; overflow: hidden; transition: transform .6s var(--ease), box-shadow .6s var(--ease); box-shadow: 0 0 0 var(--accent); }
.shot-frame:hover, .shot-frame:focus-visible { transform: translate(-5px, -5px); box-shadow: 10px 10px 0 var(--accent); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--ink); }
.shot-bar i { width: 8px; height: 8px; border: 1px solid var(--ink); }
.shot-bar i:first-child { background: var(--accent); border-color: var(--accent); }
.shot-bar b { margin-left: 12px; font-weight: 400; font-size: .6rem; color: var(--ink-2); text-transform: none; letter-spacing: .04em; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; -webkit-user-drag: none; user-select: none; }
.shot figcaption { margin-top: 14px; display: flex; gap: 14px; color: var(--ink-2); font-size: .64rem; line-height: 1.6; }
.shot figcaption span { color: var(--accent-line); }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: clamp(46px, 7vh, 72px) clamp(10px, 5vw, 76px) 24px; border: 0; background: color-mix(in srgb, var(--bg) 93%, transparent); color: var(--ink); }
.lightbox[open] { display: grid; place-items: center; animation: fade-up .35s var(--ease); }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: grid; gap: 12px; justify-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 150px); border: 1px solid var(--ink); display: block; }
.lightbox figcaption, .lb-close, .lb-nav { font: 500 .68rem/1.5 var(--font-m); letter-spacing: .12em; text-transform: uppercase; }
.lb-close { position: absolute; top: 16px; right: clamp(10px, 5vw, 76px); padding: 8px 0; border-bottom: 1px solid var(--ink); }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; width: 46px; height: 46px; font-size: 1.1rem; background: var(--accent); color: var(--on-accent); }
.lb-prev { left: clamp(4px, 1.4vw, 20px); } .lb-next { right: clamp(4px, 1.4vw, 20px); }

/* ── onward ── */
.onward { margin-top: clamp(40px, 9vh, 110px); }
.onward-next { position: relative; isolation: isolate; display: block; padding: clamp(30px, 7vh, 80px) var(--pad); text-decoration: none; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); overflow: hidden; transition: color .35s; }
.onward-next::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateX(-101%); transition: transform .7s var(--ease); }
.onward-next:hover, .onward-next:focus-visible { color: var(--on-accent); outline: none; }
.onward-next:hover::before, .onward-next:focus-visible::before { transform: none; }
.onward-kicker { display: block; margin-bottom: 14px; opacity: .7; }
.onward-title { display: block; font-weight: 800; font-size: clamp(2.6rem, 10vw, 10rem); line-height: .9; letter-spacing: -.018em; font-variation-settings: 'wdth' 75, 'opsz' 96; transition: font-variation-settings .7s var(--ease); white-space: nowrap; }
.onward-next:hover .onward-title { font-variation-settings: 'wdth' 96, 'opsz' 96; }
.onward-back { display: inline-block; margin: 26px var(--pad) 0; font: 500 .68rem/1 var(--font-m); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.onward-back:hover { color: var(--accent-line); border-color: var(--accent-line); }

/* ── footer ── */
.foot { margin: clamp(50px, 10vh, 120px) var(--pad) 0; padding: 18px 0 34px; border-top: 1px solid var(--ink); color: var(--ink-2); font-size: .64rem; }
.foot-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 30px; }
.foot time { color: var(--ink); }
.history { margin-top: 16px; }
.history summary { cursor: pointer; width: fit-content; list-style: none; padding: 6px 0; color: var(--ink); }
.history summary::-webkit-details-marker { display: none; }
.history summary::before { content: '+'; display: inline-block; width: 1.6em; color: var(--accent-line); }
.history[open] summary::before { content: '−'; }
.history ol { list-style: none; margin: 10px 0 0; padding: 0; max-width: 720px; }
.history ol > li { display: grid; grid-template-columns: 7em 10em 1fr; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.history .hist-v { color: var(--accent-line); }
.history ul { list-style: none; margin: 0; padding: 0; text-transform: none; letter-spacing: .02em; font-size: .72rem; line-height: 1.8; color: var(--ink); }
@media (max-width: 600px) { .history ol > li { grid-template-columns: 1fr 1fr; } .history ul { grid-column: 1 / -1; } }

/* ── dock: the ruler you ride between projects ── */
.dock { position: fixed; inset: auto 0 0 0; height: var(--dock-h); z-index: 40; display: flex; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--ink); font: 500 .66rem/1 var(--font-m); letter-spacing: .12em; text-transform: uppercase; }
.dock-step { flex: none; width: var(--dock-h); font-size: 1rem; transition: background .25s, color .25s; }
.dock-step:hover { background: var(--ink); color: var(--bg); }
.dock-track { position: relative; flex: 1; display: flex; min-width: 0; border-inline: 1px solid var(--line); background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 12px) bottom / 100% 6px no-repeat; }
.dock-track a { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 12px; text-decoration: none; color: var(--ink-2); border-right: 1px solid var(--line); transition: color .4s; }
.dock-track a:last-child { border-right: 0; }
.dock-track a:hover { color: var(--ink); }
.dock-track a[aria-current] { color: var(--on-accent); }
.dock-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-num { opacity: .65; }
.dock-marker { position: absolute; inset: 0 auto 0 0; background: var(--accent); transition: transform .8s var(--ease), width .8s var(--ease), background .5s; }
@media (max-width: 700px) { .dock-track a:not([aria-current]) .dock-name { display: none; } .dock-track a:not([aria-current]) { flex: 0 0 52px; } }

/* ── curtain: slats sweep the old page away ── */
.curtain { position: fixed; inset: 0; z-index: 80; pointer-events: none; visibility: hidden; }
.curtain.on { visibility: visible; pointer-events: auto; }
.curtain-slats { position: absolute; inset: 0; display: flex; }
.curtain-slats i { flex: 1; margin-right: -1px; background: var(--curtain, var(--accent)); transform: scaleY(0); }
.curtain-label { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--on-curtain, var(--on-accent)); opacity: 0; }
.curtain-num { font: 500 .8rem/1 var(--font-m); letter-spacing: .3em; }
.curtain-name { font: 800 clamp(3rem, 13vw, 13rem)/.9 var(--font-d); font-variation-settings: 'wdth' 75, 'opsz' 96; letter-spacing: -.018em; white-space: nowrap; }

/* ── scroll reveals ── */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rows .rv:nth-child(2) { transition-delay: .08s; } .rows .rv:nth-child(3) { transition-delay: .16s; } .rows .rv:nth-child(4) { transition-delay: .24s; }
.shot.rv:nth-child(2) { transition-delay: .1s; } .shot.rv:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}
@media print { #field, .columns, .dock, .curtain, .switch, .telemetry { display: none; } .rv { opacity: 1; transform: none; } .top { position: static; } }
