/* =========================================================================
   Synaptic site - "Cyanotype Schematic" design system.
   The site is an engineering drawing of a codebase: cyanotype-blue ground,
   chalk construction lines, a coordinate grid, title blocks, and red/amber
   drafting annotations. No gradients, no glow, no glass. The graph is drawn,
   not rendered. Shape language is rectangles + hairlines + circles (nodes).
   ========================================================================= */

/* ----- Tokens ----------------------------------------------------------- */
:root {
  /* engineering blue ground (true prussian, never violet) */
  --sheet:       #0d2a44;
  --sheet-2:     #103453;   /* sunken panels, title-block fills */
  --sheet-3:     #0a2238;   /* deepest wells (terminal, inputs) */

  /* chalk inks */
  --chalk:       #eef4f7;   /* body + construction line-work */
  --chalk-dim:   #9fbccc;   /* dimension labels, captions, secondary rules */
  --chalk-faint: #557a93;   /* hairlines, grid, frame */
  --grid:        rgba(120, 158, 184, 0.085);
  --grid-major:  rgba(120, 158, 184, 0.14);

  /* drafting annotation inks */
  --red:         #e0563f;   /* the redline: callouts, datum, primary action, AMBIGUOUS */
  --red-deep:    #c9462f;
  --amber:       #e8b23a;   /* caution: INFERRED, the 31x reading, honest negatives */

  /* type */
  --f-display: "Saira Condensed", "Oswald", "Arial Narrow", system-ui, sans-serif;
  --f-body:    "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono:    "Spline Sans Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;

  /* shape + rhythm - sharp, drawn, not rounded */
  --r:    2px;
  --r-sm: 1px;
  --maxw: 1320px;
  --navh: 60px;
  --gutter: clamp(1.1rem, 4vw, 2.6rem);
  --section-y: clamp(3.4rem, 7vw, 6.5rem);
  --ease: cubic-bezier(.22, .61, .25, 1);
}

/* ----- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--f-body);
  color: var(--chalk);
  line-height: 1.6;
  font-size: clamp(0.98rem, 0.95rem + 0.18vw, 1.04rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  background-color: var(--sheet);
  /* drafting paper: a fine minor grid over a stronger major grid */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 30px 30px, 30px 30px, 150px 150px, 150px 150px;
  background-position: -1px -1px;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: var(--red); color: var(--sheet); }

/* ----- Drawing frame + margin rulers ------------------------------------ */
.frame { position: fixed; inset: 9px; border: 1px solid var(--chalk-faint); pointer-events: none; z-index: 80; }
.frame__tick { position: absolute; width: 13px; height: 13px; border: 0 solid var(--chalk-dim); }
.frame__tick--tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.frame__tick--tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.frame__tick--bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.frame__tick--br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.frame__ruler { position: absolute; display: flex; font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em; color: var(--chalk-faint); }
.frame__ruler--top { top: 1px; left: 0; right: 0; justify-content: space-around; }
.frame__ruler--left { top: 0; bottom: 0; left: 2px; flex-direction: column; justify-content: space-around; }
@media (max-width: 720px) { .frame { inset: 5px; } .frame__ruler { display: none; } }

/* ----- Type primitives -------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--chalk); font-weight: 600; line-height: 1.02; letter-spacing: 0.002em; }

.display {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 1.3rem + 4.6vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0.004em;
  text-transform: uppercase;
}
.h2 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem); text-transform: uppercase; letter-spacing: 0.006em; }
.h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: 0.004em; }

.lead { font-size: clamp(1.04rem, 0.98rem + 0.6vw, 1.22rem); color: var(--chalk-dim); line-height: 1.62; max-width: 50ch; }

/* legacy accent word: now a flat red mark, never a gradient */
.signal-text { color: var(--red); }

code, .mono { font-family: var(--f-mono); font-size: 0.9em; }

/* a drafting label: uppercase mono, like an annotation on a drawing */
.label { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--chalk-dim); }
.label--red { color: var(--red); }

