/* =====================================================================
   NAME project site. Dark-first "instrument panel" theme.
   Colour carries meaning everywhere:
     cyan    = communication, links, SNR
     amber   = sensing, sensed tracks
     magenta = prediction, forecast
   ===================================================================== */

:root {
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #070b10;
  --bg-2: #0a1017;
  --panel: #0d141c;
  --panel-2: #111a24;
  --line: #1b2734;
  --line-2: #2a3a4c;
  --text: #dfe7f0;
  --muted: #93a3b6;
  --faint: #5d6d82;
  --screen: #05080c;            /* media wells stay dark in both themes */

  --cyan: #38d6f0;
  --cyan-2: #8fb6c4;
  --amber: #ffb840;
  --magenta: #ff52c4;
  --ctrl: #6f7f94;

  --tok-key: #9fb0c8;
  --tok-str: #e7dcc8;
  --tok-num: #ffb3e6;
  --tok-com: #5f7088;
  --tok-kw: #b9a7ff;
  --tok-zone: #8fb8ff;
  --tok-role: #c9a8ff;
  --tok-itin: #a6e3a1;

  --radius: 10px;
  --radius-s: 6px;
  --nav-h: 56px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.7);
  --grid-dot: rgba(120,150,180,.07);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-2: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --line: #dde3ea;
  --line-2: #c7d0db;
  --text: #0d1621;
  --muted: #4d5d70;
  --faint: #7c8a9b;
  --screen: #070b10;

  --cyan: #0a8aa8;
  --cyan-2: #5b7f8d;
  --amber: #b26a00;
  --magenta: #c2168b;
  --ctrl: #8593a4;

  --tok-key: #43566e;
  --tok-str: #6b4a1a;
  --tok-num: #a8136f;
  --tok-com: #8796a8;
  --tok-kw: #5b3fd1;
  --tok-zone: #1f5fc4;
  --tok-role: #7a3fc4;
  --tok-itin: #2c7a2a;

  --shadow: 0 1px 2px rgba(10,20,30,.06), 0 12px 30px -20px rgba(10,20,30,.25);
  --grid-dot: rgba(40,60,90,.07);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
em { font-style: italic; }
code, pre, .mono { font-family: var(--font-mono); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.c-cyan { color: var(--cyan); }
.c-cyan-2 { color: var(--cyan-2); }
.c-amber { color: var(--amber); }
.c-magenta { color: var(--magenta); }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-mono); font-size: 15px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 6px; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-tools { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: none; }
[data-theme="light"] .i-sun { display: none; }
[data-theme="light"] .i-moon { display: block; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav-tools { margin-left: auto; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; gap: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 14px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 10px 6px; font-size: 16px; }
}

/* ------------------------------------------------------------------ buttons, badges */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 15px; font-weight: 550;
}
.btn:hover { text-decoration: none; border-color: var(--cyan); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #04121a; }
.btn-primary:hover { filter: brightness(1.08); }
.btn[aria-disabled="true"] { cursor: default; }
.btn .tbd { margin-left: 2px; }
.tbd {
  display: inline-block; font: 600 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 6px; border-radius: 4px; border: 1px dashed currentColor; color: var(--magenta); opacity: .9; white-space: nowrap;
}
.btn-primary .tbd { color: #04121a; }
.mini-btn {
  margin-left: auto; font: 500 12px/1 var(--font-mono); padding: 6px 9px; border-radius: 5px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer;
}
.mini-btn:hover { color: var(--text); border-color: var(--cyan); }
.badges { display: inline-flex; gap: 6px; margin-left: auto; }
.badge { display: inline-block; font: 600 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 4px; }
.badge-ph { color: var(--magenta); border: 1px dashed var(--magenta); }
.badge-ill { color: var(--amber); border: 1px solid var(--amber); }

/* ------------------------------------------------------------------ panels */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 12px;
  border-bottom: 1px solid var(--line); background: var(--panel-2);
  font: 500 12px/1.2 var(--font-mono); color: var(--muted); letter-spacing: .03em; flex-wrap: wrap;
}
.panel-title { text-transform: uppercase; letter-spacing: .08em; }
.panel-head .badges + .led, .panel-head .mini-btn + .led { margin-left: 0; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-left: auto; flex: none; }
.panel-head .badges ~ .led, .panel-head .mini-btn ~ .led, .panel-head .seg ~ .led { margin-left: 0; }
.is-live .led, .step.is-active .led { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.legend-inline { display: inline-flex; gap: 10px; align-items: center; font-size: 11px; flex-wrap: wrap; }
.legend-inline i { font-style: normal; }

.media { position: relative; background: var(--screen); overflow: hidden; }
.media-16x9 { aspect-ratio: 16 / 9; }
.media-square { aspect-ratio: 1 / 1; }
.media video, .media img { width: 100%; height: 100%; object-fit: cover; }

/* missing-asset state */
.fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(127,140,160,.06) 10px 20px), var(--screen);
  color: #8b9bb0; font: 12px/1.5 var(--font-mono); z-index: 3;
}
.fallback b { display: block; color: #c9d3de; font-size: 13px; margin-bottom: 2px; }
.demo-fallback {
  position: relative; inset: auto; min-height: 140px; border-radius: var(--radius); border: 1px dashed var(--line-2); margin: 12px 0;
}
.is-loading .led { background: var(--amber); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ------------------------------------------------------------------ hero */
.hero { padding: clamp(36px, 7vw, 84px) 0 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px/1 var(--font-mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); padding: 7px 10px; border-radius: 999px; background: var(--panel); }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.hero h1 { font-size: clamp(2.05rem, 5.2vw, 3.9rem); font-weight: 720; margin: 18px 0 18px; max-width: 18ch; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--amber) 55%, var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.16rem); color: var(--muted); max-width: 70ch; }
.lede em { color: var(--text); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 36px; }

