
:root {
  color-scheme: dark;
  --bg: #03070d;
  --bg-soft: #07101a;
  --ink: #edf7f6;
  --muted: #8ca2aa;
  --muted-2: #5e727a;
  --cyan: #48f1d4;
  --cyan-soft: rgba(72, 241, 212, .15);
  --cyan-line: rgba(72, 241, 212, .32);
  --blue: #65a9ff;
  --violet: #a783ff;
  --amber: #ffca69;
  --red: #ff7e87;
  --panel: rgba(6, 17, 26, .63);
  --panel-strong: rgba(8, 24, 35, .86);
  --line: rgba(187, 226, 228, .14);
  --line-strong: rgba(187, 226, 228, .26);
  --shadow: 0 30px 90px rgba(0, 0, 0, .45);
  --header-h: 76px;
  --page-x: clamp(24px, 5.8vw, 112px);
  --content-w: 1440px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 0%, rgba(25, 86, 97, .18), transparent 36rem),
    linear-gradient(180deg, #02060b, #040a11 45%, #02060b);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button,
input,
a { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

a { color: inherit; }

::selection {
  background: rgba(72, 241, 212, .24);
  color: #fff;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-160%);
  background: #fff;
  color: #000;
  padding: 10px 16px;
  border-radius: 4px;
}

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

#app-shell { position: relative; min-height: 100%; }

#webgl-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.render-vignette,
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.render-vignette {
  background:
    linear-gradient(90deg, rgba(1, 4, 8, .82) 0, rgba(1, 4, 8, .14) 40%, transparent 62%),
    linear-gradient(180deg, rgba(0, 0, 0, .18), transparent 18%, transparent 76%, rgba(0, 0, 0, .72));
}

.noise-layer {
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.19'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-h);
  padding: 0 var(--page-x);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .065);
  background: linear-gradient(180deg, rgba(3, 7, 13, .91), rgba(3, 7, 13, .48));
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--cyan-line);
  border-radius: 50%;
  box-shadow: inset 0 0 24px rgba(72, 241, 212, .08);
}

.brand-mark i {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
}

.brand-mark i:nth-child(1) { transform: translate(-8px, 5px); }
.brand-mark i:nth-child(2) { transform: translate(8px, 5px); }
.brand-mark i:nth-child(3) { transform: translate(0, -9px); }

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1px;
  background: var(--cyan-line);
  transform-origin: center;
}
.brand-mark::before { transform: rotate(30deg); }
.brand-mark::after { transform: rotate(-30deg); }

.brand strong,
.brand small {
  display: block;
  letter-spacing: .15em;
}

.brand strong { font-size: 11px; }
.brand small { color: var(--muted); font-size: 9px; margin-top: 2px; }

.chapter-nav {
  justify-self: center;
  position: relative;
}

.nav-trigger {
  border: 1px solid var(--line);
  background: rgba(10, 23, 31, .56);
  border-radius: 999px;
  padding: 8px 14px;
  display: none;
  gap: 10px;
  cursor: pointer;
}

.nav-trigger span { color: var(--cyan); }

.chapter-nav ol {
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(10px, 1.55vw, 25px);
  list-style: none;
}

.chapter-nav a {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  transition: color .35s var(--ease);
}

.chapter-nav a b {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 500;
}

.chapter-nav a::after {
  content: "";
  position: absolute;
  transform: translateY(17px);
  width: 0;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transition: width .35s var(--ease);
}

.chapter-nav a.is-active,
.chapter-nav a:hover { color: var(--ink); }

.chapter-nav a.is-active::after { width: 20px; }

