/* Self-hosted Roboto (Apache-2.0) — accessible, gate-safe (no external fetch),
   the open sibling of the Skyzai Google-Sans grammar. latin + greek subsets. */
@font-face{font-family:'Roboto';font-style:normal;font-weight:100 900;font-display:optional;src:url('../fonts/Roboto-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Roboto';font-style:normal;font-weight:100 900;font-display:optional;src:url('../fonts/Roboto-greek.woff2') format('woff2');unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}
@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:100 700;font-display:optional;src:url('../fonts/RobotoMono-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:100 700;font-display:optional;src:url('../fonts/RobotoMono-greek.woff2') format('woff2');unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}

:root {
  /* Skyzai web brand — dark .org, yellow primary, blue secondary, FIRE sectors */
  --bg: #050505;
  --surface: #0A0A0A;
  --elevated: #111111;
  --surface-highest: #161616;
  --border: #2A2A2A;
  --text: #F3F4F6;
  --cream: #FFFDE7;
  --text-muted: #9CA3AF;
  --text-dim: #555555;
  --accent: #FFEB3B;
  --accent-contrast: #050505;
  --gold: #FFEB3B;
  --gold-bright: #FFF176;
  --teal: #2196F3;
  --blue: #2196F3;
  --blue-soft: #42A5F5;
  --sector-finance: #F44336;
  --sector-insurance: #4CAF50;
  --sector-real-infra: #2196F3;
  --sector-electronic-lab: #FFEB3B;
  --line: rgba(243, 244, 246, 0.12);
  --line-soft: rgba(243, 244, 246, 0.07);
  --shape-sm: 4px;
  --shape-md: 8px;
  --shape-lg: 16px;
  --shape-full: 999px;
  --target-min: 48px;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --instrument-bg: rgba(5, 5, 5, 0.96);
  --instrument-bg-soft: rgba(5, 5, 5, 0.82);
  --instrument-line: rgba(243, 244, 246, 0.15);
  --instrument-line-soft: rgba(243, 244, 246, 0.075);
  --instrument-amber: #FFEB3B;
  --instrument-blue: #2196F3;
  --instrument-green: #4CAF50;
  --instrument-warn: #FF7A17;

  /* Skyzai grammar via self-hosted Roboto (accessible, consistent everywhere) + system fallback */
  --font-heading: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* φ = 1.618 spacing scale, snapped to a 4px grid (Skyzai structural law) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 48px;
  --space-6: 80px;
  --space-7: 128px;
  --phi: 1.618;
}

:root[data-theme="light"] {
  /* Skyzai true-tone reading theme */
  --bg: #FDFAF4;
  --surface: #FAF7F0;
  --elevated: #F2EDE3;
  --surface-highest: #EAE3D5;
  --border: #D6CFBF;
  --text: #18160E;
  --text-muted: #4A4438;
  --text-dim: #7A7062;
  --accent: #2E7D32;
  --accent-contrast: #FFFFFF;
  --gold: #92650A;
  --gold-bright: #7A5408;
  --teal: #1565C0;
  --blue: #1565C0;
  --blue-soft: #1E88E5;
  --line: rgba(24, 22, 14, 0.14);
  --line-soft: rgba(24, 22, 14, 0.08);
}

/* Base */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
}

.skip {
  position: fixed;
  z-index: 1000;
  top: var(--space-2);
  left: var(--space-2);
  padding: 10px 14px;
  background: var(--gold);
  color: var(--accent-contrast);
  border-radius: var(--shape-sm);
  font: 700 13px/1 var(--font-mono);
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms var(--ease-standard);
}

.skip:focus {
  transform: translateY(0);
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sector-electronic-lab) 5%, transparent), transparent 30rem),
    linear-gradient(90deg, color-mix(in srgb, var(--sector-real-infra) 6%, transparent), transparent 34%, transparent 66%, color-mix(in srgb, var(--sector-insurance) 4%, transparent)),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  margin: 0;
}

a {
  color: inherit;
}

strong {
  color: var(--text);
}

code {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.94em;
  overflow-wrap: anywhere;
  padding: 0.08rem 0.28rem;
  word-break: break-word;
}

noscript {
  display: block;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 82px 32px 18px;
}

.site-shell {
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.08);
  border-bottom: 1px solid var(--border);
  gap: var(--space-3);
  overflow: hidden;
}

.topbar .brand {
  flex: 0 0 auto;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing:0;
}

.topbar .number-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  font-size: 13px;
  font-weight: 500;
}

.topbar .number-nav::-webkit-scrollbar {
  display: none;
}

.topbar .number-nav a,
.topbar .number-nav span {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: var(--target-min);
  min-height: var(--target-min);
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
}

.topbar .number-nav a:hover {
  color: var(--text);
}

.topbar .number-nav .active {
  color: var(--gold);
}

/* Topbar extended routes (used by 7+ source-note pages, 19-route nav) */
.topbar .topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-3);
}

.topbar .routes {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  font-size: 13px;
  font-weight: 500;
}

.topbar .routes::-webkit-scrollbar {
  display: none;
}

.topbar .route,
.topbar .nav-route {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: var(--target-min);
  min-height: var(--target-min);
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
}

.topbar .route:hover,
.topbar .nav-route:hover {
  color: var(--text);
}

.topbar .route.active,
.topbar .nav-route.active {
  color: var(--gold);
  font-weight: 700;
}

.topbar .nav-route {
  font-size: 12px;
  letter-spacing:0;
  opacity: 0.85;
}

.topbar .nav-route.active {
  opacity: 1.0;
}

.theme-toggle {
  flex: 0 0 auto;
  width: var(--target-min);
  height: var(--target-min);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: 700 12px/1 var(--font-body);
  letter-spacing:0;
  text-transform: uppercase;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.command-open {
  display: inline-flex;
  min-width: 5.2rem;
  min-height: var(--target-min);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: 700 11px/1 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing:0;
  text-transform: uppercase;
}

.command-open:hover {
  border-color: var(--accent);
  color: var(--text);
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: max(5rem, 10vh) 1rem 1rem;
}

.command-palette.is-open {
  display: flex;
}

.command-panel {
  width: min(620px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--shape-lg);
  background: var(--bg);
  overflow: hidden;
}

.command-panel form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
}

.command-prefix,
.command-empty,
.command-result small {
  color: var(--text-muted);
  font: 700 0.66rem/1 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing:0;
  text-transform: uppercase;
}

.command-panel .command-input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: 0.95rem/1.2 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  outline: 0;
  padding: 0;
}

.command-panel .command-input::placeholder {
  color: var(--text-muted);
}

.command-results {
  display: grid;
  max-height: min(420px, 60vh);
  overflow: auto;
}

.command-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  text-decoration: none;
}

.command-result:last-child {
  border-bottom: 0;
}

.command-result:hover,
.command-result.is-active {
  background: var(--surface);
}

.command-result strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.command-result span {
  color: var(--gold);
  font: 700 0.72rem/1 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.command-empty {
  padding: 1rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 32px 80px;
  text-align: center;
}

.hero.home-hero {
  min-height: calc(100vh - 64px);
  align-items: flex-start;
  padding-top: 140px;
  text-align: left;
}

.hero-copy {
  min-width: 0;
  width: min(100%, 720px);
  max-width: 720px;
}

.kicker,
.evidence,
.chapter-kicker {
  color: var(--text-muted);
  font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing:0;
  text-transform: uppercase;
}

.home-hero .hero-copy {
  width: min(100%, 980px);
  max-width: none;
  margin: 0 auto;
}

.home-hero h1 {
  max-width: 11ch;
  margin-left: 0;
}

.home-hero .subtitle {
  margin: 0;
  max-width: 56ch;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(44px, 6.5vw, 84px);
  font-weight: 800;
  line-height: 1.02;
  margin: 24px 0 32px;
  letter-spacing:0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.hero .subtitle {
  font-size: 21px;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 auto;
}

body.dimension-page .hero {
  gap: clamp(2rem, 4vw, 5rem);
}

body.dimension-page .hero-copy {
  flex: 0 1 min(38vw, 460px);
  max-width: min(38vw, 460px);
}

body.dimension-page .hero .subtitle {
  max-width: 34ch;
}

body.dimension-page .visual-panel {
  flex: 1 1 min(58vw, 820px);
  max-width: min(60vw, 820px);
  margin-top: 0;
}

@media (min-width: 901px) {
  body.dimension-page .hero {
    align-items: flex-start;
  }
}

.equation-strip {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--gold);
  letter-spacing:0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}
.equation-strip span {
  white-space: nowrap;
}
.equation-strip span + span::before {
  content: "·";
  color: var(--text-muted);
  margin-right: 14px;
}

.home-hero .equation-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 42px;
}

