:root {
  --bg: #050609;
  --panel: rgba(12, 16, 22, 0.9);
  --panel-strong: rgba(18, 24, 33, 0.96);
  --ink: #f5f7fb;
  --muted: #aab4c4;
  --line: rgba(245, 247, 251, 0.16);
  --cyan: #61dbe3;
  --coral: #ff7b5f;
  --acid: #caff6a;
  --amber: #ffd166;
  --aqua-deep: #0a8fa3;
  --film: rgba(2, 4, 7, 0.74);
  --glass: rgba(3, 7, 11, 0.72);
  --glass-soft: rgba(10, 16, 23, 0.56);
  --panel-idle: rgba(4, 9, 13, 0.34);
  --panel-active: rgba(7, 14, 19, 0.58);
  --panel-trace: rgba(97, 219, 227, 0.16);
  --hud-line: rgba(97, 219, 227, 0.28);
  --hud-hot: rgba(202, 255, 106, 0.54);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 520vh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ink);
  background:
    linear-gradient(110deg, rgba(97, 219, 227, 0.09), transparent 28%),
    linear-gradient(250deg, rgba(255, 123, 95, 0.11), transparent 30%),
    linear-gradient(180deg, #080a10 0%, #020307 58%, #050609 100%);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  letter-spacing: 0;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 50;
  transform: translateY(-180%);
  padding: 10px 12px;
  border-radius: 6px;
  background: #f7f8fb;
  color: #07080c;
  font-weight: 800;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.screen-grid,
.signal-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.screen-grid {
  z-index: 0;
  background-image:
    linear-gradient(112deg, rgba(97, 219, 227, 0.075) 1px, transparent 1px),
    repeating-linear-gradient(90deg, rgba(245, 247, 251, 0.034) 0 1px, transparent 1px 84px),
    linear-gradient(180deg, transparent, rgba(202, 255, 106, 0.032) 52%, transparent);
  background-size: 92px 46px, 84px 100%, 100% 100%;
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 72%, transparent 100%);
  opacity: 0.42;
}

.signal-noise {
  z-index: 3;
  opacity: 0.07;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.88) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(97, 219, 227, 0.7) 0 1px, transparent 1px 132px);
  mix-blend-mode: screen;
}

.topbar {
  position: fixed;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 20;
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.back-link,
.api-tag {
  pointer-events: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.back-link {
  padding: 0 14px;
  font-weight: 800;
}

.api-tag {
  margin: 0;
  padding: 0 12px;
  color: var(--acid);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
}

.image-stream {
  position: fixed;
  inset: 0;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.stream-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 209, 102, 0.065), transparent 20%, rgba(97, 219, 227, 0.035) 82%, transparent),
    linear-gradient(180deg, #020407 0%, #0a0d13 48%, #030407 100%);
}

.stream-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(245, 247, 251, 0.075);
  background:
    linear-gradient(90deg, rgba(97, 219, 227, 0.16), transparent 11%, transparent 89%, rgba(255, 209, 102, 0.1)),
    linear-gradient(180deg, rgba(245, 247, 251, 0.1), transparent 8%, transparent 88%, rgba(5, 6, 9, 0.68));
  box-shadow: inset 0 0 92px rgba(0, 0, 0, 0.58);
  pointer-events: none;
}

.stream-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(5, 6, 9, 0.18), transparent 22%, transparent 72%, rgba(5, 6, 9, 0.74)),
    linear-gradient(90deg, rgba(5, 6, 9, 0.48), transparent 16%, transparent 84%, rgba(5, 6, 9, 0.54));
  pointer-events: none;
}

.stream-image {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100vh;
  padding: 54px 24px 34px;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.12) contrast(1.08) brightness(0.96);
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
  will-change: opacity, transform, filter;
}

.rain-field {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  perspective: 880px;
}

.rain-drop {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size);
  height: var(--height);
  object-fit: cover;
  border: 1px solid rgba(97, 219, 227, 0.24);
  border-radius: 4px;
  opacity: 0;
  box-shadow:
    0 26px 54px rgba(0, 0, 0, 0.42),
    0 0 30px rgba(97, 219, 227, 0.16),
    inset 0 0 0 1px rgba(245, 247, 251, 0.12);
  filter: saturate(1.24) contrast(1.1) brightness(0.94);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transform: translate3d(var(--x), -34vh, 0) rotate(var(--rotate)) rotateX(10deg);
  animation: imageRain var(--duration) linear forwards;
  will-change: transform, opacity;
}

.rain-drop.is-wide {
  object-fit: contain;
  background:
    linear-gradient(135deg, rgba(97, 219, 227, 0.07), transparent),
    rgba(5, 6, 9, 0.58);
}