/* ----- Layout ----------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.4rem, 5vw, 4rem); }
.section-head { max-width: 56ch; margin-bottom: clamp(1.8rem, 3.5vw, 3rem); }
.section-head .lead { margin-top: 0.9rem; }
.section-head .label { display: block; margin-bottom: 0.9rem; }

.rule { height: 0; border: 0; border-top: 1px solid var(--chalk-faint); opacity: 0.6; }
.divider { height: 1px; background: var(--chalk-faint); opacity: 0.5; border: 0; }

/* the sheet: persistent left title-block rail + content column */
.sheet { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sheet__grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(1.6rem, 3vw, 3.4rem); }
.sheet__main { min-width: 0; }
@media (max-width: 1040px) { .sheet__grid { grid-template-columns: 1fr; gap: 0; } }

/* ----- Title-block rail ------------------------------------------------- */
.rail { position: sticky; top: calc(var(--navh) + 1.1rem); align-self: start; }
.rail__block { border: 1px solid var(--chalk-faint); }
.rail__row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--chalk-faint); font-family: var(--f-mono); font-size: 0.7rem; }
.rail__row:last-child { border-bottom: 0; }
.rail__row .k { color: var(--chalk-faint); text-transform: uppercase; letter-spacing: 0.1em; }
.rail__row .v { color: var(--chalk-dim); text-align: right; }
.rail__row .v.red { color: var(--red); }
.rail__index { margin-top: 1rem; display: flex; flex-direction: column; }
.rail__index a { display: flex; gap: 0.55rem; padding: 0.34rem 0; font-family: var(--f-mono); font-size: 0.72rem; color: var(--chalk-dim); border-bottom: 1px dotted rgba(120,158,184,0.25); transition: color .2s var(--ease); }
.rail__index a:last-child { border-bottom: 0; }
.rail__index a .n { color: var(--chalk-faint); }
.rail__index a:hover, .rail__index a.is-here { color: var(--chalk); }
.rail__index a.is-here .n { color: var(--red); }
@media (max-width: 1040px) {
  .rail { position: static; margin-bottom: 1.6rem; padding-top: 1.6rem; }
  .rail__index { display: none; }
  .rail__block { display: grid; grid-template-columns: repeat(2, 1fr); }
  .rail__row { border-right: 1px solid var(--chalk-faint); }
}

/* ----- Nav (title-block header) ----------------------------------------- */
.nav { position: sticky; top: 0; z-index: 70; background: var(--sheet); border-bottom: 1px solid var(--chalk-faint); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--navh); }
.nav__right { display: flex; align-items: center; gap: clamp(0.9rem, 2.2vw, 1.7rem); }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__word { font-family: var(--f-display); font-weight: 700; font-size: 1.32rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--chalk); }
.nav__links { display: flex; align-items: center; gap: clamp(0.9rem, 2.2vw, 1.9rem); }
.nav__links a { color: var(--chalk-dim); font-family: var(--f-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; transition: color .18s var(--ease); position: relative; padding: 0.2rem 0; }
.nav__links a:not(.nav__cta):hover, .nav__links a[aria-current="page"] { color: var(--chalk); }
.nav__links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--red); }
.nav__links a .ext { opacity: 0.65; }
.nav__cta { color: var(--sheet) !important; background: var(--red); padding: 0.4em 0.95em; letter-spacing: 0.08em; }
.nav__cta:hover { background: var(--red-deep); }
.nav__sheet { font-family: var(--f-mono); font-size: 0.68rem; color: var(--chalk-faint); letter-spacing: 0.08em; }
@media (max-width: 980px) { .nav__sheet { display: none; } }

.nav__toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--chalk-faint); }
.nav__toggle span { display: block; width: 17px; height: 1.5px; background: var(--chalk); margin: 4px auto; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; inset: var(--navh) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--sheet-2); border-bottom: 1px solid var(--chalk-faint);
    padding: 0.4rem var(--gutter) 1.2rem;
    clip-path: inset(0 0 100% 0); opacity: 0;
    transition: clip-path .32s var(--ease), opacity .32s var(--ease);
  }
  .nav__links.is-open { clip-path: inset(0 0 0 0); opacity: 1; }
  .nav__links a { padding: 0.85rem 0; border-bottom: 1px solid var(--chalk-faint); font-size: 0.95rem; }
  .nav__cta { text-align: center; margin-top: 0.9rem; }
}