.home-hero .equation-strip span {
  display: inline-flex;
  min-height: var(--target-min);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 18px;
  background: var(--surface);
}

.evidence {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing:0;
}

.home-hero .evidence {
  max-width: 70ch;
  line-height: 1.55;
}

.route-readout,
.protocol-readout {
  margin-top: 20px;
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
  text-align: left;
}

.route-readout {
  grid-template-columns: 1fr;
  max-width: 38rem;
}

.protocol-readout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 46rem;
}

.route-readout div,
.protocol-readout div {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    var(--surface);
  border-left: 2px solid var(--instrument-line);
  padding: 12px 14px;
}

.route-readout div:first-child,
.protocol-readout div:first-child {
  border-left-color: var(--gold);
}

.route-readout div:nth-child(2),
.protocol-readout div:nth-child(2) {
  border-left-color: var(--instrument-blue);
}

.route-readout div:nth-child(3),
.protocol-readout div:nth-child(3) {
  border-left-color: var(--instrument-green);
}

.route-readout div:nth-child(4),
.protocol-readout div:nth-child(4) {
  border-left-color: var(--instrument-warn);
}

.route-readout span,
.protocol-readout span {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  margin-bottom: 0.28rem;
  text-transform: uppercase;
}

.route-readout strong,
.protocol-readout strong {
  display: block;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.25;
  margin-bottom: 0.22rem;
}

.route-readout p,
.protocol-readout p {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
}

.command-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(100%, 720px);
  margin-top: 44px;
}

.command-input {
  width: 100%;
  min-width: 0;
  min-height: var(--target-min);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 15px/1.2 var(--font-body);
  padding: 13px 16px;
  outline: 0;
}

.command-input:focus {
  border-color: var(--accent);
}

.command-run {
  border: 1px solid var(--border);
  min-height: var(--target-min);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: 700 12px/1 var(--font-body);
  letter-spacing:0;
  padding: 0 18px;
  text-transform: uppercase;
}

.command-run:hover {
  border-color: var(--accent);
}

.command-feedback {
  min-height: 18px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
}

.home-hero .cta-row {
  justify-content: flex-start;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  min-height: var(--target-min);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 0 18px;
  text-decoration: none;
}

.btn-primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--accent-contrast);
}

.btn-primary:hover,
.btn-ghost:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Visual Panel */
.visual-panel {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  margin-top: 64px;
  min-height: min(70vh, 720px);
  border: 1px solid var(--border);
  border-radius: var(--shape-md);
  background: #050505;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.028);
}

.visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 64px 100%;
  opacity: 0.38;
}

.visual-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

body.dimension-page .visual-labels {
  display: none;
}

body.soul-loop-instrument .visual-panel::after {
  opacity: 0.38;
}

body.soul-loop-instrument .instrument-overlay {
  opacity: 0.84;
}

body.soul-loop-instrument .instrument-graticule {
  inset: 20px;
  opacity: 0.24;
}

body.soul-loop-instrument .instrument-reticle {
  opacity: 0.42;
}

.instrument-visual {
  border-color: rgba(243, 244, 246, 0.18);
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
}

.instrument-visual::after {
  opacity: 0.09;
}

body.soul-loop-instrument .visual-labels {
  z-index: 4;
  display: none;
}

body.soul-loop-instrument .visual-labels .label {
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.74);
  color: rgba(243, 244, 246, 0.78);
  font: 700 10px/1 "Roboto Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

body.soul-loop-instrument .visual-labels .top,
body.soul-loop-instrument .visual-labels .bottom {
  color: var(--gold);
}

body.soul-loop-instrument .visual-labels .top {
  top: 64px;
}

body.soul-loop-instrument .visual-labels .bottom {
  bottom: 28px;
}

.instrument-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  border: 1px solid rgba(243, 244, 246, 0.075);
  box-shadow:
    inset 0 0 0 1px rgba(5, 5, 5, 0.78),
    inset 0 0 0 12px rgba(243, 244, 246, 0.008);
  contain: paint;
}

.instrument-graticule {
  position: absolute;
  inset: 24px;
  opacity: 0.052;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(33,150,243,0.13) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.1) 0 1px, transparent 1px 128px);
}

.instrument-corners {
  position: absolute;
  inset: 12px;
}

.instrument-corners span {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(243, 244, 246, 0.14);
  border-style: solid;
}

.instrument-corners span:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 1px 0 0 1px;
}

.instrument-corners span:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 1px 1px 0 0;
}

.instrument-corners span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-width: 0 1px 1px 0;
}

.instrument-corners span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-width: 0 0 1px 1px;
}

.instrument-overlay::before,
.instrument-overlay::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(243, 244, 246, 0.095);
}

.instrument-overlay::after {
  inset: 24px;
  border-color: rgba(243, 244, 246, 0.055);
}

.instrument-reticle {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(255,255,255,0.16) calc(50% - 0.5px), rgba(255,255,255,0.16) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(66,165,245,0.14) calc(50% - 0.5px), rgba(66,165,245,0.14) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  opacity: 0.064;
}

.instrument-id {
  position: absolute;
  left: 13px;
  bottom: 13px;
  display: inline-flex;
  gap: 5px;
  color: rgba(243, 244, 246, 0.5);
  font: 700 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}

.instrument-id span {
  border: 1px solid rgba(243, 244, 246, 0.11);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.86);
  padding: 3px 5px;
}

.instrument-calibration {
  position: absolute;
  right: 13px;
  bottom: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: min(360px, 44%);
  color: rgba(243, 244, 246, 0.5);
  font: 700 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}

.instrument-calibration span {
  border: 1px solid rgba(243, 244, 246, 0.11);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.84);
  padding: 3px 5px;
}

.instrument-measurements {
  position: absolute;
  top: 112px;
  left: 13px;
  display: grid;
  width: min(218px, calc(100% - 26px));
  gap: 5px;
  color: rgba(243, 244, 246, 0.7);
  font: 700 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}

.instrument-meter {
  display: grid;
  grid-template-columns: minmax(4.5rem, 0.55fr) minmax(0, 1fr) minmax(3.5rem, auto);
  gap: 6px;
  align-items: center;
  min-height: 19px;
  border: 1px solid var(--instrument-line-soft);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.88);
  padding: 4px 6px;
  backdrop-filter: blur(3px);
}

.instrument-meter span,
.instrument-meter em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instrument-meter span {
  color: rgba(243, 244, 246, 0.58);
}

.instrument-meter em {
  justify-self: end;
  color: rgba(243, 244, 246, 0.84);
  font-style: normal;
}

.instrument-meter i {
  display: block;
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(243, 244, 246, 0.13);
  background:
    repeating-linear-gradient(90deg, rgba(243,244,246,0.14) 0 1px, transparent 1px 12.5%),
    rgba(243, 244, 246, 0.035);
}

.instrument-meter b {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(66,165,245,0.58), rgba(243,244,246,0.7));
}

.instrument-meter.error b {
  background: linear-gradient(90deg, rgba(76,175,80,0.44), rgba(255,122,23,0.62));
}

body.soul-loop-instrument .instrument-measurements {
  top: 112px;
}

.instrument-mode-burrisphere .instrument-measurements,
.instrument-mode-ccc .instrument-measurements {
  left: auto;
  right: 13px;
  top: 52px;
}

.instrument-scale {
  position: absolute;
  opacity: 0.5;
  color: rgba(243, 244, 246, 0.48);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: 0;
  text-transform: uppercase;
}

.instrument-scale.x {
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.28) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.11) 0 1px, transparent 1px 8px);
}

.instrument-scale.x::after {
  content: attr(data-axis-label);
  position: absolute;
  right: 0;
  top: -15px;
}

.instrument-scale.y {
  top: 12px;
  bottom: 12px;
  left: 12px;
  width: 12px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.28) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.11) 0 1px, transparent 1px 8px);
}

.instrument-scale.y::after {
  content: attr(data-axis-label);
  position: absolute;
  left: 16px;
  top: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transform-origin: left top;
}

.instrument-telemetry {
  position: absolute;
  top: 13px;
  left: 13px;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  max-width: calc(100% - 372px);
  min-height: 25px;
  overflow: hidden;
  color: rgba(243, 244, 246, 0.76);
  font: 700 9px/1 "Roboto Mono", ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}

.instrument-telemetry span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 10.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--instrument-line);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.88);
  padding: 4px 6px;
  backdrop-filter: blur(4px);
}