.scroll-depth {
  position: relative;
  z-index: -1;
  height: 520vh;
  pointer-events: none;
}

.stream-stage.is-loading .stream-image {
  opacity: 0.26;
  transform: scale(0.985);
  filter: saturate(0.65) contrast(0.92);
}

.loading-vail {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 5;
  display: none;
  min-height: 40px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(202, 255, 106, 0.32);
  border-radius: 6px;
  background: rgba(6, 8, 12, 0.82);
  color: var(--acid);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.stream-stage.is-loading .loading-vail {
  opacity: 1;
  transform: translateY(0);
}

.image-counter {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  display: none;
  min-width: 82px;
  min-height: 58px;
  place-items: center;
  border: 1px solid rgba(97, 219, 227, 0.32);
  border-radius: 6px;
  background: rgba(6, 8, 12, 0.72);
  color: var(--cyan);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
}

.learning-selection {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
}

.yolo-layer {
  position: absolute;
  inset: 58px 28px 36px;
  z-index: 13;
  overflow: visible;
  pointer-events: none;
}

.yolo-box {
  position: absolute;
  left: var(--yolo-x, 40%);
  top: var(--yolo-y, 40%);
  width: var(--yolo-w, 20%);
  height: var(--yolo-h, 18%);
  min-width: 36px;
  min-height: 28px;
  border: 2px solid rgba(var(--yolo-color-rgb, 202, 255, 106), 0.92);
  background: rgba(var(--yolo-color-rgb, 202, 255, 106), 0.035);
  box-shadow:
    0 0 0 1px rgba(2, 4, 7, 0.7),
    0 0 18px rgba(var(--yolo-color-rgb, 202, 255, 106), 0.18);
  animation: yoloAcquire 420ms ease both;
}

.yolo-box::before,
.yolo-box::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.yolo-box::before {
  right: -2px;
  top: -2px;
  border-top: 3px solid rgba(245, 247, 251, 0.86);
  border-right: 3px solid rgba(245, 247, 251, 0.86);
}

.yolo-box::after {
  left: -2px;
  bottom: -2px;
  border-left: 3px solid rgba(245, 247, 251, 0.86);
  border-bottom: 3px solid rgba(245, 247, 251, 0.86);
}

.yolo-box[data-source='SHAPE'] {
  border-style: dashed;
  opacity: 0.78;
}

.yolo-label {
  position: absolute;
  left: -2px;
  bottom: calc(100% + 3px);
  max-width: min(230px, 58vw);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 3px 6px;
  background: rgba(2, 4, 7, 0.82);
  color: rgba(245, 247, 251, 0.96);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(var(--yolo-color-rgb, 202, 255, 106), 0.18);
}

.yolo-label b {
  color: rgba(var(--yolo-color-rgb, 202, 255, 106), 0.98);
  font-weight: 700;
}

.yolo-label i {
  color: rgba(97, 219, 227, 0.78);
  font-style: normal;
  font-weight: 700;
}

.yolo-status {
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(202, 255, 106, 0.82);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-shadow: 0 0 16px rgba(2, 4, 7, 0.7);
  text-transform: uppercase;
}

.learning-selection,
.segmentation-layer,
.sector-map {
  display: none !important;
}

.sector-map {
  position: absolute;
  inset: 58px 28px 36px;
  z-index: 8;
  display: none;
  overflow: visible;
  border: 0;
  opacity: 0.92;
  pointer-events: none;
  perspective: 980px;
  filter: drop-shadow(0 0 24px rgba(97, 219, 227, 0.13));
  isolation: isolate;
}

.sector-map::before {
  content: none;
  position: absolute;
  inset: -3.5%;
  border: 1px solid rgba(97, 219, 227, 0.18);
  background:
    linear-gradient(100deg, transparent 0 39%, rgba(97, 219, 227, 0.28) 46%, rgba(202, 255, 106, 0.14) 49%, transparent 56%),
    linear-gradient(18deg, transparent 0 48%, rgba(245, 247, 251, 0.12) 49%, transparent 51%),
    repeating-linear-gradient(180deg, rgba(97, 219, 227, 0.064) 0 1px, transparent 1px 24px);
  clip-path: polygon(4% 0, 94% 3%, 100% 15%, 97% 92%, 88% 100%, 7% 96%, 0 86%, 1% 9%);
  mix-blend-mode: screen;
  opacity: 0.48;
  transform: rotateX(10deg) rotateZ(-0.65deg);
  animation: hudSweep 3200ms linear infinite;
}

.sector-map::after {
  content: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(25vw, 230px);
  aspect-ratio: 1;
  border: 1px solid rgba(202, 255, 106, 0.28);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(97, 219, 227, 0.42) 50%, transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(97, 219, 227, 0.34) 50%, transparent calc(50% + 1px));
  box-shadow:
    0 0 0 1px rgba(5, 6, 9, 0.36),
    inset 0 0 26px rgba(97, 219, 227, 0.08),
    0 0 42px rgba(202, 255, 106, 0.14);
  transform: translate(-50%, -50%);
  opacity: 0.58;
  animation: targetPulse 2600ms ease-in-out infinite alternate;
}