/* ----- Buttons (flat ink stamps, no pill, no glow) ---------------------- */
.btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.72em 1.2em; font-family: var(--f-mono); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid transparent; transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease); white-space: nowrap; }
.btn--primary { background: var(--red); color: var(--sheet); font-weight: 600; }
.btn--primary:hover { background: var(--red-deep); }
.btn--ghost { border-color: var(--chalk-faint); color: var(--chalk); }
.btn--ghost:hover { border-color: var(--chalk); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ----- Hero ------------------------------------------------------------- */
.hero { padding-block: clamp(2.2rem, 5vw, 4.2rem) clamp(2.6rem, 6vw, 5rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr); gap: clamp(1.4rem, 3.5vw, 3.6rem); align-items: center; }
@media (max-width: 940px) { .hero__grid { grid-template-columns: 1fr; gap: 2rem; } }
.hero__title { margin: 0.7rem 0 1.2rem; }
.hero__lead { max-width: 42ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.8rem; }
@media (max-width: 460px) { .hero__cta .btn { flex: 1 1 auto; justify-content: center; } }

/* the signature drawing panel */
.draw-panel { position: relative; border: 1px solid var(--chalk-faint); background: linear-gradient(var(--sheet-2), var(--sheet)); }
.draw-panel__tag { position: absolute; top: -1px; left: -1px; font-family: var(--f-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sheet); background: var(--chalk-dim); padding: 0.18rem 0.5rem; }
.draw-panel__rev { position: absolute; bottom: -1px; right: -1px; font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.1em; color: var(--chalk-faint); border-top: 1px solid var(--chalk-faint); border-left: 1px solid var(--chalk-faint); padding: 0.14rem 0.45rem; }
.draw-panel__svg { width: 100%; height: auto; display: block; }

/* dimensioned proof line under the hero */
.hero__proof { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; margin-top: 1.8rem; padding-top: 1.1rem; border-top: 1px solid var(--chalk-faint); font-family: var(--f-mono); font-size: 0.82rem; color: var(--chalk-dim); }
.hero__proof b { color: var(--chalk); font-weight: 600; }
.hero__proof .red { color: var(--red); font-weight: 600; }

/* ----- "the shift" note ------------------------------------------------- */
.note { border: 1px solid var(--chalk-faint); border-left: 3px solid var(--red); padding: clamp(1.1rem, 2.5vw, 1.7rem) clamp(1.2rem, 3vw, 2rem); background: var(--sheet-2); }
.note__line { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 0.95rem + 1.5vw, 2rem); line-height: 1.22; text-transform: uppercase; letter-spacing: 0.01em; color: var(--chalk); max-width: 34ch; }
.note__line em { font-style: normal; color: var(--chalk-dim); }