.instrument-telemetry span[data-field="metric"],
.instrument-telemetry span[data-field="uncertainty"],
.instrument-telemetry span[data-field="time"],
.instrument-telemetry span[data-field="phase"],
.instrument-telemetry span[data-field="sample"],
.instrument-telemetry span[data-field="state"] {
  display: none;
}

.instrument-telemetry span[data-field="mode"] {
  max-width: 8.75rem;
}

.instrument-telemetry span[data-field="invariant"] {
  max-width: 8.75rem;
}

.instrument-telemetry span[data-field="sample"] {
  max-width: 6.4rem;
}

.instrument-telemetry span[data-field="state"] {
  max-width: 7.25rem;
}

.instrument-telemetry span[data-field="metric"] {
  color: var(--gold);
}

.instrument-telemetry span[data-field="invariant"] {
  color: rgba(243, 244, 246, 0.92);
}

.instrument-telemetry span[data-field="phase"] {
  color: var(--sector-insurance);
}

.instrument-telemetry span[data-field="uncertainty"] {
  color: var(--sector-finance);
}

.instrument-telemetry span[data-field="state"] {
  color: rgba(66, 165, 245, 0.92);
}

@media (min-width: 1520px) {
  .instrument-telemetry {
    max-width: calc(100% - 354px);
  }

  .instrument-telemetry span[data-field="metric"],
  .instrument-telemetry span[data-field="uncertainty"],
  .instrument-telemetry span[data-field="time"],
  .instrument-telemetry span[data-field="phase"],
  .instrument-telemetry span[data-field="sample"],
  .instrument-telemetry span[data-field="state"] {
    display: inline-block;
    max-width: 11.5rem;
  }
}

.instrument-controls {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 6;
  display: grid;
  grid-template-columns: auto auto auto minmax(120px, 156px);
  gap: 5px;
  align-items: center;
  color: rgba(243, 244, 246, 0.78);
  font: 700 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: uppercase;
}

.instrument-controls button,
.instrument-controls label {
  min-height: 25px;
  border: 1px solid var(--instrument-line);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.9);
  color: inherit;
  backdrop-filter: blur(4px);
}

.instrument-controls button {
  padding: 0 8px;
  cursor: pointer;
}

.instrument-controls button:hover {
  border-color: rgba(255, 235, 59, 0.58);
  color: var(--gold);
}

.instrument-controls button[aria-pressed="true"] {
  border-color: rgba(66, 165, 245, 0.54);
  color: rgba(66, 165, 245, 0.96);
}

.instrument-controls label {
  display: grid;
  grid-template-columns: auto minmax(56px, 1fr);
  gap: 6px;
  align-items: center;
  padding: 0 7px;
}

.instrument-controls input[type="range"] {
  width: 100%;
  appearance: none;
  height: 16px;
  border-radius: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-image:
    repeating-linear-gradient(90deg, rgba(243,244,246,.24) 0 1px, transparent 1px 8px),
    linear-gradient(90deg, rgba(66,165,245,.28), rgba(243,244,246,.42));
}

.instrument-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border: 2px solid #050505;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(243,244,246,.42);
}

.instrument-controls input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid #050505;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(243,244,246,.42);
}

.visual-labels .label {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.82);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 10px;
}

.visual-labels .top { top: 18px; left: 50%; transform: translateX(-50%); }
.visual-labels .left { left: 18px; top: 50%; transform: translateY(-50%); }
.visual-labels .right { right: 18px; top: 50%; transform: translateY(-50%); }
.visual-labels .bottom { bottom: 18px; left: 50%; transform: translateX(-50%); }
.horn-visual .visual-labels .bottom { bottom: 3.6rem; }
.horn-visual .visual-labels .top,
.horn-visual .visual-labels .left {
  display: none;
}
.horn-visual .visual-labels .left {
  left: 18px;
  top: auto;
  bottom: 36%;
  max-width: 13.5rem;
}
.horn-visual .visual-labels .right {
  top: auto;
  right: 18px;
  bottom: 34%;
  max-width: 12rem;
}
.burrisphere-visual .visual-labels .top {
  max-width: min(26rem, calc(100% - 36px));
  text-align: center;
}
.burrisphere-visual .visual-labels { display: none; }
.burrisphere-visual .visual-labels .left { display: none; }
.burrisphere-visual .visual-labels .bottom { display: none; }
.ccc-visual .visual-labels { display: none; }

.model-readout {
  overflow: hidden;
  text-align: left;
  text-wrap: balance;
}

.model-readout.instrument-readout {
  text-wrap: auto;
  font-variant-numeric: tabular-nums;
  background: rgba(5, 5, 5, 0.9) !important;
  border-color: var(--instrument-line) !important;
  border-left-color: var(--instrument-amber) !important;
  color: rgba(243, 244, 246, 0.84) !important;
  line-height: 1.38 !important;
  max-height: min(23vh, 142px) !important;
  outline: 1px solid rgba(5, 5, 5, 0.76);
  text-wrap: auto;
}

.model-readout,
.model-slider {
  font-variant-numeric: tabular-nums;
}

.model-slider {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 44px !important;
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(5.2rem, auto) minmax(0, 1fr) minmax(5.2rem, auto) minmax(5.8rem, auto);
  gap: 10px;
  align-items: center;
  color: rgba(243, 244, 246, 0.68);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
}

.model-slider .slider-end,
.model-slider .slider-output {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(243, 244, 246, 0.14);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.9);
  padding: 0 7px;
  white-space: nowrap;
}

.model-slider .slider-lo {
  color: var(--gold);
}

.model-slider .slider-hi {
  color: rgba(66, 165, 245, 0.96);
}

.model-slider .slider-output {
  min-width: 4.9rem;
  justify-content: end;
  color: rgba(243, 244, 246, 0.86);
}

.model-slider input[type="range"] {
  appearance: none;
  height: 16px !important;
  border-radius: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 4px;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(243,244,246,.5) calc(50% - 0.5px), rgba(243,244,246,.5) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.24) 0 1px, transparent 1px 8px),
    linear-gradient(90deg, rgba(255,235,59,0.28), rgba(66,165,245,0.28));
  cursor: pointer;
}

.rapidity-slider .slider-hi {
  min-width: 10.5rem;
}

.theta-slider .slider-end {
  min-width: 5.2rem;
}

.model-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #050505;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.46);
}

.model-slider input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #050505;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.46);
}

.instrument-visual {
  --instrument-phase: 0;
  --instrument-primary: 0;
  --instrument-secondary: 0;
  --instrument-error: 0;
}

.instrument-visual::after {
  opacity: 0.055;
}

.instrument-overlay {
  box-shadow:
    inset 0 0 0 1px rgba(5, 5, 5, 0.86),
    inset 0 0 0 12px rgba(243, 244, 246, 0.006);
}

.instrument-graticule {
  opacity: 0.048;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(33,150,243,0.11) 0 1px, transparent 1px 160px),
    repeating-linear-gradient(0deg, rgba(255,235,59,0.08) 0 1px, transparent 1px 160px);
}

.instrument-reticle {
  opacity: 0.052;
}

.instrument-aperture {
  position: absolute;
  inset: 54px 64px 84px;
  border: 1px solid rgba(243, 244, 246, 0.09);
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(255,235,59,0.13) calc(50% - 0.5px), rgba(255,235,59,0.13) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(66,165,245,0.12) calc(50% - 0.5px), rgba(66,165,245,0.12) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  opacity: 0.16;
}

.instrument-aperture::before,
.instrument-aperture::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: rgba(243, 244, 246, 0.58);
}

.instrument-aperture::before {
  left: 0;
  right: 0;
  top: calc((1 - var(--instrument-primary)) * 100%);
  height: 1px;
  box-shadow: 0 0 0 1px rgba(5, 5, 5, 0.42);
}

.instrument-aperture::after {
  top: 0;
  bottom: 0;
  left: calc(var(--instrument-secondary) * 100%);
  width: 1px;
  background: rgba(66, 165, 245, 0.76);
}

.instrument-aperture span {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(243, 244, 246, 0.08);
}