.sector-cell {
  position: absolute;
  left: var(--sector-x, 40%);
  top: var(--sector-y, 40%);
  width: var(--sector-w, 22%);
  height: var(--sector-h, 18%);
  min-width: 92px;
  min-height: 46px;
  border: 1px solid rgba(97, 219, 227, var(--sector-alpha, 0.4));
  background:
    linear-gradient(135deg, rgba(97, 219, 227, 0.1), transparent 30%),
    linear-gradient(315deg, rgba(202, 255, 106, 0.08), transparent 45%),
    linear-gradient(180deg, rgba(3, 7, 11, 0.08), rgba(3, 7, 11, 0.02));
  box-shadow:
    inset 0 0 0 1px rgba(5, 6, 9, 0.28),
    inset 0 0 22px rgba(97, 219, 227, 0.04),
    0 0 24px rgba(97, 219, 227, 0.1);
  clip-path: polygon(0 13px, 13px 0, 82% 0, 100% 18%, 100% 100%, 16% 100%, 0 84%);
  transform: rotate(var(--sector-tilt, 0deg)) translate3d(0, 0, var(--sector-depth, 0));
  transform-origin: center;
  mix-blend-mode: screen;
  transition:
    left 520ms ease,
    top 520ms ease,
    width 520ms ease,
    height 520ms ease,
    opacity 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    transform 520ms ease;
  animation:
    sectorWake 1050ms ease-out both,
    microFlicker 4200ms steps(2, end) infinite;
}

.sector-cell::before,
.sector-cell::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.sector-cell::before {
  inset: -4px;
  border: 1px solid rgba(202, 255, 106, 0.62);
  border-right-color: transparent;
  border-bottom-color: transparent;
  opacity: 0.42;
  filter: drop-shadow(0 0 9px rgba(202, 255, 106, 0.2));
}

.sector-cell::after {
  left: 8%;
  top: 48%;
  width: 84%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 247, 251, 0.82), rgba(97, 219, 227, 0.44), transparent);
  opacity: 0.26;
  transform: rotate(-7deg);
  animation: sectorScan 1450ms ease-in-out infinite;
}

.sector-cell.is-hot {
  border-color: rgba(202, 255, 106, 0.5);
  background:
    linear-gradient(135deg, rgba(202, 255, 106, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(97, 219, 227, 0.12), transparent 52%);
  box-shadow:
    inset 0 0 28px rgba(202, 255, 106, 0.1),
    0 0 34px rgba(202, 255, 106, 0.18);
}

.sector-cell[data-focus-role='primary'] {
  border-color: rgba(var(--sector-color-rgb, 202, 255, 106), 0.74);
  box-shadow:
    inset 0 0 34px rgba(var(--sector-color-rgb, 202, 255, 106), 0.13),
    0 0 44px rgba(var(--sector-color-rgb, 202, 255, 106), 0.22),
    0 0 0 1px rgba(245, 247, 251, 0.08);
}

.sector-cell[data-focus-role='primary']::before {
  opacity: 0.82;
}

.sector-cell[data-focus-role='primary'] .sector-tag {
  border-color: rgba(var(--sector-color-rgb, 202, 255, 106), 0.48);
  color: rgba(245, 247, 251, 0.92);
}

.sector-cell[data-focus-role='secondary'] {
  border-style: dashed;
  filter: drop-shadow(0 0 12px rgba(97, 219, 227, 0.12));
}

.sector-cell[data-focus-role='support'] {
  filter: saturate(0.8);
}

.sector-cell[data-focus-role='support']::before {
  opacity: 0.28;
}

.sector-cell[data-focus-role='support'] .sector-tag {
  opacity: 0.62;
  max-width: min(160px, 46vw);
}

.sector-tag {
  position: absolute;
  left: 50%;
  top: -25px;
  max-width: min(220px, 58vw);
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(97, 219, 227, 0.24);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(97, 219, 227, 0.12), transparent),
    rgba(2, 4, 7, 0.76);
  color: rgba(245, 247, 251, 0.8);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.56rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    0 0 18px rgba(97, 219, 227, 0.1),
    inset 0 1px 0 rgba(245, 247, 251, 0.08);
  transform: translateX(-50%) skewX(-7deg);
}

