:root {
  --ink: #eaf7ff;
  --muted: #91afc4;
  --muted-2: #6d8ca2;
  --bg: #041423;
  --bg-deep: #020c15;
  --panel: #071d31;
  --panel-2: #0a263f;
  --panel-3: #0d3150;
  --line: rgba(117, 190, 226, .22);
  --line-strong: rgba(87, 202, 240, .48);
  --cyan: #29d7f1;
  --cyan-2: #65e6f7;
  --blue: #1686c7;
  --green: #6fe3b0;
  --amber: #f1c46a;
  --red: #ff7186;
  --shadow: 0 16px 50px rgba(0, 0, 0, .28);
  --radius: 18px;
  --radius-sm: 11px;
  --shell: min(1480px, calc(100% - 36px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg-deep); }
body {
  margin: 0;
  background:
    radial-gradient(circle at 16% -4%, rgba(25, 134, 196, .16), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(23, 204, 232, .08), transparent 24%),
    linear-gradient(180deg, #03111f 0%, var(--bg) 45%, #03111e 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  min-width: 320px;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
canvas { display: block; max-width: 100%; }
img, svg { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 14px;
  transform: translateY(-150%);
  background: var(--cyan);
  color: #02111e;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.shell { width: var(--shell); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 15, 26, .91);
  backdrop-filter: blur(16px);
}
.nav-shell { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 44px; height: 44px; color: #d9f8ff; filter: drop-shadow(0 0 10px rgba(41, 215, 241, .25)); }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: .18em; font-size: 17px; }
.brand small { margin-top: 6px; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.primary-nav { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.primary-nav a { position: relative; display: flex; align-items: center; padding: 0 18px; text-decoration: none; color: #bdd2df; font-size: 14px; }
.primary-nav a::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: transparent; }
.primary-nav a:hover, .primary-nav a:focus-visible, .primary-nav a.active { color: #fff; }
.primary-nav a.active::after { background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.menu-toggle { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; color: white; }
.menu-toggle span:not(.sr-only) { width: 18px; height: 1px; background: currentColor; }

.hero { position: relative; min-height: 410px; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(18, 104, 162, .25), transparent 55%),
    linear-gradient(180deg, rgba(4, 17, 30, .15), rgba(3, 15, 27, .75));
}
.hero-field { position: absolute; inset: 0; opacity: .85; }
.hero-field::before, .hero-field::after {
  content: "";
  position: absolute;
  width: 68%;
  height: 280px;
  top: 98px;
  border-top: 1px solid rgba(64, 212, 242, .28);
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(41, 215, 241, .22));
}
.hero-field::before { left: -20%; transform: rotate(8deg); }
.hero-field::after { right: -20%; transform: rotate(-8deg); }
.hero-field span { position: absolute; width: 3px; height: 3px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 12px 2px rgba(41, 215, 241, .5); }
.hero-field span:nth-child(1) { left: 8%; top: 24%; }
.hero-field span:nth-child(2) { left: 31%; top: 69%; }
.hero-field span:nth-child(3) { left: 52%; top: 30%; }
.hero-field span:nth-child(4) { left: 76%; top: 62%; }
.hero-field span:nth-child(5) { left: 92%; top: 23%; }
.hero-content { position: relative; text-align: center; padding: 70px 20px; }
.eyebrow { margin: 0 0 8px; color: var(--cyan-2); font-size: 11px; letter-spacing: .17em; font-weight: 700; }
.hero h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(50px, 8vw, 92px); line-height: 1.02; letter-spacing: -.03em; text-shadow: 0 0 30px rgba(103, 226, 247, .12); }
.hero-content > p:not(.eyebrow) { margin: 18px auto 0; color: #a9c8da; font-size: clamp(16px, 2.2vw, 22px); max-width: 820px; }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.button, .icon-button, .segmented, .text-button {
  border: 0;
  cursor: pointer;
  transition: .2s ease;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(10, 39, 63, .68);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
}
.button:hover, .button:focus-visible { transform: translateY(-1px); border-color: var(--cyan); box-shadow: 0 8px 24px rgba(20, 168, 211, .16); }
.button.primary { background: linear-gradient(135deg, #11aacd, #1b75b8); border-color: #3ae3f7; color: white; box-shadow: 0 8px 22px rgba(21, 159, 201, .22); }
.button.ghost { background: transparent; }
.button.danger { border-color: rgba(255, 113, 134, .55); color: #ff9aad; background: rgba(91, 20, 37, .18); }
.button.small { min-height: 38px; padding: 7px 13px; font-size: 12px; }
.button.tiny { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button.full { width: 100%; }
.icon-button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); background: var(--panel); font-size: 20px; }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--cyan); color: var(--cyan); }

.timeline-section, .visualizer-section, .knowledge-section, .research-section, .annotation-section { padding-top: 72px; }
.timeline-section { padding-bottom: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 24px; }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 46px); font-weight: 400; line-height: 1.12; }
.section-lede { margin: 10px 0 0; max-width: 900px; color: var(--muted); }
.timeline-actions, .annotation-actions { display: flex; align-items: center; gap: 9px; }
.timeline-wrap { overflow-x: auto; padding: 20px 8px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(9, 36, 59, .78), rgba(5, 24, 41, .88)); scrollbar-color: var(--blue) transparent; }
.timeline-track { min-width: 1240px; display: grid; grid-template-columns: repeat(11, minmax(96px, 1fr)); position: relative; }
.timeline-track::before { content: ""; position: absolute; top: 19px; left: 4.5%; right: 4.5%; height: 1px; background: linear-gradient(90deg, rgba(60, 180, 220, .28), rgba(82, 218, 242, .82), rgba(60, 180, 220, .28)); }
.timeline-node { position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; padding: 0 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.timeline-node .node-dot { z-index: 1; width: 14px; height: 14px; margin-top: 12px; border-radius: 50%; border: 2px solid #92bed4; background: #08213a; box-shadow: 0 0 0 4px rgba(4, 18, 32, .85); }
.timeline-node span { display: block; text-align: center; }
.timeline-node .node-year { color: #d6eaf4; font-size: 11px; font-weight: 800; }
.timeline-node .node-title { font-size: 11px; line-height: 1.25; }
.timeline-node .node-kind { width: 7px; height: 7px; border-radius: 50%; margin-top: 2px; background: #8cb8ce; opacity: .8; }
.timeline-node[data-kind="bridge"] .node-kind { background: var(--amber); }
.timeline-node[data-kind="descendant"] .node-kind { background: #ba96f4; }
.timeline-node[data-kind="frontier"] .node-kind { background: var(--green); }
.timeline-node:hover, .timeline-node:focus-visible { color: #fff; }
.timeline-node.active { color: var(--cyan-2); }
.timeline-node.active .node-dot { width: 22px; height: 22px; margin-top: 8px; border-color: white; background: var(--cyan); box-shadow: 0 0 0 7px rgba(41, 215, 241, .13), 0 0 24px rgba(41, 215, 241, .65); }
.timeline-legend { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 8px 0; color: var(--muted); font-size: 12px; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8cb8ce; }
.dot.bridge { background: var(--amber); }
.dot.descendant { background: #ba96f4; }
.dot.frontier { background: var(--green); }

.visualizer-section { padding-bottom: 34px; }
.view-buttons { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 25, 43, .82); }
.segmented { min-height: 36px; padding: 7px 13px; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; }
.segmented.active { background: var(--panel-3); color: white; box-shadow: inset 0 0 0 1px rgba(76, 205, 239, .24); }
.visualizer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: stretch; }
.stage-card, .readout-card, .control-deck, .compare-deck, .special-panel, .knowledge-section, .document-card, .reference-card, .data-card, .annotation-section {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 34, 56, .94), rgba(5, 25, 42, .96));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stage-card { overflow: hidden; min-height: 640px; display: flex; flex-direction: column; }
.stage-toolbar { min-height: 58px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.stage-toolbar > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge, .file-pill, .status-pill { display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; }
.badge { padding: 5px 10px; font-size: 11px; font-weight: 750; color: #052035; background: var(--cyan); }
.badge.subtle { color: #bad8e8; border: 1px solid var(--line); background: rgba(11, 44, 70, .85); }
.canvas-frame { position: relative; flex: 1; min-height: 500px; overflow: hidden; background:
  radial-gradient(circle at 64% 45%, rgba(18, 120, 182, .19), transparent 35%),
  linear-gradient(180deg, rgba(2, 13, 23, .72), rgba(5, 24, 40, .98)); }
.canvas-frame::before { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(89, 155, 188, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(89, 155, 188, .1) 1px, transparent 1px); background-size: 36px 36px; }
#apparatus-canvas { position: relative; width: 100%; height: 100%; min-height: 500px; }
.canvas-status { position: absolute; left: 16px; bottom: 49px; z-index: 2; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(3, 16, 28, .83); color: var(--muted); font-size: 11px; }
.distance-scale { position: absolute; left: 6%; right: 6%; bottom: 15px; display: flex; justify-content: space-between; color: #7f9fb2; font-size: 10px; }
.distance-scale::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 1px; background: rgba(135, 198, 226, .22); }
.stage-caption { min-height: 76px; padding: 14px 18px; border-top: 1px solid var(--line); color: #aac5d4; font-size: 13px; }
.readout-column { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; }
.readout-card { padding: 16px; box-shadow: none; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-title-row h3 { margin: 0; font-size: 14px; font-weight: 700; }
.status-pill { padding: 4px 8px; font-size: 10px; border: 1px solid var(--line); color: var(--muted); }
.status-pill.running { color: var(--green); border-color: rgba(111, 227, 176, .4); }
.status-pill.paused { color: var(--amber); border-color: rgba(241, 196, 106, .4); }
.readout-list { margin: 14px 0 0; }
.readout-list div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid rgba(107, 174, 207, .13); font-size: 12px; }
.readout-list dt { color: var(--muted); }
.readout-list dd { margin: 0; text-align: right; color: #e7f5fb; font-weight: 650; }
.info-button { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--cyan); background: transparent; cursor: pointer; }
.duality-values { display: grid; gap: 12px; margin-top: 15px; }
.duality-values > div { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; }
.duality-values span { color: var(--muted); font-size: 11px; }
.duality-values strong { font-size: 16px; }
meter { width: 100%; height: 7px; grid-column: 1 / -1; accent-color: var(--cyan); }
meter::-webkit-meter-bar { background: rgba(109, 166, 193, .14); border: 0; border-radius: 99px; }
meter::-webkit-meter-optimum-value { background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 99px; }
.equation { margin-top: 14px; text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 22px; color: white; }
.duality-card > p { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.accumulation-card { min-height: 300px; display: flex; flex-direction: column; }
#detector-canvas { width: 100%; height: 225px; margin-top: 10px; border: 1px solid rgba(91, 170, 208, .18); border-radius: 10px; background: rgba(1, 10, 18, .52); }
#event-counter { color: var(--cyan); font-size: 11px; }
.detector-legend { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.line { width: 16px; height: 2px; display: inline-block; vertical-align: middle; margin-right: 5px; }
.line.predicted { background: var(--cyan); }
.line.observed { background: #e7f9ff; }

.special-panel { margin-top: 18px; padding: 18px; box-shadow: none; }
.special-panel.hidden { display: none; }
.special-heading { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; }
.special-heading h3 { margin: 0; font-size: 20px; }
.special-heading > p { margin: 0; max-width: 610px; color: var(--muted); font-size: 13px; }
.eraser-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.eraser-grid figure { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 14, 24, .55); }
.eraser-grid canvas { width: 100%; height: 120px; }
.eraser-grid figcaption { margin-top: 8px; color: #aac9da; font-size: 11px; text-align: center; }
.temporal-diagram { margin-top: 18px; display: grid; grid-template-columns: .7fr auto 1.3fr; gap: 22px; align-items: center; }
.time-gates { position: relative; height: 150px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 14, 24, .58); }
.time-gates::after { content: "time"; position: absolute; right: 10px; bottom: 8px; color: var(--muted-2); font-size: 10px; }
.time-gates span { position: absolute; bottom: 23px; width: 16px; height: 88px; background: linear-gradient(180deg, #98f3ff, #18a6d0); box-shadow: 0 0 22px rgba(41, 215, 241, .58); border-radius: 4px 4px 0 0; }
.time-gates span:first-child { left: 31%; }
.time-gates span:nth-child(2) { left: 66%; }
.time-gates i { position: absolute; top: 22px; left: 37%; right: 29%; height: 1px; background: var(--cyan); color: var(--cyan); font-style: normal; font-size: 11px; text-align: center; }
.temporal-arrow { color: var(--cyan-2); font-size: 12px; text-align: center; }
#temporal-spectrum { width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 14, 24, .58); }

.control-deck, .compare-deck { margin-top: 18px; padding: 20px; box-shadow: none; }
.control-heading, .compare-controls { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.control-heading h3, .compare-controls h3 { margin: 0; font-size: 20px; }
.control-grid { display: grid; grid-template-columns: 1.2fr .95fr .85fr; gap: 20px; margin-top: 18px; }
.control-group { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(3, 17, 29, .46); }
.control-group > label, .control-group fieldset + label { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; margin: 0 0 13px; color: #dbeaf2; font-size: 12px; }
.control-group output { color: var(--cyan-2); font-variant-numeric: tabular-nums; }
input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--cyan); }
fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
legend { margin-bottom: 10px; color: #dbeaf2; font-size: 12px; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-grid button { min-height: 39px; border: 1px solid var(--line); border-radius: 9px; color: #c2d8e4; background: rgba(10, 42, 68, .65); cursor: pointer; font-size: 12px; }
.choice-grid button.active { color: #031521; background: var(--cyan); border-color: #9cf4ff; font-weight: 800; box-shadow: 0 0 18px rgba(41, 215, 241, .28); }
.run-buttons { display: grid; grid-template-columns: 1.25fr .8fr .7fr; gap: 8px; margin-top: 18px; }
.switch-row { display: flex !important; grid-template-columns: none !important; justify-content: space-between; align-items: center; gap: 18px; }
input[type="checkbox"][role="switch"] {
  appearance: none;
  width: 42px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 8, 15, .65);
  position: relative;
  cursor: pointer;
}
input[type="checkbox"][role="switch"]::after { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #8ba8b9; transition: .2s ease; }
input[type="checkbox"][role="switch"]:checked { background: rgba(31, 189, 219, .35); border-color: var(--cyan); }
input[type="checkbox"][role="switch"]:checked::after { transform: translateX(19px); background: #eaffff; box-shadow: 0 0 10px var(--cyan); }
.helper { margin: 0; color: var(--muted-2); font-size: 10px; }

.compare-controls { display: grid; grid-template-columns: 1fr auto minmax(250px, .55fr); }
.compact-switch { margin: 0 !important; }
.compare-controls label:not(.switch-row) { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
select, input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 17, 29, .72);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}
select:focus, input[type="text"]:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(41, 215, 241, .11); }
.compare-content { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin-top: 18px; transition: .25s ease; }
.compare-content.disabled { opacity: .28; filter: grayscale(.6); pointer-events: none; }
.compare-content article { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2, 14, 24, .54); }
.compare-label { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.compare-label span { color: var(--cyan); font-size: 10px; font-weight: 800; }
.compare-label strong { font-size: 12px; }
.compare-content canvas { width: 100%; height: 135px; }
.compare-vs { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--cyan); font-size: 10px; font-weight: 900; }

.knowledge-section { padding: 28px 28px 30px; margin-top: 44px; box-shadow: none; }
.knowledge-section .section-heading { margin-bottom: 18px; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.tabs button { position: relative; min-height: 48px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.tabs button::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -1px; height: 2px; background: transparent; }
.tabs button[aria-selected="true"] { color: var(--cyan-2); }
.tabs button[aria-selected="true"]::after { background: var(--cyan); box-shadow: 0 0 10px rgba(41, 215, 241, .5); }
.tab-panels { padding-top: 24px; }
.knowledge-copy { display: grid; grid-template-columns: 90px 1fr; gap: 22px; max-width: 1050px; }
.large-index { font-family: Georgia, "Times New Roman", serif; font-size: 74px; line-height: .9; color: rgba(68, 200, 236, .25); }
.knowledge-copy h3 { margin: 0 0 8px; font-size: 22px; }
.knowledge-copy p { margin: 0 0 10px; color: #b7ceda; }
.callout { padding: 11px 14px; border-left: 2px solid var(--cyan); background: rgba(22, 135, 181, .09); color: #cce6f2 !important; }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.fact-grid div { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 14, 24, .46); }
.fact-grid span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.fact-grid strong { display: block; margin-top: 5px; font-size: 14px; }
.equation-grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr; gap: 12px; margin-top: 24px; }
.equation-grid div { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(2, 14, 24, .48); }
.equation-grid span { color: var(--muted); font-size: 10px; }
.equation-grid strong { display: block; margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 400; }
.concept-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: stretch; }
.concept-node { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2, 14, 24, .5); }
.concept-node > span { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 12px; border-radius: 50%; background: var(--cyan); color: #042033; font-weight: 900; font-size: 12px; }
.concept-node strong { font-size: 16px; }
.concept-node p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.flow-arrow { display: grid; place-items: center; color: var(--cyan); font-size: 22px; }
.myth-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.myth-grid div { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2, 14, 24, .48); }
.myth-grid p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.interpretation-layout { display: grid; grid-template-columns: minmax(220px, .42fr) 1fr; gap: 24px; align-items: start; }
.interpretation-layout label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.interpretation-layout h3 { margin: 0 0 8px; }
.interpretation-layout p { color: #b7ceda; }

.research-section { padding-bottom: 0; }
.research-grid { display: grid; grid-template-columns: 1.05fr 1fr .95fr; gap: 18px; }
.document-card, .reference-card, .data-card { min-width: 0; padding: 18px; box-shadow: none; }
.file-pill { padding: 4px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.pdf-frame { height: 420px; margin: 14px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #e8eff3; }
.pdf-frame iframe { width: 100%; height: 100%; border: 0; }
.reference-list { margin: 14px 0; padding-left: 21px; max-height: 455px; overflow: auto; scrollbar-color: var(--blue) transparent; }
.reference-list li { margin-bottom: 11px; padding-left: 4px; color: #b7ceda; font-size: 11px; line-height: 1.45; }
.reference-list li a { color: var(--cyan-2); text-decoration-thickness: 1px; text-underline-offset: 2px; }
#run-json, #annotation-json { margin: 14px 0; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #020d17; color: #b7e1ef; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
#run-json { min-height: 420px; max-height: 420px; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.annotation-section { margin-top: 44px; margin-bottom: 68px; padding: 24px; box-shadow: none; }
.annotation-grid { display: grid; grid-template-columns: .9fr 1fr 1.05fr; gap: 18px; margin-top: 20px; }
.annotation-form { display: grid; align-content: start; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2, 14, 24, .48); }
.annotation-form label { color: var(--muted); font-size: 11px; }
.annotation-form textarea { resize: vertical; min-height: 132px; }
.annotation-preview, .annotation-list-wrap { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2, 14, 24, .48); }
#annotation-json { min-height: 230px; max-height: 340px; }
.text-button { padding: 0; background: transparent; color: var(--muted); font-size: 11px; }
.danger-text { color: #ff96a6; }
.annotation-list { display: grid; gap: 10px; margin-top: 14px; max-height: 340px; overflow: auto; }
.annotation-item { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 31, 51, .7); }
.annotation-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted-2); font-size: 9px; }
.annotation-item p { margin: 8px 0; color: #d7e9f1; font-size: 12px; white-space: pre-wrap; }
.annotation-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.annotation-tags span { padding: 3px 7px; border-radius: 999px; background: rgba(27, 142, 187, .17); color: var(--cyan-2); font-size: 9px; }
.annotation-item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.annotation-item-actions button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.empty-state { padding: 24px 10px; text-align: center; color: var(--muted-2); font-size: 12px; }

.site-footer { border-top: 1px solid var(--line); background: #020c15; }
.footer-grid { min-height: 132px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; }
.footer-brand .brand-mark { width: 36px; height: 36px; }
.footer-grid > p { margin: 0; color: var(--muted); font-size: 11px; }
.footer-grid > a { color: var(--cyan); text-decoration: none; font-size: 12px; }

.popover { position: fixed; z-index: 200; right: 24px; top: 94px; width: min(360px, calc(100% - 32px)); padding: 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: #08233a; box-shadow: var(--shadow); transform: translateY(-14px); opacity: 0; pointer-events: none; transition: .2s ease; }
.popover.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.popover button { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.popover h3 { margin: 0 25px 8px 0; font-size: 15px; }
.popover p { margin: 0; color: var(--muted); font-size: 12px; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 1120px) {
  .visualizer-grid { grid-template-columns: 1fr; }
  .readout-column { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; }
  .control-grid { grid-template-columns: 1fr 1fr; }
  .audio-controls { grid-column: 1 / -1; }
  .research-grid { grid-template-columns: 1fr 1fr; }
  .data-card { grid-column: 1 / -1; }
  #run-json { min-height: 280px; max-height: 360px; }
  .annotation-grid { grid-template-columns: 1fr 1fr; }
  .annotation-list-wrap { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  :root { --shell: min(100% - 24px, 1480px); }
  .site-header { position: relative; }
  .nav-shell { height: 68px; }
  .menu-toggle { display: flex; }
  .primary-nav { display: none; position: absolute; z-index: 20; top: 68px; left: 12px; right: 12px; height: auto; padding: 8px; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #061c2e; box-shadow: var(--shadow); }
  .primary-nav.open { display: flex; }
  .primary-nav a { min-height: 46px; border-radius: 8px; }
  .primary-nav a::after { display: none; }
  .primary-nav a.active { background: var(--panel-3); }
  .hero { min-height: 365px; }
  .hero-content { padding: 56px 12px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading.compact { align-items: flex-start; }
  .view-buttons { width: 100%; }
  .segmented { flex: 1; }
  .readout-column { grid-template-columns: 1fr; }
  .stage-card { min-height: 560px; }
  .canvas-frame, #apparatus-canvas { min-height: 430px; }
  .eraser-grid { grid-template-columns: 1fr 1fr; }
  .special-heading { align-items: flex-start; flex-direction: column; }
  .temporal-diagram { grid-template-columns: 1fr; }
  .temporal-arrow { transform: rotate(90deg); }
  .control-grid { grid-template-columns: 1fr; }
  .audio-controls { grid-column: auto; }
  .compare-controls { grid-template-columns: 1fr; align-items: start; }
  .compare-content { grid-template-columns: 1fr; }
  .compare-vs { margin-inline: auto; }
  .knowledge-section { padding: 22px 16px; }
  .tabs { grid-template-columns: 1fr 1fr; }
  .tabs button:last-child { grid-column: 1 / -1; }
  .knowledge-copy { grid-template-columns: 52px 1fr; }
  .large-index { font-size: 46px; }
  .fact-grid, .equation-grid { grid-template-columns: 1fr; }
  .concept-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
  .interpretation-layout { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .data-card { grid-column: auto; }
  .annotation-grid { grid-template-columns: 1fr; }
  .annotation-list-wrap { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; padding-block: 28px; text-align: center; }
  .footer-brand { justify-self: center; }
}

@media (max-width: 520px) {
  :root { --shell: calc(100% - 18px); --radius: 14px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 8px; }
  .brand-mark { width: 38px; height: 38px; }
  .hero h1 { font-size: 47px; }
  .hero-content > p:not(.eyebrow) { font-size: 15px; }
  .timeline-section, .visualizer-section, .research-section { padding-top: 52px; }
  .timeline-actions { width: 100%; }
  .timeline-actions .button { flex: 1; }
  .section-heading h2 { font-size: 31px; }
  .view-buttons { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stage-toolbar { align-items: flex-start; flex-direction: column; }
  .canvas-frame, #apparatus-canvas { min-height: 390px; }
  .distance-scale { display: none; }
  .canvas-status { bottom: 12px; }
  .eraser-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .run-buttons { grid-template-columns: 1fr; }
  .control-deck, .compare-deck { padding: 14px; }
  .control-group { padding: 14px; }
  .tabs { display: flex; overflow-x: auto; }
  .tabs button { flex: 0 0 132px; }
  .tabs button:last-child { grid-column: auto; }
  .knowledge-copy { grid-template-columns: 1fr; }
  .large-index { display: none; }
  .myth-grid { grid-template-columns: 1fr; }
  .annotation-section { padding: 16px; }
  .annotation-actions { width: 100%; }
  .annotation-actions .button { flex: 1; }
  .data-actions { grid-template-columns: 1fr; }
}

.slit-count-wrap { margin: 2px 0 15px; }
.slit-count-wrap > span { display: block; margin-bottom: 8px; color: #dbeaf2; font-size: 12px; }
.mini-choice-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mini-choice-grid button { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; background: rgba(10, 42, 68, .65); color: #c2d8e4; cursor: pointer; }
.mini-choice-grid button.active { background: var(--cyan); border-color: #9cf4ff; color: #031521; font-weight: 800; }
