:root {
  color-scheme: dark;
  --ink: #050817;
  --ink-raised: #0a1024;
  --ink-soft: #111a35;
  --line: rgba(197, 214, 255, 0.15);
  --line-bright: rgba(197, 214, 255, 0.31);
  --paper: #edf4ff;
  --muted: #93a5ca;
  --acid: #62f6ff;
  --acid-soft: rgba(98, 246, 255, 0.12);
  --aqua: #35d7ff;
  --violet: #a77bff;
  --magenta: #ff5bd6;
  --danger: #ff7d9c;
  --display: "Regalia Monarch", "Bodoni 72", "Didot", Georgia, "Times New Roman", serif;
  --serif: var(--display);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 18px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; z-index: -1; inset: 0; pointer-events: none; opacity: .42; background: linear-gradient(115deg, transparent 0 35%, rgba(98,246,255,.035) 35.1%, transparent 35.3% 70%, rgba(255,91,214,.03) 70.1%, transparent 70.3%), radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 30%), rgba(98,246,255,.08), transparent 28%); transition: background-position 500ms ease; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.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;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--acid);
  color: var(--ink);
  font-weight: 800;
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 76px;
  padding: 0 clamp(22px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 15, 0.86);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--paper);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand b { color: var(--acid); font-weight: 650; }