.pipeline { display: grid; grid-template-columns: minmax(0, 5fr) 34px minmax(0, 7fr); gap: 0; align-items: stretch; }
.pipe-col { display: flex; flex-direction: column; min-width: 0; }
.step { transition: border-color .4s; }
.step.is-active { border-color: color-mix(in srgb, var(--cyan) 55%, var(--line)); }
.step-n { color: var(--cyan); font-weight: 700; }
.prompt-box { display: flex; gap: 10px; padding: 14px 16px; min-height: 92px; }
.prompt-glyph { color: var(--cyan); font-family: var(--font-mono); font-weight: 700; }
.prompt-text { margin: 0; font-size: 16px; line-height: 1.5; }
.prompt-text.typing::after, .code-program.typing code::after { content: "\258C"; color: var(--cyan); animation: blink .9s steps(1) infinite; margin-left: 1px; }
.step-program { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.code-program { flex: 1; margin: 0; max-height: 360px; min-height: 200px; }
.pipe-arrow { position: relative; height: 34px; display: flex; align-items: center; padding-left: 26px; }
.pipe-arrow::before { content: ""; position: absolute; left: 24px; top: 4px; bottom: 4px; border-left: 1px dashed var(--line-2); }
.pipe-arrow::after { content: ""; position: absolute; left: 20.5px; bottom: 2px; border: 4px solid transparent; border-top: 6px solid var(--line-2); }
.pipe-arrow span { font: 11px/1 var(--font-mono); color: var(--faint); padding-left: 14px; }
.pipe-arrow-side { height: auto; padding: 0; justify-content: center; }
.pipe-arrow-side::before { left: 4px; right: 4px; top: 50%; bottom: auto; border-left: 0; border-top: 1px dashed var(--line-2); }
.pipe-arrow-side::after { left: auto; right: 0; bottom: auto; top: calc(50% - 4px); border: 4px solid transparent; border-left: 6px solid var(--line-2); }
.pipe-arrow-side span { position: absolute; writing-mode: vertical-rl; transform: rotate(180deg); padding: 0; top: 10%; background: var(--bg); line-height: 1.6; }
.step-scene { display: flex; flex-direction: column; align-self: start; width: 100%; }
.step-scene .media { flex: 1; }

.stats { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.stats li { padding: 16px 16px; border-right: 1px solid var(--line); }
.stats li:last-child { border-right: 0; }
.stats b { display: block; font: 700 1.55rem/1.1 var(--font-mono); color: var(--text); margin-bottom: 6px; }
.stats span { color: var(--muted); font-size: 13.5px; line-height: 1.4; display: block; }

/* ------------------------------------------------------------------ sections */
.section { padding: clamp(56px, 9vw, 110px) 0 0; }
.sec-head { max-width: 760px; margin-bottom: 28px; }
.kicker { display: flex; align-items: center; gap: 10px; font: 600 12.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.kicker span { color: var(--cyan); border: 1px solid var(--line-2); border-radius: 4px; padding: 4px 6px; }
.sec-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; margin-bottom: 14px; }
.sec-head p { color: var(--muted); font-size: 1.04rem; }

/* ------------------------------------------------------------------ code */
.code {
  margin: 0; padding: 14px 16px; overflow: auto; font-size: 12.8px; line-height: 1.6; color: var(--text);
  background: var(--panel); tab-size: 4; -webkit-overflow-scrolling: touch;
}
.code code { white-space: pre; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-kw { color: var(--tok-kw); }
.tok-fn { color: var(--cyan); }
.tok-flag { color: var(--amber); }
.tok-zone { color: var(--tok-zone); }
.tok-role { color: var(--tok-role); }
.tok-itin { color: var(--tok-itin); }
.code .tok-zone.v, .code .tok-role.v, .code .tok-itin.v { background: color-mix(in srgb, currentColor 12%, transparent); border-radius: 3px; }
.legend-inline .tok-zone, .legend-inline .tok-role, .legend-inline .tok-itin { padding: 2px 5px; border-radius: 3px; background: color-mix(in srgb, currentColor 14%, transparent); }

.code-block { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; color: var(--muted); }
.copy-btn { margin-left: auto; font: 500 12px/1 var(--font-mono); padding: 7px 10px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--cyan); }
.copy-btn.is-done { color: var(--cyan); border-color: var(--cyan); }
.code-block .code { flex: 1; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dots i:nth-child(1) { background: var(--magenta); opacity: .7; }
.dots i:nth-child(2) { background: var(--amber); opacity: .7; }
.dots i:nth-child(3) { background: var(--cyan); opacity: .7; }

/* ------------------------------------------------------------------ 2. levels (peel-apart) */
.peel-track { height: 260vh; position: relative; }
.peel-sticky { position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h)); display: flex; align-items: center; overflow: hidden; }
.peel-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 28px; align-items: center; }
.peel-copy { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.peel-copy li { display: flex; gap: 14px; padding: 14px; border-radius: var(--radius); border: 1px solid transparent; opacity: .45; transition: opacity .35s, border-color .35s, background .35s; }
.peel-copy li.is-on { opacity: 1; border-color: var(--line); background: var(--panel); }
.peel-copy h3 { font-size: 1.05rem; margin-bottom: 4px; }
.peel-copy p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.lvl-n { font: 700 12px/1 var(--font-mono); color: var(--cyan); border: 1px solid var(--line-2); border-radius: 4px; padding: 5px 6px; height: fit-content; }
.peel-copy li[data-level="semantic"] .lvl-n { color: var(--tok-zone); }
.peel-copy li[data-level="physical"] .lvl-n { color: var(--text); }
.peel-copy li[data-level="network"] .lvl-n { color: var(--amber); }

.peel-viewport { position: relative; perspective: 1700px; perspective-origin: 50% 30%; display: grid; place-items: center; min-height: 0; }
.peel { --p: 0; --gap: 150px; }
.peel-stage {
  --sep: calc(var(--p) * var(--gap));
  position: relative; width: 100%; aspect-ratio: 16 / 9; transform-style: preserve-3d;
  transform: translateY(calc(var(--p) * 8%)) rotateX(calc(var(--p) * 56deg)) rotateZ(calc(var(--p) * -28deg)) scale(calc(1 - var(--p) * 0.2));
  will-change: transform;
}
.plane {
  position: absolute; inset: 0; border-radius: 8px; overflow: visible;
  transform: translateZ(calc(var(--i) * var(--sep)));
  border: 1px solid color-mix(in srgb, var(--cyan) calc(var(--p) * 60%), var(--line-2));
  background: var(--screen);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
}
.plane > img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.plane[data-i="1"], .plane[data-i="2"] { opacity: calc(1 - var(--p) * 0.22); }
.plane[data-i="1"] > img, .plane[data-i="2"] > img { mix-blend-mode: normal; }
.plane-label {
  position: absolute; left: 0; top: 0; transform: translate(0, -120%); white-space: nowrap;
  font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px;
  background: var(--panel); border: 1px solid var(--line-2); opacity: calc(var(--p) * 1.4 - .2);
}
.plane[data-level="semantic"] .plane-label { color: var(--tok-zone); }
.plane[data-level="physical"] .plane-label { color: var(--text); }
.plane[data-level="network"] .plane-label { color: var(--amber); }
.mark { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--amber); opacity: calc(var(--p) * 1.5 - .3); }
.mark.ap { border-color: var(--cyan); border-radius: 2px; transform: rotate(45deg); }
.mark-label { position: absolute; transform: translate(10px, -50%); font: 600 10.5px/1 var(--font-mono); color: #fff; background: rgba(5,8,12,.75); padding: 3px 4px; border-radius: 3px; white-space: nowrap; opacity: calc(var(--p) * 1.5 - .4); pointer-events: none; }
.peel-links { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(0); pointer-events: none; }
.link-line {
  position: absolute; width: 0; height: calc(2 * var(--sep)); transform-origin: 50% 0; transform: rotateX(90deg);
  border-left: 1.5px dashed var(--amber); opacity: calc(var(--p) * 1.3 - .25);
}
.link-line.ap { border-left-color: var(--cyan); }
.peel-hint { position: absolute; bottom: -34px; left: 50%; transform: translateX(-50%); font: 11px/1 var(--font-mono); color: var(--faint); letter-spacing: .2em; text-transform: uppercase; margin: 0; opacity: calc(1 - var(--p) * 3); }
.peel.is-static .peel-track { height: auto; }
.peel.is-static .peel-sticky { position: relative; top: 0; height: auto; padding: 150px 0 60px; }

.slots-panel { margin-top: 24px; }
.slots { display: grid; grid-template-columns: repeat(var(--n, 40), minmax(0, 1fr)); gap: 3px; padding: 18px 14px 6px; }
.slot { height: 34px; border-radius: 3px; background: color-mix(in srgb, var(--cyan) 70%, transparent); position: relative; cursor: default; transition: transform .15s; }
.slot.sense { background: var(--amber); }
.slot.ctrl { background: var(--ctrl); }
.slot:hover, .slot:focus-visible { transform: scaleY(1.18); outline: none; box-shadow: 0 0 0 2px var(--text); }
.slot[data-tick]::after { content: attr(data-tick); position: absolute; top: 40px; left: 0; font: 10px/1 var(--font-mono); color: var(--faint); }
.slot-readout { padding: 16px 14px 12px; margin: 0; font-size: 12.5px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin: 0 3px 0 6px; }
.sw-data { background: color-mix(in srgb, var(--cyan) 70%, transparent); }
.sw-sense { background: var(--amber); }
.sw-ctrl { background: var(--ctrl); }

/* ------------------------------------------------------------------ 3. scrubber */
.scrub-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; }
.scrub-media .overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.scrub-media video { object-fit: contain; }
.scrub-side { border-left: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.readouts { display: grid; gap: 8px; }
.ro { display: grid; grid-template-columns: 38px 1fr auto; align-items: baseline; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); }
.ro-k { font: 600 11px/1 var(--font-mono); color: var(--muted); }
.ro.c-cyan .ro-k { color: var(--cyan); }
.ro.c-cyan-2 .ro-k { color: var(--cyan-2); }
.ro-v { font-size: 20px; font-weight: 650; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.ro-u { font: 11px/1 var(--font-mono); color: var(--faint); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; }
.ln { display: inline-block; width: 22px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.ln-true { border-color: #e6edf5; }
.ln-sensed { border-color: var(--amber); border-top-style: dotted; border-top-width: 3px; }
.ln-forecast { border-color: var(--magenta); }
.ln-ap9 { border-color: var(--cyan); }
.ln-ap1 { border-color: var(--cyan-2); border-top-style: dashed; margin-left: 6px; }
.chart { border-top: 1px solid var(--line); height: 170px; position: relative; }
.chart svg { width: 100%; height: 100%; }
.chart .grid line { stroke: var(--line); }
.chart .axis-t { fill: var(--faint); font: 10.5px var(--font-mono); }
.chart .s-ap9 { stroke: var(--cyan); fill: none; stroke-width: 2; }
.chart .s-ap1 { stroke: var(--cyan-2); fill: none; stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart .ghost { opacity: .25; }
.chart .cursor { stroke: var(--text); stroke-width: 1; }
.chart .event { stroke: var(--amber); stroke-dasharray: 3 3; }
.chart .event-t { fill: var(--amber); font: 10.5px var(--font-mono); }
.scrub-controls { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }
.scrub-controls .mini-btn { margin-left: 0; }
.play-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--cyan); background: transparent; color: var(--cyan); cursor: pointer; }
.play-btn svg { width: 18px; height: 18px; fill: currentColor; }
.play-btn .i-pause { display: none; }
.play-btn.is-playing .i-play { display: none; }
.play-btn.is-playing .i-pause { display: block; }
.range-wrap { position: relative; flex: 1; min-width: 0; }
.range-marks { position: absolute; left: 0; right: 0; top: 0; bottom: 0; pointer-events: none; }
.range-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--amber); border-radius: 1px; }
.range-mark span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font: 10px/1.4 var(--font-mono); color: var(--amber); white-space: nowrap; }