.sector-core {
  position: absolute;
  display: none;
  left: 50%;
  top: 50%;
  width: min(34vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 20deg, transparent 0 16%, rgba(97, 219, 227, 0.32) 18%, transparent 22% 48%, rgba(202, 255, 106, 0.28) 51%, transparent 56% 100%),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(97, 219, 227, 0.34) 50%, transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(97, 219, 227, 0.34) 50%, transparent calc(50% + 1px));
  opacity: 0.48;
  transform: translate(-50%, -50%);
  animation: coreSpin 6200ms linear infinite;
}

.sector-core::before,
.sector-core::after {
  content: '';
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(97, 219, 227, 0.28);
  border-radius: 50%;
}

.sector-core::after {
  inset: 42%;
  border-color: rgba(202, 255, 106, 0.34);
  box-shadow: 0 0 18px rgba(202, 255, 106, 0.14);
}

.segmentation-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.segment-mask,
.segment-contour,
.vision-particle,
.vision-beam {
  position: absolute;
  pointer-events: none;
}

.segment-mask {
  left: var(--segment-x, 42%);
  top: var(--segment-y, 38%);
  width: var(--segment-w, 22%);
  height: var(--segment-h, 28%);
  border: 1px solid rgba(var(--segment-color-rgb, 202, 255, 106), 0.34);
  background:
    linear-gradient(135deg, rgba(var(--segment-color-rgb, 202, 255, 106), 0.08), transparent 56%),
    repeating-linear-gradient(115deg, rgba(97, 219, 227, 0.08) 0 1px, transparent 1px 10px);
  clip-path: var(--segment-path, polygon(12% 0, 86% 8%, 100% 48%, 78% 100%, 20% 88%, 0 36%));
  opacity: 0.2;
  filter: drop-shadow(0 0 12px rgba(var(--segment-color-rgb, 202, 255, 106), 0.12));
  transform: rotate(var(--segment-tilt, -4deg));
  animation: segmentBreath 2200ms ease-in-out infinite alternate;
}

.segment-contour {
  inset: -3px;
  border: 1px solid rgba(var(--segment-color-rgb, 97, 219, 227), 0.58);
  clip-path: inherit;
  opacity: 0.52;
}

.vision-particle {
  left: var(--particle-x, 50%);
  top: var(--particle-y, 50%);
  width: 4px;
  height: 4px;
  border: 1px solid rgba(var(--segment-color-rgb, 202, 255, 106), 0.68);
  background: rgba(245, 247, 251, 0.7);
  box-shadow: 0 0 14px rgba(var(--segment-color-rgb, 202, 255, 106), 0.36);
  transform: translate(-50%, -50%) rotate(45deg);
  animation: particleDrift var(--particle-speed, 2800ms) ease-in-out infinite;
}

.vision-beam {
  left: var(--beam-x, 10%);
  top: var(--beam-y, 48%);
  width: var(--beam-w, 78%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(97, 219, 227, 0.68), rgba(var(--segment-color-rgb, 202, 255, 106), 0.46), transparent);
  opacity: 0.48;
  transform: rotate(var(--beam-tilt, -8deg));
  animation: beamSweep 1800ms ease-in-out infinite;
}

.segment-mask[data-focus-role='primary'] {
  border-color: rgba(var(--segment-color-rgb, 202, 255, 106), 0.58);
  filter: drop-shadow(0 0 18px rgba(var(--segment-color-rgb, 202, 255, 106), 0.2));
}

.segment-mask[data-focus-role='secondary'] {
  opacity: 0.18;
}

.segment-mask[data-focus-role='support'] {
  opacity: 0.1;
}

.vision-particle[data-focus-role='primary'] {
  width: 6px;
  height: 6px;
  background: rgba(var(--segment-color-rgb, 202, 255, 106), 0.78);
}

.vision-beam[data-focus-role='primary'] {
  height: 2px;
  opacity: 0.62;
}

.vision-beam[data-focus-role='support'] {
  opacity: 0.28;
}

