/* The Four Pillars of Quantum Technology: interactive companion to the QuOT Lab poster.
   Design language: NeuroPal (glass panels; Space Grotesk, Inter, JetBrains Mono; Atkinson Hyperlegible option)
   on the poster's navy with its colour-blind-safe pillar colours. */

@font-face { font-family: "Space Grotesk"; src: url("../fonts/SpaceGrotesk-var.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-var.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-scale: 1;
  --r-window: 28px;
  --r-panel: 22px;
  --r-control: 999px;
  --r-small: 12px;
  --col: 46rem;
  --col-wide: 60rem;
  --gap: clamp(1rem, 3vw, 1.5rem);
  color-scheme: dark;
}

/* Night (default): the poster's own colours */
[data-theme="dark"] {
  --bg0: #060A20; --bg1: #0A0F2C; --bg2: #111A45;
  --text: #F5F7FF; --muted: #AEB8D6; --line: rgba(174, 184, 214, 0.22);
  --glass: rgba(21, 30, 78, 0.58); --glass-strong: rgba(24, 34, 88, 0.86);
  --glass-border: rgba(174, 184, 214, 0.18); --glass-hi: rgba(255, 255, 255, 0.07);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --p1: #3FD4BB; --p2: #FF2200; --p3: #B18AFF; --p4: #FFE45C;
  --alert: #FF2E63; --on-accent: #0A0F2C; --focus: #FFE45C;
}
/* Day: darker pillar tones keep text contrast >= 5:1 on white */
[data-theme="light"] {
  color-scheme: light;
  --bg0: #E9EDF8; --bg1: #F4F6FC; --bg2: #FFFFFF;
  --text: #0E1330; --muted: #444D74; --line: rgba(14, 19, 48, 0.14);
  --glass: rgba(255, 255, 255, 0.70); --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-border: rgba(14, 19, 48, 0.10); --glass-hi: rgba(255, 255, 255, 0.9);
  --shadow: 0 16px 40px rgba(30, 40, 90, 0.13);
  --p1: #0B7C6B; --p2: #C21A00; --p3: #6A3FD2; --p4: #8A6B00;
  --alert: #C4103F; --on-accent: #FFFFFF; --focus: #6A3FD2;
}
/* High contrast: no transparency, solid borders */
[data-theme="contrast"] {
  --bg0: #000; --bg1: #000; --bg2: #000;
  --text: #FFF; --muted: #F0F0F0; --line: #FFF;
  --glass: #000; --glass-strong: #000; --glass-border: #FFF; --glass-hi: transparent;
  --shadow: none;
  --p1: #5CFFE3; --p2: #FF7A5C; --p3: #D2B8FF; --p4: #FFF06B;
  --alert: #FF6B8E; --on-accent: #000; --focus: #FFF06B;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(106.25% * var(--text-scale)); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[data-motion="reduced"] { scroll-behavior: auto; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-body); font-size: 1rem; line-height: 1.55; font-weight: 400;
  color: var(--text); background: var(--bg1);
  background-image: radial-gradient(120% 70% at 50% -10%, var(--bg2) 0%, var(--bg1) 55%, var(--bg0) 100%);
  background-attachment: fixed;
  font-feature-settings: "cv05" 1, "ss01" 0;
  overflow-x: hidden;
}
[data-readable="1"] { --font-display: "Atkinson Hyperlegible", var(--font-body); --font-body: "Atkinson Hyperlegible", ui-sans-serif, system-ui, sans-serif; }
[data-readable="1"] body { letter-spacing: 0.01em; word-spacing: 0.04em; line-height: 1.65; }

/* Slow aurora in the pillar colours; frozen for reduced motion */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: 0.16; animation: drift 46s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: var(--p1); left: -25vmax; top: 10vh; }
.aurora span:nth-child(2) { background: var(--p3); right: -28vmax; top: 35vh; animation-duration: 58s; animation-delay: -12s; }
.aurora span:nth-child(3) { background: var(--p4); left: 10vw; bottom: -40vmax; opacity: 0.08; animation-duration: 64s; animation-delay: -30s; }
[data-theme="light"] .aurora span { opacity: 0.12; }
[data-theme="contrast"] .aurora { display: none; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(8vmax, -6vmax, 0) scale(1.15); } }
[data-motion="reduced"] .aurora span { animation: none; }

