/* Polymorphic — v3 "plates".
 * nemradar.com's grammar in black, bone and sand: Space Grotesk for reading, Share Tech Mono for
 * the instrument furniture, JetBrains Mono for numbers and captions; plates with corner ticks;
 * bracketed callouts; a fixed star chart; dot-matrix numerals.
 * Two themes: night (bone on black) and paper (ink on beige). There is no hue. Sand (umber on
 * paper) is the one signal tone and is spent only on what the reader should look at: the thing
 * a model found, a live state, the primary action. Everything else is ink at some weight.
 * Readability rules: running text is never uppercase or tracked; body copy is 17.5px or larger;
 * no text below 11px; reading measure stays under 68 characters. */

@font-face { font-family: 'Space Grotesk'; src: url('./fonts/SpaceGrotesk-Variable.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('./fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Share Tech Mono'; src: url('./fonts/ShareTechMono.woff2') format('woff2'); font-weight: 400; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #000; --plate: #080807; --plate-2: #0e0d0c;
  --hi: #fff; --ink: #ece8e0; --ink-2: #c3beb4; --mut: #8f8a80; --faint: #5c5851;
  --rule: #2c2a26; --rule-2: #1c1b18; --tick: #a39d92;
  --sig: #d8c39b; --sig-ink: #e6d5b3; --lab: var(--sig);
  --acc: var(--sig);   /* read by the lab drawings */
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --hud: 'Share Tech Mono', 'JetBrains Mono', ui-monospace, monospace;
  --bar: 52px;
  --gut: max(24px, calc((100vw - 1240px) / 2));
  --measure: 66ch;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* the shared motion layer reads these */
  --pm-ink: var(--ink); --pm-mut: var(--mut); --pm-bg: var(--bg);
  --pm-line: color-mix(in srgb, var(--sig) 80%, transparent); --pm-spot: rgba(236, 232, 224, 0.045);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1ebdf; --plate: #ebe4d6; --plate-2: #e4dccd;
  --hi: #000; --ink: #15130f; --ink-2: #36322b; --mut: #6a6458; --faint: #a39b8c;
  --rule: #cdc4b2; --rule-2: #dcd4c4; --tick: #4c473e;
  --sig: #7c5d2a; --sig-ink: #6b4f22;
  --pm-spot: rgba(21, 19, 15, 0.04);
}

html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip;
  font: 400 17.5px/1.66 var(--sans); font-feature-settings: "ss01"; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease; }
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--sig) 45%, transparent); color: var(--hi); }
:focus-visible { outline: 1px solid var(--sig); outline-offset: 4px; }
img, svg, canvas { display: block; }
.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--hi); color: var(--bg); font: 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; }
.skip:focus { top: 12px; }
.stars { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
main, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- type */
.display { margin: 0; font: 600 clamp(2.5rem, 4.3vw, 4.2rem)/1.0 var(--sans); letter-spacing: -0.037em; color: var(--hi); text-wrap: balance; }
.title { margin: 0; font: 600 clamp(1.9rem, 3vw, 2.85rem)/1.06 var(--sans); letter-spacing: -0.03em; color: var(--hi); text-wrap: balance; }
/* the copy marks the second clause of a headline; here it is set light rather than grey */
.display em, .title em, .next h2 em { font-style: normal; font-weight: 300; --mut: var(--hi); }
.lede { margin: 0; max-width: 36em; font-size: clamp(1.1rem, 1.32vw, 1.24rem); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.intro { margin: 0; max-width: 40em; font-size: 1.1rem; line-height: 1.66; color: var(--ink-2); text-wrap: pretty; }
.kick { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 400 12px/1.4 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); }
.kick::before { content: ''; flex: none; width: 18px; height: 1px; background: var(--sig); }
.hud-k { font: 400 11.5px/1.4 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--mut); }
strong, b { font-weight: 600; color: var(--hi); }

/* ---------------------------------------------------------------- the top bar */
.top { position: fixed; inset: 0 0 auto; z-index: 40; height: var(--bar); display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 2.2vw, 28px); border-bottom: 1px solid transparent;
  font: 400 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--mut);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent), color-mix(in srgb, var(--bg) 0%, transparent));
  transition: background-color .3s ease, border-color .3s ease; }
.top.solid { background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom-color: var(--rule-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); white-space: nowrap; }
.brand__mark { width: 31px; height: auto; color: var(--ink); }
.brand__mark .weft { color: var(--hi); }
.brand__word { letter-spacing: .3em; }
.brand:hover .brand__mark .weft { color: var(--sig); }
.crumb { padding-left: 16px; border-left: 1px solid var(--rule); white-space: nowrap; }
.spacer { flex: 1; }
.nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 24px); }
.nav a { position: relative; padding: 7px 0; color: var(--mut); white-space: nowrap; transition: color .2s ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: .16em; bottom: 0; height: 1px; background: var(--ink); }
.nav .cta { margin-left: 4px; padding: 8px 11px 7px; color: var(--sig-ink); border: 1px solid color-mix(in srgb, var(--sig) 58%, transparent); }
.nav .cta:hover { color: var(--hi); border-color: var(--sig); background: color-mix(in srgb, var(--sig) 14%, transparent); }
.theme { display: inline-flex; gap: 0; flex: none; padding: 2px; border: 1px solid var(--rule); background: transparent; cursor: pointer; }
.theme span { display: grid; place-items: center; width: 26px; height: 24px; color: var(--mut); transition: color .2s ease, background-color .2s ease; }
.theme svg { display: block; width: 13px; height: 13px; }
[data-theme="dark"] .theme [data-t="dark"], [data-theme="light"] .theme [data-t="light"] { color: var(--bg); background: var(--ink); }
.theme:hover span { color: var(--ink-2); }
[data-theme="dark"] .theme:hover [data-t="dark"], [data-theme="light"] .theme:hover [data-t="light"] { color: var(--bg); }
.menu { display: none; padding: 8px 11px 7px; border: 1px solid var(--rule); background: transparent; color: var(--ink);
  font: 400 12px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }

/* ---------------------------------------------------------------- the foot */
.foot { width: min(1240px, 100% - 48px); margin: clamp(96px, 12vw, 160px) auto 0; padding: 22px 0 48px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  font: 400 11.5px/1.7 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.foot p { margin: 0; }
.foot a { color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--ink); border-color: var(--ink-2); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------------------------------------------------------------- buttons */
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 30px; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 16px;
  font: 400 12px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  color: var(--ink); background: transparent; border: 1px solid var(--rule); transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
.btn:hover { color: var(--hi); border-color: var(--ink-2); }
.btn--primary { color: var(--hi); border-color: var(--sig); }
.btn--primary:hover { color: var(--bg); background: var(--sig); border-color: var(--sig); }
.btn--lg { min-height: 58px; padding: 0 24px; font-size: 13px; }
.link { display: inline-flex; gap: 8px; font: 400 12px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--mut);
  border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.link:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------------------------------------------------------------- corner ticks: the mark of a plate */
.tick { position: relative; }
.tick::before, .tick::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--tick); pointer-events: none; z-index: 3; }
.tick::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.tick::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------------------------------------------------------------- the hero: words left, a working plate bleeding right */
.hero { position: relative; padding-top: calc(var(--bar) + clamp(18px, 2.6vw, 36px)); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 13fr); gap: clamp(24px, 3.2vw, 52px); align-items: start; }
/* home: the plate runs a little past the fold so the manifold fills the first screen; its lenses wait just below */
@media (min-width: 981px) {
  [data-page="home"] .hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  [data-page="home"] .inst { height: clamp(700px, calc(100svh + 48px), 1000px); }
}
.hero__copy { display: flex; flex-direction: column; padding: clamp(18px, 3.4vw, 54px) 0 6px; min-width: 0; }
.hero .lede { margin-top: 24px; }
.who { display: flex; align-items: center; gap: 14px; margin: 0 0 28px; }
.who svg { width: 54px; height: auto; color: var(--ink); }
.who svg .weft { color: var(--sig); }
.who p { margin: 0; font: 400 11.5px/1.55 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--mut); }
.who b { display: block; font-weight: 400; color: var(--ink); letter-spacing: .24em; }
.crumb-link { align-self: flex-start; margin-bottom: 30px; font: 400 12px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--mut); }
.crumb-link:hover { color: var(--ink); }
.more { margin-top: 22px; }

/* the plate caption: what the drawing shows, as WEFT Research captions its plates */
.plate-cap { margin: auto 0 0; padding-top: 34px; max-width: 48ch; font: 400 12.5px/1.62 var(--mono); color: var(--mut); }
.plate-cap .label { display: block; margin-bottom: 9px; font: 400 11.5px/1 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--sig-ink); }
.plate-cap b { font-weight: 400; color: var(--ink-2); }

/* the instrument: a live model drawn straight onto the night, no frame, bleeding off the right edge */
.inst { position: relative; height: clamp(600px, calc(100svh - var(--bar) - 36px), 840px); margin: 0 calc(-1 * var(--gut)) 0 0; overflow: hidden; touch-action: pan-y; }
.inst > canvas { position: absolute; top: 0; left: 0; width: calc(100% - clamp(12px, 2.4vw, 34px)); height: 100%; }
.inst .hud { position: absolute; z-index: 2; margin: 0; pointer-events: none; color: var(--ink-2);
  font: 400 12px/1.5 var(--hud); letter-spacing: .1em; text-transform: uppercase;
  text-shadow: 0 0 3px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg); }
.inst .hud b { font-weight: 400; color: var(--hi); font-variant-numeric: tabular-nums; }
/* a readout in brackets, top left */
.inst .brk { padding: 8px 13px 8px 14px; min-width: 210px; }
.inst .brk::before, .inst .brk::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; border: 1px solid var(--tick); }
.inst .brk::before { left: 0; border-right: 0; }
.inst .brk::after { right: 0; border-left: 0; }
.inst .brk span { display: flex; justify-content: space-between; gap: 22px; }
.inst .brk span:first-child { display: block; margin-bottom: 3px; color: var(--sig-ink); letter-spacing: .16em; }
.inst .hud--tl { left: clamp(14px, 2vw, 26px); top: clamp(14px, 2vw, 24px); }
/* the state: one big word in sand, in brackets, with two lines of what it means */
.inst .state { right: clamp(18px, 2.6vw, 36px); top: clamp(14px, 2vw, 24px); padding: 7px 12px 8px 14px; max-width: min(360px, 46%); }
.inst .state::before, .inst .state::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; border: 1px solid var(--sig); }
.inst .state::before { left: 0; border-right: 0; }
.inst .state::after { right: 0; border-left: 0; }
.inst .state strong { display: block; margin-bottom: 4px; font: 400 clamp(22px, 2.2vw, 30px)/1.05 var(--hud); letter-spacing: .12em; color: var(--sig); }
.inst .state span { display: block; }
.inst .state span + span { color: var(--mut); }
.inst .probe { left: 0; top: 0; white-space: nowrap; opacity: 0; transition: opacity .2s ease; }
.inst .probe.on { opacity: 1; }
.inst .trace canvas { display: block; width: 200px; height: 40px; margin-top: 4px; }
.inst .record { position: absolute; left: clamp(14px, 2vw, 26px); right: clamp(18px, 2.6vw, 36px); bottom: clamp(14px, 2vw, 24px);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: end; pointer-events: none; z-index: 2; }
.inst .record > .hud { position: static; padding-bottom: 2px; }
.inst .record ol { display: flex; justify-content: flex-end; gap: clamp(10px, 1.4vw, 18px); margin: 0; padding: 0; list-style: none; overflow: hidden; }
.inst .spec { flex: none; display: grid; gap: 5px; width: 64px; color: var(--mut); font: 400 10.5px/1.4 var(--hud); letter-spacing: .08em; text-transform: uppercase; animation: spec .9s cubic-bezier(.16,1,.3,1) both; }
.inst .spec canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.inst .spec b { font-weight: 400; color: var(--ink); }
@keyframes spec { from { opacity: 0; transform: translateY(10px); } }
.inst .tl { position: absolute; left: clamp(14px, 2vw, 26px); right: clamp(18px, 2.6vw, 36px); bottom: clamp(14px, 2vw, 24px); height: 78px; pointer-events: none; z-index: 2; }
.inst .tl canvas { width: 100%; height: 100%; display: block; }