.learning-box {
  position: absolute;
  left: var(--box-x);
  top: var(--box-y);
  width: var(--box-w);
  height: var(--box-h);
  border: 1px solid rgba(202, 255, 106, 0.72);
  background:
    linear-gradient(135deg, rgba(202, 255, 106, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(97, 219, 227, 0.1), transparent 56%);
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  box-shadow:
    inset 0 0 0 1px rgba(5, 6, 9, 0.38),
    inset 0 0 26px rgba(97, 219, 227, 0.07),
    0 0 24px rgba(202, 255, 106, 0.18);
  opacity: 0;
  animation: selectFrame 1900ms ease-out forwards;
}

.learning-box[data-focus-role='primary'] {
  border-color: rgba(202, 255, 106, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(5, 6, 9, 0.38),
    inset 0 0 34px rgba(202, 255, 106, 0.1),
    0 0 32px rgba(202, 255, 106, 0.26);
}

.learning-box[data-focus-role='secondary'] {
  border-color: rgba(97, 219, 227, 0.62);
}

.learning-box[data-focus-role='secondary'] .learning-label {
  color: var(--cyan);
}

.learning-box::before,
.learning-box::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(97, 219, 227, 0.56);
  box-shadow: 0 0 10px rgba(97, 219, 227, 0.28);
}

.learning-box::before {
  top: 18%;
}

.learning-box::after {
  top: 66%;
}

.learning-label {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  max-width: 220px;
  padding: 3px 6px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(202, 255, 106, 0.12), transparent),
    rgba(2, 4, 7, 0.78);
  color: var(--acid);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(202, 255, 106, 0.12);
}

.learning-hud {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 29;
  width: min(640px, calc(100vw - 28px));
  display: grid;
  gap: 6px;
  opacity: 0.74;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: machinePanelCycle 22s ease-in-out infinite;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.38));
}

.learning-terminal,
.learning-readout,
.embedding-panel,
.frame-strip {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  clip-path: none;
  overflow: visible;
}

.learning-terminal::after,
.learning-readout::after,
.embedding-panel::after,
.frame-strip::after {
  content: none;
}

.learning-terminal > *,
.learning-readout > *,
.embedding-panel > *,
.frame-strip > * {
  position: relative;
  z-index: 1;
}

.learning-terminal {
  position: relative;
  overflow: visible;
  min-height: 164px;
}

.learning-terminal::before {
  content: none;
}

.learning-chrome {
  position: relative;
  z-index: 1;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-bottom: 0;
  background: transparent;
  color: rgba(245, 247, 251, 0.72);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
}

.learning-chrome span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--coral);
}

.learning-chrome span:nth-child(2) {
  background: var(--amber);
}

.learning-chrome span:nth-child(3) {
  background: var(--acid);
}

.learning-chrome strong {
  margin-left: 4px;
  color: var(--acid);
  font-weight: 700;
}

.learning-log {
  position: relative;
  z-index: 1;
  height: 138px;
  margin: 0;
  padding: 8px 10px 9px;
  overflow: hidden;
  list-style: none;
  color: rgba(159, 255, 138, 0.88);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.42;
  text-shadow: 0 0 12px rgba(138, 255, 114, 0.16);
}

.learning-log li {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  border-bottom: 1px solid rgba(138, 255, 114, 0.06);
}

.learning-log li:first-child {
  animation: terminalLineWake 1800ms ease;
}

.learning-log li strong {
  color: var(--cyan);
  font-weight: 700;
}

.learning-log li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-readout {
  display: grid;
  grid-template-columns: 0.45fr 0.55fr 1fr 1fr;
  overflow: visible;
}

.learning-readout div {
  min-width: 0;
  padding: 6px 8px;
  border-right: 0;
  background: transparent;
}

.learning-readout div:last-child {
  border-right: 0;
}

.learning-readout span,
.embedding-panel p {
  display: block;
  margin: 0 0 3px;
  color: rgba(245, 247, 251, 0.5);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.learning-readout strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(97, 219, 227, 0.14);
}

.embedding-panel {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  padding: 6px 8px;
}

.embedding-panel p {
  margin: 0;
}

.embedding-bars {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  align-items: end;
  gap: 3px;
  height: 34px;
}

.embedding-bars span {
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background:
    linear-gradient(180deg, var(--acid), var(--cyan)),
    linear-gradient(90deg, transparent, rgba(245, 247, 251, 0.38), transparent);
  opacity: 0.86;
  box-shadow: 0 0 10px rgba(97, 219, 227, 0.16);
  transform-origin: bottom;
  transition: height 180ms ease, opacity 180ms ease;
}

.frame-strip {
  display: flex;
  gap: 6px;
  overflow: hidden;
  padding: 5px;
}

.frame-tile {
  position: relative;
  flex: 0 0 62px;
  height: 48px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: 0 0 14px rgba(5, 6, 9, 0.36);
}

.frame-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.86;
  filter: saturate(1.15) contrast(1.06);
}