.instrument-signal-ruler {
  position: absolute;
  top: 54px;
  right: 14px;
  bottom: 84px;
  width: 42px;
  border-left: 1px solid rgba(243, 244, 246, 0.16);
  color: rgba(243, 244, 246, 0.48);
  font: 700 8px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.instrument-signal-ruler span {
  position: absolute;
  left: 7px;
  right: 0;
  height: 1px;
  border-top: 1px solid rgba(243, 244, 246, 0.16);
}

.instrument-signal-ruler span::after {
  content: attr(data-tick);
  position: absolute;
  right: 0;
  top: -4px;
}

.instrument-signal-ruler span:nth-child(1) { top: 0; }
.instrument-signal-ruler span:nth-child(2) { top: 25%; }
.instrument-signal-ruler span:nth-child(3) { top: 50%; }
.instrument-signal-ruler span:nth-child(4) { top: 75%; }
.instrument-signal-ruler span:nth-child(5) { bottom: 0; }

.instrument-signal-ruler b {
  position: absolute;
  left: -5px;
  width: 10px;
  height: 2px;
  background: rgba(243, 244, 246, 0.82);
  transform: translateY(1px);
}

.instrument-signal-ruler b::after {
  content: attr(data-label);
  position: absolute;
  left: -96px;
  top: -4px;
  width: 88px;
  overflow: hidden;
  color: rgba(243, 244, 246, 0.48);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instrument-signal-ruler .primary {
  top: calc((1 - var(--instrument-primary)) * 100%);
  background: var(--gold);
}

.instrument-signal-ruler .secondary {
  top: calc((1 - var(--instrument-secondary)) * 100%);
  background: #42A5F5;
}

.instrument-signal-ruler .error {
  top: calc((1 - var(--instrument-error)) * 100%);
  background: var(--sector-finance);
}

.instrument-sample-ledger {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 64px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  color: rgba(243, 244, 246, 0.28);
  font: 700 8px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.instrument-sample-ledger span {
  position: relative;
  text-align: center;
}

.instrument-sample-ledger span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 6px;
  background: rgba(243, 244, 246, 0.16);
}

.instrument-acquisition {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 45px;
  height: 5px;
  border: 1px solid rgba(243, 244, 246, 0.1);
  background:
    repeating-linear-gradient(90deg, rgba(243,244,246,0.13) 0 1px, transparent 1px 24px),
    rgba(5, 5, 5, 0.76);
}

.instrument-acquisition span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--instrument-phase));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255,235,59,0.52), rgba(66,165,245,0.42));
}

.instrument-acquisition b {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: calc(var(--instrument-phase) * 100%);
  width: 1px;
  background: rgba(243, 244, 246, 0.64);
  transform: translateX(-0.5px);
}

.instrument-meter b,
.instrument-acquisition span,
.instrument-acquisition b {
  transition: transform 90ms linear, left 90ms linear;
}

.instrument-controls label {
  grid-template-columns: auto minmax(56px, 1fr) auto;
}

.instrument-controls output {
  min-width: 3.4rem;
  color: rgba(243, 244, 246, 0.86);
  text-align: right;
}

/* Instrument-grade refinement pass: retain the lab grammar, reduce HUD glare. */
.instrument-visual::after {
  opacity: 0.038;
}

.instrument-overlay {
  border-color: rgba(243, 244, 246, 0.075);
  box-shadow:
    inset 0 0 0 1px rgba(5, 5, 5, 0.9),
    inset 0 0 0 12px rgba(243, 244, 246, 0.004);
}

.instrument-overlay::before {
  border-color: rgba(243, 244, 246, 0.09);
}

.instrument-overlay::after {
  border-color: rgba(243, 244, 246, 0.04);
}

.instrument-graticule {
  opacity: 0.052;
}

.instrument-reticle {
  opacity: 0.044;
}

.instrument-aperture {
  inset: 58px 72px 96px;
  opacity: 0.17;
}

.instrument-aperture::before,
.instrument-aperture::after {
  background: rgba(243, 244, 246, 0.48);
}

.instrument-aperture::after {
  background: rgba(66, 165, 245, 0.52);
}

.instrument-signal-ruler {
  opacity: 0.64;
}

.instrument-measurements {
  opacity: 0.84;
}

.instrument-meter,
.instrument-telemetry span,
.instrument-controls button,
.instrument-controls label,
.model-readout.instrument-readout,
.model-slider .slider-end,
.model-slider .slider-output {
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(3px);
}

.instrument-meter {
  border-color: rgba(243, 244, 246, 0.06);
}

.instrument-meter b {
  background: linear-gradient(90deg, rgba(66,165,245,0.54), rgba(243,244,246,0.68));
}

.instrument-meter.error b {
  background: linear-gradient(90deg, rgba(76,175,80,0.4), rgba(255,122,23,0.58));
}

@media (min-width: 1180px) {
  .instrument-telemetry span[data-field="sample"],
  .instrument-telemetry span[data-field="phase"],
  .instrument-telemetry span[data-field="state"] {
    display: inline-block;
  }

  .instrument-telemetry span[data-field="sample"] {
    max-width: 6.8rem;
  }

  .instrument-telemetry span[data-field="phase"] {
    max-width: 5.6rem;
  }

  .instrument-telemetry span[data-field="state"] {
    max-width: 8.2rem;
  }
}

.instrument-telemetry span,
.instrument-controls button,
.instrument-controls label {
  border-color: rgba(243, 244, 246, 0.12);
}

.instrument-controls button {
  min-width: 3.25rem;
}

.instrument-controls button,
.instrument-controls label,
.model-slider .slider-end,
.model-slider .slider-output {
  box-shadow: 0 0 0 1px rgba(5, 5, 5, 0.56);
}

.model-readout.instrument-readout {
  max-height: min(22vh, 140px) !important;
  border-left-width: 2px !important;
}

.instrument-mode-burrisphere .instrument-measurements,
.instrument-mode-ccc .instrument-measurements {
  top: 58px;
}

body.soul-loop-instrument .instrument-overlay {
  opacity: 0.76;
}

body.soul-loop-instrument .instrument-graticule {
  opacity: 0.12;
}

body.soul-loop-instrument .instrument-reticle {
  opacity: 0.18;
}

.lab-frame {
  opacity: 0.22;
}

.standalone-telemetry span,
.instrument-spec,
.standalone-measurements {
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(3px);
}

.standalone-telemetry span {
  border-color: rgba(243, 244, 246, 0.12);
}

@media (prefers-reduced-transparency: reduce) {
  .instrument-meter,
  .instrument-telemetry span,
  .instrument-controls button,
  .instrument-controls label,
  .model-readout.instrument-readout,
  .model-slider .slider-end,
  .model-slider .slider-output {
    backdrop-filter: none !important;
    background: #050505 !important;
  }
}

@media (prefers-contrast: more) {
  .instrument-overlay,
  .instrument-meter,
  .instrument-telemetry span,
  .instrument-controls button,
  .instrument-controls label,
  .model-readout.instrument-readout {
    border-color: rgba(243, 244, 246, 0.34) !important;
  }
}

.dimension-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  border: 0;
}

.fallback {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px;
}

body.webgl-failed .fallback {
  display: flex;
}

.fallback-equation {
  font-family: var(--font-heading);
  font-size: 42px;
  color: var(--gold);
  margin-bottom: 16px;
}

.fallback-inner {
  max-width: 34rem;
}

.fallback p {
  color: var(--text-muted);
  margin: 0;
}

/* Chapters */
.chapters {
  max-width: 680px;
  margin: 120px auto;
  padding: 0 32px;
}

.chapter {
  display: block;
  margin-bottom: 96px;
}

.chapter-body {
  width: 100%;
  min-width: 0;
  max-width: 840px;
}

.chapter-kicker {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing:0;
  text-transform: uppercase;
}

.chapter-number {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing:0;
  margin-bottom: 12px;
}

.chapter h2 {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 24px;
}

.chapter p {
  font-size: 17px;
  color: var(--text);
}

.chapter .note {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Dimension axiom ledgers */
.axiom-ledger {
  max-width: 920px;
  margin: 120px auto;
  padding: 0 32px;
}

.axiom-ledger-header {
  max-width: 760px;
  margin-bottom: 36px;
}

.axiom-ledger-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  margin: 0 0 16px;
  scroll-margin-top: 112px;
}

.axiom-ledger-header p,
.axiom-note {
  color: var(--text-muted);
  font-size: 16px;
}

.axiom-list {
  border-top: 1px solid var(--border);
}

.axiom-card {
  display: grid;
  grid-template-columns: minmax(9rem, 0.34fr) minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.axiom-origin {
  color: var(--gold);
  font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1.55;
  text-transform: uppercase;
}

.axiom-card h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px;
}

.axiom-card p {
  color: var(--text);
  font-size: 16px;
  margin: 0 0 10px;
}

.axiom-card p:last-child {
  margin-bottom: 0;
}

.axiom-card ul {
  margin: 10px 0 0;
  padding-left: 1.2rem;
}

.axiom-card li {
  color: var(--text);
  font-size: 15px;
  margin: 6px 0;
}

.axiom-note {
  margin: 24px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--gold);
}

.axiom-note a {
  color: var(--text);
}