/* the spec strip under a hero */
.spec-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.spec-strip > div { padding: 20px 22px 22px 0; min-width: 0; }
.spec-strip > div + div { padding-left: 22px; border-left: 1px solid var(--rule-2); }
.spec-strip b { display: block; margin: 12px 0 10px; font: 600 clamp(1.45rem, 2vw, 1.85rem)/1.05 var(--sans); letter-spacing: -0.025em; color: var(--hi); }
.spec-strip p { margin: 0; max-width: 30ch; font-size: 0.98rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.spec-strip .led { display: block; margin: 12px 0 10px; font-size: 40px; color: var(--hi); }

/* ---------------------------------------------------------------- sections: a head that uses the width, then the work */
.sec { padding-top: clamp(96px, 12vw, 168px); }
.head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px clamp(32px, 5vw, 72px); align-items: end; margin-bottom: clamp(30px, 4vw, 52px); }
.head .intro { padding-bottom: 6px; }
.head--solo { grid-template-columns: minmax(0, 1fr); }
.head--solo .title { max-width: 22ch; }
.bar-h { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin: 0 0 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.after { margin: 26px 0 0; max-width: 46em; font-size: 1.06rem; line-height: 1.66; color: var(--ink-2); text-wrap: pretty; }

/* ---------------------------------------------------------------- specimen cards: a small working drawing above the words */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px); }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--rule); background: color-mix(in srgb, var(--plate) 90%, transparent);
  transition: border-color .2s ease, transform .2s var(--ease); }
.card::before, .card::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--sig); opacity: 0; transition: opacity .2s ease; pointer-events: none; z-index: 2; }
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.card:hover { border-color: color-mix(in srgb, var(--sig) 40%, var(--rule)); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card__art { position: relative; height: 168px; border-bottom: 1px solid var(--rule-2); overflow: hidden; }
.cards--2 .card__art { height: 236px; }
.card__art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.card__art .tag, .thumb .tag { position: absolute; left: 10px; top: 10px; z-index: 1; padding: 6px 8px; background: color-mix(in srgb, var(--bg) 78%, transparent);
  font: 400 11px/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.card__body > .hud-k { color: var(--sig-ink); }
.card h3 { margin: 2px 0 0; font: 600 1.32rem/1.18 var(--sans); letter-spacing: -0.018em; color: var(--hi); text-wrap: balance; }
.card p { margin: 0; flex: 1; font-size: 1rem; line-height: 1.58; color: var(--ink-2); text-wrap: pretty; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span { padding: 6px 8px 5px; border: 1px solid var(--rule); color: var(--mut); font: 400 11px/1 var(--hud); letter-spacing: .14em; text-transform: uppercase; }
.ticks { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: t; }
.ticks li { display: flex; gap: 14px; padding: 11px 0; border-top: 1px solid var(--rule-2); font-size: 0.98rem; line-height: 1.45; color: var(--ink); }
.ticks li::before { content: counter(t, decimal-leading-zero); counter-increment: t; flex: none; padding-top: 2px; font: 400 12px/1.45 var(--mono); color: var(--mut); }

/* ---------------------------------------------------------------- plates: a drawing with its number, its finding and how to read it */
.plate { position: relative; margin: 0; padding: clamp(16px, 2vw, 24px) clamp(16px, 2vw, 26px) clamp(14px, 1.8vw, 20px);
  background: color-mix(in srgb, var(--plate) 84%, transparent); border: 1px solid var(--rule-2); }
.plate::before, .plate::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--sig); pointer-events: none; z-index: 3; }
.plate::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.plate::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.plate__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: baseline; margin-bottom: 14px; }
.plate__no { padding-top: 3px; font: 400 12px/1 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--sig-ink); white-space: nowrap; }
.plate__title { margin: 0; font: 600 1.18rem/1.28 var(--sans); letter-spacing: -0.01em; color: var(--hi); }
.plate__finding { margin: 5px 0 0; max-width: 74ch; font-size: 1rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.plate__note { font: 400 11.5px/1.4 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--mut); white-space: nowrap; }
.plate__note.live { color: var(--sig-ink); }
.plate__note.live::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--sig); vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.plate canvas { display: block; width: 100%; }
.plate__readout { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--rule-2);
  font: 400 11.5px/1.4 var(--hud); letter-spacing: .16em; text-transform: uppercase; color: var(--mut); }