.frame-tile span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(5, 6, 9, 0.74);
  color: var(--acid);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.56rem;
}

.llm-vision {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: min(390px, calc(100vw - 380px));
  min-width: 292px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  clip-path: none;
  opacity: 0.7;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: llmPanelCycle 17s ease-in-out infinite;
}

.llm-vision::before {
  content: none;
}

.llm-vision::after {
  content: none;
}

.llm-vision:has(.llm-speech.is-updating) {
  opacity: 0.94;
  animation: panelUpdateFlash 860ms ease both;
}

.llm-kicker {
  margin: 0 0 8px;
  color: rgba(202, 255, 106, 0.86);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(202, 255, 106, 0.18);
}

.llm-speech {
  margin: 0;
  color: rgba(245, 247, 251, 0.92);
  font-size: clamp(0.9rem, 1.35vw, 1.08rem);
  line-height: 1.25;
  text-shadow: 0 0 22px rgba(0, 0, 0, 0.4);
}

.llm-speech.is-updating {
  animation: llmPulse 520ms ease;
}

.llm-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.llm-tokens span {
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(245, 247, 251, 0.72);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stream-console {
  min-height: auto;
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 92px 28px 32px;
  background:
    linear-gradient(180deg, rgba(18, 24, 33, 0.96), rgba(8, 11, 16, 0.93)),
    var(--panel);
  box-shadow: -28px 0 70px rgba(0, 0, 0, 0.28);
}

.compact-console {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 28;
  width: min(340px, calc(100vw - 32px));
  align-content: start;
  gap: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.compact-console .console-heading,
.compact-console .console-hidden,
.compact-console .query-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.console-heading,
.query-form,
.control-strip,
.readout,
.image-data {
  width: 100%;
}

.kicker,
.data-label,
.query-form label,
.readout dt,
.status-line {
  font-family: 'IBM Plex Mono', monospace;
}

.kicker,
.data-label,
.query-form label,
.readout dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.console-heading h1 {
  margin: 10px 0 14px;
  font-size: 4.5rem;
  line-height: 0.92;
}

.lead {
  margin: 0;
  max-width: 32rem;
  color: #d8deea;
  font-size: 1.05rem;
  line-height: 1.55;
}

.query-form {
  display: grid;
  gap: 8px;
}

.compact-console .query-form {
  padding: 7px;
  border: 1px solid rgba(97, 219, 227, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(97, 219, 227, 0.08), transparent 42%),
    rgba(4, 7, 11, 0.68);
  backdrop-filter: blur(18px) saturate(1.1);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(245, 247, 251, 0.07);
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 6px;
}

.query-row input,
.query-row button,
.control-strip button,
.control-strip a {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(245, 247, 251, 0.13);
}

.query-row input {
  min-width: 0;
  padding: 0 10px;
  background:
    linear-gradient(180deg, rgba(245, 247, 251, 0.09), rgba(245, 247, 251, 0.055));
  color: var(--ink);
  outline: none;
  font-size: 0.9rem;
}

.query-row input:focus {
  border-color: rgba(97, 219, 227, 0.62);
  box-shadow: 0 0 0 3px rgba(97, 219, 227, 0.12);
}

.query-row button,
.control-strip button,
.control-strip a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  background: rgba(245, 247, 251, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.query-row button {
  border-color: rgba(255, 123, 95, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 123, 95, 0.2), rgba(202, 255, 106, 0.05)),
    rgba(7, 9, 13, 0.62);
  box-shadow: inset 0 1px 0 rgba(245, 247, 251, 0.08);
}

.control-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.control-strip button:hover,
.control-strip a:hover,
.query-row button:hover {
  border-color: rgba(97, 219, 227, 0.68);
  background:
    linear-gradient(135deg, rgba(97, 219, 227, 0.18), rgba(202, 255, 106, 0.06)),
    rgba(7, 9, 13, 0.66);
}

.readout {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.readout div {
  min-width: 0;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
}

.readout div:last-child {
  border-right: 0;
}

.readout dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-data {
  display: grid;
  gap: 8px;
}

.image-data h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.1;
}

.image-data p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-line {
  min-height: 22px;
  margin: 0;
  color: var(--amber);
  font-size: 0.82rem;
}

.second-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(245, 247, 251, 0.09);
}

.second-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--acid), var(--coral));
  animation: secondPulse 1000ms linear infinite;
}

body.is-paused .second-meter span {
  animation-play-state: paused;
}

body.is-paused .api-tag {
  color: var(--amber);
}

body.is-paused .rain-drop {
  animation-play-state: paused;
}