/* Typography */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.018em; margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 8.2vw, 3.6rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.45rem, 4.6vw, 1.95rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; max-width: 65ch; text-wrap: pretty; }
p + p { margin-top: 0.8em; }
a { color: inherit; text-underline-offset: 0.18em; }
strong { font-weight: 650; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.7rem 1rem; border-radius: var(--r-small); background: var(--focus); color: var(--on-accent); font-weight: 700; text-decoration: none; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* Glass */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: var(--r-panel);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
[data-theme="contrast"] .glass { border-width: 2px; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.6rem max(1rem, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg1) 72%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.brand b { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -0.01em; }
.brand span { font-size: 0.78rem; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Controls */
button, .btn { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 44px; padding: 0.55rem 1.05rem; border-radius: var(--r-control);
  border: 1px solid var(--glass-border); background: var(--glass-strong);
  font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { border-color: var(--accent, var(--muted)); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent, var(--p1)); color: var(--on-accent); border-color: transparent; }
.btn.small { min-height: 38px; padding: 0.35rem 0.8rem; font-size: 0.88rem; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.icon-btn { width: 44px; height: 44px; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 22px; border: 1px solid var(--glass-border); background: var(--glass); margin: 0; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 36px; padding: 0.3rem 0.85rem; border-radius: var(--r-control); font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.seg input:checked + span { background: var(--accent, var(--p1)); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.lang-seg span { min-height: 34px; padding: 0.25rem 0.7rem; }

.switch { display: inline-flex; align-items: center; gap: 0.7rem; min-height: 44px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font-weight: 600; }
.switch .track { flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; transition: background-color 0.2s; border: 1px solid var(--glass-border); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform 0.2s; }
.switch[aria-checked="true"] .track { background: var(--accent, var(--p1)); }
.switch[aria-checked="true"] .track::after { transform: translateX(20px); background: var(--on-accent); }
[data-motion="reduced"] .switch .track, [data-motion="reduced"] .switch .track::after { transition: none; }

.field { display: grid; gap: 0.35rem; }
.field label, .field .label { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; font-size: 0.93rem; }
.field output { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent, var(--p1)); font-weight: 600; white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; touch-action: pan-y; --fill: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--accent, var(--p1)) var(--fill), var(--line) var(--fill)); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--accent, var(--p1)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--accent, var(--p1)); border: 3px solid var(--bg2); box-shadow: 0 0 0 1px var(--glass-border), 0 4px 14px rgba(0,0,0,0.35); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent, var(--p1)); border: 3px solid var(--bg2); }
input[type="range"]:disabled { opacity: 0.4; cursor: not-allowed; }

/* Layout */
main { display: block; padding: 0 max(1rem, env(safe-area-inset-left, 0px)) 3rem; outline: none; }
.wrap { max-width: var(--col); margin: 0 auto; }
.wrap-wide { max-width: var(--col-wide); margin: 0 auto; }
section { margin-top: clamp(2.2rem, 7vw, 3.4rem); }
.stack > * + * { margin-top: var(--gap); }

/* Hub */
.hub-head { padding-top: clamp(1.8rem, 7vw, 3.4rem); }
.hub-head p.lead { font-size: 1.12rem; color: var(--muted); margin-top: 0.9rem; }
.event { display: inline-block; margin-bottom: 1rem; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.portals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.7rem, 2.6vw, 1.4rem); margin-top: 1.6rem; }
.portal { --accent: var(--p1); display: flex; flex-direction: column; text-decoration: none; border-radius: var(--r-window); padding: 0.45rem 0.45rem 0.9rem; transition: border-color 0.2s; }
.portal:hover { border-color: var(--accent); }
.portal .window { position: relative; border-radius: calc(var(--r-window) - 8px); overflow: hidden; background: #111A45; aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.portal canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.portal .meta { display: block; padding: 0.75rem 0.45rem 0; }
.portal .window .badge { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.portal h2 { font-size: clamp(0.98rem, 4.1vw, 1.35rem); line-height: 1.15; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.portal p { font-size: clamp(0.82rem, 2.8vw, 0.95rem); color: var(--muted); margin-top: 0.3rem; }
.p1 { --accent: var(--p1); } .p2 { --accent: var(--p2); } .p3 { --accent: var(--p3); } .p4 { --accent: var(--p4); }

/* Pillar number badges: shape encodes the pillar as well as colour */
.badge { flex: none; display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--accent); color: var(--on-accent); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.badge.s1 { border-radius: 50%; }
.badge.s2 { border-radius: 26%; }
.badge.s3 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); width: 2.4rem; height: 2.4rem; }
.badge.s4 { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); width: 2.35rem; }
.badge.big { width: 3rem; height: 3rem; font-size: 1.45rem; }
.badge.big.s3 { width: 3.4rem; height: 3.4rem; }
.badge.big.s4 { width: 3.3rem; }