/* range inputs */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan) var(--fill, 0%), var(--line-2) var(--fill, 0%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--cyan); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 35%, transparent); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 35%, transparent); }

/* overlay strokes */
.overlay .trk { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.overlay .trk-true { stroke: #e6edf5; stroke-width: 2; opacity: .85; }
.overlay .trk-sensed { stroke: #ffb840; stroke-width: 3; stroke-dasharray: 0.5 6; }
.overlay .trk-forecast { stroke: #ff52c4; stroke-width: 2; opacity: .7; }
.overlay .fc-arrow { stroke: #ff52c4; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.overlay .pt-true { fill: #e6edf5; }
.overlay .pt-sensed { fill: none; stroke: #ffb840; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.overlay .pt-forecast { fill: #ff52c4; }

/* ------------------------------------------------------------------ 4. body */
.body-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 20px; align-items: start; }
.wipe-frame { display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto 22px; padding: 14px 14px 4px 6px; }
.axis { font: 11px/1 var(--font-mono); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.axis-y { writing-mode: vertical-rl; transform: rotate(180deg); }
.axis-x { grid-column: 2; }
.wipe { --pos: 50%; position: relative; background: var(--screen); border-radius: 4px; overflow: hidden; user-select: none; touch-action: pan-y; aspect-ratio: 5 / 3; }
.wipe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
#wipe-sim { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.wipe-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.6); pointer-events: none; z-index: 2; }
.wipe-handle span { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(5,8,12,.8); border: 2px solid #fff; }
.wipe-handle span::before, .wipe-handle span::after { content: ""; position: absolute; top: 50%; border: 5px solid transparent; transform: translateY(-50%); }
.wipe-handle span::before { left: 3px; border-right-color: #fff; }
.wipe-handle span::after { right: 3px; border-left-color: #fff; }
.wipe:focus-within .wipe-handle span { box-shadow: 0 0 0 4px rgba(56,214,240,.6); }
.wipe input[type="range"] { position: absolute; inset: 0; height: 100%; opacity: 0; z-index: 3; cursor: ew-resize; }
.wipe-tag { position: absolute; top: 8px; z-index: 2; font: 600 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: #fff; background: rgba(5,8,12,.7); padding: 5px 7px; border-radius: 4px; pointer-events: none; }
.wipe-tag-l { left: 8px; }
.wipe-tag-r { right: 8px; }
.wipe-panel figcaption { padding: 4px 16px 14px; color: var(--muted); font-size: 14px; }
.wipe-panel { margin: 0; }
.seg { display: inline-flex; margin-left: auto; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 5px 9px; font: 500 11.5px/1 var(--font-mono); color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--cyan); color: #04121a; }
.body-media img { position: absolute; inset: 0; object-fit: contain; opacity: 0; transition: opacity .35s; }
.body-media img.is-on { opacity: 1; }
.metric { padding: 14px 16px 16px; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.metric-v { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
.metric-k { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ 5. gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); gap: 18px; position: relative; }
.card { perspective: 1400px; height: 330px; }
.card-inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card.is-flipped .card-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.face-back { transform: rotateY(180deg); }
.card-hit { position: absolute; inset: 0; z-index: 4; border: 0; background: transparent; cursor: pointer; border-radius: var(--radius); }
.card:hover .face-front, .card:focus-within .face-front { border-color: var(--line-2); }
.face-front .media { aspect-ratio: 16 / 9; flex: none; }
.face-front .media video { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; }
.face-front .media video.is-playing { opacity: 1; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.04rem; font-weight: 650; margin: 0; }
.card-stats { display: flex; gap: 14px; font: 12.5px/1 var(--font-mono); color: var(--muted); flex-wrap: wrap; }
.card-stats b { color: var(--text); font-weight: 650; }
.card-flip-hint { margin-top: auto; font: 11.5px/1 var(--font-mono); color: var(--faint); display: flex; justify-content: space-between; }
.face-back .panel-head { flex: none; }
.face-back .code { flex: 1; font-size: 11.5px; padding: 10px 12px; background: var(--panel); }
.back-meta { flex: none; border-top: 1px solid var(--line); padding: 8px 12px 10px; display: grid; gap: 6px; font-size: 12px; background: var(--panel-2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font: 11px/1 var(--font-mono); padding: 4px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }
.chip.zone { color: var(--tok-zone); }
.chip.role { color: var(--tok-role); }
.card-back-btn { position: relative; z-index: 5; }
.card.is-flipped .card-hit { display: none; }
.card-own .face { border-style: dashed; border-color: var(--line-2); align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 10px; background: transparent; }
.card-own a { position: absolute; inset: 0; z-index: 2; border-radius: var(--radius); }
.card-own .plus { width: 54px; height: 54px; border-radius: 50%; border: 1px dashed var(--cyan); display: grid; place-items: center; color: var(--cyan); font: 300 30px/1 var(--font-sans); }
.card-own h3 { font-size: 1.05rem; }
.card-own p { margin: 0; color: var(--muted); font-size: 14px; }
.card-own:hover .face { border-color: var(--cyan); }

/* ------------------------------------------------------------------ 6. studies */
.study { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 22px; align-items: start; margin-bottom: 56px; }
.study h3 { font-size: 1.3rem; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.q { font: 700 12px/1 var(--font-mono); color: var(--magenta); border: 1px solid var(--line-2); padding: 5px 6px; border-radius: 4px; flex: none; transform: translateY(-2px); }
.study-text { color: var(--muted); }
.study-text b { color: var(--text); }
.study-code { position: sticky; top: calc(var(--nav-h) + 16px); }
.study-code .code { max-height: 520px; }
.cx-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; padding: 16px; }
.cx-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.cx-cell { aspect-ratio: 1; border-radius: 3px; border: 1px solid var(--line); background: transparent; padding: 0; cursor: pointer; position: relative; }
.cx-cell.better { background: color-mix(in srgb, var(--magenta) calc(35% + var(--s, 0) * 65%), transparent); border-color: transparent; }
.cx-cell.worse { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) calc(30% + var(--s, 0) * 60%), transparent) 0 2px, transparent 2px 5px); border-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.cx-cell.same { background: var(--panel-2); }
.cx-cell.is-featured { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--magenta); z-index: 1; }
.cx-cell.is-selected { outline: 2px solid var(--text); outline-offset: 1px; z-index: 2; }
.cx-cell:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; z-index: 2; }
.legend .sw.better { background: var(--magenta); }
.legend .sw.worse { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 4px); border: 1px solid var(--muted); }
.legend .sw.same { background: var(--panel-2); border: 1px solid var(--line-2); }
.legend .sw.feat { background: transparent; box-shadow: 0 0 0 2px var(--magenta); }
.cx-readout { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; min-height: 3em; }
.cx-readout b { color: var(--text); }
.cx-featured { border-radius: var(--radius-s); aspect-ratio: 15 / 8; }
.cx-featured img { object-fit: contain; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table caption { text-align: left; padding: 12px 16px 6px; color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); }
.data-table th, .data-table td { padding: 7px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { font: 600 11px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.data-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.data-table th.num { text-align: right; }
.data-table tr.is-pred td:first-child { color: var(--magenta); }
.data-table tr:last-child td { border-bottom: 0; }

.air-control { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px; }
.air-control label { font-size: 14px; color: var(--muted); min-width: 120px; }
.air-control output { color: var(--amber); font-weight: 700; }
.air-timeline { overflow: hidden; margin: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--screen); padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.air-strip { display: flex; gap: 3px; width: max-content; animation: ticker 9s linear infinite; }
.air-strip i { width: 14px; height: 30px; border-radius: 2px; background: color-mix(in srgb, #38d6f0 70%, transparent); flex: none; transition: background .3s, transform .3s; }
.air-strip i.s { background: #ffb840; transform: scaleY(1.12); }
@keyframes ticker { to { transform: translateX(-50%); } }
.air-legend { padding: 8px 16px 0; margin: 0; font-size: 12.5px; color: var(--muted); }
.air-legend .sw:first-child { margin-left: 0; }
.air-readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 14px 16px 6px; }
.air-ro { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--panel-2); }
.air-ro .k { font: 600 11px/1.2 var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.air-ro .v { font: 700 1.5rem/1.2 var(--font-mono); font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.air-ro .v small { font-size: 12px; color: var(--faint); font-weight: 500; margin-left: 4px; }
.air-ro.comms .v { color: var(--cyan); }
.air-ro.sense .v { color: var(--amber); }
.air-ro svg { width: 100%; height: 30px; overflow: visible; }
.air-ro svg polyline { fill: none; stroke: var(--line-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.air-ro svg circle { r: 3.5; }
.air-ro.comms svg circle { fill: var(--cyan); }
.air-ro.sense svg circle { fill: var(--amber); }
.source { padding: 4px 16px 14px; margin: 0; font-size: 11.5px; color: var(--faint); }

/* ------------------------------------------------------------------ 7. get started */
.gs-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 22px; align-items: start; }
.terminal .code { background: var(--screen); color: #dfe7f0; font-size: 13px; }
.terminal .tok-com { color: #6d7f96; }
.terminal .tok-str { color: #e7dcc8; }
.terminal .tok-flag { color: #ffb840; }
.terminal .tok-fn { color: #38d6f0; }
.release { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.release li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.release b { font-weight: 650; }
.release span { grid-column: 1; color: var(--muted); font-size: 14px; line-height: 1.45; }
.release .tbd { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.release .tbd:hover { text-decoration: none; }
.bibtex { margin-top: 22px; }

.footer { margin-top: clamp(60px, 9vw, 110px); border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; }
.footer p { margin: 0; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-right: 0; }
  .stats li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .study, .gs-grid, .body-grid { grid-template-columns: minmax(0, 1fr); }
  .study-code { position: static; }
  .body-model { max-width: 520px; }
}
@media (max-width: 860px) {
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .pipe-arrow-side { height: 34px; justify-content: flex-start; padding-left: 26px; }
  .pipe-arrow-side::before { left: 24px; right: auto; top: 4px; bottom: 4px; border-top: 0; border-left: 1px dashed var(--line-2); }
  .pipe-arrow-side::after { left: 20.5px; right: auto; top: auto; bottom: 2px; border: 4px solid transparent; border-top: 6px solid var(--line-2); }
  .pipe-arrow-side span { position: static; writing-mode: horizontal-tb; transform: none; background: none; padding-left: 14px; }
  .code-program { max-height: 260px; }
  .peel-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: center; height: 100%; }
  .peel-copy { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .peel-copy li { padding: 8px; flex-direction: column; gap: 6px; }
  .peel-copy p { font-size: 12.5px; }
  .peel-copy h3 { font-size: .92rem; }
  .peel { --gap: 70px; }
  .scrub-body { grid-template-columns: minmax(0, 1fr); }
  .scrub-side { border-left: 0; border-top: 1px solid var(--line); }
  .readouts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li { border-right: 1px solid var(--line) !important; border-top: 1px solid var(--line); }
  .stats li:nth-child(-n+2) { border-top: 0; }
  .stats li:nth-child(2n) { border-right: 0 !important; }
  .stats li:last-child { grid-column: 1 / -1; border-right: 0 !important; }
  .peel-copy p { display: none; }
  .peel-copy li { flex-direction: row; align-items: center; }
  .slots { gap: 2px; padding: 14px 10px 4px; }
  .slot { height: 26px; }
  .slot[data-tick]::after { top: 30px; }
  .ro { grid-template-columns: 1fr; text-align: left; gap: 2px; padding: 6px 8px; }
  .ro-v { text-align: left; font-size: 17px; }
  .ro-u { display: none; }
  .scrub-controls { flex-wrap: wrap; }
  .scrub-controls .range-wrap { order: 3; flex-basis: 100%; }
  .chart { height: 140px; }
  .air-control { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .code { font-size: 12px; }
  .hero h1 br { display: none; }
}

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

/* late additions */
.air-strip i.c { background: var(--ctrl); }
.fallback.fallback-soft { inset: auto 8px 8px auto; padding: 6px 9px; border-radius: 4px; background: rgba(5,8,12,.85); }
.fallback.fallback-soft b { display: inline; margin-right: 6px; }
.pipeline.is-live .led { background: var(--faint); box-shadow: none; }
.pipeline .step.is-active .led { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.ev-lab { position: absolute; font: 10.5px/1.2 var(--font-mono); color: var(--muted); white-space: nowrap; pointer-events: none; }
.ev-lab.is-key { color: var(--text); font-weight: 650; }
.chart .event { stroke: var(--faint); }
.chart .event.is-key { stroke: var(--text); stroke-dasharray: 4 3; }
.range-mark { background: var(--faint); }
.range-mark.is-key { background: var(--text); width: 3px; }
.ro-serving .ro-v { font-size: 16px; color: var(--cyan); }
.ro-serving { grid-template-columns: 58px 1fr auto; }
.note { margin: 0; padding: 10px 14px 12px; font-size: 11.5px; line-height: 1.5; color: var(--faint); border-top: 1px solid var(--line); }
.note:empty { display: none; }
.overlay .ap-link { stroke: #38d6f0; stroke-width: 1.5; opacity: .45; vector-effect: non-scaling-stroke; }
.overlay .ap-link.is-serving { stroke-width: 3; opacity: .95; }
.overlay .ap-link.is-blocked { stroke-dasharray: 6 6; opacity: .35; stroke: #8fb6c4; }
.overlay .ap-mark path { fill: #38d6f0; stroke: #05080c; stroke-width: 2; }
.overlay .ap-mark text { fill: #fff; font: 600 26px var(--font-mono); paint-order: stroke; stroke: #05080c; stroke-width: 5px; }
.ln-link { border-color: var(--cyan); border-top-width: 3px; }
.ln-blocked { border-color: var(--cyan-2); border-top-style: dashed; margin-left: 6px; }
.data-table tr.grp td { font: 600 11px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); padding-top: 9px; padding-bottom: 7px; }
.data-table .ci { display: block; font-size: 10.5px; color: var(--faint); }
.data-table tr.is-priv td:first-child { color: var(--cyan); }
.data-table td:first-child { min-width: 150px; }
.more { border-top: 1px solid var(--line); }
.more summary { cursor: pointer; padding: 12px 16px; font: 500 12.5px/1.3 var(--font-mono); color: var(--muted); }
.more summary:hover { color: var(--text); }
.more .table-wrap { border-top: 0; }
#cx-source { border-top: 1px solid var(--line); padding-top: 10px; }
.back-meta .chips { max-height: 46px; overflow: hidden; }
.card-body .badge { margin-bottom: -2px; }
.air-ro .v .tbd { font-size: 11px; vertical-align: middle; }
.slot.ul, .sw-ul { background: var(--ctrl); opacity: .75; }
.slot.idle, .sw-idle { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.sw-idle { box-shadow: inset 0 0 0 1px var(--muted); }
.cx-layout { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: start; }
.legend-col { display: grid; gap: 8px; font-size: 13px; }
.legend-col .sw, .legend-row .sw { margin-left: 0; margin-right: 6px; }
.cx-featured { aspect-ratio: auto; margin: 0 16px 16px; border-radius: var(--radius-s); background: #fff; }
.cx-featured img { height: auto; object-fit: contain; position: static; }
.cx-featured .fallback { position: relative; min-height: 120px; }
@media (max-width: 560px) {
  .peel { --gap: 52px; }
  .peel-copy li { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; }
  .peel-copy h3 { font-size: .8rem; }
  .peel-viewport { margin-top: 70px; }
  .peel-stage { width: 92%; }
}
@media (max-width: 560px) { .mark-label { font-size: 8.5px; padding: 2px 3px; } }
[hidden] { display: none !important; }

/* v2: body axes drawn from extent */
.wipe-frame { grid-template-columns: 20px 40px minmax(0, 1fr); grid-template-rows: auto 22px 20px; padding: 14px 16px 6px 6px; }
.wipe-frame .axis-y { grid-column: 1; grid-row: 1; }
.wipe-frame .ticks-y { grid-column: 2; grid-row: 1; }
.wipe-frame .wipe { grid-column: 3; grid-row: 1; }
.wipe-frame .ticks-x { grid-column: 3; grid-row: 2; }
.wipe-frame .axis-x { grid-column: 3; grid-row: 3; }
.ticks { position: relative; font: 10.5px/1 var(--font-mono); color: var(--muted); }
.ticks span { position: absolute; white-space: nowrap; }
.ticks-x span { top: 6px; transform: translateX(-50%); }
.ticks-x span::before { content: ""; position: absolute; left: 50%; top: -6px; height: 4px; border-left: 1px solid var(--line-2); }
.ticks-y span { right: 6px; transform: translateY(-50%); }
.ticks-y span::after { content: ""; position: absolute; right: -6px; top: 50%; width: 4px; border-top: 1px solid var(--line-2); }
.ticks-x span:first-child { transform: translateX(-2px); }
.wipe-panel .panel-head .seg { margin-left: 0; }
.chart .event-band { fill: var(--text); opacity: .08; }
.chart .event-band.is-key { fill: var(--text); opacity: .14; }
.range-mark.is-band { margin-left: 0; border-radius: 2px; opacity: .55; }
.card { height: 372px; }
.card-prompt { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-prompt .q-mark { color: var(--cyan); font-family: var(--font-mono); }
.card-prompt.is-none { font: italic 12px/1.4 var(--font-mono); color: var(--faint); }
.back-summary { flex: none; margin: 0; padding: 8px 12px; font-size: 12.5px; line-height: 1.45; color: var(--muted); border-bottom: 1px solid var(--line); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.back-summary:empty { display: none; }
.face-back .panel-title { text-transform: none; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lvl-note { margin-top: 6px !important; font-size: 12px !important; color: var(--amber) !important; }
@media (max-width: 560px) { .lvl-note { display: none; } }
.back-summary { max-height: calc(12.5px * 1.45 * 3 + 16px); }
@media (max-width: 560px) { .chart .chart-hi { display: none; } }