.runtime-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.rail {
  position: fixed;
  z-index: 32;
  right: clamp(13px, 2vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.rail-line {
  width: 1px;
  min-height: 230px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}

.rail-line span {
  display: block;
  width: 100%;
  height: 0;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.rail ol {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted-2);
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rail li { transition: color .25s, transform .25s; }
.rail li.is-active { color: var(--cyan); transform: translateX(-3px); }

main { position: relative; z-index: 2; }

.chapter {
  position: relative;
  min-height: 110svh;
  padding: calc(var(--header-h) + 56px) var(--page-x) 86px;
  display: flex;
  align-items: center;
  isolation: isolate;
}

.chapter::before {
  content: attr(data-index);
  position: absolute;
  left: var(--page-x);
  bottom: 32px;
  color: rgba(255, 255, 255, .025);
  font: 900 clamp(90px, 14vw, 220px)/.72 ui-sans-serif, system-ui;
  pointer-events: none;
}

.chapter-inner {
  position: relative;
  width: min(100%, var(--content-w));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 25px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--cyan);
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .18em;
}

.eyebrow::after {
  content: "";
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan-line), transparent);
}

.eyebrow span {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--cyan-line);
  border-radius: 50%;
}

h1,
h2 {
  margin: 0;
  max-width: 13ch;
  font-weight: 560;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

h1 { font-size: clamp(58px, 8.3vw, 132px); }
h2 { font-size: clamp(48px, 6.2vw, 96px); }

h1 em,
h2 em {
  color: transparent;
  -webkit-text-stroke: 1px rgba(207, 248, 242, .72);
  font-style: normal;
  font-weight: 350;
}

p { color: var(--muted); }

.lead {
  max-width: 660px;
  margin: 34px 0 0;
  font-size: clamp(15px, 1.2vw, 19px);
}

.glass-panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(36, 79, 86, .08), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(120%);
  overflow: hidden;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--cyan) 0 44px, transparent 44px) top left / 100% 1px no-repeat,
    linear-gradient(180deg, var(--cyan) 0 30px, transparent 30px) top left / 1px 100% no-repeat;
  opacity: .55;
}

.panel-index {
  display: block;
  color: var(--cyan);
  font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .15em;
}

/* Hero */
.chapter--hero { min-height: 125svh; }

.hero-copy {
  padding-top: 3vh;
}

.hero-copy .lead { max-width: 600px; }

.hero-metrics {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 190px));
  gap: 1px;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--line);
}

.hero-metrics > div {
  min-height: 94px;
  padding: 17px 20px;
  background: rgba(3, 10, 16, .78);
}

.hero-metrics strong,
.hero-metrics span { display: block; }

.hero-metrics strong {
  color: var(--ink);
  font: 500 17px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-metrics span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 32px;
  padding: 13px 18px;
  border: 1px solid var(--cyan-line);
  background: rgba(28, 83, 80, .12);
  text-decoration: none;
  color: #dcfff8;
  font-size: 12px;
  letter-spacing: .04em;
  transition: background .3s, transform .3s;
}

.primary-cta span { color: var(--cyan); font-size: 18px; }
.primary-cta:hover { background: rgba(28, 83, 80, .25); transform: translateY(-2px); }

.scroll-cue {
  position: absolute;
  right: var(--page-x);
  bottom: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .17em;
  writing-mode: vertical-rl;
}

.scroll-cue span {
  width: 1px;
  height: 60px;
  background: linear-gradient(180deg, transparent, var(--cyan));
  animation: scrollCue 2.4s var(--ease) infinite;
}

@keyframes scrollCue {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Split / family */
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .62fr);
  gap: clamp(70px, 9vw, 160px);
  align-items: center;
}

.copy-panel > p:not(.eyebrow) {
  max-width: 590px;
  margin: 30px 0 0;
}

.family-switcher {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 230px));
  gap: 10px;
}

.family-switcher button {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(5, 14, 21, .66);
  padding: 15px 16px;
  cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
}