.timeline { display: grid; grid-template-columns: auto 1fr auto; gap: 0.2rem 1rem; align-items: center; padding: 1rem 1.2rem; margin-top: 1.4rem; }
.timeline .era { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.timeline .era.now { color: var(--p1); }
.timeline .line { height: 2px; background: linear-gradient(to right, var(--muted), var(--p1)); border-radius: 2px; }
.timeline small { color: var(--muted); font-size: 0.82rem; grid-column: span 1; }

/* Toolbox */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: var(--gap); margin-top: 1.2rem; }
.tool { padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; --accent: var(--p1); }
.tool h3 { font-size: 1.1rem; }
.tool .sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }
.tool canvas { width: 100%; display: block; border-radius: var(--r-small); background: #111A45; }
.tool .tally { font-size: 0.85rem; color: var(--muted); min-height: 1.4em; }
.tool .explain { font-size: 0.9rem; }

/* Pillar page */
.crumbs { padding-top: 1.1rem; }
.pillar-head { display: flex; gap: 1rem; align-items: center; margin-top: 1.2rem; }
.pillar-head h1 { font-size: clamp(1.8rem, 7vw, 3rem); color: var(--text); }
.pillar-head p { color: var(--muted); font-size: 1.08rem; margin-top: 0.35rem; }
.hero-window { position: relative; margin-top: 1.4rem; border-radius: var(--r-window); overflow: hidden; background: #111A45; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: var(--shadow); aspect-ratio: 1; max-height: 78vh; margin-inline: auto; }
.hero-window canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-caption { margin-top: 0.9rem; color: var(--muted); }
.stage { position: relative; border-radius: 14px; overflow: hidden; background: #111A45; }
.stage canvas.sim { border-radius: 0; }
.stage .canvas-ctl { right: auto; bottom: auto; left: 0.5rem; top: 0.5rem; }
.stage .canvas-ctl .btn { width: 40px; height: 40px; min-height: 40px; }
.canvas-ctl { position: absolute; right: 0.7rem; bottom: 0.7rem; z-index: 2; }
.canvas-ctl .btn { background: rgba(10, 15, 44, 0.72); color: #F5F7FF; border-color: rgba(174, 184, 214, 0.3); }
.big-fact { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; margin-top: 1.3rem; }
.big-fact b { font-family: var(--font-display); font-size: clamp(2.3rem, 9vw, 3.4rem); line-height: 1; color: var(--accent); letter-spacing: -0.03em; white-space: nowrap; }
.big-fact span { flex: 1 1 14rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.chips li { padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); font-size: 0.9rem; font-weight: 550; }

.bench { padding: clamp(1rem, 3.5vw, 1.6rem); }
.bench > * + * { margin-top: 1rem; }
.bench h2 { font-size: clamp(1.3rem, 4.2vw, 1.65rem); }
.bench canvas.sim { width: 100%; display: block; border-radius: var(--r-small); background: #111A45; touch-action: pan-y; }
.bench .controls { display: grid; gap: 0.9rem; }
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.panels figure { margin: 0; }
.panels canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 10px; background: #111A45; image-rendering: pixelated; }
.panels figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.3; }
.panels figure.drawable canvas { cursor: crosshair; outline: 2px dashed var(--accent); outline-offset: 2px; touch-action: none; }
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr)); gap: 0.5rem; margin: 0; }
.readouts div { padding: 0.55rem 0.75rem; border-radius: var(--r-small); background: color-mix(in srgb, var(--bg2) 55%, transparent); border: 1px solid var(--line); }
.readouts dt { font-size: 0.78rem; color: var(--muted); line-height: 1.25; }
.readouts dd { margin: 0.15rem 0 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 600; }
.tip { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 0.9rem; color: var(--text); }
details.deeper { border-top: 1px solid var(--line); padding-top: 0.8rem; }
details.deeper summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
details.deeper p { margin-top: 0.5rem; }

.status { padding: 0.75rem 0.95rem; border-radius: var(--r-small); font-weight: 600; border: 1px solid var(--line); }
.status.ok { border-color: var(--accent); }
.status.bad { border-color: var(--alert); color: var(--alert); }
.meter { position: relative; margin-top: 1.9rem; height: 16px; border-radius: 999px; background: var(--line); overflow: visible; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); width: 0; transition: width 0.25s; }
.meter .fill.bad { background: var(--alert); }
.meter .mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); }
.meter .mark span { position: absolute; top: -1.45rem; left: 50%; transform: translateX(-50%); font-size: 0.75rem; white-space: nowrap; color: var(--muted); }
[data-motion="reduced"] .meter .fill { transition: none; }
.keys { font-family: var(--font-mono); font-size: 0.95rem; letter-spacing: 0.08em; word-break: break-all; line-height: 1.7; }
.keys .err { color: var(--alert); text-decoration: underline wavy; text-underline-offset: 3px; }
table.rounds { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
table.rounds th { text-align: center; font-weight: 600; color: var(--muted); padding: 0.3rem 0.2rem; border-bottom: 1px solid var(--line); font-size: 0.75rem; line-height: 1.2; }
table.rounds td { text-align: center; padding: 0.28rem 0.2rem; font-family: var(--font-mono); border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
table.rounds td.x { color: var(--muted); }
table.rounds td.bad { color: var(--alert); font-weight: 700; }
.table-scroll { overflow-x: auto; }

.gates { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.45rem; }
.gates .btn { min-height: 48px; padding: 0.3rem; font-family: var(--font-display); font-size: 1.15rem; }
.hist { display: grid; grid-template-columns: auto 1fr auto; gap: 0.35rem 0.7rem; align-items: center; font-size: 0.9rem; }
.hist .bar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.hist .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.3s; }
.hist .bar.alt i { background: var(--muted); }
[data-motion="reduced"] .hist .bar i { transition: none; }
.circuit { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; font-family: var(--font-mono); font-size: 0.9rem; min-height: 2rem; }
.circuit .g { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 6px; border: 1.5px solid var(--accent); font-weight: 700; font-family: var(--font-display); }
.circuit .wire { width: 0.7rem; height: 2px; background: var(--muted); }

.scale-track { position: relative; height: 18px; border-radius: 999px; background: var(--line); margin: 2.4rem 0 1.8rem; }
.scale-track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.scale-track .tick { position: absolute; top: -7px; bottom: -7px; width: 2px; background: var(--muted); }
.scale-track .tick span { position: absolute; left: 50%; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.scale-track .tick.up span { bottom: calc(100% + 3px); }
.scale-track .tick.down span { top: calc(100% + 3px); }

.stepper { display: grid; gap: 1rem; }
.stepper .scene { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; align-items: center; min-height: 6.5rem; }
.stepper svg { width: 5.5rem; height: 5.5rem; }
.stepper .dots { display: flex; gap: 0.4rem; }
.stepper .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.stepper .dots i.on { background: var(--accent); }

.experts { padding: 1.1rem 1.2rem; }
.experts math { font-size: clamp(1.05rem, 4.4vw, 1.22rem); display: block; margin: 0.45rem 0 0.2rem; overflow-x: auto; overflow-y: hidden; padding: 0.3rem 0; }
.lab { padding: 1.1rem 1.2rem; border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.lab h2 { font-size: 1.3rem; }
.pager { display: flex; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }

/* Settings dialog */
dialog.sheet { width: min(34rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); padding: 0; color: var(--text); background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-panel); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
dialog.sheet::backdrop { background: rgba(3, 6, 20, 0.55); }
[data-theme="contrast"] dialog.sheet { background: #000; border: 2px solid #FFF; }
.sheet-inner { padding: 1.2rem 1.25rem 1.3rem; display: grid; gap: 1.15rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sheet .setting { display: grid; gap: 0.45rem; }
.sheet .setting > .label { font-weight: 650; }
.sheet .note { font-size: 0.85rem; color: var(--muted); }
.seg.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.seg.grid5 span { justify-content: center; padding: 0.3rem 0.2rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend svg { width: 28px; height: 12px; flex: none; }

footer.site { margin-top: 4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
footer.site p + p { margin-top: 0.5rem; }

@media (min-width: 760px) {
  html { font-size: calc(112.5% * var(--text-scale)); }
  .hero-window { max-width: 38rem; }
  .gates .btn { font-size: 1.25rem; }
}
@media (min-width: 900px) {
  .portals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .panels { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .gates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } }
