:root {
  --teal: #0064B0;
  --teal-bright: #6AADD6;
  --navy: #071018;
  --ink: #0b1324;
  --text: #e8eef4;
  --muted: #8b97a8;
  --danger: #ef4444;
  --ok: #34d399;
  --font-display: "Sora", "Plus Jakarta Sans", sans-serif;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(0, 100, 176, 0.18), transparent 55%),
    radial-gradient(ellipse 40% 40% at 90% 90%, rgba(0, 100, 176, 0.08), transparent 50%),
    #05090f;
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.fx-vignette {
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.55) 100%);
}

.fx-grain {
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grain 0.45s steps(2) infinite;
}

.fx-grid {
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(106, 173, 214, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 173, 214, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  100% { transform: translate(0, 0); }
}

.hud-top,
.hud-bottom,
.caption-bar {
  position: fixed;
  z-index: 30;
  display: flex;
  align-items: center;
}

.hud-top {
  top: 0;
  left: 0;
  right: 0;
  padding: 1.1rem 1.5rem;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #f4f7fb;
  box-shadow: 0 0 0 6px rgba(0, 100, 176, 0.18), 0 0 24px rgba(106, 173, 214, 0.35);
  background: radial-gradient(circle at center, transparent 42%, rgba(106, 173, 214, 0.55) 43%, transparent 62%);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-text span {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: lowercase;
}

.hud-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--muted);
}

.rec {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--teal-bright);
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.68rem;
}

.rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.stage {
  position: fixed;
  inset: 4.5rem 1.5rem 7.5rem;
  z-index: 5;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
  filter: blur(8px);
  transition: opacity 0.55s ease, transform 0.7s ease, filter 0.55s ease;
  display: grid;
  place-items: center;
}

.scene.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  filter: blur(0);
  z-index: 2;
}

.caption-bar {
  left: 1.5rem;
  bottom: 4.4rem;
  gap: 0.9rem;
  max-width: min(42rem, calc(100% - 18rem));
}

.caption-bar .idx {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--teal-bright);
  letter-spacing: 0.14em;
}

.kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.caption {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 3.35rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 30;
}

.progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  box-shadow: 0 0 12px rgba(106, 173, 214, 0.6);
}

.hud-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.7rem 1.5rem;
  gap: 0.5rem;
}