/* ----- Dimensioned scale bar (token economy) ---------------------------- */
.dim { display: grid; gap: 1.3rem; }
.dim__row { display: grid; grid-template-columns: 16ch minmax(0, 1fr) 9ch; align-items: center; gap: 0.8rem; }
@media (max-width: 600px) { .dim__row { grid-template-columns: 1fr; gap: 0.3rem; } }
.dim__name { font-family: var(--f-mono); font-size: 0.78rem; color: var(--chalk-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.dim__track { position: relative; height: 26px; border: 1px solid var(--chalk-faint); background:
  repeating-linear-gradient(90deg, transparent 0, transparent 13px, rgba(120,158,184,0.10) 13px, rgba(120,158,184,0.10) 14px); }
.dim__fill { position: absolute; top: -1px; bottom: -1px; left: -1px; width: var(--w); border: 1px solid var(--chalk); background: repeating-linear-gradient(135deg, transparent 0, transparent 4px, rgba(238,244,247,0.12) 4px, rgba(238,244,247,0.12) 5px); }
.dim__fill--syn { border-color: var(--red); background: repeating-linear-gradient(135deg, rgba(224,86,63,0.18) 0, rgba(224,86,63,0.18) 4px, rgba(224,86,63,0.34) 4px, rgba(224,86,63,0.34) 5px); }
.js .dim__fill { width: 0; transition: width 1s var(--ease); }
.js .is-inview .dim__fill { width: var(--w); }
.dim__val { font-family: var(--f-mono); font-size: 0.86rem; color: var(--chalk); text-align: right; }
.dim__val.red { color: var(--red); }
.dim__read { margin-top: 0.4rem; display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.dim__big { font-family: var(--f-display); font-weight: 700; font-size: clamp(3rem, 1.8rem + 4vw, 4.6rem); line-height: 0.9; color: var(--red); letter-spacing: 0.01em; }
.dim__cap { color: var(--chalk-dim); max-width: 34ch; }
.dim__note { font-family: var(--f-mono); font-size: 0.74rem; color: var(--chalk-faint); margin-top: 1.1rem; line-height: 1.6; }
.dim__note a { color: var(--chalk-dim); border-bottom: 1px solid var(--chalk-faint); }
.dim__note a:hover { color: var(--chalk); }
.tokens__grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(1.6rem, 4vw, 3.6rem); align-items: center; }
@media (max-width: 820px) { .tokens__grid { grid-template-columns: 1fr; } }

/* ----- Feature assembly ------------------------------------------------- */
.assembly { display: grid; gap: 1rem; }
/* the datum part: reverse impact, given a full-width drawing cell */
.datum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: clamp(1.2rem, 3vw, 2.4rem); border: 1px solid var(--chalk-faint); background: var(--sheet-2); padding: clamp(1.2rem, 3vw, 2rem); position: relative; }
@media (max-width: 760px) { .datum { grid-template-columns: 1fr; } }
.part__balloon { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1.5px solid var(--red); color: var(--red); font-family: var(--f-mono); font-size: 0.78rem; font-weight: 600; flex: none; }
.part__head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.8rem; }
.part__cmd { font-family: var(--f-mono); font-size: 0.78rem; color: var(--chalk); background: var(--sheet-3); border: 1px solid var(--chalk-faint); padding: 0.5rem 0.7rem; margin-bottom: 0.9rem; overflow-x: auto; }
.part__cmd .p { color: var(--red); }
.datum .h3 { font-size: 1.4rem; }
.datum__body { color: var(--chalk-dim); }
.datum__body code { color: var(--chalk); }

/* the other capabilities: a numbered schedule grid */
.schedule { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 680px) { .schedule { grid-template-columns: 1fr; } }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 760px) { .cards3 { grid-template-columns: 1fr; } }

/* ----- Explanatory figures (schematic diagrams) ------------------------- */
.fig { width: 100%; height: auto; display: block; border: 1px solid var(--chalk-faint); background: var(--sheet-3); margin: 1.1rem 0; }
.fig text { font-family: var(--f-mono); }
.fig .t-tag { fill: var(--chalk-faint); font-size: 9.5px; letter-spacing: 0.14em; }
.fig .t-lbl { fill: var(--chalk); font-size: 11px; }
.fig .t-dim { fill: var(--chalk-dim); font-size: 9.5px; }
.fig .t-red { fill: var(--red); font-size: 10.5px; letter-spacing: 0.03em; }
.fig .t-amber { fill: var(--amber); font-size: 10px; }
.fig .ln { stroke: var(--chalk-dim); stroke-width: 1; fill: none; }
.fig .ln-faint { stroke: var(--chalk-faint); stroke-width: 1; fill: none; }
.fig .ln-red { stroke: var(--red); stroke-width: 1.1; fill: none; }
.fig .ln-red-d { stroke: var(--red); stroke-width: 1; fill: none; stroke-dasharray: 4 4; }
.fig .ln-faint-d { stroke: var(--chalk-faint); stroke-width: 1; fill: none; stroke-dasharray: 4 4; }
.fig .ln-amber { stroke: var(--amber); stroke-width: 1.2; fill: none; }
.fig .node { fill: var(--sheet); stroke: var(--chalk); stroke-width: 1.2; }
.fig .node-dim { fill: var(--sheet); stroke: var(--chalk-faint); stroke-width: 1; }
.fig .datum { fill: var(--red); stroke: none; }
.fig .box { fill: var(--sheet-2); stroke: var(--chalk-faint); stroke-width: 1; }
.fig .box-red { fill: none; stroke: var(--red); stroke-width: 1.2; }
.fig .box-fill { fill: var(--sheet-2); stroke: var(--chalk); stroke-width: 1; }
.part { border: 1px solid var(--chalk-faint); background: var(--sheet-2); padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; }
.part__cmd-top { font-family: var(--f-mono); font-size: 0.74rem; color: var(--chalk); margin: 0.6rem 0 0.7rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--chalk-faint); overflow-x: auto; }
.part__cmd-top .p { color: var(--red); }
.part .h3 { margin-bottom: 0.4rem; }
.part__body { color: var(--chalk-dim); font-size: 0.93rem; line-height: 1.58; flex: 1; }
.part__body code { color: var(--chalk); }