@media (max-width: 640px) {
  .axiom-ledger {
    padding: 0 20px;
  }

  .axiom-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.equation-block {
  display: grid;
  gap: 8px;
  margin: 24px 0;
}

.equation-block span {
  border-left: 2px solid var(--gold);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  padding: 10px 14px;
}

.mu-limit {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1rem, 4vw, 4rem);
}

.mu-inner {
  max-width: 880px;
  margin: 0 auto;
}

.mu-mark {
  color: var(--gold);
  font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 1;
}

.mu-limit p {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.18vw, 1.09rem);
  line-height: 1.45;
}

.mu-limit a,
.route-footer a {
  display: inline-flex;
  min-height: var(--target-min);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.mu-limit a:hover,
.route-footer a:hover {
  border-color: var(--gold);
}

.route-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem) 3rem;
}

.spine-section {
  max-width: 1180px;
  margin-top: 0;
  padding-top: 96px;
}

.section-intro {
  max-width: 680px;
  color: var(--text-muted);
  font-size: 18px;
}

.spine-grid,
.portal-grid,
.constraint-grid,
.titans-row {
  display: grid;
  gap: 1px;
  margin: 48px 0;
  border: 1px solid var(--border);
  border-radius: var(--shape-lg);
  overflow: hidden;
  background: var(--border);
}

.spine-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.portal-grid,
.constraint-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.titans-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spine-card,
.portal-card,
.constraint-card,
.titan-glyph {
  display: grid;
  gap: 16px;
  min-height: 224px;
  padding: 20px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.spine-card:hover,
.portal-card:hover {
  background: var(--surface);
  text-decoration: none;
}

.spine-number,
.card-label,
.glyph-name {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing:0;
  text-transform: uppercase;
}

.spine-card h3,
.portal-card h3,
.constraint-card h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.spine-card p,
.portal-card p,
.constraint-card p,
.glyph-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.spine-mode {
  align-self: end;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing:0;
  text-transform: uppercase;
}

.glyph-symbol {
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 54px;
  line-height: 1;
}

.doctrine-note {
  max-width: 760px;
  border-left: 2px solid var(--gold);
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 15px;
}

/* Public Library */
.library-page {
  background: var(--bg);
}

.library-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 112px 24px 80px;
}

.library-hero {
  border-bottom: 1px solid var(--border);
  padding: 48px 0 36px;
}

.library-hero h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing:0;
  overflow-wrap: anywhere;
}

.library-hero p {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 18px;
}

.library-route-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.library-route-row a,
.library-article a {
  color: var(--gold);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.library-route-row a {
  display: inline-flex;
  min-height: var(--target-min);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
  text-transform: uppercase;
}

.library-route-row a:hover {
  border-color: var(--gold);
}

.library-article {
  max-width: 840px;
  padding: 48px 0 28px;
}

.library-article strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.library-article h1,
.library-article h2,
.library-article h3,
.library-article h4 {
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.12;
}

.library-article h1 {
  font-size: clamp(36px, 7vw, 68px);
  margin: 0 0 28px;
}

.library-article h2 {
  border-top: 1px solid var(--border);
  margin: 56px 0 18px;
  padding-top: 28px;
  font-size: clamp(28px, 4vw, 42px);
}

.library-article h3 {
  margin: 38px 0 14px;
  font-size: 24px;
}

.library-article p,
.library-article li {
  color: var(--text);
  font-size: 17px;
}

.library-article p {
  margin: 0 0 18px;
}

.library-article ul,
.library-article ol {
  margin: 0 0 24px;
  padding-left: 1.35rem;
}

.library-article blockquote {
  margin: 28px 0;
  border-left: 2px solid var(--gold);
  background: var(--surface);
  color: var(--text-muted);
  padding: 18px 22px;
}

.library-article pre {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.library-article pre code {
  border: 0;
  background: transparent;
  overflow-wrap: normal;
  padding: 0;
  white-space: pre;
  word-break: normal;
}

.library-article table {
  display: block;
  width: 100%;
  margin: 26px 0;
  overflow-x: auto;
  border-collapse: collapse;
}

.library-article th,
.library-article td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.library-article th {
  background: var(--surface);
  color: var(--text);
}

.library-article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 42px 0;
}

.library-meta {
  display: grid;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 22px;
}

.library-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .library-article pre {
    overflow-x: hidden;
    white-space: pre-wrap;
  }

  .library-article pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Public doctrine support pages */
.container {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
  padding: 112px 0 64px;
}

.container h1,
.container h2,
.container h3 {
  font-family: var(--font-heading);
  letter-spacing:0;
}

.container h1 {
  margin: 0 0 24px;
  font-size: clamp(42px, 8vw, 76px);
  line-height: 0.98;
}

.container h2 {
  margin-top: 42px;
  font-size: clamp(28px, 4vw, 42px);
}

.container h3 {
  margin-top: 0;
  color: var(--gold);
}

.container p,
.container li {
  color: var(--text-muted);
}

.kvs-table,
.rosetta-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.kvs-table th,
.kvs-table td,
.rosetta-table th,
.rosetta-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

.kvs-table th,
.rosetta-table th {
  background: var(--surface);
  color: var(--text-muted);
  font: 700 0.7rem/1.2 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing:0;
  text-transform: uppercase;
}

.kvs-table td {
  border: 1px solid var(--border);
}

.rosetta-table tr.operative td {
  background: rgba(201, 168, 76, 0.04);
}

.rosetta-table tr.boundary td {
  background: rgba(122, 110, 168, 0.04);
}

.rosetta-table tr.entry td {
  background: rgba(255, 255, 255, 0.04);
}

.rosetta-table .lvl {
  color: var(--gold);
  font: 700 0.9rem/1.2 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.rosetta-table tr.boundary .lvl {
  color: #9c8fe8;
}

.rosetta-table tr.entry .lvl {
  color: var(--text-muted);
}

pre.glyph-block {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.glyph {
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 1.1em;
  letter-spacing:0;
}

.tier {
  display: inline-block;
  border-radius: 4px;
  background: rgba(201, 168, 76, 0.18);
  color: var(--gold);
  padding: 1px 6px;
  font: 700 0.74rem/1.35 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing:0;
}

.tier-a {
  background: rgba(96, 214, 152, 0.16);
  color: #82e6b0;
}

.tier-i {
  background: rgba(96, 168, 240, 0.16);
  color: #8fc8ff;
}

.tier-c,
.tier-d {
  background: rgba(255, 165, 80, 0.16);
  color: #ffb26b;
}

.closing,
.constraint-block {
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: var(--shape-lg);
  background: rgba(201, 168, 76, 0.07);
  margin: 1.5rem 0;
  padding: 1.25rem 1.4rem;
  text-align: center;
}

.constraint-block .eq {
  color: var(--gold);
  font: 700 1.5rem/1.2 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-bottom: 0.5rem;
}

.constraint-block .note {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cta {
  display: inline-flex;
  min-height: var(--target-min);
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  margin: 0.5rem 0.5rem 0.5rem 0;
  padding: 0 1rem;
  font-size: 0.9rem;
  text-decoration: none;
}

.cta:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.paper-card,
.nine-row-card {
  border: 1px solid var(--border);
  border-radius: var(--shape-lg);
  background: var(--surface);
  margin: 1.2rem 0;
  padding: 1.1rem 1.3rem;
}

.paper-card .kill {
  border-left: 3px solid #ffb26b;
  background: rgba(255, 165, 80, 0.1);
  margin: 0.6rem 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
}

.doct-block {
  border-left: 3px solid var(--gold);
  background: rgba(201, 168, 76, 0.06);
  margin: 1.2rem 0;
  padding: 0.6rem 1rem;
  font-style: italic;
}

.svg-sphere {
  width: 100%;
  height: auto;
  margin: 1rem 0 1.5rem;
}

.svg-sphere text {
  fill: var(--text);
  font-family: var(--font-body);
  font-size: 10px;
}

.svg-sphere .axis {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
}

.svg-sphere .pole {
  fill: var(--gold);
}

.svg-sphere .center {
  fill: #f1d97a;
}

.svg-sphere .equator {
  stroke: var(--gold);
  stroke-dasharray: 4 3;
  stroke-width: 1.5;
}

.svg-sphere .label-major {
  font-size: 12px;
  font-weight: 700;
}

.cross-domain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.cross-domain .cd-cell {
  border: 1px solid var(--border);
  border-radius: var(--shape-lg);
  background: var(--surface);
  padding: 0.85rem 1rem;
}

.cross-domain .cd-cell h4 {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font: 700 0.9rem/1.2 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cross-domain .cd-cell p {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
}

.cross-domain .cd-cell .tier {
  margin-top: 0.4rem;
}

@media (max-width: 1100px) {
  .spine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-grid,
  .constraint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 16px;
    width: 100dvw;
    max-width: 100dvw;
  }

  .topbar .number-nav {
    justify-content: flex-start;
    gap: 10px;
  }

  .topbar .topbar-inner {
    min-width: 0;
  }

  .topbar .routes {
    justify-content: flex-start;
    gap: 10px;
  }

  .topbar .number-nav a,
  .topbar .number-nav span,
  .topbar .route,
  .topbar .nav-route {
    min-width: var(--target-min);
  }

  .hero {
    padding: 110px 20px 64px;
    flex-direction: column;
  }

  body.dimension-page .hero,
  body.soul-loop-instrument .hero {
    padding-top: 88px;
  }

  .hero-copy {
    width: 100%;
    max-width: 100%;
  }

  .protocol-readout {
    grid-template-columns: 1fr;
  }

  body.dimension-page .hero-copy,
  body.soul-loop-instrument .hero-copy {
    order: 1;
    max-width: 100%;
    margin-top: 32px;
  }

  .equation-strip {
    width: 100%;
    min-width: 0;
    justify-content: center;
    font-size: clamp(14px, 4vw, 18px);
  }

  .equation-strip span {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .equation-strip span + span::before {
    content: none;
    margin-right: 0;
  }

  .visual-panel {
    max-width: 100%;
    margin-top: 32px;
    min-height: min(58vh, 480px);
  }

  body.dimension-page .visual-panel,
  body.soul-loop-instrument .visual-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    order: -1;
    margin-top: 0;
    min-height: min(62svh, 520px);
  }

  .model-readout {
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: auto !important;
    bottom: 3.8rem !important;
    max-width: none !important;
    max-height: 26vh;
    font-size: 9.5px !important;
    line-height: 1.45 !important;
  }

  .model-slider {
    left: 0.75rem !important;
    right: 0.75rem !important;
    bottom: 0.75rem !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.45rem !important;
    font-size: 9px !important;
  }

  .model-slider input[type="range"] {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .model-slider .slider-end {
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .model-slider .slider-hi {
    justify-content: end;
  }

  .model-slider .slider-output {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: center;
    min-height: 20px;
  }

  .instrument-overlay::before {
    inset: 8px;
  }

  .instrument-overlay::after {
    inset: 18px;
  }

  .instrument-scale.x {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .instrument-scale.y {
    top: 8px;
    bottom: 8px;
    left: 8px;
  }

  .instrument-scale.x::after,
  .instrument-scale.y::after {
    content: none;
  }

  .instrument-telemetry {
    top: 9px;
    left: 9px;
    right: 9px;
    max-width: calc(100% - 18px);
    flex-wrap: wrap;
    gap: 4px;
    font-size: 8px;
  }

  .instrument-calibration,
  .instrument-id,
  .instrument-measurements,
  .instrument-signal-ruler,
  .instrument-sample-ledger {
    display: none;
  }

  .instrument-aperture {
    inset: 54px 18px 118px;
    opacity: 0.14;
  }

  .instrument-telemetry span[data-field="time"],
  .instrument-telemetry span[data-field="sample"],
  .instrument-telemetry span[data-field="state"] {
    display: none;
  }

  .instrument-controls {
    top: auto;
    right: 9px;
    left: 9px;
    bottom: 9px;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    font-size: 8px;
  }

  .instrument-controls button,
  .instrument-controls label {
    min-height: 24px;
  }

  body.dimension-page .model-slider {
    bottom: 2.7rem !important;
  }

  body.dimension-page .model-readout {
    bottom: 8rem !important;
  }

  body.soul-loop-instrument .model-readout {
    bottom: 6.35rem !important;
  }

  body.soul-loop-instrument .visual-labels .label {
    display: none;
  }

  body.dimension-page .model-slider {
    left: 0.75rem !important;
    right: 0.75rem !important;
  }

  .horn-visual .visual-labels .bottom {
    left: 18px;
    right: 7.25rem;
    transform: none;
    text-align: center;
  }

  body.dimension-page .horn-visual .visual-labels .bottom {
    right: 18px;
  }

  .horn-visual .visual-labels .left,
  .horn-visual .visual-labels .right {
    display: none;
  }

  .burrisphere-visual .visual-labels .left,
  .burrisphere-visual .visual-labels .right,
  .burrisphere-visual .visual-labels .bottom {
    display: none;
  }

  .container {
    width: min(100% - 32px, 1120px);
    padding-top: 96px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(32px, 9.5vw, 48px);
    letter-spacing:0;
    overflow-wrap: anywhere;
  }

  .library-hero h1 {
    max-width: 100%;
    font-size: clamp(38px, 11vw, 48px);
  }

  .hero .subtitle {
    font-size: 18px;
  }

  .command-console,
  .titans-row,
  .spine-grid,
  .portal-grid,
  .constraint-grid {
    grid-template-columns: 1fr;
  }

  .chapters {
    padding: 0 20px;
    margin: 80px auto;
  }

  .dimension-canvas {
    height: 420px;
  }
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2rem;
}

.site-footer .phi {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--text);
}

/* ============================================================
   Lab instrument shell — sphere.html / cascade.html / lightcone.html
   (their HUD selectors were orphaned by the 2026-06-07 rewrite;
   restored here: full-bleed canvas + fixed overlay HUD)
   ============================================================ */
#scene { position: fixed; inset: 0; z-index: 0; }
#scene canvas { display: block; width: 100%; height: 100%; }
.lab-frame {
  position: fixed;
  inset: 84px 24px 24px;
  z-index: 2;
  pointer-events: none;
  --instrument-phase: 0;
  --instrument-primary: 0;
  border: 1px solid rgba(243, 244, 246, 0.095);
  background:
    repeating-linear-gradient(90deg, rgba(243,244,246,.022) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, rgba(243,244,246,.022) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(66,165,245,.034) 0 1px, transparent 1px 160px),
    repeating-linear-gradient(0deg, rgba(255,235,59,.026) 0 1px, transparent 1px 160px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.028);
  opacity: .22;
}
.lab-frame::before,
.lab-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(243,244,246,.07);
}
.lab-frame::after {
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(243,244,246,.07) calc(50% - .5px), rgba(243,244,246,.07) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(0deg, transparent calc(50% - .5px), rgba(66,165,245,.045) calc(50% - .5px), rgba(66,165,245,.045) calc(50% + .5px), transparent calc(50% + .5px));
}
.lab-frame .corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(243,244,246,.18);
  border-style: solid;
}
.lab-frame .corner::after {
  position: absolute;
  color: rgba(243, 244, 246, 0.52);
  font: 700 9px/1 var(--font-mono);
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}
.lab-frame .corner:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.lab-frame .corner:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.lab-frame .corner:nth-child(3) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.lab-frame .corner:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.lab-frame .corner:nth-child(1)::after { content: "30 Hz sample"; left: 8px; top: 8px; }
.lab-frame .corner:nth-child(4)::after { content: "calibrated grid"; left: 8px; bottom: 8px; }
.lab-frame .corner:nth-child(2)::before,
.lab-frame .corner:nth-child(3)::before {
  content: "";
  position: absolute;
  right: 8px;
  width: min(180px, 28vw);
  height: 5px;
  border: 1px solid rgba(243, 244, 246, 0.12);
  background:
    repeating-linear-gradient(90deg, rgba(243,244,246,.16) 0 1px, transparent 1px 18px),
    rgba(5, 5, 5, 0.82);
}
.lab-frame .corner:nth-child(2)::before {
  top: 8px;
  background:
    linear-gradient(90deg, rgba(243,244,246,.54), rgba(66,165,245,.42)) left center / calc(var(--instrument-primary) * 100%) 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(243,244,246,.16) 0 1px, transparent 1px 18px),
    rgba(5, 5, 5, 0.82);
}
.lab-frame .corner:nth-child(3)::before {
  bottom: 8px;
  background:
    linear-gradient(90deg, rgba(255,235,59,.48), rgba(66,165,245,.38)) left center / calc(var(--instrument-phase) * 100%) 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(243,244,246,.16) 0 1px, transparent 1px 18px),
    rgba(5, 5, 5, 0.82);
}
body.cascade-instrument .lab-frame .corner:nth-child(1)::after { content: "30 Hz morph sample"; }
body.cascade-instrument .lab-frame .corner:nth-child(4)::after { content: "u/v mesh grid"; }
body.sphere-instrument .lab-frame .corner:nth-child(1)::after { content: "30 Hz latitude scan"; }
body.sphere-instrument .lab-frame .corner:nth-child(4)::after { content: "S² chart grid"; }
body.lightcone-instrument .lab-frame .corner:nth-child(1)::after { content: "30 Hz cone sample"; }
body.lightcone-instrument .lab-frame .corner:nth-child(4)::after { content: "c=1 calibration"; }
body.cascade-instrument .lab-frame .corner:nth-child(1)::after,
body.sphere-instrument .lab-frame .corner:nth-child(1)::after,
body.lightcone-instrument .lab-frame .corner:nth-child(1)::after {
  display: none;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  display: none;
  background: none;
}
body > span.brand {
  position: fixed;
  left: 32px;
  top: 86px;
  z-index: 4;
  color: var(--gold);
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0;
}
body > a.exit {
  position: fixed;
  right: 32px;
  top: 84px;
  z-index: 4;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--shape-full);
  padding: 0 14px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  text-decoration: none;
  font: 700 12px/1 var(--font-mono);
}
body > a.exit:hover {
  color: var(--gold);
  border-color: var(--gold);
}
body.sphere-instrument > a.exit {
  top: auto;
  right: 20px;
  bottom: 92px;
}

body.sphere-instrument .title {
  display: none;
}

.title {
  position: fixed;
  left: 32px;
  bottom: 32px;
  z-index: 4;
  max-width: min(520px, calc(100vw - 64px));
  font-family: var(--font-mono);
}
.lightcone-instrument .title {
  display: none;
}
.title .eq {
  color: var(--gold);
  font-size: clamp(18px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.1;
}
.title .sub {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
#overlay {
  position: fixed;
  left: 32px;
  top: 136px;
  z-index: 4;
  width: min(340px, calc(100vw - 64px));
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.9);
  padding: 10px 12px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  color: var(--text);
}
#glyph {
  color: var(--gold);
  font: 800 14px/1.05 var(--font-mono);
  transition: none;
}
#caption {
  margin-top: 8px;
  transition: none;
}
#caption .lead {
  display: block;
  max-width: 34ch;
  color: var(--text);
  font: 800 12px/1.34 var(--font-mono);
}
#caption .sub {
  display: block;
  max-width: 42ch;
  margin-top: 8px;
  color: var(--text-muted);
  font: 700 10px/1.5 var(--font-mono);
}
#counter {
  position: fixed;
  right: 32px;
  bottom: 126px;
  z-index: 4;
  color: var(--text-muted);
  font: 700 12px/1 var(--font-mono);
  opacity: 0;
}
.standalone-telemetry {
  position: fixed;
  top: 86px;
  left: 50%;
  z-index: 4;
  width: max-content;
  max-width: min(520px, calc(100vw - 680px));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 5px;
  min-height: 25px;
  overflow: hidden;
  color: rgba(243, 244, 246, 0.76);
  font: 700 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  pointer-events: none;
}

.standalone-telemetry span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 10.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--instrument-line);
  border-radius: 2px;
  background: rgba(5, 5, 5, 0.88);
  padding: 4px 6px;
  backdrop-filter: blur(4px);
}

.standalone-telemetry span[data-field="metric"],
.standalone-telemetry span[data-field="uncertainty"] {
  display: none;
}

.standalone-telemetry span[data-field="mode"] {
  max-width: 8.5rem;
}

.standalone-telemetry span[data-field="sample"] {
  max-width: 7rem;
}

.standalone-telemetry span[data-field="metric"] {
  color: var(--gold);
}

.standalone-telemetry span[data-field="phase"] {
  color: var(--sector-insurance);
}

.standalone-telemetry span[data-field="uncertainty"] {
  color: var(--sector-finance);
}

.standalone-telemetry span[data-field="state"] {
  color: rgba(66, 165, 245, 0.92);
}

@media (min-width: 1280px) {
  .standalone-telemetry {
    max-width: min(880px, calc(100vw - 420px));
  }

  .standalone-telemetry span[data-field="metric"],
  .standalone-telemetry span[data-field="uncertainty"] {
    display: inline-block;
    max-width: 11.5rem;
  }
}
.instrument-spec {
  position: fixed;
  left: 32px;
  top: 268px;
  z-index: 4;
  display: grid;
  gap: 6px;
  width: min(340px, calc(100vw - 64px));
  border: 1px solid var(--instrument-line);
  border-left: 2px solid rgba(66, 165, 245, 0.86);
  border-radius: var(--shape-sm);
  background: var(--instrument-bg);
  color: rgba(243, 244, 246, 0.68);
  padding: 9px 12px;
  font: 700 10px/1.42 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.instrument-spec span:first-child {
  color: rgba(243, 244, 246, 0.9);
}

body.sphere-instrument .instrument-spec {
  top: 262px;
}

body.lightcone-instrument .instrument-spec {
  top: 286px;
  width: min(520px, calc(100vw - 64px));
}
.standalone-measurements {
  position: fixed;
  left: 32px;
  top: 358px;
  z-index: 4;
  display: grid;
  gap: 6px;
  width: min(340px, calc(100vw - 64px));
  color: rgba(243, 244, 246, 0.72);
  font: 700 9px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  pointer-events: none;
}

body.sphere-instrument .standalone-measurements {
  top: 352px;
}

body.lightcone-instrument .standalone-measurements {
  top: 368px;
  width: min(520px, calc(100vw - 64px));
}

.standalone-meter {
  display: grid;
  grid-template-columns: minmax(5.2rem, 0.58fr) minmax(0, 1fr) minmax(4.2rem, auto);
  gap: 7px;
  align-items: center;
  min-height: 19px;
  border: 1px solid var(--instrument-line-soft);
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.88);
  padding: 4px 6px;
  backdrop-filter: blur(3px);
}

.standalone-meter span,
.standalone-meter em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standalone-meter span {
  color: rgba(243, 244, 246, 0.58);
}

.standalone-meter em {
  justify-self: end;
  color: rgba(243, 244, 246, 0.84);
  font-style: normal;
}

.standalone-meter i {
  display: block;
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(243, 244, 246, 0.13);
  background:
    repeating-linear-gradient(90deg, rgba(243,244,246,0.13) 0 1px, transparent 1px 12.5%),
    rgba(243, 244, 246, 0.04);
}

.standalone-meter b {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(66,165,245,0.46), rgba(243,244,246,0.62));
  transition: transform 90ms linear;
}

.standalone-meter.error b {
  background: linear-gradient(90deg, rgba(76,175,80,0.36), rgba(255,122,23,0.5));
}
#stage-readout {
  position: fixed;
  right: 32px;
  top: 136px;
  z-index: 4;
  width: min(410px, calc(100vw - 64px));
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.9);
  color: var(--text-muted);
  padding: 10px 12px;
  white-space: pre-line;
  font: 700 10.5px/1.5 var(--font-mono);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
body.sphere-instrument #stage-readout {
  left: 32px;
  right: auto;
}
.constitution-visual .label.center {
  display: none;
}
body.lightcone-instrument .meter {
  position: fixed;
  left: 32px;
  top: 136px;
  z-index: 4;
  width: min(320px, calc(100vw - 64px));
  border: 1px solid var(--border);
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.9);
  color: var(--text-muted);
  padding: 10px 12px;
  font: 700 11px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}

body.lightcone-instrument .meter .bar {
  height: 6px;
  margin-top: 8px;
  border: 1px solid rgba(243,244,246,.18);
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(243,244,246,.22) 0 1px, transparent 1px 8px),
    rgba(243,244,246,.05);
  overflow: hidden;
}

body.lightcone-instrument .meter .fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, rgba(33,150,243,.42), rgba(243,244,246,.72));
}