.brand-mark { width: 35px; height: 35px; fill: none; stroke: var(--acid); stroke-width: 1.7; }
.brand-mark path { stroke: var(--paper); }
.brand-mark .brand-core { fill: var(--acid); stroke: none; }
.primary-nav { display: flex; align-items: center; gap: 32px; }
.primary-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 160ms ease;
}
.primary-nav a:hover { color: var(--paper); }
.primary-nav .nav-cta {
  padding: 9px 15px;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  color: var(--paper);
}
.nav-link-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; letter-spacing: .02em; }
.nav-link-button:hover { color: var(--paper); }
.science-guide { width: min(920px, calc(100vw - 32px)); max-height: min(820px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--line-bright); border-radius: 10px; color: var(--paper); background: #0a1024; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.science-guide::backdrop { background: rgba(3,5,15,.78); backdrop-filter: blur(8px); }
.science-guide-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 28px 30px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, rgba(98,246,255,.08), rgba(167,123,255,.08)); }
.science-guide-header .eyebrow { margin-bottom: 10px; }
.science-guide-header h2 { max-width: 600px; font-size: clamp(30px, 4vw, 48px); }
.science-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding: 1px; background: var(--line); }
.science-guide-grid article { min-height: 170px; padding: 22px; background: #0a1024; }
.science-guide-grid h3 { margin: 11px 0 8px; font: 400 23px var(--display); }
.science-guide-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.science-level { display: inline-block; padding: 4px 6px; border: 1px solid currentColor; border-radius: 3px; font: 8px var(--mono); letter-spacing: .07em; }
.science-level-real { color: var(--acid); }
.science-level-bounded { color: var(--violet); }
.science-level-math { color: var(--aqua); }
.science-level-model { color: var(--magenta); }
.science-level-no { color: var(--danger); }
.science-guide-footer { display: flex; gap: 8px; padding: 16px 22px; color: var(--muted); background: #070b1b; font-size: 10px; line-height: 1.5; }
.science-guide-footer strong { color: var(--paper); }
.mobile-menu { display: none; }

.app-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 0%, rgba(167, 123, 255, 0.16), transparent 30%),
    radial-gradient(circle at 12% 28%, rgba(98, 246, 255, 0.08), transparent 26%),
    var(--ink);
}
.app-header { position: relative; }
.engine-status {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateX(-50%);
}
.engine-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
}
.engine-status strong { color: var(--acid); font-weight: 700; }
.simulator-app { min-height: calc(100vh - 76px); }
.app-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  max-width: 1540px;
  margin: auto;
  padding: 54px clamp(22px, 4vw, 64px) 38px;
}
.app-intro .eyebrow { margin-bottom: 12px; }
.app-intro h1 { font-size: clamp(44px, 5.8vw, 82px); }
.app-intro > div > p:last-child {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.app-readout {
  display: flex;
  gap: 30px;
  margin: 0 0 4px;
}
.app-readout div { padding-left: 14px; border-left: 1px solid var(--line-bright); }
.app-readout dt { font: 650 15px var(--mono); }
.app-readout dd { max-width: 90px; margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.35; letter-spacing: 0.08em; text-transform: uppercase; }
.app-lab.lab-section {
  padding: 0 clamp(14px, 3vw, 48px) 48px;
  border: 0;
  background: transparent;
}
.app-section-heading { max-width: 1540px; margin-bottom: 20px; }
.app-section-heading h2 { font-size: clamp(30px, 3vw, 46px); }
.app-lab .lab-shell { max-width: 1540px; }
.app-lab .lab-workspace { min-height: 650px; }
.observatory-section { padding: 30px clamp(14px, 3vw, 48px) 74px; border-top: 1px solid var(--line); background: #060a19; }
.observatory-shell { max-width: 1540px; margin: auto; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 8px; background: radial-gradient(circle at 50% 40%, rgba(167,123,255,.12), transparent 50%), #070b1b; box-shadow: var(--shadow); }
.observatory-controls { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(13,21,48,.86); }
.observatory-control-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.observatory-control-group > span { margin-right: 3px; color: var(--muted); font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.observatory-control-group button, .observatory-control-group select { min-height: 31px; padding: 0 9px; border: 1px solid var(--line-bright); border-radius: 5px; background: #080d20; color: var(--paper); cursor: pointer; font: 10px var(--mono); }
.observatory-control-group button:hover, .observatory-control-group button:focus { border-color: var(--acid); color: var(--acid); }
.observatory-control-group:last-child { margin-left: auto; }
.observatory-parity-status { padding: 14px 18px; border-top: 1px solid rgba(98,246,255,.2); color: #b9c8e8; background: rgba(98,246,255,.05); font: 10px/1.6 var(--mono); }
.observatory-svg { display: block; width: 100%; min-height: 430px; }
.observatory-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; min-height: 46px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.observatory-footer span { display: inline-flex; align-items: center; gap: 6px; }
.observatory-footer strong { margin-left: auto; color: var(--paper); font-weight: 500; }
.observatory-dot { width: 7px; height: 7px; border-radius: 50%; }
.observatory-dot-state { background: var(--acid); box-shadow: 0 0 9px var(--acid); }
.observatory-dot-measure { background: var(--violet); box-shadow: 0 0 9px var(--violet); }
.observatory-dot-graph { background: var(--magenta); box-shadow: 0 0 9px var(--magenta); }
.observatory-svg .trace-label { fill: var(--muted); font: 11px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.observatory-svg .trace-title { fill: var(--paper); font: 600 16px var(--display); letter-spacing: .01em; }
.observatory-svg .trace-value { fill: var(--acid); font: 12px var(--mono); }
.observatory-svg .trace-small { fill: var(--muted); font: 10px var(--mono); }
.observatory-svg .trace-node { fill: rgba(13,21,48,.9); stroke: rgba(197,214,255,.3); stroke-width: 1; }
.observatory-svg .trace-node-state { stroke: rgba(98,246,255,.65); }
.observatory-svg .trace-node-measure { stroke: rgba(167,123,255,.72); }
.observatory-svg .trace-node-graph { stroke: rgba(255,91,214,.7); }
.observatory-svg .trace-flow { fill: none; stroke: var(--acid); stroke-width: 2; stroke-dasharray: 7 10; animation: observatory-flow 1.7s linear infinite; }
.observatory-svg .trace-flow-measure { stroke: var(--violet); }
.observatory-svg .trace-flow-graph { stroke: var(--magenta); }
.observatory-svg .qubit-rail { stroke: rgba(197,214,255,.25); stroke-width: 2; }
.observatory-svg .qubit-node { stroke: rgba(197,214,255,.35); stroke-width: 1; fill: #111a35; }
.observatory-svg .qubit-node-active { fill: var(--acid); stroke: var(--acid); }
.observatory-svg .graph-edge { stroke: rgba(255,91,214,.55); stroke-width: 2; }
.observatory-svg .graph-vertex { fill: #0d1530; stroke: var(--magenta); stroke-width: 2; }
@keyframes observatory-flow { to { stroke-dashoffset: -34; } }
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(22px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: #647169;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.atlas-section { padding: 0 clamp(14px, 3vw, 48px) 42px; }
.atlas-shell { position: relative; display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); max-width: 1540px; min-height: 390px; margin: auto; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 8px; background: linear-gradient(120deg, rgba(13,21,48,.98), rgba(5,8,23,.99)); box-shadow: var(--shadow); }
.parallax-depth { transform: translate3d(0, var(--scroll-offset, 0px), 0) scale(var(--scroll-scale, 1)); transition: transform 120ms linear; will-change: transform; }
.atlas-shell.parallax-depth { box-shadow: 0 calc(30px + var(--scroll-shadow, 0px)) 100px rgba(0,0,0,.34), 0 0 70px rgba(98,246,255,.06); }
.observatory-shell.parallax-depth { box-shadow: 0 calc(30px + var(--scroll-shadow, 0px)) 120px rgba(0,0,0,.42), 0 0 90px rgba(167,123,255,.08); }
.atlas-shell::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 0 42%, rgba(98,246,255,.08) 42.1%, transparent 42.3% 68%, rgba(255,91,214,.06) 68.1%, transparent 68.3%); }
.atlas-copy { position: relative; z-index: 1; display: grid; align-content: center; gap: 16px; padding: clamp(24px, 4vw, 50px); }
.atlas-copy .eyebrow { margin: 0; }
.atlas-copy h2 { font-size: clamp(32px, 4vw, 58px); }
.atlas-copy > p:not(.eyebrow) { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.atlas-equation { width: fit-content; padding: 10px 13px; border-left: 2px solid var(--acid); color: var(--acid); background: rgba(98,246,255,.06); font: 15px var(--mono); }
.atlas-signal { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 8px var(--mono); letter-spacing: .1em; }
.atlas-signal span:first-child { color: var(--acid); font-size: 14px; }
.atlas-signal i { width: 30px; height: 1px; margin-left: 3px; background: linear-gradient(90deg, var(--acid), var(--magenta)); }
.atlas-stage-rail { position: absolute; top: 50%; left: 17px; display: grid; gap: 11px; transform: translateY(-50%); }
.atlas-stage-rail span { width: 5px; height: 5px; border: 1px solid var(--line-bright); border-radius: 50%; }
.atlas-stage-rail span.is-current { border-color: var(--acid); background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.atlas-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.atlas-mode { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 5px; min-height: 42px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: rgba(5,8,23,.4); color: var(--muted); text-align: left; cursor: pointer; }
.atlas-mode b { color: var(--violet); font: 10px var(--mono); }
.atlas-mode span { font: 10px var(--mono); }
.atlas-mode:hover, .atlas-mode.is-active { border-color: var(--acid); background: var(--acid-soft); color: var(--paper); box-shadow: 0 0 20px rgba(98,246,255,.08); }
.atlas-visual { position: relative; z-index: 1; min-height: 390px; border-left: 1px solid var(--line); background-image: linear-gradient(rgba(98,246,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(98,246,255,.045) 1px, transparent 1px), radial-gradient(circle at 50% 45%, rgba(53,215,255,.14), transparent 62%), #070b1b; background-size: 42px 42px, 42px 42px, auto, auto; }
.atlas-visual::after { content: ""; position: absolute; inset: 14% 8% 17%; pointer-events: none; border: 1px solid rgba(98,246,255,.16); border-radius: 50%; box-shadow: 0 0 70px rgba(167,123,255,.08), inset 0 0 45px rgba(98,246,255,.05); }
.atlas-visual canvas { position: relative; z-index: 1; display: block; width: 100%; height: 390px; min-height: 390px; }
.atlas-scene { position: absolute; z-index: 2; inset: 0; display: block; width: 100%; height: 390px; pointer-events: none; }
.atlas-scene .scene-line { stroke: rgba(98,246,255,.35); stroke-width: 2; fill: none; }
.atlas-scene .scene-line-hot { stroke: var(--magenta); stroke-width: 4; filter: drop-shadow(0 0 5px rgba(255,91,214,.75)); }
.atlas-scene .scene-node { fill: #0d1530; stroke: var(--acid); stroke-width: 2; }
.atlas-scene .scene-node-hot { fill: var(--acid); }
.atlas-scene .scene-text { fill: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.atlas-scene .scene-value { fill: var(--acid); font: 13px var(--mono); }
.atlas-scene .scene-pulse { fill: var(--acid); filter: drop-shadow(0 0 8px rgba(98,246,255,.9)); animation: scene-pulse 1.8s ease-in-out infinite; }
.atlas-scene .scene-orbit { fill: none; stroke: rgba(98,246,255,.22); stroke-width: 1; stroke-dasharray: 4 12; animation: scene-orbit 12s linear infinite; transform-origin: 450px 195px; }
@keyframes scene-pulse { 50% { opacity: .22; transform: scale(1.8); transform-origin: center; } }
@keyframes scene-orbit { to { transform: rotate(360deg); } }
.atlas-frame-label { position: absolute; z-index: 2; color: rgba(197,214,255,.56); font: 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.atlas-frame-label-top { top: 14px; right: 20px; }
.atlas-frame-label-left { bottom: 51px; left: 18px; }
.atlas-frame-label-right { right: 18px; bottom: 51px; }
.atlas-caption { position: absolute; right: 20px; bottom: 15px; left: 20px; color: var(--muted); font: 9px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.analysis-section { padding: 30px clamp(14px, 3vw, 48px) 74px; border-top: 1px solid var(--line); background: #080d20; }
.workbench-layer { position: relative; }
.workbench-layer::before { content: ""; position: absolute; top: 0; right: clamp(14px, 3vw, 48px); left: clamp(14px, 3vw, 48px); height: 1px; background: linear-gradient(90deg, transparent, rgba(98,246,255,.6), rgba(167,123,255,.6), transparent); }
.analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 1540px; margin: auto; }
.analysis-card { display: grid; align-content: start; gap: 13px; min-width: 0; padding: 21px; border: 1px solid var(--line-bright); border-radius: 8px; background: #0d1530; }
.analysis-card .field input[type="text"], .analysis-card .field input[type="number"], .analysis-card textarea { width: 100%; min-height: 38px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; resize: vertical; background: #080d20; color: var(--paper); font-family: var(--mono); font-size: 11px; }
.analysis-card textarea { min-height: 82px; }
.analysis-card .field input:focus, .analysis-card textarea:focus { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid-soft); }
.analysis-card .button { width: 100%; min-height: 40px; }
.analysis-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.analysis-output { min-height: 115px; max-height: 270px; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; color: #b9c8e8; background: #070b1b; font: 10px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.analysis-visual { display: grid; gap: 9px; min-height: 130px; padding: 14px; border: 1px solid rgba(98,246,255,.24); border-radius: 6px; background: linear-gradient(135deg, rgba(98,246,255,.08), rgba(167,123,255,.08)); }
.analysis-visual strong { color: var(--paper); font: 600 17px var(--display); }
.analysis-visual > span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.visual-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.visual-metric { min-height: 43px; padding: 7px 8px; border-left: 2px solid var(--acid); background: rgba(5,8,23,.52); }
.visual-metric-measure { border-left-color: var(--violet); }
.visual-metric-graph { border-left-color: var(--magenta); }
.visual-metric small { display: block; color: var(--muted); font: 8px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.visual-metric b { display: block; margin-top: 3px; overflow: hidden; color: var(--paper); font: 11px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.raw-details { border-top: 1px solid var(--line); padding-top: 8px; }
.raw-details summary { color: var(--muted); cursor: pointer; font: 9px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.raw-details { display: none; }
.vertex-section { padding: 30px clamp(14px, 3vw, 48px) 74px; border-top: 1px solid var(--line); background: #070b1b; }
.vertex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 1540px; margin: auto; }
.vertex-visual-wrap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: radial-gradient(circle at 50% 42%, rgba(167,123,255,.16), transparent 58%), #070b1b; }
.vertex-visual-wrap canvas { display: block; width: 100%; height: auto; aspect-ratio: 760 / 430; }
.vertex-visual-caption { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-top: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.topology-graph-wrap { overflow: hidden; border: 1px solid rgba(255,91,214,.22); border-radius: 7px; background: radial-gradient(circle at 50% 44%, rgba(167,123,255,.14), transparent 60%), #070b1b; }
.topology-graph { display: block; width: 100%; min-height: 280px; }
.topology-graph .topology-edge { stroke: rgba(197,214,255,.28); stroke-width: 2; fill: none; }
.topology-graph .topology-edge-active { stroke: var(--magenta); stroke-width: 4; filter: drop-shadow(0 0 5px rgba(255,91,214,.7)); }
.topology-graph .topology-edge-label { fill: var(--muted); font: 9px var(--mono); }
.topology-graph .topology-vertex { fill: #111a35; stroke: var(--acid); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(98,246,255,.55)); }
.topology-graph .topology-vertex-active { fill: var(--acid); stroke: var(--acid); }
.topology-graph .topology-vertex-label { fill: var(--paper); font: 700 11px var(--mono); text-anchor: middle; dominant-baseline: middle; }
.topology-graph .topology-phase-label { fill: var(--muted); font: 9px var(--mono); text-anchor: middle; }
.topology-graph-legend { display: flex; gap: 15px; padding: 8px 11px; border-top: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.topology-graph-legend span { display: flex; align-items: center; gap: 6px; }
.topology-graph-legend i { display: inline-block; width: 18px; height: 2px; background: var(--magenta); }
.topology-legend-phase { width: 8px !important; height: 8px !important; border-radius: 50%; background: var(--acid) !important; }
.invariant-gauge { display: grid; gap: 6px; margin-top: 4px; }
.invariant-gauge-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(197,214,255,.12); }
.invariant-gauge-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--violet), var(--magenta)); transition: width 350ms ease; }
.invariant-gauge > div:last-child { display: flex; justify-content: space-between; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.invariant-gauge strong { color: var(--acid); font-weight: 500; }
.vertex-key { width: 8px; height: 8px; border-radius: 50%; }
.vertex-key-phase { background: var(--acid); box-shadow: 0 0 9px var(--acid); }
.vertex-key-edge { width: 19px; height: 2px; margin-left: 10px; border-radius: 0; background: var(--aqua); box-shadow: 0 0 8px var(--aqua); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: var(--acid);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow span { width: 22px; height: 1px; background: currentColor; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -0.05em; line-height: 0.96; }
h1 { max-width: 780px; font-size: clamp(56px, 7vw, 112px); }
h1 em, h2 em { color: var(--acid); font-weight: 400; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--acid); color: #101b0d; }
.button-primary:hover { background: #c8ff6f; }
.button-quiet { border-color: var(--line); background: rgba(255, 255, 255, 0.025); color: var(--paper); }
.button-secondary { border-color: var(--line-bright); background: #172722; color: var(--paper); }

.lab-section { padding: 100px clamp(18px, 4vw, 64px) 120px; border-top: 1px solid var(--line); background: #080d20; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; max-width: 1420px; margin: 0 auto 38px; }
.section-heading .eyebrow { margin-bottom: 13px; }
.section-heading h2, .method-intro h2, .architecture-copy h2 { font-size: clamp(44px, 5vw, 76px); }
.section-heading > p { max-width: 450px; margin: 0 0 5px; color: var(--muted); font-size: 14px; }
.lab-shell { max-width: 1420px; margin: auto; overflow: hidden; border: 1px solid var(--line-bright); border-radius: var(--radius); background: #0b1230; box-shadow: var(--shadow); }
.lab-toolbar { display: flex; align-items: center; min-height: 68px; padding: 11px 16px 11px 21px; border-bottom: 1px solid var(--line); background: #101a3c; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.field select, .field input[type="number"] { min-height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: #080d20; color: var(--paper); font-family: var(--mono); font-size: 12px; }
.field select:focus, .field input:focus { border-color: var(--acid); box-shadow: 0 0 0 2px var(--acid-soft); }
.compact-field { display: flex; align-items: center; gap: 12px; }
.compact-field select { width: 126px; }
.toolbar-divider { width: 1px; height: 30px; margin: 0 20px; background: var(--line); }
.example-group { display: flex; align-items: center; gap: 7px; }
.example-group > span { margin-right: 4px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.example-group button, .text-button, .icon-button { border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #b7c1b9; cursor: pointer; }
.example-group button { padding: 7px 10px; font-size: 11px; }
.example-group button:hover, .text-button:hover, .icon-button:hover { border-color: var(--line-bright); color: var(--paper); }
.toolbar-actions { display: flex; gap: 7px; margin-left: auto; }
.icon-button { width: 36px; height: 36px; font-size: 19px; }
.text-button { padding: 0 13px; font-size: 11px; }
.lab-workspace { display: grid; grid-template-columns: 252px minmax(300px, 0.95fr) minmax(400px, 1.2fr); min-height: 680px; }
.gate-panel, .circuit-panel, .results-panel { padding: 23px; }
.gate-panel, .circuit-panel { border-right: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; justify-content: space-between; }
.panel-title h3 { margin: 0; font-size: 13px; letter-spacing: 0.01em; }
.panel-title > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.gate-family { margin: 23px 0 8px; color: #718078; font-size: 9px; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase; }
.gate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gate-grid-two { grid-template-columns: repeat(2, 1fr); }
.gate-button { display: grid; place-items: center; min-height: 58px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,0.015); cursor: pointer; transition: border 120ms, background 120ms, transform 120ms; }
.gate-button:hover { border-color: var(--line-bright); transform: translateY(-1px); }
.gate-button.is-selected { border-color: var(--acid); background: var(--acid-soft); box-shadow: inset 0 0 22px rgba(98, 246, 255, 0.08); }
.gate-button strong { font: 700 14px var(--mono); }
.gate-button strong sub { font-size: 8px; }
.gate-button span { margin-top: 3px; color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: 0.04em; }
.gate-config { display: grid; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.rotation-field output { float: right; color: var(--paper); font-family: var(--mono); }
.rotation-field input { width: 100%; accent-color: var(--acid); }
.add-gate { width: 100%; min-height: 42px; }

.circuit-panel { position: relative; min-width: 0; background: rgba(2, 9, 7, 0.24); }
.circuit-view { min-height: 540px; margin: 18px -23px 0; overflow: hidden; }
.empty-circuit { display: grid; place-items: center; align-content: center; min-height: 480px; color: var(--muted); text-align: center; }
.empty-circuit p { margin: 18px 0 3px; font-size: 13px; }
.empty-circuit strong { color: var(--paper); font-family: var(--mono); }
.empty-circuit small { font-size: 10px; }
.empty-orbit { position: relative; display: block; width: 60px; height: 60px; border: 1px solid var(--line-bright); border-radius: 50%; }
.empty-orbit::before { content: ""; position: absolute; inset: 12px -8px; border: 1px solid rgba(184,242,91,.35); border-radius: 50%; transform: rotate(55deg); }
.empty-orbit::after { content: ""; position: absolute; width: 6px; height: 6px; top: 8px; right: 5px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); }
.circuit-scroll { min-width: max-content; padding: 25px 23px; }
.circuit-row { position: relative; display: grid; grid-template-columns: 35px repeat(var(--columns), 54px); align-items: center; height: 66px; }
.system-label { position: relative; z-index: 2; color: var(--muted); font: 11px var(--mono); }
.wire { position: absolute; right: 0; left: 35px; height: 1px; background: #34433d; }
.circuit-cell { position: relative; z-index: 2; display: grid; place-items: center; height: 54px; }
.circuit-gate { width: 36px; height: 36px; padding: 0; border: 1px solid var(--acid); border-radius: 5px; background: #182650; color: var(--acid); font: 700 10px var(--mono); cursor: pointer; box-shadow: 0 0 18px rgba(98, 246, 255, 0.12); }
.circuit-gate:hover { background: var(--acid); color: var(--ink); }
.control-mark { width: 9px; height: 9px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 10px rgba(91,230,196,.4); }
.swap-mark { color: var(--aqua); font: 21px var(--mono); }
.circuit-note { position: absolute; right: 22px; bottom: 18px; left: 22px; margin: 0; color: #66746d; font-size: 9px; }
.circuit-note span { margin-right: 7px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 8px var(--mono); }

.results-panel { min-width: 0; background: #0d1530; }
.results-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.exact-badge { margin-left: 8px; padding: 3px 6px; border: 1px solid rgba(91,230,196,.3); border-radius: 4px; color: var(--aqua) !important; }
.tab-list { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #09130f; }
.tab-list button { padding: 6px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.tab-list button.is-active { background: #1a2a24; color: var(--paper); }
.metrics-row { display: grid; grid-template-columns: 1.25fr 1fr .7fr; gap: 1px; margin: 18px 0; background: var(--line); border: 1px solid var(--line); }
.metrics-row div { padding: 11px; background: #0b1613; }
.metrics-row span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.metrics-row strong { display: block; margin-top: 4px; font: 600 10px var(--mono); }
.result-content { height: 410px; overflow: auto; scrollbar-color: #34443d transparent; }
.engine-stack { margin: 0 0 18px; padding: 13px 0 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.engine-stack-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.engine-stack-header strong { color: var(--aqua); font: 11px var(--mono); }
.engine-stack-header span { color: var(--muted); font: 9px var(--mono); }
.engine-stack canvas { display: block; width: 100%; height: 104px; }
.engine-stack p { margin: 2px 0 8px; color: #66746d; font-size: 9px; }
.probability-chart { display: grid; gap: 9px; padding: 5px 0 15px; }
.probability-row { display: grid; grid-template-columns: minmax(58px, auto) 1fr 68px; gap: 10px; align-items: center; }
.basis-state { color: #cbd3cc; font: 10px var(--mono); }
.probability-track { height: 15px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.035); }
.probability-fill { display: block; width: var(--value); height: 100%; background: linear-gradient(90deg, rgba(184,242,91,.46), var(--acid)); transform-origin: left; animation: grow 400ms ease-out; }
@keyframes grow { from { transform: scaleX(0); } }
.probability-value { color: var(--muted); font: 9px var(--mono); text-align: right; }
.table-wrap { border: 1px solid var(--line); }
.amplitude-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.amplitude-table th, .amplitude-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.amplitude-table th:first-child, .amplitude-table td:first-child { text-align: left; }
.amplitude-table thead { position: sticky; z-index: 1; top: 0; background: #12201b; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.amplitude-table tbody th { color: var(--acid); font: 9px var(--mono); }
.complex-value { color: #dce3dc; font-family: var(--mono); }
.sample-bar { display: grid; grid-template-columns: 94px 78px 1fr; gap: 9px; align-items: end; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-field input { width: 100%; min-height: 36px !important; padding: 0 7px !important; }
.sample-bar .button { min-height: 36px; padding: 0 10px; font-size: 10px; }


.toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: min(450px, calc(100vw - 48px)); padding: 13px 17px; border: 1px solid rgba(184,242,91,.35); border-radius: 7px; background: #14231e; color: var(--paper); box-shadow: var(--shadow); font-size: 11px; transform: translateY(25px); opacity: 0; pointer-events: none; transition: opacity 180ms, transform 180ms; }
.toast.is-visible { transform: none; opacity: 1; }

@media (max-width: 1180px) {
  .lab-workspace { grid-template-columns: 235px 1fr; }
  .results-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .result-content { height: 340px; }
  .analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .site-header { height: 66px; }
  .mobile-menu { display: grid; width: 38px; height: 38px; place-content: center; gap: 4px; border: 1px solid var(--line); background: transparent; }
  .mobile-menu > span:not(.sr-only) { width: 16px; height: 1px; background: var(--paper); }
  .primary-nav { position: absolute; top: 66px; right: 0; left: 0; display: none; align-items: stretch; gap: 0; padding: 10px 22px 20px; border-bottom: 1px solid var(--line); background: #091411; }
  .primary-nav.is-open { display: grid; }
  .primary-nav a { padding: 13px 0; }
  .nav-link-button { padding: 13px 0; text-align: left; }
  .primary-nav .nav-cta { margin-top: 5px; text-align: center; }
  .engine-status { display: none; }
  .app-intro { grid-template-columns: 1fr; padding-top: 38px; }
  .app-readout { justify-content: flex-start; }
  .section-heading { display: grid; gap: 20px; }
  .lab-workspace { grid-template-columns: 1fr; }
  .gate-panel, .circuit-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .gate-grid { grid-template-columns: repeat(6, 1fr); }
  .gate-grid-three { grid-template-columns: repeat(3, 1fr); }
  .gate-grid-two { grid-template-columns: repeat(4, 1fr); }
  .gate-config { grid-template-columns: repeat(2, 1fr); align-items: end; }
  .add-gate { align-self: end; }
  .circuit-panel { min-height: 470px; }
  .circuit-view { min-height: 370px; overflow-x: auto; }
  .empty-circuit { min-height: 340px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .vertex-grid { grid-template-columns: 1fr; }
  .sparse-fields { grid-template-columns: 1fr; }
  .atlas-shell { grid-template-columns: 1fr; }
  .atlas-visual { min-height: 300px; border-top: 1px solid var(--line); border-left: 0; }
  .atlas-visual canvas, .atlas-scene { height: 300px; min-height: 300px; }
  .observatory-footer strong { width: 100%; margin-left: 0; }
  .science-guide-grid { grid-template-columns: 1fr; }
  .science-guide-footer { display: block; }
}

@media (max-width: 590px) {
  .app-intro { gap: 25px; padding-right: 18px; padding-left: 18px; }
  .app-intro h1 { font-size: 48px; }
  .app-readout { gap: 12px; }
  .app-readout div { padding-left: 8px; }
  .app-section-heading { padding-right: 6px; padding-left: 6px; }
  .app-footer { display: grid; }
  .lab-section { padding-right: 10px; padding-left: 10px; }
  .section-heading { padding: 0 12px; }
  .lab-toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar-divider { display: none; }
  .example-group { order: 3; width: 100%; overflow-x: auto; }
  .gate-grid { grid-template-columns: repeat(3, 1fr); }
  .gate-grid-two { grid-template-columns: repeat(2, 1fr); }
  .gate-config { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: 1fr; }
  .metrics-row div { display: flex; justify-content: space-between; align-items: center; }
  .metrics-row strong { margin: 0; }
  .sample-bar { grid-template-columns: 1fr 1fr; }
  .sample-bar .button { grid-column: 1 / -1; }
  .probability-row { grid-template-columns: 55px 1fr 62px; }
}

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

/* Scientific light theme: paper, ink, cobalt operators, orange measurements. */
:root {
  color-scheme: light;
  --ink: #f4f7fb;
  --ink-raised: #ffffff;
  --ink-soft: #e8eef7;
  --line: rgba(23, 55, 91, 0.14);
  --line-bright: rgba(23, 55, 91, 0.28);
  --paper: #172b45;
  --muted: #5e738d;
  --acid: #1769aa;
  --acid-soft: rgba(23, 105, 170, 0.1);
  --aqua: #008f9c;
  --violet: #6b58a9;
  --magenta: #d45b36;
  --danger: #bb3e4d;
  --shadow: 0 22px 65px rgba(28, 54, 84, 0.13);
}

body { background: var(--ink); color: var(--paper); }
body::before { opacity: .6; background: linear-gradient(115deg, transparent 0 35%, rgba(23,105,170,.035) 35.1%, transparent 35.3% 70%, rgba(212,91,54,.025) 70.1%, transparent 70.3%), radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 30%), rgba(23,105,170,.06), transparent 28%); }
.site-header { background: rgba(244,247,251,.9); border-bottom-color: var(--line); }
.brand, .primary-nav a:hover, .nav-link-button:hover { color: var(--paper); }
.brand-mark path { stroke: var(--paper); }
.app-body { background: radial-gradient(circle at 78% 0%, rgba(107,88,169,.09), transparent 28%), radial-gradient(circle at 8% 25%, rgba(0,143,156,.06), transparent 24%), var(--ink); }
.science-guide, .science-guide-grid article { color: var(--paper); background: #ffffff; }
.science-guide-header { background: linear-gradient(120deg, rgba(23,105,170,.08), rgba(107,88,169,.08)); }
.science-guide-footer { background: #eef3f9; }
.atlas-shell { background: linear-gradient(120deg, rgba(255,255,255,.98), rgba(237,243,250,.98)); }
.atlas-visual { background-image: linear-gradient(rgba(23,105,170,.065) 1px, transparent 1px), linear-gradient(90deg, rgba(23,105,170,.065) 1px, transparent 1px), radial-gradient(circle at 50% 45%, rgba(0,143,156,.1), transparent 62%), #edf3f9; }
.atlas-visual::after { border-color: rgba(23,105,170,.2); box-shadow: 0 0 70px rgba(107,88,169,.08), inset 0 0 45px rgba(0,143,156,.05); }
.observatory-section, .analysis-section, .vertex-section, .lab-section { background: #eef3f9; }
.observatory-shell, .lab-shell { background: #ffffff; }
.observatory-controls, .lab-toolbar { background: #e8eef7; }
.observatory-visual, .atlas-visual, .vertex-visual-wrap, .topology-graph-wrap { box-shadow: inset 0 0 60px rgba(23,105,170,.035); }
.analysis-card { background: #ffffff; }
.analysis-card .field input[type="text"], .analysis-card .field input[type="number"], .analysis-card textarea, .field select, .field input[type="number"], .observatory-control-group button, .observatory-control-group select { background: #f6f9fc; color: var(--paper); }
.analysis-output { color: #294766; background: #f5f8fc; }
.analysis-visual { background: linear-gradient(135deg, rgba(23,105,170,.07), rgba(107,88,169,.07)); }
.visual-metric { background: rgba(232,238,247,.7); }
.results-panel { background: #ffffff; }
.metrics-row div { background: #f1f5fa; }
.tab-list, .field select, .field input[type="number"] { background: #f6f9fc; }
.tab-list button.is-active { background: #dce8f4; color: var(--paper); }
.probability-track { background: rgba(23,55,91,.08); }
.probability-fill { background: linear-gradient(90deg, rgba(23,105,170,.35), var(--acid)); }
.amplitude-table thead { background: #e8eef7; }
.circuit-panel { background: rgba(232,238,247,.38); }
.gate-button, .circuit-gate { background: #f5f8fc; }
.button-secondary { background: #e5edf6; color: var(--paper); }
.button-primary { background: var(--acid); color: #ffffff; }
.button-primary:hover { background: #0f568d; }
.raw-details summary, .circuit-note, .engine-stack p { color: var(--muted); }
.app-footer { border-top-color: var(--line); color: var(--muted); }
.toast { border-color: rgba(23,105,170,.3); background: #ffffff; color: var(--paper); box-shadow: var(--shadow); }
.observatory-svg .qubit-node { fill: #dbe7f2; stroke: #6d87a2; }
.observatory-svg .graph-vertex, .atlas-scene .scene-node, .topology-graph .topology-vertex { fill: #ffffff; }
.observatory-svg .trace-node { fill: rgba(255,255,255,.92); }
.atlas-scene .scene-text, .topology-graph .topology-edge-label, .topology-graph .topology-phase-label { fill: var(--muted); }
.circuit-note { color: var(--muted); }
.wire { background: #9db1c7; }
.control-mark { background: var(--aqua); box-shadow: 0 0 10px rgba(0,143,156,.35); }
.probability-fill { background: linear-gradient(90deg, rgba(23,105,170,.35), var(--acid)); }
.amplitude-table thead { background: #e8eef7; }
.tab-list { background: #f6f9fc; }
.exact-badge { border-color: rgba(0,143,156,.3); }

/* Editorial restraint: information-dense scientific workstation scale. */
h1, h2 { letter-spacing: -0.025em; line-height: 1.02; }
h1 { max-width: 760px; font-size: clamp(38px, 4.5vw, 68px); }
.app-intro { padding-top: 38px; padding-bottom: 28px; }
.app-intro h1 { font-size: clamp(38px, 4.5vw, 68px); }
.app-intro > div > p:last-child { margin-top: 12px; font-size: 13px; }
.app-section-heading h2, .section-heading h2 { font-size: clamp(34px, 3.6vw, 54px); letter-spacing: -.02em; }
.section-heading { margin-bottom: 24px; }
.atlas-copy h2 { font-size: clamp(30px, 3.2vw, 46px); letter-spacing: -.02em; }
.atlas-copy { gap: 13px; padding: clamp(22px, 3vw, 38px); }
.analysis-card, .lab-shell, .observatory-shell, .atlas-shell { border-radius: 5px; box-shadow: 0 18px 45px rgba(28,54,84,.08); }
.analysis-card { padding: 17px; gap: 10px; }
.panel-title h3 { font-size: 12px; }
.field > span, .example-group > span, .gate-family { font-size: 8px; letter-spacing: .1em; }
.gate-button { min-height: 52px; border-radius: 4px; }
.gate-button strong { font-size: 13px; }
.button { min-height: 42px; padding: 0 15px; font-size: 12px; border-radius: 5px; }
.analysis-visual { min-height: 110px; padding: 12px; }
.analysis-visual strong { font-size: 15px; }
.observatory-controls { padding: 9px 13px; }
.observatory-svg { min-height: 390px; }
.observatory-footer { min-height: 38px; padding: 8px 13px; }
.science-guide-grid h3 { font-size: 20px; }
