:root {
  /* Unified Swiss Drafting Foundry Tokens (Zed x Grilli Type x Oxide Computer) */
  --paper: #F6F5F0;
  --sheet: #FCFBF8;
  --recess: #ECEAE1;
  --recess-deep: #E2DFD4;
  --console: #171715;
  --console-bar: #20201D;
  --console-rule: #2F2E2A;
  --console-ink: #EAE8E0;
  --console-muted: #98958A;

  --ink: #141413;
  --ink-2: #484742;
  --ink-3: #6E6C64;
  --rule: #D4D1C5;
  --rule-soft: #E5E2D8;
  --rule-strong: #141413;

  /* ONE unified surgical Swiss vermilion across headline, diff wire, deltas & primary CTA */
  --spot: #C8321A;
  --spot-hover: #A82814;
  --spot-soft: #F6E6E2;
  --spot-dark: #F06449; /* legibility-adjusted vermilion on #171715 console surface */

  /* Archival botanical ink strictly for 0-axiom Lean 4 formal verification stamps */
  --proof: #155A3E;
  --proof-soft: #E5F0EB;
  --proof-dark: #5DC293;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --frame-max: 1240px;
  --rail-w: 52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "liga" 0;
}

/* ===== ARCHITECTURAL DRAFTING FRAME WITH INSTRUMENTED MARGINALIA ===== */
.draft-shell {
  position: relative;
  max-width: calc(var(--frame-max) + var(--rail-w) * 2);
  margin: 0 auto;
  padding: 0 var(--rail-w);
  overflow-x: clip;
}
.draft-inner {
  position: relative;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  background: var(--paper);
  min-width: 0;
}

/* Diamond registration marks + real editorial section index marginalia bound to seams */
.seam {
  position: relative;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 24px;
}
.seam::before,
.seam::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 1px solid var(--ink-3);
  transform: rotate(45deg);
  z-index: 5;
}
.seam::before { left: -4px; }
.seam::after { right: -4px; }

.margin-index {
  position: absolute;
  left: calc(-1 * var(--rail-w));
  top: -10px;
  width: calc(var(--rail-w) - 10px);
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  user-select: none;
  pointer-events: none;
}
.margin-tick {
  position: absolute;
  left: -10px;
  top: 0;
  width: 6px;
  height: 1px;
  background: var(--ink-3);
  pointer-events: none;
}
.margin-code-right {
  position: absolute;
  right: calc(-1 * var(--rail-w));
  top: -9px;
  width: calc(var(--rail-w) - 10px);
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  user-select: none;
  pointer-events: none;
}

/* ===== SWISS FOUNDRY MASTHEAD ===== */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.mast-left {
  display: flex;
  align-items: baseline;
  gap: 28px;
  min-width: 0;
}
.brand-word {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
}
.brand-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  transform: translateY(1px);
}
.mast-nav {
  display: flex;
  align-items: baseline;
  gap: 22px;
}
.mast-nav a {
  text-decoration: none;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-3);
  transition: color 0.14s;
  white-space: nowrap;
}
.mast-nav a:hover,
.mast-nav a[aria-current="page"] { color: var(--ink); }
.mast-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}
.mast-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.mast-entity {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.btn-sharp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--sheet);
  border-radius: 2px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-sharp:hover {
  background: var(--spot);
  border-color: var(--spot);
  color: #FFFFFF;
}
.btn-sharp:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn-spot {
  background: var(--spot);
  border-color: var(--spot);
  color: #FFFFFF;
}
.btn-spot:hover {
  background: var(--spot-hover);
  border-color: var(--spot-hover);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}