body.lightcone-instrument .tier {
  position: fixed;
  left: 32px;
  top: 204px;
  z-index: 4;
  width: min(520px, calc(100vw - 64px));
  margin: 0;
  border: 1px solid var(--border);
  border-left: 2px solid rgba(66, 165, 245, 0.8);
  border-radius: var(--shape-sm);
  background: rgba(5, 5, 5, 0.9);
  color: var(--text-muted);
  padding: 9px 12px;
  font: 700 10.5px/1.45 var(--font-mono);
  backdrop-filter: blur(4px);
}
#enter {
  position: fixed;
  left: 32px;
  bottom: 32px;
  z-index: 4;
  min-height: 44px;
  display: none;
  align-items: center;
  border: 1px solid var(--gold);
  border-radius: var(--shape-full);
  padding: 0 16px;
  color: #050505;
  background: var(--gold);
  text-decoration: none;
  font: 800 12px/1 var(--font-mono);
}
#enter.show { display: inline-flex; }
button.nav {
  position: fixed;
  top: 50%;
  z-index: 4;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--text-muted);
  font: 400 30px/1 var(--font-heading);
  cursor: pointer;
}
button.nav:hover {
  color: var(--gold);
  border-color: var(--gold);
}
#prev { left: 24px; }
#next { right: 24px; }
#playpause {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 4;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--shape-full);
  padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--text-muted);
  font: 700 12px/1 var(--font-mono);
  cursor: pointer;
}
#scan-toggle {
  position: fixed;
  right: 20px;
  bottom: 32px;
  z-index: 4;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--shape-full);
  padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--text-muted);
  font: 700 12px/1 var(--font-mono);
  cursor: pointer;
}
#playpause:hover {
  color: var(--gold);
  border-color: var(--gold);
}
#scan-toggle:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.standalone-controls #playpause,
.standalone-controls #scan-toggle {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  min-height: 25px;
  border-radius: 2px;
  padding: 0 8px;
  background: rgba(5, 5, 5, 0.88);
  color: inherit;
  font: inherit;
}
.standalone-controls {
  position: fixed;
  top: auto;
  right: 32px;
  bottom: 32px;
  left: auto;
  z-index: 4;
  grid-template-columns: auto auto auto minmax(160px, 210px);
}

.cascade-controls,
.sphere-controls {
  width: max-content;
}

.standalone-controls button,
.standalone-controls label {
  background: rgba(5, 5, 5, 0.88);
}

#timeline-shell {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(420px, calc(100vw - 220px));
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font: 700 11px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
#timeline-shell input {
  width: 100%;
  cursor: pointer;
}
#timeline-shell input,
.position-scrub input {
  appearance: none;
  height: 16px;
  border-radius: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 4px;
  background-image:
    repeating-linear-gradient(90deg, rgba(243,244,246,.2) 0 1px, transparent 1px 8px),
    linear-gradient(90deg, rgba(33,150,243,.24), rgba(255,235,59,.36), rgba(244,67,54,.22));
}
#timeline-shell input::-webkit-slider-thumb,
.position-scrub input::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #050505;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(243,244,246,.46);
}
#timeline-shell input::-moz-range-thumb,
.position-scrub input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #050505;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(243,244,246,.46);
}
#dots {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 9px;
}
#dots .dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
#dots .dot.on {
  border-color: var(--gold);
  background: rgba(255, 235, 59, 0.72);
}
@media (max-width: 1100px) {
  .standalone-telemetry {
    display: none;
  }

  .instrument-spec,
  .standalone-measurements {
    display: none;
  }
}
@media (max-width: 900px) {
  body > span.brand,
  body > a.exit {
    display: none;
  }
  #overlay {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 132px;
    width: auto;
    max-height: 208px;
    overflow: hidden;
    padding: 10px 12px;
  }
  #glyph { font-size: 12px; }
  #caption .lead {
    font-size: 13px;
  }
  #caption .sub {
    font-size: 10px;
  }
  #counter {
    left: 18px;
    right: 18px;
    bottom: 72px;
    text-align: left;
  }
  #stage-readout {
    left: 18px;
    right: 18px;
    top: 86px;
    width: auto;
    max-height: 106px;
    overflow: hidden;
    font-size: 9.5px;
    border-color: rgba(243, 244, 246, 0.16);
    border-left-color: rgba(255, 235, 59, 0.92);
    background: rgba(5, 5, 5, 0.78);
  }
  .standalone-telemetry {
    display: none;
  }

  .instrument-spec,
  .standalone-measurements {
    display: none;
  }
  body.sphere-instrument #stage-readout {
    left: 18px;
    right: 18px;
  }
  button.nav {
    display: none;
  }
  .standalone-controls {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    width: auto;
    grid-template-columns: auto auto auto minmax(0, 1fr);
  }
  #timeline-shell {
    left: 18px;
    right: 82px;
    bottom: 62px;
    width: auto;
    transform: none;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #timeline-shell span {
    display: none;
  }
  #dots {
    display: none;
  }
  #enter {
    left: 18px;
    bottom: 18px;
  }
  .title {
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: none;
  }
  body.lightcone-instrument .meter {
    left: 18px;
    right: 18px;
    top: 216px;
    width: auto;
  }
  body.lightcone-instrument .tier {
    left: 18px;
    right: 18px;
    top: 270px;
    width: auto;
    max-height: 58px;
    overflow: hidden;
  }
  body.lightcone-instrument .title {
    display: none;
  }
}
/* hidden until the page's own catch sets display:flex */
#fallback {
  display: none;
  position: fixed; inset: 0; z-index: 6;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
  background: var(--bg); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 14px;
}
#fallback .g { font-size: 40px; color: var(--gold); }
#panel {
  position: fixed; right: 20px; top: 84px; z-index: 4;
  width: min(320px, 86vw); padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border: 1px solid var(--border); border-radius: var(--shape-sm);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 13px;
}
#panel .lvl { color: var(--gold); font-size: 11px; letter-spacing:0; text-transform: uppercase; }
#panel .op { font-size: 20px; margin: 4px 0 2px; font-family: var(--font-heading); font-weight: 700; }
#panel .tier { font-size: 12px; margin-bottom: 6px; }
#panel .ology { color: var(--text-muted); }
#panel .q { font-style: italic; color: var(--text-muted); margin: 4px 0 10px; }
#panel .row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--border); }
#panel .k { color: var(--text-muted); }
#panel .v { color: var(--gold); }
.position-scrub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font: 700 11px/1 var(--font-mono);
}
.position-scrub input {
  width: 100%;
  cursor: pointer;
}
.hint {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 108px; z-index: 4;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); letter-spacing:0;
  white-space: nowrap;
}
.legend {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 4;
  display: flex; gap: 14px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
}
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend-note {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 10px; z-index: 4;
  max-width: 76ch !important; margin: 0 !important;
  font-family: var(--font-mono); color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  padding: 5px 12px; border-radius: var(--shape-sm); backdrop-filter: blur(6px);
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  #panel,
  .legend-note {
    background: var(--bg);
    backdrop-filter: none;
  }
}

@media (max-width: 900px) {
  .lab-frame {
    inset: 76px 18px 18px;
  }
  body.sphere-instrument #panel {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 92px;
    width: auto;
    max-height: min(232px, calc(100vh - 314px));
    overflow: auto;
    padding: 10px 12px;
    font-size: 11px;
  }
  body.sphere-instrument #panel .op {
    font-size: 16px;
  }
  body.sphere-instrument #panel .q {
    display: none;
  }
  body.sphere-instrument #panel .row {
    padding: 4px 0;
  }
  body.sphere-instrument #panel .row:nth-last-of-type(-n+2) {
    display: none;
  }
  body.sphere-instrument .title,
  body.sphere-instrument .legend-note {
    display: none;
  }
  body.sphere-instrument .hint {
    display: none;
  }
  body.sphere-instrument .legend {
    display: none;
  }
  body.sphere-instrument .sphere-controls {
    bottom: 18px;
  }
}

/* ============================================================
   Polish: focus + scrollbar + selection (Skyzai instrument feel)
   ============================================================ */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
::selection { background: rgba(255, 235, 59, .3); color: #050505; }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
::-webkit-scrollbar-track { background: transparent; }
/* Canon-source receipts whose online target is not yet published (audit 2026-07-04:
   the former GitHub links 404'd and leaked a private lane). Rendered as honest muted
   text, never a decoy link. */
.canon-src { color: var(--text-muted, #888); font-style: italic; }

/* Ruling Q6, signed 2026-07-31: the library-indexing boundary is published as a stated
   editorial policy on /atlas/. An unexplained noindex reads as concealment, so the block
   carries the reason, the cost, and the evidence that would reverse it. */
.policy{ max-width:74ch; margin:18px 0 26px; padding:1.1rem 1.3rem;
  border:1px solid rgba(224,145,58,.34); border-left:3px solid rgba(224,145,58,.7);
  border-radius:8px; background:rgba(224,145,58,.05); }
.policy h3{ margin:0 0 .6rem; font-size:1rem; color:#e8b84b; letter-spacing:.01em; }
.policy p{ margin:.55rem 0; line-height:1.68; font-size:.88rem; opacity:.94; }
.policy b{ color:#e8b84b; font-weight:600; }
.policy i{ opacity:.86; }
.policy code{ font-size:.85em; }
.policy .tier{ font-family:ui-monospace,"SF Mono",Menlo,monospace; font-size:.8em; color:#e0913a; }
.policy .policy-prov{ margin-top:.9rem; padding-top:.8rem;
  border-top:1px dashed rgba(224,145,58,.3); font-size:.84rem; }