.plate__readout b { margin-left: 8px; font-weight: 400; color: var(--hi); font-variant-numeric: tabular-nums; }
.howto { margin: 12px 0 0; max-width: 120ch; font: 400 12.5px/1.62 var(--mono); color: var(--mut); text-wrap: pretty; }
.howto .label { margin-right: 10px; font: 400 11px/1 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.plate--data .plate__head { margin-bottom: 8px; }

/* ---------------------------------------------------------------- the rail: four stages on one line */
.rail { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 30px); margin: 0; padding: 0; }
.rail li { position: relative; display: flex; flex-direction: column; padding-top: 18px; border-top: 1px solid var(--rule); }
.rail li::before { content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--sig); transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s var(--ease); }
.rail li.on::before { transform: none; }
.rail__k { font: 400 11.5px/1.4 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--mut); transition: color .4s ease; }
.rail li.on .rail__k { color: var(--sig-ink); }
.rail .led { display: block; margin: 14px 0 20px; font-size: 34px; color: var(--faint); transition: color .4s ease; }
.rail li.on .led { color: var(--hi); }
.rail h3 { margin: 0 0 8px; font: 600 1.22rem/1.22 var(--sans); letter-spacing: -0.015em; color: var(--hi); }
.rail p { margin: 0; font-size: 1rem; line-height: 1.58; color: var(--ink-2); text-wrap: pretty; }

/* ---------------------------------------------------------------- the index: two columns of what we have shipped */
.index { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5vw, 72px); margin: 0; padding: 0; }
.index li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 4px 10px; padding: 17px 0 18px; border-top: 1px solid var(--rule); }
.index .n { padding-top: 3px; font: 400 12.5px/1.4 var(--mono); color: var(--mut); }
.index .t { font: 600 1.06rem/1.35 var(--sans); color: var(--hi); }
.index .d { grid-column: 2; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.index li:hover .n { color: var(--sig-ink); }

/* ---------------------------------------------------------------- dot-matrix numerals */
.led { display: inline-block; line-height: 1; }
.v3-dots { display: inline-block; vertical-align: -0.06em; }
.v3-dots svg { display: block; height: 0.8em; width: auto; overflow: visible; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px clamp(28px, 4vw, 56px); padding: 26px 0 4px; border-top: 1px solid var(--rule); }
.stat .led { font-size: clamp(44px, 4.8vw, 60px); color: var(--sig); }
.stat p { margin: 14px 0 0; max-width: 30ch; font: 400 13px/1.6 var(--mono); color: var(--ink-2); }

/* ---------------------------------------------------------------- from the lab: NEM Radar */
.lab .plate { padding-bottom: clamp(16px, 2vw, 22px); }
.spikes { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; }
.spikes__hours { position: relative; font: 400 11px/1 var(--mono); color: var(--faint); }
.spikes__hours span { position: absolute; right: 0; transform: translateY(-50%); }
.spikes__plot { position: relative; aspect-ratio: 669 / 290; }
.spikes__plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.spikes__months { position: relative; grid-column: 2; height: 24px; margin-top: 8px; font: 400 11px/1 var(--mono); color: var(--faint); }
.spikes__months span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.spikes .callout { position: absolute; z-index: 2; padding: 6px 15px 7px 13px; pointer-events: none; white-space: nowrap;
  font: 400 11.5px/1.45 var(--hud); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); text-shadow: 0 0 3px var(--bg), 0 0 8px var(--bg); }