@keyframes secondPulse {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes imageRain {
  0% {
    opacity: 0;
    transform: translate3d(var(--x), -34vh, -80px) rotate(var(--rotate)) rotateX(12deg) skewX(-3deg) scale(0.82);
  }

  9% {
    opacity: var(--opacity);
  }

  42% {
    transform: translate3d(calc(var(--x) + 6vw), 42vh, 40px) rotate(calc(var(--rotate) + 4deg)) rotateX(6deg) skewX(2deg) scale(0.96);
  }

  72% {
    opacity: var(--opacity);
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(var(--x) + var(--drift)), 118vh, 90px) rotate(calc(var(--rotate) + var(--spin))) rotateX(-7deg) skewX(4deg) scale(1.06);
  }
}

@keyframes selectFrame {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }

  14% {
    opacity: 1;
  }

  70% {
    opacity: 0.82;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes yoloAcquire {
  0% {
    opacity: 0;
    transform: scale(0.94);
    filter: brightness(1.45);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes hudSweep {
  0% {
    background-position: -160% 0, 0 0, 0 0;
    opacity: 0.28;
  }

  50% {
    opacity: 0.58;
  }

  100% {
    background-position: 160% 0, 0 0, 0 24px;
    opacity: 0.34;
  }
}

@keyframes sectorWake {
  0% {
    opacity: 0;
    transform: rotate(var(--sector-tilt, 0deg)) translate3d(0, -12px, var(--sector-depth, 0)) scale(0.82);
  }

  100% {
    opacity: 1;
    transform: rotate(var(--sector-tilt, 0deg)) translate3d(0, 0, var(--sector-depth, 0)) scale(1);
  }
}

@keyframes sectorScan {
  0%,
  100% {
    opacity: 0.1;
    transform: translateY(-15px) rotate(-7deg);
  }

  48% {
    opacity: 0.64;
    transform: translateY(16px) rotate(-7deg);
  }
}

@keyframes targetPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.94) rotate(-2deg);
  }

  100% {
    transform: translate(-50%, -50%) scale(1.03) rotate(2deg);
  }
}

@keyframes coreSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes microFlicker {
  0%,
  92%,
  100% {
    opacity: 1;
  }

  94% {
    opacity: 0.78;
  }

  96% {
    opacity: 0.94;
  }
}

@keyframes terminalScan {
  0% {
    background-position: -120% 0, 0 0;
  }

  100% {
    background-position: 120% 0, 0 18px;
  }
}

@keyframes segmentBreath {
  0% {
    opacity: 0.18;
    transform: rotate(var(--segment-tilt, -4deg)) scale(0.985);
  }

  100% {
    opacity: 0.36;
    transform: rotate(var(--segment-tilt, -4deg)) scale(1.015);
  }
}

@keyframes particleDrift {
  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.8);
  }

  50% {
    opacity: 0.95;
    transform: translate(calc(-50% + 8px), calc(-50% - 12px)) rotate(45deg) scale(1.2);
  }
}

@keyframes beamSweep {
  0%,
  100% {
    opacity: 0.12;
    transform: translateX(-6%) rotate(var(--beam-tilt, -8deg));
  }

  48% {
    opacity: 0.58;
    transform: translateX(6%) rotate(var(--beam-tilt, -8deg));
  }
}

