@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* Lumen: Caliper's sibling. Same type and geometry; amber/gold swapped for cyan on slate. */
:root {
  color-scheme: dark;
  --void: #04070a;
  --panel: #0a1219;
  --panel-2: #0e1922;
  --rule: #16232e;
  --rule-2: #223443;
  --bone: #e3edf4;
  --muted: #8295a6;
  --faint: #4b5e6e;
  --cyan: #2fe6f2;
  --cyan-hi: #a5f6fb;
  --cyan-dim: rgba(47, 230, 242, 0.38);
  --cyan-ghost: rgba(47, 230, 242, 0.07);
  --warm: #ffd99a;
  --radius: 0;
  --header-h: 60px;
  --gutter: 24px;
  --maxw: 1200px;
  --font-display: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --glow: 0 0 0 1px var(--cyan), 0 0 18px rgba(47, 230, 242, 0.35), inset 0 0 12px rgba(47, 230, 242, 0.12);
}
@media (max-width: 768px) { :root { --gutter: 16px; } }

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

html {
  background: var(--void);
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--header-h);
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) transparent;
}
::-webkit-scrollbar { width: 2px; height: 2px; }
::-webkit-scrollbar-thumb { background: var(--cyan); }
::-webkit-scrollbar-track { background: transparent; }

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font: 400 15px/1.65 var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* Blueprint grid, as in the wireframe. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(47, 230, 242, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(47, 230, 242, 0.035) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

a { color: inherit; }
code { font: 0.9em var(--font-mono); color: var(--cyan); }
::selection { background: var(--cyan); color: var(--void); }

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed; left: 8px; top: -60px; z-index: 100;
  padding: 10px 14px;
  font: 12px var(--font-mono);
  background: var(--cyan); color: var(--void);
}
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 52px); line-height: 1.04; letter-spacing: -0.015em; }
h3 { font-size: 20px; line-height: 1.2; letter-spacing: -0.005em; }