/* ----- BOM / languages schedule ----------------------------------------- */
.bom__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.bom__count { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.02em; }
.bom { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--chalk-faint); border-bottom: 0; }
@media (max-width: 760px) { .bom { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .bom { grid-template-columns: 1fr; } }
.bom__item { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--chalk-faint); border-right: 1px solid var(--chalk-faint); font-family: var(--f-mono); font-size: 0.8rem; color: var(--chalk-dim); }
.bom__item .n { color: var(--chalk-faint); font-size: 0.7rem; min-width: 1.6em; }
.bom__item.is-tier1 { color: var(--chalk); }
.bom__item.is-tier1 .dot { color: var(--red); }

/* ----- Install procedure + terminal ------------------------------------- */
.install__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.install__grid > * { min-width: 0; }
@media (max-width: 820px) { .install__grid { grid-template-columns: 1fr; } }

.terminal { border: 1px solid var(--chalk-faint); background: var(--sheet-3); }
.terminal__bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--chalk-faint); background: var(--sheet-2); }
.terminal__sheet { font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sheet); background: var(--chalk-dim); padding: 0.14rem 0.5rem; }
.terminal__title { font-family: var(--f-mono); font-size: 0.72rem; color: var(--chalk-faint); }
.terminal__body { padding: 1.1rem 1.1rem 1.2rem; font-family: var(--f-mono); font-size: 0.82rem; line-height: 1.8; overflow-x: auto; }
.terminal__body .c { color: var(--chalk-faint); }
.terminal__body .p { color: var(--red); user-select: none; }
.terminal__body .o { color: var(--amber); }
.cmd-line { display: flex; align-items: flex-start; gap: 0.55rem; }
.cmd-line code { color: var(--chalk); white-space: pre; }
.copy-btn { margin-left: auto; flex: none; font-family: var(--f-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--chalk-dim); border: 1px solid var(--chalk-faint); padding: 0.18em 0.55em; transition: color .18s, border-color .18s; }
.copy-btn:hover { color: var(--chalk); border-color: var(--chalk); }
.copy-btn.copied { color: var(--amber); border-color: var(--amber); }

.steps { display: grid; gap: 0.6rem; counter-reset: step; }
.step { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.85rem; padding: 0.8rem 0.95rem; border: 1px solid var(--chalk-faint); background: var(--sheet-2); }
.step > div { min-width: 0; }
.step__n { counter-increment: step; font-family: var(--f-mono); font-size: 0.74rem; color: var(--red); width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border: 1px solid var(--red); }
.step__n::before { content: counter(step, decimal-leading-zero); }
.step code { color: var(--chalk); font-size: 0.84rem; overflow-wrap: anywhere; }
.step__note { font-size: 0.78rem; color: var(--chalk-faint); }