@keyframes llmPulse {
  0% {
    opacity: 0.42;
    transform: translateY(-2px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes machinePanelCycle {
  0%,
  7% {
    opacity: 0.18;
    transform: translate3d(-10px, 14px, 0) scale(0.985);
    filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.18)) blur(1px);
  }

  13%,
  58% {
    opacity: 0.78;
    transform: translate3d(0, 0, 0) scale(1);
    filter: drop-shadow(0 18px 44px rgba(0, 0, 0, 0.34)) blur(0);
  }

  70%,
  100% {
    opacity: 0.34;
    transform: translate3d(-4px, 8px, 0) scale(0.992);
    filter: drop-shadow(0 12px 34px rgba(0, 0, 0, 0.22)) blur(0);
  }
}

@keyframes llmPanelCycle {
  0%,
  10% {
    opacity: 0.16;
    transform: translate3d(12px, -10px, 0) scale(0.985);
    filter: blur(1.2px);
  }

  16%,
  62% {
    opacity: 0.76;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }

  78%,
  100% {
    opacity: 0.3;
    transform: translate3d(6px, -4px, 0) scale(0.992);
    filter: blur(0);
  }
}

@keyframes panelGlassScan {
  0%,
  28% {
    opacity: 0.12;
    transform: translateX(-88%);
  }

  42% {
    opacity: 0.34;
  }

  58% {
    opacity: 0.18;
    transform: translateX(88%);
  }

  100% {
    opacity: 0.1;
    transform: translateX(88%);
  }
}

@keyframes panelTopTrace {
  0%,
  100% {
    opacity: 0.18;
    transform: scaleX(0.34);
  }

  48% {
    opacity: 0.72;
    transform: scaleX(1);
  }
}

@keyframes panelUpdateFlash {
  0% {
    opacity: 0.34;
    transform: translate3d(8px, -4px, 0) scale(0.99);
    filter: blur(0.8px);
  }

  38% {
    opacity: 0.96;
    transform: translate3d(0, 0, 0) scale(1.01);
    filter: blur(0);
  }

  100% {
    opacity: 0.82;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes terminalLineWake {
  0% {
    color: rgba(202, 255, 106, 0.42);
    text-shadow: 0 0 2px rgba(202, 255, 106, 0.1);
    transform: translateX(-6px);
  }

  34% {
    color: rgba(202, 255, 106, 0.96);
    text-shadow: 0 0 18px rgba(202, 255, 106, 0.24);
    transform: translateX(0);
  }

  100% {
    color: inherit;
    text-shadow: inherit;
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  body {
    min-height: auto;
  }

  .image-stream {
    position: fixed;
    inset: 0;
    grid-template-columns: 1fr;
  }

  .scroll-depth {
    height: 180vh;
  }

  .stream-stage {
    min-height: 100vh;
    border-right: 0;
  }

  .stream-image {
    height: 100vh;
    padding: 72px 16px 24px;
  }

  .rain-drop {
    width: min(var(--size), 34vw);
    filter: saturate(1.14) contrast(1.04) brightness(0.95);
  }

  .sector-map {
    inset: 72px 16px 24px;
    opacity: 0.82;
  }

  .sector-cell {
    min-width: 72px;
    min-height: 38px;
  }

  .sector-tag {
    top: -23px;
    max-width: 170px;
    font-size: 0.52rem;
  }

  .sector-map::after {
    width: min(36vw, 180px);
  }

  .sector-core {
    width: min(42vw, 250px);
  }

  .segment-mask {
    opacity: 0.22;
  }

  .vision-particle {
    width: 3px;
    height: 3px;
  }

  .compact-console {
    top: 12px;
    left: 12px;
    width: min(340px, calc(100vw - 24px));
  }

  .learning-hud {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    gap: 6px;
  }

  .learning-terminal {
    min-height: 124px;
  }

  .learning-log {
    height: 100px;
    font-size: 0.64rem;
  }

  .learning-readout {
    grid-template-columns: 1fr 1fr;
  }

  .learning-readout div:nth-child(2n) {
    border-right: 0;
  }

  .embedding-panel,
  .frame-strip {
    display: none;
  }

  .llm-vision {
    top: 64px;
    right: 10px;
    width: min(420px, calc(100vw - 20px));
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .api-tag {
    display: none;
  }

  .query-row,
  .control-strip,
  .readout {
    grid-template-columns: 1fr;
  }

  .compact-console .query-row {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .readout div,
  .readout div:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .readout div:last-child {
    border-bottom: 0;
  }

  .console-heading h1 {
    font-size: 2.65rem;
  }

  .image-counter {
    right: 14px;
    bottom: 14px;
    min-width: 68px;
    min-height: 48px;
    font-size: 1.2rem;
  }

  .loading-vail {
    left: 14px;
    bottom: 14px;
    max-width: calc(100% - 104px);
  }

  .learning-hud {
    bottom: 8px;
  }

  .learning-log li {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px;
  }

  .llm-vision {
    top: 58px;
    padding: 10px;
  }

  .sector-map {
    inset: 112px 10px 164px;
    filter: drop-shadow(0 0 16px rgba(97, 219, 227, 0.08));
  }

  .sector-cell {
    min-width: 54px;
    min-height: 32px;
    opacity: 0.86;
  }

  .sector-cell:nth-of-type(n + 6) .sector-tag {
    display: none;
  }

  .sector-tag {
    left: 50%;
    top: -20px;
    max-width: 132px;
    padding: 3px 5px;
    font-size: 0.45rem;
  }

  .sector-map::before {
    opacity: 0.3;
  }

  .sector-map::after {
    width: 30vw;
    opacity: 0.42;
  }

  .sector-core {
    width: 38vw;
    opacity: 0.34;
  }

  .segment-mask,
  .vision-beam {
    opacity: 0.16;
  }

  .vision-particle {
    opacity: 0.62;
  }

  .llm-speech {
    font-size: 0.98rem;
  }

  .llm-tokens {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .second-meter span {
    width: 100%;
  }
}