/* ---------- Pills and buttons ---------- */
.pill-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 7px;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cyan);
  background: var(--cyan-ghost);
  border: 1px solid var(--cyan-dim);
}
.pill::before { content: "["; margin-right: 3px; opacity: 0.55; }
.pill::after { content: "]"; margin-left: 3px; opacity: 0.55; }
.pill-muted { color: var(--muted); background: none; border-color: var(--rule-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bone);
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 160ms, background-color 160ms, border-color 160ms, box-shadow 160ms, text-shadow 160ms, transform 160ms var(--ease);
}
.btn-primary { color: var(--void); background: var(--cyan); border-color: var(--cyan); }
@media (hover: hover) {
  .btn:hover {
    color: var(--cyan);
    background: rgba(47, 230, 242, 0.06);
    border-color: var(--cyan);
    box-shadow: var(--glow);
    text-shadow: 0 0 8px rgba(47, 230, 242, 0.7);
  }
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Header ---------- */
.site-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  background: rgba(4, 7, 10, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.site-head.is-scrolled { border-bottom-color: var(--rule); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 18px/1 var(--font-display);
  letter-spacing: 0.14em;
  text-decoration: none;
}
.brand-mark { width: 18px; height: 18px; fill: none; stroke: var(--cyan); stroke-width: 1.2; }
.brand-mark rect:first-of-type { fill: var(--cyan); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  padding: 8px 10px;
  font: 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 160ms;
}
.nav a.is-active, .nav a:hover { color: var(--cyan); }
@media (max-width: 1024px) { .head-tags { display: none; } }
@media (max-width: 420px) { .nav a { padding: 8px 6px; font-size: 11px; } }

/* ---------- Hero ---------- */
.hero-track { position: relative; height: 175vh; height: 175svh; }
.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--header-h) + 7vh) var(--gutter) 0;
  text-align: center;
}
.hero-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(transparent, var(--void));
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease-out; }
.hero-canvas.is-on { opacity: 1; }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; max-width: 880px; }
.wordmark {
  display: block;
  font-size: clamp(64px, 12vw, 168px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--cyan-hi);
  text-shadow: 0 0 22px rgba(47, 230, 242, 0.55), 0 0 70px rgba(47, 230, 242, 0.25);
}
.h1-line {
  display: block;
  margin-top: 14px;
  font-size: clamp(17px, 2.2vw, 26px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lede { max-width: 580px; margin: 14px 0 0; color: var(--bone); font-size: clamp(15px, 1.4vw, 17px); }
.vision { max-width: 580px; margin: 6px 0 24px; color: var(--muted); font-size: 15px; }
.hero-copy .cta-row { justify-content: center; }
.hero-status {
  position: absolute;
  left: var(--gutter);
  bottom: 22px;
  z-index: 1;
  display: flex;
  gap: 12px;
  margin: 0;
  font: 11px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-status::before { content: "//"; color: var(--faint); }
.hero-pct { color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-track { height: auto; }
  .hero-stage { position: relative; height: auto; min-height: 100vh; min-height: 100svh; }
  .hero-status { display: none; }
}

/* ---------- Bento + cards ---------- */
.bento { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative;
  min-width: 0;
  padding: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--rule-2);
}
/* Blueprint corner ticks. */
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  opacity: 0.75;
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 10px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 1px 10px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 1px 10px no-repeat;
}
.card-idx {
  margin: 0 0 14px;
  font: 11px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}
.card-copy { margin: 10px 0 0; color: var(--muted); }
.card-foot {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font: 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-foot b { float: right; font-weight: 500; color: var(--cyan); }
.metric { display: flex; flex-direction: column; }
.metric .card-foot { margin-top: auto; }
.metric .card-copy { margin-bottom: 16px; }
.metric-val {
  margin: 14px 0 4px;
  font: 500 clamp(28px, 3vw, 40px)/1.05 var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--cyan-hi);
  text-shadow: 0 0 18px rgba(47, 230, 242, 0.35);
}

/* ---------- Measured ---------- */
.pillars { position: relative; padding: 24px 0 96px; scroll-margin-top: var(--header-h); }
.measured { margin-top: 56px; }
.measured-title { font-size: clamp(24px, 3vw, 36px); }
.measured-sub { max-width: 720px; margin: 10px 0 20px; color: var(--muted); }
.bench { width: 100%; border-collapse: collapse; font: 13px/1.5 var(--font-mono); }
.bench th, .bench td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.bench thead th { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--rule-2); }
.bench tbody th { font-weight: 400; color: var(--bone); }
.bench td:nth-child(2) { color: var(--cyan); white-space: nowrap; }
.bench td:nth-child(3) { color: var(--muted); }
.bench-note { max-width: 860px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.bench-note a { color: var(--cyan); text-underline-offset: 3px; }

/* ---------- Bands (each module locks in on scroll) ---------- */
.band {
  position: relative;
  padding-bottom: 104px;
  border-top: 1px solid var(--rule);
  scroll-snap-align: start;
  scroll-margin-top: var(--header-h);
}
.band-head {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: rgba(4, 7, 10, 0.86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.band-head-inner { display: flex; align-items: center; gap: 8px 16px; min-height: 50px; padding-block: 8px; }
.band-head .pill-row { margin-left: auto; }
.band-idx { flex: none; margin: 0; font: 12px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
.band-idx b { font-weight: 500; color: var(--bone); }
.band-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px 56px;
  align-items: end;
  padding: 56px 0 36px;
}
.band-intro > p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- CodeGraph explorer ---------- */
.explorer {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--rule-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(47, 230, 242, 0.05);
}
.ex-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
  font: 11px var(--font-mono);
  color: var(--muted);
}
.ex-dots { display: inline-flex; gap: 6px; }
.ex-dots i { width: 8px; height: 8px; border: 1px solid var(--rule-2); }
.ex-dots i:first-child { border-color: var(--cyan-dim); }
.ex-hint { margin-left: auto; color: var(--cyan); }
.ex-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 420px; }
.ex-graph {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 16px 12px 40px;
  background: radial-gradient(ellipse at 45% 50%, rgba(47, 230, 242, 0.06), transparent 70%);
}
.ex-svg { display: block; width: 100%; height: auto; }
.ex-legend {
  position: absolute;
  left: 16px;
  bottom: 12px;
  display: flex;
  gap: 18px;
  margin: 0;
  font: 10.5px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ex-legend span::before { content: ""; display: inline-block; width: 18px; margin-right: 8px; vertical-align: middle; border-top: 1.5px dashed var(--cyan); }
.ex-legend .lg-in::before { border-top: 1.5px dotted var(--cyan-dim); }
.ex-side { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--rule); }
.ex-panel { min-width: 0; }
.ex-panel + .ex-panel { border-top: 1px solid var(--rule); }
.ex-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  font: 11px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ex-path { color: var(--cyan); text-transform: none; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-code { display: flex; height: 250px; overflow: auto; font: 11.5px/1.65 var(--font-mono); }
.ex-code pre { margin: 0; padding: 12px 0; font: inherit; }
.ex-gutter { flex: none; position: sticky; left: 0; padding: 12px 10px 12px 14px !important; text-align: right; color: var(--faint); background: var(--panel); user-select: none; }
.ex-src { flex: 1; padding-right: 14px !important; color: var(--bone); }
.tk-k { color: var(--cyan); }
.tk-s { color: var(--warm); }
.tk-c { color: var(--faint); }
.tk-d { color: var(--cyan-hi); }
.ex-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 12px 14px 16px; font: 11.5px/1.5 var(--font-mono); }
.ex-info dt { color: var(--muted); }
.ex-info dd { margin: 0; overflow-wrap: anywhere; }
.ex-info .hl { color: var(--cyan); }
.ex-caption { margin: 0; padding: 10px 14px; border-top: 1px solid var(--rule); font: 11px/1.5 var(--font-mono); color: var(--muted); }

.ex-edge { fill: none; stroke: var(--rule-2); stroke-width: 1.4; transition: stroke 200ms, opacity 200ms; }
.ex-edge.is-out { stroke: var(--cyan); stroke-dasharray: 6 4; animation: ex-flow 0.9s linear infinite; }
.ex-edge.is-in { stroke: var(--cyan-dim); stroke-dasharray: 2 4; }
.ex-edge.is-dim { opacity: 0.4; }
@keyframes ex-flow { to { stroke-dashoffset: -10; } }
.ex-node { cursor: pointer; outline: none; color: var(--muted); transition: opacity 200ms; }
.ex-node rect { fill: var(--panel-2); stroke: var(--rule-2); stroke-width: 1; transition: fill 200ms, stroke 200ms; }
.ex-node text { fill: currentColor; font: 12px var(--font-mono); }
.ex-node .ex-dir { fill: var(--faint); font-size: 9.5px; }
.ex-node .ico { fill: none; stroke: currentColor; stroke-width: 1.1; }
.ex-node.is-dep { color: var(--bone); }
.ex-node.is-dep rect { stroke: var(--cyan-dim); }
.ex-node.is-sel { color: var(--cyan-hi); }
.ex-node.is-sel rect { fill: rgba(47, 230, 242, 0.13); stroke: var(--cyan); filter: drop-shadow(0 0 6px rgba(47, 230, 242, 0.55)); }
.ex-node.is-dim { opacity: 0.45; }
.ex-node:focus-visible rect { stroke: var(--cyan); stroke-width: 2; }
@media (hover: hover) { .ex-node:hover rect { stroke: var(--cyan); } }
@media (prefers-reduced-motion: reduce) { .ex-edge.is-out { animation: none; } }

/* ---------- CodeGraph bento ---------- */
.bento-cg { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.area-arch { grid-column: 1 / -1; }
.diagram-card { display: flex; flex-direction: column; margin: 0; padding: 0; }
.diagram-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0;
  padding: 13px 18px;
  border-bottom: 1px solid var(--rule);
  font: 11px var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.diagram-head span:first-child { color: var(--cyan); }
.diagram-scroll { overflow-x: auto; padding: 10px 12px; }
.diagram { display: block; width: 100%; min-width: 680px; height: auto; }
.diagram-card figcaption { padding: 13px 18px 16px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }

/* ---------- Footer: status ---------- */
.site-foot { padding-bottom: 0; }
.status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 24px; margin: 0; font: 13px/1.5 var(--font-mono); }
.status dt { color: var(--cyan); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; line-height: 1.8; }
.status dd { margin: 0; color: var(--muted); }
.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  position: relative;
  padding-block: 20px 28px;
  font: 11px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--muted);
}
.foot-bottom::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--rule); }
.foot-bottom a { color: var(--bone); text-decoration-color: var(--cyan-dim); text-underline-offset: 3px; }
.foot-bottom a:hover { color: var(--cyan); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ex-body { grid-template-columns: minmax(0, 1fr); }
  .ex-side { display: grid; grid-template-columns: 1fr 1fr; border-left: 0; border-top: 1px solid var(--rule); }
  .ex-panel + .ex-panel { border-top: 0; border-left: 1px solid var(--rule); }
}
/* Grid collapse at 768px (wireframe). */
@media (max-width: 768px) {
  .bento, .bento-cg { grid-template-columns: minmax(0, 1fr); }
  .band-intro { grid-template-columns: minmax(0, 1fr); padding: 40px 0 28px; }
  .band-head .pill-row { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .band-head .pill-row::-webkit-scrollbar { display: none; }
  .ex-graph { display: block; overflow-x: auto; padding-bottom: 12px; }
  .ex-svg { min-width: 640px; }
  .ex-legend { position: static; margin-top: 10px; }
  .ex-legend::after { content: "swipe \2194"; color: var(--cyan); }
  .ex-side { display: block; }
  .ex-panel + .ex-panel { border-left: 0; border-top: 1px solid var(--rule); }
  .ex-hint { display: none; }
  .bench thead { display: none; }
  .bench tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .bench th, .bench td { padding: 0; border: 0; }
  .bench td:nth-child(3) { grid-column: 1 / -1; font-size: 12px; }
}