/* ===== CHECKOUT STATUS BANNER ===== */
.status-banner {
  display: none;
  padding: 14px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.status-banner.visible { display: flex; }
.status-banner.is-proof {
  background: var(--proof-soft);
  border-left: 3px solid var(--proof);
}
.status-banner.is-spot {
  background: var(--spot-soft);
  border-left: 3px solid var(--spot);
}
.status-banner a {
  color: var(--spot);
  font-weight: 600;
  text-underline-offset: 3px;
}
.status-banner-close {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 2px;
}

/* ===== HERO SPREAD ===== */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  min-height: 556px;
}
.hero-left {
  padding: 52px 38px 46px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.plate-code {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.plate-code span.rule-seg {
  display: inline-block;
  width: 24px;
  flex: 0 0 24px;
  height: 1px;
  background: var(--ink-3);
}
h1.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 5.6vw, 80px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 13.5ch;
  margin-bottom: 26px;
}
h1.hero-title em { font-style: italic; padding-right: 0.07em; }
h1.hero-title .tech-inline {
  font-family: var(--mono);
  font-size: 0.70em;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--spot);
  vertical-align: 0.03em;
}
.hero-copy {
  font-size: 16.5px;
  line-height: 1.58;
  color: var(--ink-2);
  max-width: 48ch;
  margin-bottom: 28px;
}
.hero-copy code,
.sec-lede code,
.method-lead p code,
.method-item p code,
.rate-spec code,
.colophon code,
.doc-body code {
  font-family: var(--mono);
  font-size: 0.87em;
  color: var(--ink);
  font-weight: 500;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-guarantee {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
  margin-bottom: 32px;
}
.hero-guarantee strong {
  color: var(--ink);
  font-weight: 600;
}
.hero-foot-strip {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.95fr;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  gap: 16px;
}
.hstat-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}
.hstat-val.spot { color: var(--spot); }
.hstat-lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
  white-space: nowrap;
}

/* Hero Right: Oxide-style Precision Netlist Plate FIG. 00 */
.hero-right {
  background: var(--sheet);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.plate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 22px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--recess);
  gap: 10px;
  flex-wrap: wrap;
}
.plate-head strong { color: var(--ink); font-weight: 600; }
.plate-canvas {
  padding: 24px 22px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.plate-elision-note {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--rule-soft);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.plate-elision-note strong { color: var(--spot); font-weight: 600; }
.plate-caption {
  padding: 13px 22px;
  border-top: 1px solid var(--rule);
  background: var(--recess);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.plate-caption a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}
.plate-caption a:hover { color: var(--spot); border-bottom-color: var(--spot); }
.proof-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--proof);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.proof-stamp::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--proof);
  display: inline-block;
}

/* ===== SECTION HEADERS ===== */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  padding: 46px 32px 26px;
  align-items: end;
}
.sec-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
h2.sec-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.7vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h2.sec-title em { font-style: italic; }
h2.sec-title .mono-inline {
  font-family: var(--mono);
  font-size: 0.72em;
  font-style: normal;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.sec-lede {
  font-size: 15px;
  line-height: 1.58;
  color: var(--ink-2);
  max-width: 52ch;
  justify-self: end;
  padding-bottom: 4px;
}

/* ===== TAB SYSTEM A: FIG. 01 SPECIMEN SELECTOR ===== */
.specimen-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--recess);
}
.spec-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-right: 1px solid var(--rule);
  padding: 15px 18px 16px;
  text-align: left;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 5px;
  position: relative;
  transition: background 0.12s;
  min-width: 0;
}
.spec-btn:last-child { border-right: none; }
.spec-btn:hover { background: var(--paper); }
.spec-btn.active { background: var(--sheet); }
.spec-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2.5px;
  background: var(--ink);
}
.spec-btn-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  line-height: 1;
  margin-bottom: 2px;
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 2px;
}
.spec-btn.active .kbd {
  border-color: var(--ink);
  color: var(--sheet);
  background: var(--ink);
}
.spec-delta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--spot);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.spec-delta.kill { color: var(--ink-3); }
.spec-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.spec-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.3;
}

.specimen-body {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  background: var(--sheet);
}
.spec-left {
  padding: 28px 28px 28px 32px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.spec-headline {
  font-family: var(--sans);
  font-size: 24px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.spec-note {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.56;
}
.metrology-list {
  border-top: 1px solid var(--rule);
}
.met-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 12.5px;
  align-items: baseline;
}
.met-k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.met-v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: break-word;
}
.met-v strong.spot { color: var(--spot); font-weight: 600; }
.met-v strong.proof { color: var(--proof); font-weight: 600; }

.spec-diagram-box {
  border: 1px solid var(--rule);
  background: var(--sheet);
  padding: 14px 16px;
}
.spec-diagram-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.spec-artifact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}
.spec-artifact-links a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
}
.spec-artifact-links a:hover {
  color: var(--spot);
  border-bottom-color: var(--spot);
}

/* ===== TAB SYSTEM B: OXIDE GRAPHITE CONSOLE REGISTER ===== */
.spec-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--console);
  color: var(--console-ink);
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--console-rule);
  background: var(--console-bar);
  padding: 0 14px 0 0;
  gap: 10px;
  flex-wrap: wrap;
}
.code-tabs {
  display: flex;
  align-items: stretch;
  min-width: 0;
  flex-wrap: wrap;
}
.ctab {
  appearance: none;
  background: transparent;
  border: none;
  border-right: 1px solid var(--console-rule);
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--console-muted);
  letter-spacing: 0.02em;
  position: relative;
}
.ctab:hover { color: #FFFFFF; background: #262622; }
.ctab.active {
  background: var(--console);
  color: #FFFFFF;
  font-weight: 600;
}
.ctab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--spot-dark);
}
.copy-btn {
  background: transparent;
  border: 1px solid #3C3B36;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--console-muted);
  border-radius: 2px;
}
.copy-btn:hover { border-color: #EAE8E0; color: #FFFFFF; }
.code-stage {
  padding: 22px 24px 20px;
  flex: 1;
  overflow-x: auto;
  background: var(--console);
}
.code-stage pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--console-ink);
  white-space: pre;
  tab-size: 2;
}
.code-stage .tok-cm { color: #7E7B71; }
.code-stage .tok-kw { color: var(--proof-dark); font-weight: 500; }
.code-stage .tok-hx { color: var(--spot-dark); font-weight: 600; }

/* Interactive imm8 Bit-Probe Panel */
.imm-probe {
  border-top: 1px solid var(--console-rule);
  background: #1B1B18;
  padding: 16px 24px;
  display: grid;
  gap: 10px;
}
.imm-probe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--console-muted);
}
.imm-probe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bit-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bit-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #252521;
  color: var(--console-ink);
  border: 1px solid #3C3B35;
  padding: 4px 10px;
  border-radius: 2px;
}
.bit-btn.on {
  background: var(--spot);
  border-color: var(--spot);
  color: #FFFFFF;
  font-weight: 600;
}
.lut-cells {
  display: grid;
  grid-template-columns: repeat(8, 28px);
  gap: 3px;
}
.lut-cell {
  text-align: center;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid #2E2D29;
  background: #141412;
  color: #7E7B71;
}
.lut-cell.hi { color: var(--console-ink); }
.lut-cell.sel {
  border-color: var(--spot-dark);
  background: rgba(200, 50, 26, 0.28);
  color: #FFFFFF;
  font-weight: 700;
}
.code-footer {
  border-top: 1px solid var(--console-rule);
  padding: 11px 24px;
  background: var(--console-bar);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--console-muted);
}
.code-footer strong { color: var(--proof-dark); font-weight: 600; }
.code-footer a {
  color: var(--console-ink);
  text-decoration: none;
  border-bottom: 1px solid #4A4842;
}
.code-footer a:hover { color: #FFFFFF; border-bottom-color: #FFFFFF; }

/* ===== ASYMMETRIC EDITORIAL METHOD GRID ===== */
.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}
.method-lead {
  padding: 36px 36px 38px 32px;
  border-right: 1px solid var(--rule);
  background: var(--sheet);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.method-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
}
.method-item {
  padding: 30px 32px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.method-item:last-child { border-bottom: none; }
.method-idx {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--spot);
}
.method-lead h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.method-item h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.method-lead p,
.method-item p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.rtl-spec-strip {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.rtl-kv .k {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.rtl-kv .v {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 3px;
}
.method-foot {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* ===== TAB SYSTEM C: FIG. 02 PRINT-EDITORIAL SILICON LEDGER ===== */
.ledger-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1.5px solid var(--ink);
  gap: 16px;
  flex-wrap: wrap;
}
.ledger-tabs {
  display: flex;
  gap: 4px;
}
.ltab {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  border-bottom: none;
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  transition: background 0.12s, color 0.12s;
}
.ltab:hover { color: var(--ink); background: var(--recess); }
.ltab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
  font-weight: 600;
}
.ledger-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 10px;
}
.table-scroll {
  overflow-x: auto;
  background: var(--sheet);
  max-width: 100%;
}
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: left;
}
table.ledger th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--paper);
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.ledger td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink);
  vertical-align: top;
}
table.ledger tr:last-child td { border-bottom: none; }
table.ledger tr:hover td { background: #F8F7F2; }
.delta-win { color: var(--spot); font-weight: 600; }
.delta-flat { color: var(--ink-3); }
.delta-zero { color: var(--proof); font-weight: 600; }
.ledger-foot {
  padding: 13px 32px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ledger-foot a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}
.ledger-foot a:hover { color: var(--spot); border-bottom-color: var(--spot); }

/* ===== FIG. 03 LIVE PURE-BITWISE DSL EVALUATOR ===== */
.dsl-band {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  border-top: 1px solid var(--rule);
}
.dsl-left {
  padding: 30px 32px;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  min-width: 0;
}
.dsl-right {
  padding: 30px 32px;
  background: var(--sheet);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.dsl-input {
  width: 100%;
  min-height: 196px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
  resize: vertical;
}
.dsl-input:focus { outline: none; border-color: var(--ink); }
.dsl-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.dsl-out-box {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* ===== FIG. 04 FOUNDRY RATE CARD (SWISS SPEC TABLE) ===== */
.rate-card {
  border-top: 1px solid var(--rule);
  background: var(--sheet);
}
.rate-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1.05fr) minmax(0, 1.4fr) 196px 210px;
  border-bottom: 1px solid var(--rule);
  align-items: stretch;
}
.rate-row:last-child { border-bottom: none; }
.rate-row.featured {
  background: var(--paper);
  box-shadow: inset 3px 0 0 var(--spot);
}
.rate-cell {
  padding: 24px 20px;
  border-right: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.rate-cell:last-child { border-right: none; align-items: flex-end; }
.rate-idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}
.rate-name {
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.rate-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rate-row.featured .rate-sub { color: var(--spot); font-weight: 600; }
.rate-spec {
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-2);
  display: grid;
  gap: 5px;
}
.rate-spec li::before {
  content: '— ';
  color: var(--ink-3);
  font-family: var(--mono);
}
.rate-price {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.rate-note {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.4;
}
.rate-disclosure {
  padding: 14px 32px;
  border-top: 1px solid var(--rule);
  background: var(--recess);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.checkout-panel {
  display: none;
  border-top: 1px solid var(--rule-strong);
  background: var(--sheet);
  padding: 22px 32px;
}
.checkout-panel.visible { display: block; }
.checkout-panel-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.checkout-panel h3 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--spot);
  margin-bottom: 6px;
}
.checkout-panel p {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 70ch;
  line-height: 1.55;
}
.checkout-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== LEGAL & ABOUT DOCUMENT PAGES ===== */
.doc-hero {
  padding: 46px 32px 32px;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.doc-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 16px;
}
.doc-title em { font-style: italic; }
.doc-sub {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 66ch;
  line-height: 1.6;
}
.doc-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
  background: var(--recess);
}
.doc-meta-cell {
  padding: 14px 20px;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.doc-meta-cell:last-child { border-right: none; }
.doc-meta-k {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.doc-meta-v {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.doc-body {
  padding: 38px 32px 52px;
  background: var(--paper);
  display: grid;
  gap: 32px;
}
.doc-section {
  max-width: 82ch;
}
.doc-section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 12px;
}
.doc-section h3 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--spot);
  margin: 18px 0 8px;
}
.doc-section p {
  font-size: 15px;
  line-height: 1.66;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.doc-section ul,
.doc-section ol {
  padding-left: 22px;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.doc-section li strong,
.doc-section p strong { color: var(--ink); }
.doc-section a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-section a:hover { color: var(--spot); }
.doc-callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--spot);
  background: var(--sheet);
  padding: 18px 20px;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
}
.doc-callout.proof {
  border-left-color: var(--proof);
}
.doc-callout strong { color: var(--ink); }
.doc-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--rule);
  background: var(--sheet);
}
.doc-card {
  padding: 24px 26px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.doc-card:nth-child(2n) { border-right: none; }
.doc-card h3 {
  margin-top: 0;
}
.doc-table-wrap {
  border: 1px solid var(--rule);
  overflow-x: auto;
  background: var(--sheet);
}

/* ===== FOOTER COLOPHON ===== */
.colophon {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.72fr) minmax(0, 0.78fr);
  gap: 32px;
  padding: 42px 32px 44px;
  background: var(--recess);
}
.colophon h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.colophon p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}
.colophon ul {
  list-style: none;
  display: grid;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}