.spikes .callout::before, .spikes .callout::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px; border: 1px solid var(--lab); }
.spikes .callout::before { left: 0; border-right: 0; }
.spikes .callout::after { right: 0; border-left: 0; }
.spikes .callout strong { display: block; font: 400 clamp(18px, 1.9vw, 26px)/1.1 var(--hud); letter-spacing: .1em; color: var(--lab); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; font: 400 12px/1.3 var(--mono); color: var(--ink-2); }
.legend i { display: inline-block; margin-right: 8px; vertical-align: -1px; border-radius: 50%; }
.lab__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; }
.lab .spec-strip { margin-top: 26px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lab .spec-strip b { font-family: var(--mono); font-weight: 400; font-size: clamp(1.25rem, 1.7vw, 1.55rem); letter-spacing: 0; }

/* ---------------------------------------------------------------- the close: one sentence and one action */
.close { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 28px 56px; align-items: end;
  margin-top: clamp(96px, 12vw, 168px); padding: clamp(28px, 4vw, 52px); border: 1px solid var(--rule); background: color-mix(in srgb, var(--plate) 80%, transparent); }
.close h2 { margin: 0; max-width: 17ch; font: 600 clamp(2.2rem, 4.4vw, 4rem)/1.0 var(--sans); letter-spacing: -0.037em; color: var(--hi); text-wrap: balance; }
.close p { margin: 18px 0 0; max-width: 40em; font-size: 1.12rem; line-height: 1.62; color: var(--ink-2); }
.close .kick { margin-bottom: 20px; }

/* ---------------------------------------------------------------- the library */
.hero--lib .head { margin-bottom: 0; }
.lib { padding-top: clamp(26px, 3.4vw, 42px); }
.routes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.route { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--rule); background: color-mix(in srgb, var(--plate) 92%, transparent);
  transition: border-color .2s ease, transform .2s var(--ease); }
.route::before, .route::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--sig); opacity: 0; transition: opacity .2s ease; pointer-events: none; z-index: 2; }
.route::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.route::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.route:hover, .route:focus-visible { border-color: color-mix(in srgb, var(--sig) 45%, var(--rule)); transform: translateY(-3px); outline: none; }
.route:hover::before, .route:hover::after, .route:focus-visible::before, .route:focus-visible::after { opacity: 1; }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--rule-2); }
.thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.route__meta { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 18px 18px; }
.route__meta > .hud-k { color: var(--sig-ink); }
.route h2 { margin: 2px 0 0; font: 600 1.28rem/1.15 var(--sans); letter-spacing: -0.018em; color: var(--hi); text-wrap: balance; }
.route p { margin: 0; flex: 1; font-size: 0.97rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.route__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.route__foot .led { font-size: 30px; color: var(--sig); }
.route__foot small { display: block; margin-top: 8px; font: 400 11.5px/1.45 var(--mono); color: var(--mut); }
.route__go { font: 400 11.5px/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--mut); white-space: nowrap; transition: color .2s ease; }
.route:hover .route__go { color: var(--sig-ink); }
.route--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.route--wide .thumb { aspect-ratio: auto; min-height: 220px; border-bottom: 0; border-right: 1px solid var(--rule-2); }
.route--wide .route__meta { padding: 22px 24px; }
.route--wide h2 { font-size: 1.6rem; }
.note { margin: 18px 0 0; max-width: 90ch; font: 400 12px/1.6 var(--mono); color: var(--mut); }