/* ----- Generic content rows (features / why pages) ---------------------- */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(1.2rem, 4vw, 3.2rem); padding-block: clamp(1.8rem, 3.5vw, 2.9rem); border-top: 1px solid var(--chalk-faint); }
.row:last-child { border-bottom: 1px solid var(--chalk-faint); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; gap: 0.9rem; } }
.row__title { font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); text-transform: uppercase; }
.row__lead { color: var(--chalk-dim); margin-top: 0.6rem; max-width: 44ch; }
.row__body p { color: var(--chalk-dim); margin-bottom: 1rem; }
.row__body p:last-of-type { margin-bottom: 0; }
.row__body code { color: var(--chalk); }
.row__cmd { font-family: var(--f-mono); font-size: 0.8rem; color: var(--chalk); background: var(--sheet-3); border: 1px solid var(--chalk-faint); padding: 0.6rem 0.8rem; margin-bottom: 1rem; overflow-x: auto; }
.row__cmd .p { color: var(--red); }
.taglist { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--chalk-dim); border: 1px solid var(--chalk-faint); padding: 0.26em 0.6em; }
.tag::before { content: "["; color: var(--chalk-faint); margin-right: 0.3em; }
.tag::after { content: "]"; color: var(--chalk-faint); margin-left: 0.3em; }

/* ----- Data tables (schedules) ------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--chalk-faint); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 540px; }
table.data th, table.data td { padding: 0.66rem 0.85rem; text-align: left; border-bottom: 1px solid var(--chalk-faint); border-right: 1px solid var(--chalk-faint); }
table.data th:last-child, table.data td:last-child { border-right: 0; }
table.data thead th { font-family: var(--f-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--chalk-dim); background: var(--sheet-2); position: sticky; top: 0; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--sheet-2); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--f-mono); }
table.data td .repo { font-family: var(--f-mono); color: var(--chalk); }
.callout { border-left: 3px solid var(--amber); padding: 0.3rem 0 0.3rem 1rem; margin: 1.3rem 0; color: var(--chalk-dim); }
.callout b { color: var(--chalk); }

/* ----- Sign-off (closing) ----------------------------------------------- */
.signoff { border: 1px solid var(--chalk-faint); background: var(--sheet-2); }
.signoff__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--chalk-faint); font-family: var(--f-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--chalk-faint); }
.signoff__bar .stamp { color: var(--red); border: 1px solid var(--red); padding: 0.1rem 0.5rem; }
.signoff__body { padding: clamp(1.6rem, 4vw, 3rem); }
.signoff__title { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); text-transform: uppercase; letter-spacing: 0.01em; max-width: 20ch; }
.signoff__row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }

/* legacy cta classes mapped to sign-off look */
.cta { position: relative; }
.cta__title { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); text-transform: uppercase; max-width: 20ch; }
.cta__row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }

/* ----- Footer (full title block) ---------------------------------------- */
.foot { border-top: 1px solid var(--chalk-faint); margin-top: 2rem; }
.foot__titleblock { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--chalk-faint); border-bottom: 0; }
@media (max-width: 760px) { .foot__titleblock { grid-template-columns: repeat(2, 1fr); } }
.foot__cell { padding: 0.9rem 1rem; border-bottom: 1px solid var(--chalk-faint); border-right: 1px solid var(--chalk-faint); }
.foot__cell .k { display: block; font-family: var(--f-mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--chalk-faint); margin-bottom: 0.3rem; }
.foot__cell .v { font-family: var(--f-mono); font-size: 0.8rem; color: var(--chalk-dim); }
.foot__grid { display: flex; flex-wrap: wrap; gap: 1.8rem 3rem; justify-content: space-between; padding-block: 2rem; }
.foot__brand { max-width: 32ch; }
.foot__brand .brand { margin-bottom: 0.8rem; }
.foot__brand p { color: var(--chalk-dim); font-size: 0.88rem; }
.foot__col h4 { font-family: var(--f-mono); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--chalk-faint); margin-bottom: 0.8rem; }
.foot__col a { display: block; color: var(--chalk-dim); font-size: 0.88rem; padding: 0.26rem 0; transition: color .18s var(--ease); }
.foot__col a:hover { color: var(--chalk); }
.foot__meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; align-items: center; justify-content: space-between; padding: 1.3rem 0 1.6rem; border-top: 1px solid var(--chalk-faint); font-family: var(--f-mono); font-size: 0.74rem; color: var(--chalk-faint); }
.foot__meta a { color: var(--chalk-dim); }
.foot__meta a:hover { color: var(--chalk); }