.ctrl {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ctrl:hover {
  border-color: rgba(106, 173, 214, 0.4);
  color: var(--teal-bright);
}

.ctrl.cta {
  margin-left: auto;
  background: var(--teal);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.ctrl.cta:hover {
  background: #005494;
  color: #fff;
}

.end-card {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(5, 9, 15, 0.55);
  backdrop-filter: blur(8px);
}

.end-card[hidden] {
  display: none;
}

.end-card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.end-card button {
  appearance: none;
  border: 0;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- Intro ---------- */
.scene-intro .orbits {
  position: absolute;
  width: min(70vmin, 640px);
  height: min(70vmin, 640px);
}

.scene-intro .orbits span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(106, 173, 214, 0.16);
  border-radius: 46% 54% 48% 52% / 50% 44% 56% 50%;
  animation: orbit 18s linear infinite;
}

.scene-intro .orbits span:nth-child(2) { inset: 8%; animation-duration: 22s; animation-direction: reverse; }
.scene-intro .orbits span:nth-child(3) { inset: 16%; animation-duration: 14s; }
.scene-intro .orbits span:nth-child(4) { inset: 24%; animation-duration: 26s; animation-direction: reverse; }
.scene-intro .orbits span:nth-child(5) { inset: 32%; animation-duration: 11s; }

@keyframes orbit {
  to { transform: rotate(360deg); }
}

.intro-mark {
  width: min(28vmin, 220px);
  position: relative;
  z-index: 2;
}

.scribble {
  width: 100%;
  filter: drop-shadow(0 0 24px rgba(106, 173, 214, 0.35));
}

.scene-intro.is-on .scribble {
  animation: mark-in 1.4s ease both;
}

@keyframes mark-in {
  from { transform: scale(0.7) rotate(-12deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.intro-name,
.intro-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  margin: 0;
}

.intro-name {
  top: calc(50% + min(18vmin, 150px));
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  letter-spacing: -0.06em;
  font-weight: 700;
}

.intro-tag {
  top: calc(50% + min(26vmin, 220px));
  color: var(--muted);
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
}

.scene-intro.is-on .intro-name {
  animation: rise 1s 0.5s ease both;
}

.scene-intro.is-on .intro-tag {
  animation: rise 1s 0.9s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Face ---------- */
.scene-face {
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.hud-frame {
  width: min(42vh, 340px);
  aspect-ratio: 4 / 5;
  position: relative;
  border: 1px solid rgba(106, 173, 214, 0.22);
  background: linear-gradient(180deg, rgba(0, 100, 176, 0.08), rgba(7, 16, 24, 0.4));
  overflow: hidden;
}

.hud-frame .c {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--teal-bright);
}

.hud-frame .tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.hud-frame .tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.hud-frame .bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.hud-frame .br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal-bright), transparent);
  box-shadow: 0 0 18px var(--teal-bright);
  animation: scan 2.4s ease-in-out infinite;
}

@keyframes scan {
  0% { top: 8%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}

.mesh {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
}

.mesh circle {
  fill: #6AADD6;
}

.mesh-dots circle {
  animation: twinkle 1.8s ease-in-out infinite;
}

.mesh-dots circle:nth-child(odd) { animation-delay: 0.4s; }

@keyframes twinkle {
  50% { opacity: 0.25; }
}

.bbox {
  position: absolute;
  left: 22%;
  top: 16%;
  width: 56%;
  height: 62%;
  border: 1.5px solid rgba(106, 173, 214, 0.85);
  box-shadow: 0 0 0 1px rgba(106, 173, 214, 0.15), inset 0 0 30px rgba(0, 100, 176, 0.12);
}

.scene-face.is-on .bbox {
  animation: lock 1.1s 0.3s ease both;
}

@keyframes lock {
  from { transform: scale(1.18); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.readouts {
  justify-self: start;
  display: grid;
  gap: 0.7rem;
  min-width: 8.5rem;
}

.readout {
  padding: 0.55rem 0.75rem;
  border-left: 2px solid rgba(106, 173, 214, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

.readout span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.readout strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.readout.live strong {
  color: var(--teal-bright);
}

.scene-face.is-on .readouts {
  animation: rise-left 0.8s 0.2s ease both;
}

@keyframes rise-left {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}

.match-card {
  justify-self: end;
  width: min(16rem, 34vw);
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(8, 18, 28, 0.86);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.scene-face.is-on .match-card {
  animation: rise-right 0.8s 1.6s ease both;
}

.scene-face.is-on .readout.live strong {
  animation: status-swap 0.01s 1.6s forwards;
}

@keyframes status-swap {
  to { }
}

.scene-face.is-on .readout.live strong::after {
  content: "";
}

@keyframes rise-right {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

.pill {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--teal-bright);
  margin-bottom: 0.5rem;
}

.pill-ok {
  color: var(--ok);
}

.match-card h3,
.ocr-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.match-card p,
.ocr-card p {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.conf {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.conf b { color: var(--ok); }

.conf-bar {
  margin-top: 0.4rem;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.conf-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
}

.scene-face.is-on .conf-bar i {
  animation: fillbar 0.9s 2s ease forwards;
}

@keyframes fillbar {
  to { width: 98%; }
}

.scene-face.is-on .readout.live {
  --live-label: "MATCHED";
}

.scene-face.is-on .readout.live strong {
  animation: flash-ok 0.3s 1.6s both;
}

@keyframes flash-ok {
  to { color: var(--ok); }
}

/* ---------- Plate ---------- */
.scene-plate {
  overflow: hidden;
}

.road {
  position: absolute;
  inset: 8% 10% 18%;
  perspective: 600px;
  background:
    linear-gradient(#0a1a28, #071018 40%),
    linear-gradient(90deg, #0b2230, #123044 50%, #0b2230);
  border-radius: 16px;
  overflow: hidden;
}

.horizon {
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(106, 173, 214, 0.4), transparent);
}

.lanes {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 160%;
  height: 120%;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 34px,
    rgba(255, 255, 255, 0.55) 34px 40px
  );
  clip-path: polygon(49% 0, 51% 0, 62% 100%, 38% 100%);
  opacity: 0.28;
  animation: road 0.9s linear infinite;
}

.road::before,
.road::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18));
}

.road::before {
  left: 18%;
  transform: skewX(18deg);
}

.road::after {
  right: 18%;
  transform: skewX(-18deg);
}

@keyframes road {
  to { background-position: 0 74px; }
}

.car {
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: 260px;
  height: 110px;
  transform: translateX(-50%);
}

.scene-plate.is-on .car {
  animation: approach 2.2s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes approach {
  from { transform: translateX(-50%) translateY(40px) scale(0.55); opacity: 0.2; }
  to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

.car-body {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 18px;
  height: 36px;
  background: linear-gradient(180deg, #1c3348, #0d1a28);
  border-radius: 8px 8px 4px 4px;
}

.car-cabin {
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: 48px;
  height: 28px;
  background: #152536;
  border-radius: 8px 8px 0 0;
}

.car-light {
  position: absolute;
  bottom: 26px;
  width: 10px;
  height: 8px;
  background: #fde68a;
  box-shadow: 0 0 12px #fbbf24;
  border-radius: 2px;
}

.car-light.l { left: 14%; }
.car-light.r { right: 14%; }

.plate {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  background: #f4f7fb;
  color: #0b1324;
  padding: 4px 7px;
  border-radius: 3px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

.plate span,
.plate em {
  min-width: 0.85em;
  text-align: center;
  opacity: 0.15;
}

.scene-plate.is-on .plate span,
.scene-plate.is-on .plate em {
  animation: glyph 0.25s ease forwards;
}

.scene-plate.is-on .plate span:nth-child(1) { animation-delay: 1.4s; }
.scene-plate.is-on .plate span:nth-child(2) { animation-delay: 1.55s; }
.scene-plate.is-on .plate span:nth-child(3) { animation-delay: 1.7s; }
.scene-plate.is-on .plate span:nth-child(4) { animation-delay: 1.85s; }
.scene-plate.is-on .plate em { animation-delay: 2s; }
.scene-plate.is-on .plate span:nth-child(6) { animation-delay: 2.15s; }
.scene-plate.is-on .plate span:nth-child(7) { animation-delay: 2.3s; }

@keyframes glyph {
  to { opacity: 1; }
}

.ocr-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  bottom: 8%;
  background: linear-gradient(90deg, transparent, rgba(106, 173, 214, 0.18), transparent);
  mix-blend-mode: screen;
}

.scene-plate.is-on .ocr-beam {
  animation: beam 1.6s 1.2s ease both;
}

@keyframes beam {
  from { transform: translateX(-40%); opacity: 0; }
  40% { opacity: 1; }
  to { transform: translateX(40%); opacity: 0; }
}

.ocr-card {
  position: absolute;
  right: 6%;
  top: 18%;
  width: min(16rem, 32vw);
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(8, 18, 28, 0.9);
  border: 1px solid rgba(0, 100, 176, 0.35);
}

.ocr-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
}

.ocr-card li {
  padding: 0.2rem 0 0.2rem 1rem;
  position: relative;
}

.ocr-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright);
}

.scene-plate.is-on .ocr-card {
  animation: rise-right 0.8s 2.2s ease both;
}

/* ---------- Live ---------- */
.dash {
  width: min(960px, 92%);
  height: min(520px, 72%);
  display: grid;
  grid-template-columns: 160px 1fr;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: #0b1324;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.dash-side {
  background: #080e18;
  padding: 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #8b97a8;
}

.dash-logo {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.dash-side span {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
}

.dash-side .on {
  background: rgba(0, 100, 176, 0.16);
  color: var(--teal-bright);
}

.cam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}

.cam {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #111c2b;
  min-height: 0;
}

.cam header {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
}

.feed {
  position: relative;
  height: 100%;
  min-height: 140px;
  background:
    linear-gradient(180deg, rgba(0, 100, 176, 0.12), transparent 40%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 4px);
}

.feed-a { background-color: #123044; }
.feed-b { background-color: #152536; }
.feed-c { background-color: #102030; }
.feed-d { background-color: #183044; }

.feed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.35));
}

.hit {
  position: absolute;
  z-index: 2;
  border: 1.5px solid var(--teal-bright);
  box-shadow: 0 0 12px rgba(106, 173, 214, 0.4);
  color: var(--teal-bright);
}

.hit em {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 0.58rem;
  font-style: normal;
  letter-spacing: 0.12em;
  color: inherit;
}

.hit.face {
  width: 28%;
  height: 48%;
  left: 36%;
  top: 18%;
}

.hit.plate {
  width: 34%;
  height: 12%;
  left: 33%;
  bottom: 22%;
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.sil {
  position: absolute;
  background: rgba(30, 58, 76, 0.85);
}

.sil-person {
  width: 22%;
  height: 46%;
  left: 39%;
  bottom: 16%;
  border-radius: 50% 50% 12% 12% / 28% 28% 12% 12%;
}

.sil-person::before {
  content: "";
  position: absolute;
  width: 42%;
  height: 22%;
  left: 29%;
  top: -14%;
  background: inherit;
  border-radius: 50%;
}

.sil-desk {
  width: 54%;
  height: 18%;
  left: 23%;
  bottom: 18%;
  border-radius: 6px;
}

.sil-car {
  width: 48%;
  height: 16%;
  left: 26%;
  bottom: 24%;
  border-radius: 6px 6px 3px 3px;
}

.sil-fence {
  left: 8%;
  right: 8%;
  bottom: 22%;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(106, 173, 214, 0.25) 0 10px, transparent 10px 18px);
}

.scene-live.is-on .cam {
  opacity: 0;
  animation: cam-on 0.6s ease forwards;
}

.scene-live.is-on .cam:nth-child(1) { animation-delay: 0.15s; }
.scene-live.is-on .cam:nth-child(2) { animation-delay: 0.35s; }
.scene-live.is-on .cam:nth-child(3) { animation-delay: 0.55s; }
.scene-live.is-on .cam:nth-child(4) { animation-delay: 0.75s; }

@keyframes cam-on {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.ops-chip {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.18);
  color: var(--ok);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.scene-live.is-on .ops-chip {
  animation: rise 0.7s 1.1s ease both;
}

/* ---------- Field ---------- */
.map {
  width: min(720px, 70%);
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.gps-path {
  fill: none;
  stroke: url(#trail);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
}

.scene-field.is-on .gps-path {
  animation: draw 2.4s 0.3s ease forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.pin {
  fill: var(--teal-bright);
}

.pin-pulse {
  fill: none;
  stroke: var(--teal-bright);
  stroke-width: 2;
}

.scene-field.is-on .pin-pulse {
  animation: ping 1.6s 2.2s ease-out infinite;
}

@keyframes ping {
  from { r: 8; opacity: 0.9; }
  to { r: 28; opacity: 0; }
}

.phone {
  position: absolute;
  right: 8%;
  bottom: 10%;
  width: 150px;
  height: 280px;
  border-radius: 22px;
  border: 3px solid #1a2438;
  background: #0b1324;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.notch {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 48px;
  height: 8px;
  transform: translateX(-50%);
  background: #05090f;
  border-radius: 99px;
  z-index: 2;
}

.phone-feed {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 100, 176, 0.25), transparent 40%),
    #123044;
  padding: 2.2rem 0.8rem;
}

.phone-live {
  display: inline-block;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--ok);
  font-weight: 700;
}

.phone-feed p {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.scene-field.is-on .phone {
  animation: rise-right 0.8s 0.8s ease both;
}

.gps-chip {
  position: absolute;
  left: 10%;
  bottom: 8%;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 100, 176, 0.16);
  color: var(--teal-bright);
  font-size: 0.78rem;
}

.scene-field.is-on .gps-chip {
  animation: rise-left 0.7s 2s ease both;
}

/* ---------- Drone ---------- */
.feed-drone {
  background:
    linear-gradient(180deg, #1a3348 0%, #0e2233 42%, #16301c 42%, #0d2418 100%);
}

.sil-aerial {
  left: 18%;
  right: 18%;
  top: 48%;
  height: 38%;
  background:
    linear-gradient(90deg, transparent 8%, rgba(20, 48, 36, 0.9) 8% 28%, transparent 28% 36%, rgba(18, 42, 32, 0.85) 36% 62%, transparent 62% 70%, rgba(22, 50, 38, 0.9) 70% 92%, transparent 92%),
    repeating-linear-gradient(90deg, rgba(106, 173, 214, 0.12) 0 2px, transparent 2px 28px);
  border-radius: 2px;
}

.sil-aerial::before,
.sil-aerial::after {
  content: "";
  position: absolute;
  background: rgba(28, 58, 46, 0.95);
}

.sil-aerial::before {
  width: 22%;
  height: 28%;
  left: 12%;
  top: 8%;
  border-radius: 2px;
}

.sil-aerial::after {
  width: 30%;
  height: 22%;
  right: 10%;
  top: 18%;
  border-radius: 2px;
}

.hit.air {
  width: 22%;
  height: 18%;
  right: 14%;
  top: 12%;
  border-color: var(--teal-bright);
}

.scene-drone {
  overflow: hidden;
}

.drone-view {
  position: absolute;
  inset: 4% 18% 10% 6%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #071018;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.drone-sky {
  position: absolute;
  inset: 0 0 48% 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 110%, rgba(0, 100, 176, 0.18), transparent 55%),
    linear-gradient(180deg, #0b1c2c 0%, #163044 70%, #8fbfc4 100%);
}

.drone-horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 46%;
  height: 8%;
  background: linear-gradient(180deg, rgba(232, 238, 244, 0.35), transparent);
  transform: rotate(-3deg);
  opacity: 0.55;
}

.scene-drone.is-on .drone-horizon {
  animation: horizon-roll 7s ease-in-out both;
}

@keyframes horizon-roll {
  0% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-6px); }
  100% { transform: rotate(-2deg) translateY(4px); }
}

.drone-ground {
  position: absolute;
  left: -20%;
  right: -20%;
  top: 48%;
  height: 90%;
  transform: perspective(520px) rotateX(58deg);
  transform-origin: 50% 0;
  background:
    linear-gradient(180deg, #2f5a3a 0%, #1a3a28 40%, #102418 100%);
  overflow: hidden;
}

.scene-drone.is-on .drone-ground {
  animation: flyover 8s linear both;
}

@keyframes flyover {
  from { transform: perspective(520px) rotateX(58deg) translateY(18px) scale(1.05); }
  to { transform: perspective(520px) rotateX(58deg) translateY(-70px) scale(1.22); }
}

.drone-roads {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 47%, rgba(210, 220, 210, 0.35) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 62%, rgba(210, 220, 210, 0.22) 62% 66%, transparent 66%);
  opacity: 0.7;
}

.drone-lot {
  position: absolute;
  left: 58%;
  top: 28%;
  width: 28%;
  height: 22%;
  background: repeating-linear-gradient(90deg, rgba(40, 55, 48, 0.7) 0 10px, rgba(70, 90, 72, 0.45) 10px 14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.drone-bldg {
  position: absolute;
  background: linear-gradient(180deg, #3d5568, #1c3348);
  box-shadow: 0 8px 0 #0b1a24;
}

.drone-bldg.b1 { left: 18%; top: 22%; width: 16%; height: 14%; }
.drone-bldg.b2 { left: 38%; top: 18%; width: 12%; height: 20%; }
.drone-bldg.b3 { left: 22%; top: 48%; width: 20%; height: 12%; }
.drone-bldg.b4 { left: 68%; top: 52%; width: 14%; height: 16%; }

.drone-car {
  position: absolute;
  left: 64%;
  top: 34%;
  width: 7%;
  height: 4%;
  background: #d4dce4;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.drone-figure {
  position: absolute;
  left: 44%;
  top: 40%;
  width: 2.4%;
  height: 2.4%;
  border-radius: 50%;
  background: #e8eef4;
  box-shadow: 0 0 10px rgba(106, 173, 214, 0.7);
}

.drone-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 7px,
    rgba(106, 173, 214, 0.04) 7px 8px
  );
  mix-blend-mode: screen;
  pointer-events: none;
  animation: grain 0.8s steps(2) infinite;
}

.drone-reticle {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.drone-reticle::before,
.drone-reticle::after {
  content: "";
  position: absolute;
  background: rgba(106, 173, 214, 0.7);
}

.drone-reticle::before {
  left: 50%;
  top: 18%;
  bottom: 18%;
  width: 1px;
  transform: translateX(-50%);
}

.drone-reticle::after {
  top: 50%;
  left: 18%;
  right: 18%;
  height: 1px;
  transform: translateY(-50%);
}

.drone-reticle i {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--teal-bright);
}

.drone-reticle i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.drone-reticle i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.drone-reticle i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.drone-reticle i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.drone-label {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 3;
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.drone-telem {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.drone-telem li span {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.drone-telem strong {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--teal-bright);
}

.drone-hit.face {
  left: 41%;
  top: 52%;
  width: 9%;
  height: 12%;
  z-index: 3;
}

.drone-hit.plate {
  left: 62%;
  top: 56%;
  width: 12%;
  height: 7%;
  z-index: 3;
}

.scene-drone.is-on .drone-hit {
  opacity: 0;
  animation: lock 0.7s 1.6s ease forwards;
}

.drone-card {
  position: absolute;
  right: 5%;
  top: 18%;
  width: min(16rem, 30vw);
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(8, 18, 28, 0.9);
  border: 1px solid rgba(0, 100, 176, 0.35);
  z-index: 4;
}

.drone-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.drone-card p {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.drone-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
}

.drone-card li {
  padding: 0.2rem 0 0.2rem 1rem;
  position: relative;
}

.drone-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-bright);
}

.scene-drone.is-on .drone-card {
  animation: rise-right 0.8s 1.8s ease both;
}

.scene-drone.is-on .drone-view {
  animation: cam-on 0.7s ease both;
}

/* ---------- Alert ---------- */
.alert-card {
  width: min(420px, 90%);
  border-radius: 16px;
  overflow: hidden;
  background: #12090c;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12), 0 24px 80px rgba(127, 29, 29, 0.35);
}

.alert-card header {
  background: #dc2626;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.scene-alert.is-on .alert-card header {
  animation: alert-flash 1s ease-in-out 2;
}

@keyframes alert-flash {
  50% { filter: brightness(1.25); }
}

.alert-body {
  padding: 1.1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.who {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.mini-face {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--teal-bright);
  background:
    radial-gradient(circle at 50% 38%, rgba(106, 173, 214, 0.35), transparent 42%),
    #0b1324;
}

.who strong { display: block; }
.who span { color: var(--muted); font-size: 0.78rem; }

.plate-mini {
  background: #f4f7fb;
  color: #0b1324;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

.alert-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0 1.2rem 1.1rem;
}

.note {
  font-size: 0.75rem;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.scene-alert.is-on .alert-card {
  animation: pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.scene-alert.is-on .note {
  opacity: 0;
  animation: rise-left 0.45s ease forwards;
}

.scene-alert.is-on .note:nth-child(1) { animation-delay: 0.9s; }
.scene-alert.is-on .note:nth-child(2) { animation-delay: 1.15s; }
.scene-alert.is-on .note:nth-child(3) { animation-delay: 1.4s; }

@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Outro ---------- */
.scene-outro {
  text-align: center;
}

.outro-kicker {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal-bright);
  font-size: 0.78rem;
  margin: 0 0 0.6rem;
}

.scene-outro h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  letter-spacing: -0.05em;
}

.caps {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 36rem;
}

.caps span {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(106, 173, 214, 0.28);
  color: var(--teal-bright);
  font-size: 0.82rem;
  opacity: 0;
}

.scene-outro.is-on .outro-kicker { animation: fade-up 0.7s ease both; }
.scene-outro.is-on h2 { animation: fade-up 0.8s 0.15s ease both; }
.scene-outro.is-on .caps span { animation: cap 0.45s ease forwards; }
.scene-outro.is-on .caps span:nth-child(1) { animation-delay: 0.5s; }
.scene-outro.is-on .caps span:nth-child(2) { animation-delay: 0.62s; }
.scene-outro.is-on .caps span:nth-child(3) { animation-delay: 0.74s; }
.scene-outro.is-on .caps span:nth-child(4) { animation-delay: 0.86s; }
.scene-outro.is-on .caps span:nth-child(5) { animation-delay: 0.98s; }
.scene-outro.is-on .caps span:nth-child(6) { animation-delay: 1.1s; }
.scene-outro.is-on .caps span:nth-child(7) { animation-delay: 1.22s; }

@keyframes cap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.outro-brand {
  margin-top: 2rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--muted);
}

.scene-outro.is-on .outro-brand {
  animation: fade-up 0.7s 1.3s ease both;
}

@media (max-width: 900px) {
  .scene-face {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .readouts,
  .match-card,
  .ocr-card,
  .drone-card {
    justify-self: center;
  }

  .hud-frame {
    width: min(52vw, 240px);
  }

  .dash {
    grid-template-columns: 1fr;
  }

  .dash-side {
    display: none;
  }

  .phone {
    width: 110px;
    height: 210px;
    right: 4%;
  }

  .drone-view {
    inset: 2% 4% 28% 4%;
  }

  .drone-card {
    top: auto;
    bottom: 4%;
    right: 50%;
    transform: translateX(50%);
    width: min(18rem, 88%);
  }

  .caption-bar {
    max-width: calc(100% - 2rem);
    bottom: 4.8rem;
  }

  .ctrl.link {
    display: none;
  }
}

html.preview .scene.is-on .match-card,
html.preview .scene.is-on .ocr-card,
html.preview .scene.is-on .drone-card,
html.preview .scene.is-on .ops-chip,
html.preview .scene.is-on .gps-chip,
html.preview .scene.is-on .phone,
html.preview .scene.is-on .caps span,
html.preview .scene.is-on .note,
html.preview .scene.is-on .plate span,
html.preview .scene.is-on .plate em,
html.preview .scene.is-on .conf-bar i,
html.preview .scene.is-on .gps-path,
html.preview .scene.is-on .drone-horizon,
html.preview .scene.is-on .drone-hit {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

html.preview .scene.is-on .conf-bar i {
  width: 98%;
}

html.preview .scene.is-on .gps-path {
  stroke-dashoffset: 0;
}

html.preview .scene.is-on .drone-ground {
  animation: none !important;
  transform: perspective(520px) rotateX(58deg) translateY(-30px) scale(1.12) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html.embed .ctrl.link {
  display: none;
}

html.embed .hud-top,
html.embed .hud-bottom {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

html.embed .stage {
  inset: 3.4rem 0.9rem 6.2rem;
}

html.embed .caption-bar {
  left: 0.9rem;
  bottom: 3.7rem;
}

html.embed .caption {
  font-size: clamp(0.95rem, 2.4vw, 1.45rem);
}