/* ---------------------------------------------------------------- a case study, read like a research note */
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(26px, 3.4vw, 42px) auto 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.meta > div { padding: 15px 18px 16px 0; font: 400 12px/1.5 var(--hud); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); min-width: 0; }
.meta > div + div { padding-left: 18px; border-left: 1px solid var(--rule-2); }
.meta span { display: block; margin-bottom: 6px; color: var(--mut); }
.note-body { padding-top: clamp(40px, 5vw, 70px); }
.chapter { padding-top: clamp(64px, 8vw, 112px); }
.chapter:first-child { padding-top: clamp(40px, 5vw, 64px); }
.chapter > .aside, .chapter > .prose { margin-left: clamp(0px, 8vw, 120px); max-width: var(--measure); }
.aside { margin: 0 0 16px; color: var(--ink-2); font: 400 1.04rem/1.5 var(--sans); }
.aside::first-line { font: 400 12px/2.2 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--sig-ink); }
.prose h2 { margin: 0 0 22px; font: 600 clamp(1.8rem, 3vw, 2.6rem)/1.08 var(--sans); letter-spacing: -0.028em; color: var(--hi); text-wrap: balance; }
.prose p { margin: 0 0 1.1em; font-size: 1.12rem; line-height: 1.68; color: var(--ink-2); text-wrap: pretty; }
.prose strong { font-weight: 500; color: var(--hi); }
.chapter > .plate, .chapter > .rail, .chapter > .stats, .chapter > .stack { margin-top: clamp(28px, 3.6vw, 44px); }
.chapter > .stats + p, .chapter > .stack + p { margin: 26px 0 0 clamp(0px, 8vw, 120px); max-width: var(--measure); font-size: 1.06rem; line-height: 1.66; color: var(--ink-2); }
.stack > * + * { margin-top: clamp(22px, 3vw, 34px); }
.next { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 40px; align-items: end; margin-top: clamp(96px, 12vw, 160px);
  padding: clamp(26px, 3.6vw, 46px); border: 1px solid var(--rule); background: color-mix(in srgb, var(--plate) 80%, transparent); transition: border-color .2s ease; }
.next::before, .next::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--sig); pointer-events: none; }
.next::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.next::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.next:hover { border-color: color-mix(in srgb, var(--sig) 45%, var(--rule)); }
.next .kick { margin-bottom: 16px; }
.next h2 { margin: 0; max-width: 20ch; font: 600 clamp(2rem, 4vw, 3.5rem)/1.02 var(--sans); letter-spacing: -0.035em; color: var(--hi); text-wrap: balance; }
.next .btn { pointer-events: none; }
.next:hover .btn { color: var(--bg); background: var(--sig); border-color: var(--sig); }