/* ----- Page header (sub-pages) ------------------------------------------ */
.page-head { padding-block: clamp(2.6rem, 6vw, 4.5rem) clamp(1.6rem, 3vw, 2.4rem); border-bottom: 1px solid var(--chalk-faint); }
.page-head .label { display: block; margin-bottom: 0.9rem; }
.page-head .display { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.9rem); }
.page-head .lead { margin-top: 1rem; max-width: 54ch; }
.utilities { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.6rem; }

/* ----- 404 (unresolved reference) -------------------------------------- */
.err { padding-block: clamp(2.4rem, 6vw, 5.5rem); }
.err__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: clamp(1.6rem, 4vw, 3.8rem); align-items: center; }
@media (max-width: 860px) { .err__grid { grid-template-columns: 1fr; gap: 2rem; } }
.err__code { font-family: var(--f-display); font-weight: 700; font-size: clamp(4.2rem, 2rem + 11vw, 9.5rem); line-height: 0.86; letter-spacing: 0.01em; color: var(--red); margin: 0.6rem 0 0.4rem; }
.err__title { margin-bottom: 1rem; }
.err__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.7rem; }
@media (max-width: 460px) { .err__cta .btn { flex: 1 1 auto; justify-content: center; } }

/* small helpers */
.center { text-align: center; }
.mt-s { margin-top: 0.8rem; } .mt-m { margin-top: 1.6rem; } .mt-l { margin-top: 2.4rem; }
.muted { color: var(--chalk-dim); } .faint { color: var(--chalk-faint); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ----- Reveal + plot-on motion ------------------------------------------ */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-inview { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .07s; }
.js .reveal[data-delay="2"] { transition-delay: .14s; }
.js .reveal[data-delay="3"] { transition-delay: .21s; }
.js .reveal[data-delay="4"] { transition-delay: .28s; }
/* construction lines plot on when drawn into view */
.js .plot path, .js .plot line, .js .plot circle, .js .plot rect, .js .plot polyline { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); transition: stroke-dashoffset 1.1s var(--ease); }
.js .plot.is-inview path, .js .plot.is-inview line, .js .plot.is-inview circle, .js .plot.is-inview rect, .js .plot.is-inview polyline { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .dim__fill { transition: none; }
  .js .plot path, .js .plot line, .js .plot circle, .js .plot rect, .js .plot polyline { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  .btn:hover .arrow { transform: none; }
}

/* ----- Explore page (3D graph) - schematic recolor ---------------------- */
.is-explore { overflow: hidden; }
.is-explore body, body.is-explore { overflow: hidden; }
.explore { position: relative; }
.explore__stage { position: relative; width: 100%; height: calc(100vh - var(--navh)); height: calc(100dvh - var(--navh)); min-height: 460px; overflow: hidden; touch-action: none; background: var(--sheet);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 30px 30px; }
.explore__stage canvas { display: block; }
.explore__panel { position: absolute; z-index: 5; background: var(--sheet-2); border: 1px solid var(--chalk-faint); }
.explore__controls { top: 1rem; left: 1rem; width: min(280px, calc(100vw - 2rem)); padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.explore__info { top: 1rem; right: 1rem; width: min(320px, calc(100vw - 2rem)); padding: 1.1rem; }
.g-field { width: 100%; font: inherit; font-size: 0.9rem; color: var(--chalk); background: var(--sheet-3); border: 1px solid var(--chalk-faint); padding: 0.55rem 0.7rem; }
.g-field:focus-visible { border-color: var(--red); outline: none; }
select.g-field { cursor: pointer; }
.g-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-family: var(--f-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--chalk-dim); }
.g-row .g-field { width: auto; flex: 1; max-width: 58%; text-transform: none; }
.g-buttons { display: flex; gap: 0.5rem; }
.g-btn { flex: 1; font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--chalk-dim); background: var(--sheet-3); border: 1px solid var(--chalk-faint); padding: 0.5rem 0.6rem; transition: border-color .18s var(--ease), color .18s var(--ease); }
.g-btn:hover { border-color: var(--chalk); color: var(--chalk); }
.g-btn.is-on { border-color: var(--red); color: var(--red); }
.g-btn--wide { width: 100%; flex: none; }
.g-btn:disabled { opacity: 0.5; cursor: default; }
.explore__cap { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--chalk-faint); margin: 0 0 0.3rem; }
.explore__stats { font-family: var(--f-mono); font-size: 0.72rem; color: var(--chalk-faint); line-height: 1.55; margin: 0.2rem 0 0; }
.explore__legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; }
.g-key { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--f-mono); font-size: 0.7rem; color: var(--chalk-dim); }
.g-key i { width: 10px; height: 10px; display: inline-block; border: 1px solid var(--chalk); }
.g-key--grad i { width: 26px; border: 0; background: linear-gradient(90deg, var(--chalk-faint), var(--chalk)); }
.g-close { position: absolute; top: 0.5rem; right: 0.7rem; font-size: 1.3rem; line-height: 1; color: var(--chalk-dim); }
.g-close:hover { color: var(--chalk); }
.g-info__kind { font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red); margin-bottom: 0.2rem; }
.g-info__name { font-family: var(--f-display); font-size: 1.4rem; text-transform: uppercase; word-break: break-word; margin-bottom: 0.6rem; padding-right: 1.2rem; }
.g-info__sig { font-family: var(--f-mono); font-size: 0.74rem; color: var(--chalk-dim); background: var(--sheet-3); border: 1px solid var(--chalk-faint); padding: 0.5rem 0.6rem; overflow-x: auto; white-space: pre-wrap; margin-bottom: 0.6rem; }
.g-info__file { font-family: var(--f-mono); font-size: 0.72rem; color: var(--chalk-faint); word-break: break-all; margin-bottom: 0.7rem; }
.g-info__meta { display: flex; gap: 1rem; font-family: var(--f-mono); font-size: 0.74rem; color: var(--chalk-dim); margin-bottom: 0.9rem; }
.g-info__nh-h { font-family: var(--f-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--chalk-faint); margin-bottom: 0.5rem; }
.g-info__nh { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.g-chip { font-family: var(--f-mono); font-size: 0.72rem; color: var(--chalk-dim); background: var(--sheet-3); border: 1px solid var(--chalk-faint); padding: 0.25rem 0.6rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color .18s var(--ease), color .18s var(--ease); }
.g-chip:hover { border-color: var(--red); color: var(--chalk); }
.g-more { font-family: var(--f-mono); font-size: 0.7rem; color: var(--chalk-faint); }
.explore__loading, .explore__fallback { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--chalk-dim); text-align: center; padding: 2rem; font-family: var(--f-mono); font-size: 0.82rem; }
.explore__fallback { gap: 0.6rem; }
.explore__fallback p { max-width: 40ch; }
.explore__spinner { width: 32px; height: 32px; border: 1px solid var(--chalk-faint); border-top-color: var(--red); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.explore__hint { position: absolute; z-index: 5; left: 50%; bottom: 1rem; transform: translateX(-50%); font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--chalk-faint); background: var(--sheet-2); padding: 0.35rem 0.8rem; border: 1px solid var(--chalk-faint); pointer-events: none; white-space: nowrap; }
.scene-tooltip { pointer-events: none; }
.g-tip { font-family: var(--f-mono); background: var(--sheet-2); border: 1px solid var(--chalk-faint); padding: 0.45rem 0.6rem; }
.g-tip b { display: block; color: var(--chalk); font-size: 0.8rem; }
.g-tip span { color: var(--chalk-dim); font-size: 0.7rem; }
@media (prefers-reduced-motion: reduce) { .explore__spinner { animation-duration: 2.4s; } }
@media (max-width: 680px) {
  .explore__controls { top: 0.6rem; left: 0.6rem; right: 0.6rem; width: auto; padding: 0.8rem; }
  .explore__info { top: auto; bottom: 0.6rem; left: 0.6rem; right: 0.6rem; width: auto; max-height: 46dvh; overflow-y: auto; }
  .explore__hint { display: none; }
}