.colophon a { text-decoration: none; border-bottom: 1px solid transparent; }
.colophon a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.colophon-legal {
  border-top: 1px solid var(--rule);
  padding: 16px 32px;
  background: var(--recess-deep);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-2);
}
.colophon-base {
  border-top: 1px solid var(--rule);
  padding: 13px 32px;
  background: var(--recess);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== RESPONSIVE (ZERO HORIZONTAL OVERFLOW AT 390PX) ===== */
@media (max-width: 1120px) {
  :root { --rail-w: 0px; }
  .draft-inner { border-left: none; border-right: none; }
  .seam::before, .seam::after,
  .margin-index, .margin-tick, .margin-code-right { display: none; }
  .rate-row { grid-template-columns: 1fr 1fr; }
  .rate-cell { border-right: none; border-bottom: 1px solid var(--rule-soft); align-items: flex-start !important; }
  .rate-cell:first-child { display: none; }
  .doc-meta-strip { grid-template-columns: 1fr 1fr; }
  .doc-meta-cell { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 900px) {
  .masthead { padding: 14px 18px; gap: 12px; }
  .mast-nav, .mast-entity { display: none; }
  .hero-grid,
  .sec-head,
  .specimen-body,
  .method-grid,
  .dsl-band,
  .colophon,
  .doc-grid-2 {
    grid-template-columns: 1fr;
  }
  .doc-card { border-right: none; }
  .hero-left { border-right: none; border-bottom: 1px solid var(--rule); padding: 30px 18px 28px; }
  .plate-canvas { padding: 18px 16px 12px; }
  .sec-head { padding: 32px 18px 20px; gap: 12px; }
  .sec-lede { justify-self: start; }
  .specimen-tabs { grid-template-columns: 1fr 1fr; }
  .spec-btn { border-bottom: 1px solid var(--rule); padding: 13px 14px; }
  .spec-left { border-right: none; border-bottom: 1px solid var(--rule); padding: 22px 18px; }
  .code-stage { padding: 16px; }
  .imm-probe { padding: 14px 16px; }
  .code-footer { padding: 10px 16px; }
  .method-lead { border-right: none; border-bottom: 1px solid var(--rule); padding: 26px 18px; }
  .method-item { padding: 24px 18px; }
  .rtl-spec-strip { grid-template-columns: 1fr; gap: 10px; }
  .ledger-controls { padding: 0 18px; }
  .ledger-tabs { overflow-x: auto; max-width: 100%; }
  .ledger-foot { padding: 12px 18px; }
  .dsl-left { border-right: none; border-bottom: 1px solid var(--rule); padding: 22px 18px; }
  .dsl-right { padding: 22px 18px; }
  .rate-row { grid-template-columns: 1fr; }
  .rate-cell { padding: 16px 18px; }
  .rate-disclosure,
  .checkout-panel,
  .status-banner,
  .doc-hero,
  .doc-body { padding-left: 18px; padding-right: 18px; }
  .colophon { padding: 28px 18px; gap: 22px; }
  .colophon-legal,
  .colophon-base { padding: 12px 18px; }
}
@media (max-width: 540px) {
  .brand-word { font-size: 19px; gap: 7px; }
  .btn-sharp { padding: 8px 12px; font-size: 12.5px; }
  h1.hero-title { font-size: 42px; max-width: none; }
  .hero-copy { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-actions .btn-sharp { width: 100%; }
  .hero-foot-strip { grid-template-columns: 1fr; gap: 12px; }
  .hstat-lbl { white-space: normal; }
  .specimen-tabs { grid-template-columns: 1fr; }
  .spec-btn { border-right: none; }
  .met-row { grid-template-columns: 1fr; gap: 2px; }
  .lut-cells { grid-template-columns: repeat(8, 1fr); width: 100%; }
  .ltab { padding: 9px 11px; font-size: 10.5px; }
  .dsl-actions .btn-sharp { width: 100%; }
  .doc-meta-strip { grid-template-columns: 1fr; }
  .doc-meta-cell { border-right: none; }
}