/* ---------------------------------------------------------------- the contact form */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.split .sec__head h2 { margin: 0; font: 600 clamp(1.9rem, 3vw, 2.85rem)/1.06 var(--sans); letter-spacing: -0.03em; color: var(--hi); }
.split .sec__head p:not(.kick) { margin: 18px 0 0; font-size: 1.1rem; line-height: 1.62; color: var(--ink-2); max-width: 30em; }
.form { display: grid; gap: 26px; padding: clamp(20px, 2.6vw, 32px); border: 1px solid var(--rule); background: color-mix(in srgb, var(--plate) 88%, transparent); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.form label span { display: block; margin-bottom: 4px; font: 400 11.5px/1.4 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--mut); }
.form input, .form textarea { width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--hi);
  font: 400 1.06rem/1.5 var(--sans); resize: vertical; transition: border-color .2s ease; }
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--sig); }
.form input::placeholder, .form textarea::placeholder { color: var(--faint); }
.form-status { margin: 0; font-size: 1rem; color: var(--ink); }
.method-head h2 { margin: 0; font: 600 clamp(1.9rem, 3vw, 2.85rem)/1.06 var(--sans); letter-spacing: -0.03em; color: var(--hi); }
.method-head p:not(.kick) { margin: 0; max-width: 40em; font-size: 1.1rem; line-height: 1.66; color: var(--ink-2); }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1180px) {
  .crumb { display: none; }
  .routes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab .spec-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lab .spec-strip > div:nth-child(4) { border-left: 0; padding-left: 0; }
  .lab .spec-strip > div:nth-child(n + 4) { border-top: 1px solid var(--rule-2); }
}
@media (max-width: 980px) {
  :root { --bar: 54px; }
  .hero__grid, .head, .split, .close, .route--wide, .next { grid-template-columns: minmax(0, 1fr); }
  .hero__copy { padding-bottom: 0; }
  .plate-cap { order: 3; margin-top: 18px; padding-top: 0; }
  .inst { margin: 0 calc(-1 * var(--gut)); height: 640px; }
  .cards, .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { row-gap: 34px; }
  .spec-strip, .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-strip > div:nth-child(3), .meta > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .spec-strip > div:nth-child(n + 3), .meta > div:nth-child(n + 3) { border-top: 1px solid var(--rule-2); }
  .index { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .route--wide .thumb { min-height: 0; aspect-ratio: 669 / 260; border-right: 0; border-bottom: 1px solid var(--rule-2); }
  .chapter > .aside, .chapter > .prose, .chapter > .stats + p, .chapter > .stack + p { margin-left: 0; }
  .nav { position: fixed; inset: var(--bar) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 20px 18px;
    background: var(--bg); border-bottom: 1px solid var(--rule); transform: translateY(-130%); transition: transform .3s var(--ease); }
  .nav a { padding: 15px 0; border-bottom: 1px solid var(--rule-2); font-size: 13px; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { color: var(--hi); }
  .nav .cta { margin: 14px 0 0; padding: 14px 12px; text-align: center; }
  .top.open .nav { transform: none; }
  .top.open { background: var(--bg); }
  .menu { display: inline-block; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap, .foot { width: min(1240px, 100% - 32px); }
  :root { --gut: 16px; }
  .brand__word { display: none; }
  .who svg { width: 46px; }
  .display { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .ctas .btn { flex: 1 1 auto; }
  .inst { height: 680px; }
  [data-page="home"] .inst { height: 760px; }
  .inst .hud { font-size: 11px; }
  .inst .brk { min-width: 0; }
  .inst .state { left: 14px; right: auto; top: 7.6rem; bottom: auto; max-width: calc(100% - 28px); }
  .inst .state strong { font-size: 21px; }
  .cards, .cards--2, .rail, .routes, .form .row, .spec-strip, .meta { grid-template-columns: minmax(0, 1fr); }
  .spec-strip > div + div, .meta > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-2); }
  .lab .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab .spec-strip > div { border-left: 0 !important; padding-left: 0 !important; }
  .lab .spec-strip > div:nth-child(even) { padding-left: 16px !important; border-left: 1px solid var(--rule-2) !important; }
  .plate__head { grid-template-columns: minmax(0, 1fr); }
  .plate__note { white-space: normal; }
  .spikes { grid-template-columns: 30px minmax(0, 1fr); gap: 0 6px; }
  .spikes__plot { aspect-ratio: auto; height: 300px; }
  .spikes .callout { display: none; }
  .close h2, .next h2 { font-size: clamp(2rem, 9vw, 2.6rem); }
}
@media (max-width: 559px) { #fig-paths { height: 560px !important; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plate__note.live::before { animation: none; }
  .inst .spec { animation: none; }
  .card, .route { transition: none; }
  .card:hover, .route:hover { transform: none; }
}