.family-switcher button small {
  float: right;
  color: var(--muted-2);
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.family-switcher button:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.family-switcher button[aria-selected="true"] {
  border-color: var(--cyan-line);
  background: var(--cyan-soft);
  color: #eafffb;
}

.family-detail { padding: 32px; }

.family-detail h3 {
  margin: 38px 0 24px;
  font-size: clamp(30px, 3.2vw, 52px);
  line-height: 1;
  letter-spacing: -.04em;
}

.family-detail h3 small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .06em;
}

.family-detail dl,
.application-detail dl,
.country-hud dl {
  margin: 0;
}

.family-detail dl > div,
.application-detail dl > div,
.country-hud dl > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: .08em;
}

dd { margin: 0; color: #dce9e9; font-size: 13px; }

.micro-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

/* Lab */
.chapter--lab {
  min-height: 135svh;
  align-items: flex-start;
  padding-top: calc(var(--header-h) + 7vh);
}

.lab-layout {
  min-height: calc(100svh - var(--header-h) - 10vh);
  display: grid;
  grid-template-columns: minmax(300px, 450px) 1fr minmax(250px, 320px);
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  align-items: start;
}

.lab-heading { grid-column: 1; grid-row: 1 / span 2; }
.lab-heading h2 { font-size: clamp(45px, 5.6vw, 86px); }
.lab-heading > p:last-child { margin: 28px 0 0; max-width: 440px; font-size: 13px; }

.interaction-zone {
  position: absolute;
  z-index: 8;
  left: 34%;
  right: 20%;
  top: 12%;
  bottom: 11%;
  cursor: grab;
  outline: none;
  touch-action: pan-y pinch-zoom;
}

.interaction-zone.is-dragging { cursor: grabbing; }

.interaction-zone:focus-visible {
  border: 1px dashed var(--cyan-line);
}

.interaction-hint {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  color: rgba(186, 221, 221, .52);
  font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  pointer-events: none;
}

.lab-controls {
  grid-column: 3;
  grid-row: 1;
  padding: 24px;
}

.control-group {
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.control-group > span {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 10px;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}

.segmented button {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  padding: 8px 9px;
  cursor: pointer;
  color: var(--muted);
  font-size: 10px;
}

.segmented button.is-active {
  border-color: var(--cyan-line);
  color: var(--cyan);
  background: rgba(72, 241, 212, .1);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 13px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  width: 30px;
  height: 16px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background .25s, border-color .25s;
}

.toggle-ui::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform .25s, background .25s;
}

.toggle-row input:checked + .toggle-ui {
  background: rgba(72, 241, 212, .12);
  border-color: var(--cyan-line);
}

.toggle-row input:checked + .toggle-ui::after {
  transform: translateX(14px);
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.secondary-button {
  width: 100%;
  margin-top: 13px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 10px;
  color: var(--muted);
  cursor: pointer;
}

.secondary-button:hover { color: var(--ink); border-color: var(--line-strong); }

.atom-inspector {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  padding: 24px;
}

.atom-inspector h3 {
  margin: 26px 0 10px;
  font-size: 19px;
  font-weight: 520;
}

.atom-inspector p { margin: 0; font-size: 11px; }

.measurement-readout {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.measurement-readout span,
.measurement-readout strong { display: block; }

.measurement-readout span {
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.measurement-readout strong {
  margin-top: 7px;
  color: var(--cyan);
  font: 500 23px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.measurement-readout button {
  margin-top: 12px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.structure-legend {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  color: var(--muted);
  font-size: 9px;
}

.structure-legend span { display: flex; align-items: center; gap: 7px; }

.structure-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.structure-legend i.sp2 { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.structure-legend i.sp { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.structure-legend i.triple { width: 13px; height: 3px; border-radius: 0; border-top: 1px solid var(--amber); border-bottom: 1px solid var(--amber); }
.structure-legend i.pi { background: transparent; border: 1px solid var(--blue); box-shadow: 0 0 7px var(--blue); }

/* Timeline */
.timeline-layout {
  display: grid;
  grid-template-columns: 1fr minmax(400px, 560px);
  gap: clamp(60px, 10vw, 170px);
  align-items: center;
}

.timeline-heading > p:last-child { max-width: 510px; margin-top: 28px; }

.timeline-console { padding: 32px; }

.timeline-year {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.timeline-year span {
  color: var(--muted-2);
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.timeline-year strong {
  color: transparent;
  -webkit-text-stroke: 1px rgba(72, 241, 212, .88);
  font: 300 clamp(62px, 7vw, 108px)/.78 ui-sans-serif, system-ui;
  letter-spacing: -.07em;
}

.timeline-console h3 {
  margin: 40px 0 10px;
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 520;
  letter-spacing: -.02em;
}

.timeline-console > p { min-height: 74px; font-size: 12px; }

.timeline-slider { margin-top: 32px; }

.timeline-slider input {
  width: 100%;
  height: 2px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.timeline-ticks {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}

.timeline-ticks i {
  justify-self: center;
  width: 1px;
  height: 5px;
  background: var(--line-strong);
}

.timeline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 25px;
}

.timeline-actions button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
}

.timeline-actions button:hover { border-color: var(--cyan-line); color: var(--cyan); }

/* Data */
.data-layout {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(460px, 1fr);
  align-items: center;
  gap: clamp(70px, 10vw, 170px);
}

.data-copy > p:not(.eyebrow) { max-width: 500px; margin-top: 28px; }

.stat-callout {
  margin-top: 38px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  align-items: end;
  width: max-content;
}

.stat-callout strong {
  grid-row: 1 / span 2;
  color: var(--cyan);
  font: 300 clamp(54px, 6vw, 84px)/.8 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.stat-callout span { color: #dce9e9; font-size: 13px; }
.stat-callout small { max-width: 290px; color: var(--muted-2); font-size: 9px; }

.discipline-list { padding: 24px 28px; }

.discipline-row {
  display: grid;
  grid-template-columns: 30px 110px 1fr 58px;
  gap: 14px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.discipline-row:last-child { border-bottom: 0; }

.discipline-row b,
.country-list b {
  color: var(--muted-2);
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.discipline-row span { font-size: 11px; }

.discipline-bar {
  height: 3px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}

.discipline-bar i {
  display: block;
  height: 100%;
  width: var(--bar);
  background: linear-gradient(90deg, var(--cyan), rgba(101, 169, 255, .55));
  box-shadow: 0 0 8px rgba(72, 241, 212, .5);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s var(--ease);
}

.chapter.is-visible .discipline-bar i { transform: scaleX(1); }

.discipline-row strong {
  justify-self: end;
  color: #cbdadb;
  font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Globe */
.chapter--globe {
  min-height: 135svh;
  align-items: flex-start;
  padding-top: calc(var(--header-h) + 7vh);
}

.globe-layout {
  min-height: calc(100svh - var(--header-h) - 9vh);
  display: grid;
  grid-template-columns: minmax(330px, 460px) 1fr minmax(260px, 330px);
  gap: 32px;
  align-items: center;
}

.globe-copy { grid-column: 1; }
.globe-copy h2 { font-size: clamp(47px, 5.8vw, 88px); }
.globe-copy > p:not(.eyebrow) { max-width: 430px; margin-top: 28px; font-size: 12px; }

.country-list {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  gap: 7px;
}

.country-list button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(3, 12, 18, .58);
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}

.country-list button span { font-size: 10px; }
.country-list button em {
  color: var(--muted-2);
  font: normal 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.country-list button:hover,
.country-list button[aria-selected="true"] {
  color: #eafffb;
  border-color: var(--cyan-line);
  background: rgba(72, 241, 212, .095);
}

.country-list button[aria-selected="true"] b { color: var(--cyan); }

.country-hud {
  grid-column: 3;
  justify-self: end;
  width: 100%;
  padding: 26px;
}

.country-title {
  margin: 34px 0 23px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.country-title strong {
  color: var(--cyan);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.country-title h3 {
  margin: 0;
  font-size: 34px;
  font-weight: 520;
}

.country-hud dl > div { grid-template-columns: 72px 1fr; }

.hud-leader {
  position: fixed;
  z-index: -1;
  height: 1px;
  width: 100px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  transform-origin: left center;
  opacity: .7;
  pointer-events: none;
}

/* Applications */
.applications-layout {
  display: grid;
  grid-template-columns: minmax(330px, .72fr) minmax(260px, .48fr) minmax(360px, .7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.applications-heading > p:last-child { max-width: 430px; margin-top: 28px; }

.application-tabs {
  display: grid;
  gap: 8px;
}

.application-tabs button {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 11px;
  align-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: rgba(4, 12, 18, .28);
  padding: 13px 14px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background .25s, border-color .25s, color .25s, transform .25s;
}

.application-tabs button b {
  color: var(--muted-2);
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.application-tabs button:hover { transform: translateX(4px); color: var(--ink); }
.application-tabs button[aria-selected="true"] {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(72, 241, 212, .11), transparent);
  color: #eafffb;
}
.application-tabs button[aria-selected="true"] b { color: var(--cyan); }

.application-detail { padding: 30px; }

.application-detail h3 {
  margin: 38px 0 16px;
  font-size: clamp(25px, 2.5vw, 38px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.application-detail > p { min-height: 76px; font-size: 12px; }
.application-detail dl > div { grid-template-columns: 80px 1fr; }

/* Evidence */
.chapter--evidence {
  min-height: 115svh;
  align-items: flex-start;
  padding-top: calc(var(--header-h) + 10vh);
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(330px, .62fr) 1fr;
  gap: clamp(70px, 10vw, 170px);
  align-items: start;
}

.evidence-heading > p:last-child { max-width: 490px; margin-top: 28px; }

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.evidence-grid article {
  min-height: 230px;
  padding: 26px;
}

.evidence-grid h3 {
  margin: 44px 0 12px;
  font-size: 19px;
}

.evidence-grid p { margin: 0; font-size: 11px; }

.evidence-level {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.level-a { color: var(--cyan); border: 1px solid var(--cyan-line); background: rgba(72, 241, 212, .07); }
.level-b { color: var(--amber); border: 1px solid rgba(255, 202, 105, .35); background: rgba(255, 202, 105, .07); }
.level-c { color: var(--violet); border: 1px solid rgba(167, 131, 255, .35); background: rgba(167, 131, 255, .07); }

.evidence-layout footer {
  grid-column: 1 / -1;
  margin-top: 80px;
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 26px;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: .1em;
}

.evidence-layout footer strong { color: var(--ink); font-size: 10px; }
.evidence-layout footer a { color: var(--cyan); text-decoration: none; }

.fallback-message {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(90vw, 560px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 202, 105, .35);
  background: rgba(22, 16, 5, .92);
  color: #ffe7b9;
  text-align: center;
  font-size: 11px;
  backdrop-filter: blur(10px);
}

/* Content entrance */
.chapter .chapter-inner > * {
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.chapter:not(.is-visible) .chapter-inner > * {
  opacity: .35;
  transform: translateY(16px);
}

.chapter.is-visible .chapter-inner > * {
  opacity: 1;
  transform: translateY(0);
}

/* quality modes */
html[data-quality="low"] .noise-layer { display: none; }
html[data-quality="low"] .glass-panel,
html[data-quality="low"] .topbar { backdrop-filter: none; }
html[data-quality="low"] .render-vignette { background: linear-gradient(90deg, rgba(1, 4, 8, .8), transparent 70%); }

/* Responsive */
@media (max-width: 1180px) {
  :root { --page-x: clamp(24px, 4vw, 56px); }
  .topbar { grid-template-columns: 1fr auto 1fr; }
  .chapter-nav ol { gap: 12px; }
  .chapter-nav a { font-size: 0; }
  .chapter-nav a b { font-size: 9px; }
  .chapter-nav a::after { transform: translateY(13px); }
  .split-layout,
  .timeline-layout,
  .data-layout { gap: 55px; }
  .lab-layout { grid-template-columns: minmax(280px, 390px) 1fr 250px; }
  .globe-layout { grid-template-columns: minmax(300px, 410px) 1fr 260px; }
  .applications-layout { grid-template-columns: .8fr .5fr .8fr; gap: 30px; }
}

@media (max-width: 900px) {
  :root { --header-h: 66px; --page-x: 24px; }

  .topbar { grid-template-columns: 1fr auto; }
  .runtime-status { display: none; }
  .chapter-nav { justify-self: end; }
  .nav-trigger { display: inline-flex; }
  .chapter-nav ol {
    position: fixed;
    top: var(--header-h);
    right: 16px;
    width: min(270px, calc(100vw - 32px));
    display: grid;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    background: rgba(3, 10, 16, .96);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
  }
  .chapter-nav.is-open ol {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .chapter-nav li { border-bottom: 1px solid var(--line); }
  .chapter-nav li:last-child { border: 0; }
  .chapter-nav a { font-size: 11px; padding: 12px; }
  .chapter-nav a b { width: 24px; }
  .chapter-nav a::after { display: none; }

  .rail { display: none; }
  .chapter { min-height: auto; padding-top: calc(var(--header-h) + 80px); padding-bottom: 110px; }
  .chapter--hero { min-height: 110svh; align-items: flex-end; padding-bottom: 90px; }
  .chapter--lab,
  .chapter--globe { min-height: 140svh; padding-top: calc(var(--header-h) + 55px); }
  .chapter--evidence { min-height: auto; }

  .render-vignette {
    background:
      linear-gradient(180deg, rgba(1, 4, 8, .15) 0, rgba(1, 4, 8, .04) 38%, rgba(1, 4, 8, .86) 60%, #03070d 100%);
  }

  h1 { font-size: clamp(54px, 12.4vw, 90px); }
  h2 { font-size: clamp(45px, 10.4vw, 72px); }

  .hero-copy { padding-top: 40vh; }
  .hero-copy .lead { max-width: 600px; }
  .hero-metrics { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .hero-metrics > div { min-height: 86px; padding: 14px; }
  .hero-metrics strong { font-size: 13px; }

  .split-layout,
  .timeline-layout,
  .data-layout,
  .evidence-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .family-detail,
  .timeline-console,
  .discipline-list { max-width: 650px; }

  .lab-layout {
    min-height: 125svh;
    display: grid;
    grid-template-columns: 1fr 270px;
    grid-template-rows: auto 54vh auto;
    gap: 18px;
  }
  .lab-heading { grid-column: 1 / -1; grid-row: 1; max-width: 590px; }
  .lab-heading > p:last-child { max-width: 590px; }
  .lab-controls { grid-column: 2; grid-row: 2; align-self: end; }
  .atom-inspector { grid-column: 1; grid-row: 2; align-self: end; width: min(320px, 100%); }
  .structure-legend { grid-column: 1 / -1; grid-row: 3; }
  .interaction-zone { left: 0; right: 0; top: 24%; bottom: 13%; }

  .globe-layout {
    min-height: 128svh;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto 58vh;
    align-items: start;
  }
  .globe-copy { grid-column: 1 / -1; grid-row: 1; max-width: 650px; }
  .country-list { max-width: 600px; }
  .country-hud { grid-column: 2; grid-row: 2; align-self: end; }

  .applications-layout {
    grid-template-columns: 1fr 1fr;
    gap: 38px;
  }
  .applications-heading { grid-column: 1 / -1; max-width: 620px; }
  .application-tabs { grid-column: 1; }
  .application-detail { grid-column: 2; }

  .evidence-grid { max-width: 780px; }
  .evidence-layout footer { margin-top: 40px; }
}

@media (max-width: 600px) {
  :root { --page-x: 18px; }

  .brand strong { font-size: 9px; }
  .brand small { font-size: 8px; }
  .brand-mark { width: 31px; height: 31px; }
  .nav-trigger { padding: 7px 11px; font-size: 10px; }

  .chapter { padding-bottom: 92px; overflow: clip; }
  .chapter::before { display: none; }

  .eyebrow { margin-bottom: 19px; font-size: 8px; }
  .eyebrow::after { width: 38px; }
  .eyebrow span { width: 24px; height: 24px; }

  h1 { font-size: clamp(49px, 15vw, 72px); }
  h2 { font-size: clamp(43px, 13vw, 63px); }

  .lead { font-size: 14px; }
  .hero-copy { padding-top: 44vh; }
  .hero-metrics { grid-template-columns: 1fr; border: 0; background: transparent; gap: 6px; }
  .hero-metrics > div {
    min-height: auto;
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    border: 1px solid var(--line);
    padding: 11px 13px;
  }
  .hero-metrics span { margin-top: 0; }
  .scroll-cue { display: none; }

  .family-switcher { grid-template-columns: 1fr 1fr; }
  .family-switcher button { min-width: 0; padding: 13px 10px; font-size: 10px; }
  .family-switcher button small { display: block; float: none; margin-top: 5px; }

  .family-detail,
  .timeline-console,
  .discipline-list,
  .application-detail { padding: 22px; }

  .lab-layout {
    min-height: 150svh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 64vh auto auto;
  }
  .lab-heading { grid-column: 1; grid-row: 1; }
  .lab-heading h2 { font-size: clamp(42px, 12vw, 58px); }
  .lab-heading > p:last-child { font-size: 11px; }
  .atom-inspector {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    width: 100%;
    max-width: none;
  }
  .lab-controls {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    padding: 18px;
  }
  .control-group { margin: 0; padding-bottom: 12px; }
  .toggle-row { margin: 0; }
  .secondary-button { margin: 0; }
  .structure-legend { grid-column: 1; grid-row: 4; gap: 10px 16px; justify-content: flex-start; }
  .interaction-zone { top: 19%; bottom: 31%; }
  .interaction-hint { bottom: 6px; font-size: 8px; }

  .timeline-year strong { font-size: 64px; }
  .timeline-console > p { min-height: 96px; }
  .timeline-ticks { display: none; }

  .data-layout { gap: 38px; }
  .discipline-row { grid-template-columns: 24px 88px 1fr 45px; gap: 8px; }

  .chapter--globe { min-height: 165svh; }
  .globe-layout {
    min-height: 152svh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 74vh auto;
    gap: 20px;
  }
  .globe-copy { grid-column: 1; grid-row: 1; }
  .globe-copy h2 { font-size: clamp(42px, 12vw, 58px); }
  .country-list { grid-template-columns: 1fr 1fr; }
  .country-list button { grid-template-columns: 20px 1fr; }
  .country-list button em { display: none; }
  .country-hud {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    padding: 21px;
  }
  .country-title { margin: 24px 0 15px; }
  .country-title h3 { font-size: 29px; }

  .applications-layout { grid-template-columns: 1fr; gap: 30px; }
  .applications-heading,
  .application-tabs,
  .application-detail { grid-column: 1; }
  .application-tabs { grid-template-columns: 1fr 1fr; gap: 5px; }
  .application-tabs button { padding: 11px 9px; font-size: 9px; }

  .evidence-grid { grid-template-columns: 1fr; }
  .evidence-grid article { min-height: 190px; }
  .evidence-layout footer {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .scroll-cue { display: none; }
}

@media (forced-colors: active) {
  .glass-panel { border: 1px solid CanvasText; }
  h1 em, h2 em { color: CanvasText; -webkit-text-stroke: 0; }
}
