:root {
  color-scheme: dark;
  --ink: #010302;
  --void: #000;
  --green: #72ff9f;
  --green-hot: #c4ff75;
  --green-mid: #25b95c;
  --green-dark: #062913;
  --green-hairline: rgba(150, 255, 181, .18);
  --frame-inset: clamp(14px, 2vw, 28px);
  font-family: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: crosshair;
}

.stage {
  --pointer-x: 50vw;
  --pointer-y: 50vh;
  --eye-shift-x: 0px;
  --eye-shift-y: 0px;
  --eye-rotate-x: 0deg;
  --eye-rotate-y: 0deg;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 52% 48%, rgba(16, 106, 52, .17) 0, rgba(5, 31, 16, .13) 20%, transparent 48%),
    radial-gradient(ellipse at 50% 50%, #07100a 0, #030805 43%, #010302 72%, #000 100%);
}

.stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -22%;
  background-image:
    linear-gradient(rgba(124, 255, 166, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 255, 166, .025) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(920px) rotateX(60deg) translateY(17%);
  transform-origin: center 72%;
  mask-image: radial-gradient(circle at 50% 53%, #000 0 22%, transparent 74%);
  opacity: .76;
}

.stage::after {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .19) 4px, transparent 5px),
    radial-gradient(ellipse at center, transparent 32%, rgba(0, 0, 0, .48) 74%, rgba(0, 0, 0, .86) 100%);
  mix-blend-mode: multiply;
}

.code-rain {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .38;
  filter: saturate(.82) contrast(1.12);
  mix-blend-mode: screen;
  pointer-events: none;
}

.atmosphere {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.perspective-grid {
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -50%;
  height: 105%;
  background-image:
    linear-gradient(rgba(83, 255, 146, .095) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 255, 146, .07) 1px, transparent 1px);
  background-size: 72px 52px;
  transform: perspective(610px) rotateX(67deg);
  transform-origin: center top;
  mask-image: linear-gradient(to bottom, transparent 0, #000 23%, transparent 83%);
  animation: grid-drift 15s linear infinite;
}

.radar-field {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(145vh, 145vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 71px, rgba(110, 255, 157, .035) 72px, transparent 73px 143px),
    repeating-conic-gradient(from 0deg, transparent 0 14.9deg, rgba(110, 255, 157, .035) 15deg 15.08deg);
  mask-image: radial-gradient(circle, transparent 0 24%, #000 43%, transparent 80%);
  opacity: .8;
  animation: radar-turn 110s linear infinite;
}

.system-scan {
  position: absolute;
  z-index: 1;
  top: -12%;
  left: 0;
  width: 100%;
  height: 12vh;
  background:
    linear-gradient(to bottom, transparent, rgba(91, 255, 147, .015) 55%, rgba(167, 255, 193, .095) 92%, rgba(191, 255, 208, .24) 100%);
  border-bottom: 1px solid rgba(155, 255, 184, .21);
  box-shadow: 0 18px 45px rgba(65, 255, 125, .05);
  animation: page-scan 9.5s linear infinite;
}

.glitch-scan {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent 0 10%, rgba(147, 255, 183, .38) 22%, transparent 38% 100%);
  opacity: .28;
}

.glitch-scan::after {
  content: "";
  position: absolute;
  left: 67%;
  top: -1px;
  width: 19%;
  height: 2px;
  background: rgba(255, 77, 65, .22);
}

.glitch-scan--a {
  top: 27%;
  width: 88%;
  left: -15%;
  animation: glitch-line-a 7.4s steps(1) infinite;
}

.glitch-scan--b {
  top: 72%;
  width: 62%;
  right: -25%;
  transform: scaleX(-1);
  opacity: .16;
  animation: glitch-line-b 10.8s steps(1) infinite;
}

.noise {
  position: absolute;
  z-index: 3;
  inset: 0;
  opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 190px;
  mix-blend-mode: soft-light;
  animation: noise-shift .22s steps(2) infinite;
}

.vignette {
  position: absolute;
  z-index: 4;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 28%, rgba(0, 0, 0, .23) 67%, rgba(0, 0, 0, .73) 100%);
}

.hud-code {
  position: absolute;
  z-index: 7;
  inset: clamp(22px, 3.4vw, 54px);
  pointer-events: none;
  color: rgba(168, 255, 197, .3);
  font-size: clamp(7px, .58vw, 9px);
  line-height: 1.7;
  letter-spacing: .23em;
  text-transform: uppercase;
  filter: blur(.12px);
}

.hud-code span {
  position: absolute;
  display: block;
  white-space: nowrap;
  transition: opacity .3s ease, color .3s ease;
}

.hud-code span:nth-child(1) { top: 0; left: 0; }
.hud-code span:nth-child(2) { top: 1.6em; left: 0; opacity: .57; }
.hud-code span:nth-child(3) { top: 0; right: 18%; }
.hud-code span:nth-child(4) { top: 1.6em; right: 0; }
.hud-code span:nth-child(5) { top: 47%; left: 0; writing-mode: vertical-rl; opacity: .52; }
.hud-code span:nth-child(6) { top: 48%; right: 0; writing-mode: vertical-rl; opacity: .52; }
.hud-code span:nth-child(7) { bottom: 1.6em; left: 0; opacity: .5; }
.hud-code span:nth-child(8) { bottom: 0; left: 0; }
.hud-code span:nth-child(9) { right: 17%; bottom: 1.6em; opacity: .48; }
.hud-code span:nth-child(10) { right: 0; bottom: 0; }

.stage[data-mode="track"] .hud-code {
  color: rgba(255, 184, 137, .39);
}

.pointer-field {
  position: absolute;
  z-index: 5;
  left: var(--pointer-x);
  top: var(--pointer-y);
  width: min(52vw, 700px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.75);
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(177, 255, 113, .075) 0, rgba(91, 255, 145, .026) 29%, transparent 68%);
  mix-blend-mode: screen;
  transition:
    opacity .35s ease,
    transform .65s cubic-bezier(.2, .75, .22, 1),
    background .16s ease-out;
}

.stage[data-mode="track"] .pointer-field {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle, rgba(255, 82, 46, .07) 0, rgba(182, 26, 17, .022) 31%, transparent 68%);
}

.enemy-layer {
  position: absolute;
  z-index: 15;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .16s ease-in,
    visibility 0s linear .16s;
}

.stage[data-mode="track"] .enemy-layer {
  opacity: 1;
  visibility: visible;
  transition:
    opacity .07s ease-out,
    visibility 0s linear 0s;
}

.target-reticle {
  position: absolute;
  left: var(--pointer-x);
  top: var(--pointer-y);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 85, 58, .5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(transparent calc(50% - .5px), rgba(255, 103, 72, .6) 50%, transparent calc(50% + .5px)),
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(255, 103, 72, .6) 50%, transparent calc(50% + .5px));
  box-shadow:
    0 0 0 7px rgba(255, 70, 43, .025),
    0 0 28px rgba(255, 51, 36, .18);
  -webkit-mask-image: radial-gradient(circle, #000 0 28%, transparent 29% 38%, #000 39% 63%, transparent 64%);
  mask-image: radial-gradient(circle, #000 0 28%, transparent 29% 38%, #000 39% 63%, transparent 64%);
}

.target-reticle::before,
.target-reticle::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.target-reticle::before {
  inset: -13px;
  border: 1px dashed rgba(255, 104, 72, .28);
  animation: reticle-turn 5.4s linear infinite;
}

.target-reticle::after {
  inset: -23px;
  border: 1px solid rgba(255, 95, 62, .08);
}

.target-reticle__orbit {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 131, 101, .24);
  border-radius: 50%;
  animation: reticle-turn 2.8s linear infinite reverse;
}

.target-reticle__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff8064;
  box-shadow: 0 0 10px rgba(255, 72, 47, .95);
  transform: translate(-50%, -50%);
}

.threat-card {
  position: absolute;
  top: 50%;
  right: clamp(20px, 2.2vw, 38px);
  width: min(344px, calc(100vw - 28px));
  overflow: hidden;
  padding: 12px 14px 10px;
  color: rgba(205, 255, 217, .78);
  border: 1px solid rgba(255, 94, 64, .52);
  border-left-width: 3px;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  background:
    linear-gradient(rgba(255, 70, 45, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 70, 45, .035) 1px, transparent 1px),
    linear-gradient(145deg, rgba(4, 20, 10, .94), rgba(1, 5, 3, .91));
  background-size: 19px 19px, 19px 19px, auto;
  box-shadow:
    0 18px 58px rgba(0, 0, 0, .65),
    inset 0 0 34px rgba(79, 255, 128, .035),
    0 0 24px rgba(255, 55, 36, .1);
  -webkit-backdrop-filter: blur(11px) saturate(.8);
  backdrop-filter: blur(11px) saturate(.8);
  opacity: 0;
  transform: translate(18px, -50%);
  transform-origin: right center;
  transition:
    opacity .16s ease-in,
    transform .2s ease-in;
}

.stage[data-mode="track"] .threat-card {
  opacity: 1;
  transform: translate(0, -50%);
  transition:
    opacity .09s ease-out,
    transform .16s cubic-bezier(.16, .82, .25, 1);
}

.threat-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 31px;
  height: 2px;
  background: #ff5138;
  box-shadow: 0 0 12px rgba(255, 74, 45, .72);
}

.threat-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 0;
  width: 74px;
  height: 1px;
  background: rgba(255, 107, 75, .42);
}

.threat-card__scan {
  position: absolute;
  z-index: 0;
  inset: -25% 0 auto;
  height: 24%;
  background: linear-gradient(to bottom, transparent, rgba(255, 77, 46, .075), rgba(255, 139, 102, .13), transparent);
  animation: dossier-scan 2.2s linear infinite;
  pointer-events: none;
}

.threat-card__header,
.threat-card__subject,
.threat-card__fields,
.threat-card__level,
.threat-card__footer {
  position: relative;
  z-index: 1;
}

.threat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7px;
  color: rgba(255, 115, 81, .88);
  border-bottom: 1px solid rgba(255, 90, 62, .28);
  font-size: 8px;
  line-height: 1;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 63, 31, .34);
}

.threat-card__signal {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #ff5b3e;
  box-shadow: 0 0 9px #ff5031;
  animation: alert-blink .75s steps(1) infinite;
}

.threat-card__subject {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 0 8px;
  border-bottom: 1px solid rgba(118, 255, 153, .12);
}

.threat-card__subject span {
  color: rgba(154, 255, 181, .44);
  font-size: 7px;
  letter-spacing: .22em;
}

.threat-card__subject strong {
  color: #f1ffcb;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  text-shadow: 0 0 12px rgba(132, 255, 144, .24);
}

.threat-card__fields {
  display: grid;
  padding: 3px 0;
}

.threat-field {
  display: grid;
  grid-template-columns: 39% minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 20px;
  border-bottom: 1px solid rgba(109, 255, 146, .065);
  font-size: 8px;
  letter-spacing: .045em;
}

.threat-field span {
  color: rgba(138, 255, 169, .34);
  font-size: 6.5px;
  letter-spacing: .13em;
  white-space: nowrap;
}

.threat-field strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(209, 255, 219, .85);
  font-size: 8.2px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: .035em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#detectedIp,
#detectedRegion {
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.threat-field:nth-child(1) strong,
.threat-field:nth-child(4) strong {
  color: #ff9b78;
}

.threat-card__level {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 0 8px;
  color: rgba(255, 126, 91, .68);
  font-size: 6.5px;
  letter-spacing: .13em;
}

.threat-card__level b {
  color: #ff8c68;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: .1em;
}

.threat-meter {
  height: 3px;
  overflow: hidden;
  background: rgba(255, 80, 52, .1);
}

.threat-meter i {
  display: block;
  width: 94%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 83, 55, .24), #ff5437);
  box-shadow: 0 0 9px rgba(255, 66, 40, .55);
  animation: threat-flutter 2.8s steps(1) infinite;
}

.threat-card__footer {
  display: flex;
  justify-content: space-between;
  padding-top: 7px;
  color: rgba(133, 255, 164, .3);
  border-top: 1px solid rgba(112, 255, 151, .13);
  font-size: 6px;
  letter-spacing: .105em;
}

.screen-frame {
  position: absolute;
  z-index: 18;
  inset: var(--frame-inset);
  border: 1px solid rgba(141, 255, 178, .12);
  clip-path: polygon(0 0, 23% 0, 23% 1px, 77% 1px, 77% 0, 100% 0, 100% 100%, 71% 100%, 71% calc(100% - 1px), 29% calc(100% - 1px), 29% 100%, 0 100%);
  pointer-events: none;
}

.screen-frame::before,
.screen-frame::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(173, 255, 201, .55);
}

.screen-frame::before {
  left: 0;
  top: 0;
  border-right: 0;
  border-bottom: 0;
}

.screen-frame::after {
  right: 0;
  bottom: 0;
  border-left: 0;
  border-top: 0;
}

.eye-system {
  position: relative;
  z-index: 8;
  display: grid;
  place-items: center;
  width: min(88vw, 87vh, 960px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  transition: transform .24s cubic-bezier(.2, .75, .22, 1);
}

.eye-parallax {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  transform:
    translate3d(var(--eye-shift-x), var(--eye-shift-y), 0)
    rotateX(var(--eye-rotate-x))
    rotateY(var(--eye-rotate-y));
  transform-style: preserve-3d;
  transition: filter .35s ease;
  filter:
    drop-shadow(0 0 38px rgba(52, 255, 116, .17))
    drop-shadow(0 28px 28px rgba(0, 0, 0, .76))
    drop-shadow(0 48px 64px rgba(0, 0, 0, .9));
  will-change: transform;
}

.stage[data-mode="track"] .eye-parallax {
  filter:
    drop-shadow(0 0 52px rgba(146, 255, 101, .23))
    drop-shadow(0 48px 64px rgba(0, 0, 0, .9));
}

.eye-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lens-reflection {
  position: absolute;
  z-index: 4;
  left: 33.5%;
  top: 27.7%;
  width: 38.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, .17) 0 2%, rgba(225, 255, 230, .08) 8%, transparent 24%),
    radial-gradient(circle at 64% 74%, rgba(0, 0, 0, .04) 0 30%, rgba(0, 0, 0, .3) 73%, rgba(0, 0, 0, .57) 100%);
  box-shadow:
    inset 10px 13px 24px rgba(224, 255, 226, .07),
    inset -18px -22px 32px rgba(0, 0, 0, .38);
  mix-blend-mode: screen;
  opacity: .72;
  transition: box-shadow .18s ease, opacity .18s ease;
}

.lens-reflection::after {
  content: "";
  position: absolute;
  left: 21%;
  top: 13%;
  width: 19%;
  height: 8%;
  border-radius: 50%;
  background: rgba(240, 255, 240, .2);
  filter: blur(5px);
  transform: rotate(-24deg);
}

.stage[data-mode="track"] .lens-reflection {
  opacity: .84;
  box-shadow:
    inset 10px 13px 27px rgba(255, 194, 165, .09),
    inset -23px -25px 38px rgba(20, 0, 0, .48);
}

.iris-red-halo {
  opacity: 0;
  filter: url("#softBloom");
  transition: opacity .3s ease-out;
}

.iris-alert {
  opacity: 0;
  transition: opacity .3s ease-out;
}

.stage[data-mode="track"] .iris-red-halo {
  opacity: .38;
  transition-duration: .11s;
  transition-timing-function: ease-out;
}

.stage[data-mode="track"] .iris-alert {
  opacity: 1;
  transition-duration: .12s;
  transition-timing-function: ease-out;
}

.aggressive-lids {
  opacity: 0;
  transform: translateY(-22px);
  transition:
    opacity .32s ease-in,
    transform .34s ease-in;
}

.stage[data-mode="track"] .aggressive-lids {
  opacity: .98;
  transform: translateY(0);
  transition-duration: .105s;
  transition-timing-function: cubic-bezier(.16, .82, .25, 1);
}

.tracking-shutters {
  opacity: 0;
  transition: opacity .24s ease-in;
}

.stage[data-mode="track"] .tracking-shutters {
  opacity: .98;
  transition-duration: .105s;
  transition-timing-function: cubic-bezier(.16, .82, .25, 1);
}

.predator-brows {
  opacity: 0;
  transform: translateY(-11px);
  transition:
    opacity .28s ease-in,
    transform .3s ease-in;
}

.stage[data-mode="track"] .predator-brows {
  opacity: .96;
  transform: translateY(0);
  transition-duration: .1s;
  transition-timing-function: cubic-bezier(.16, .82, .25, 1);
}

.stage[data-mode="track"] .predator-brows path:nth-child(n + 3) {
  stroke: #e4e8cf;
  stroke-opacity: .62;
}

.pupil {
  transform-box: fill-box;
  transform-origin: center;
  transition:
    transform .31s ease-in,
    filter .31s ease-in;
}

.stage[data-mode="track"] .pupil {
  transform: scaleX(.72) scaleY(1.18);
  filter: drop-shadow(0 0 11px rgba(255, 74, 52, .5));
  transition-duration: .1s;
}

.mechanism {
  transform-origin: 500px 500px;
  animation: mechanism-turn 65s linear infinite;
}

.mechanism__ring--b {
  transform-origin: 500px 500px;
  animation: mechanism-counter-turn 38s linear infinite;
}

.mechanism__ring--d {
  transform-origin: 500px 500px;
  animation: mechanism-turn 23s linear infinite;
}

.axis-marks {
  animation: axis-pulse 3.2s ease-in-out infinite;
}

.sclera-veins {
  animation: vein-pulse 4.2s ease-in-out infinite;
}

.eye-scanline {
  transform: translateY(0);
  opacity: .75;
  animation: eye-scan 3.3s cubic-bezier(.45, .04, .55, .96) infinite alternate;
  transition: opacity .2s ease;
}

.eye-mini-grid {
  transform-origin: 500px 500px;
  animation: mini-grid-turn 44s linear infinite;
}

.lid-highlight {
  animation: lid-glint 6s ease-in-out infinite;
}

.scan-arc {
  position: absolute;
  z-index: 0;
  inset: -1%;
  border-radius: 50%;
  background: conic-gradient(
    from 178deg,
    transparent 0deg,
    transparent 26deg,
    rgba(106, 255, 158, .025) 29deg,
    rgba(132, 255, 177, .21) 37deg,
    rgba(192, 255, 137, .42) 40deg,
    rgba(132, 255, 177, .08) 43deg,
    transparent 47deg,
    transparent 360deg
  );
  mask-image: radial-gradient(circle, transparent 0 8%, #000 26% 48%, rgba(0, 0, 0, .55) 68%, transparent 76%);
  filter: blur(2.5px);
  animation: scan-arc-turn 5.2s linear infinite;
  transition: opacity .5s ease, filter .5s ease;
  will-change: transform;
}

.stage[data-mode="track"] .scan-arc {
  animation-play-state: paused;
  opacity: .07;
  filter: blur(7px);
}

.stage[data-mode="track"] .eye-scanline {
  animation-play-state: paused;
  opacity: 0;
}

.stage[data-mode="track"] .system-scan {
  opacity: .32;
}

.radar-rings {
  position: absolute;
  z-index: 1;
  inset: 3%;
  border-radius: 50%;
  pointer-events: none;
}

.radar-rings span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(130, 255, 169, .11);
  border-radius: 50%;
  animation: radar-pulse 4.8s cubic-bezier(.2, .5, .45, 1) infinite;
}

.radar-rings span:nth-child(2) {
  animation-delay: -1.6s;
}

.radar-rings span:nth-child(3) {
  animation-delay: -3.2s;
}

.stage[data-mode="track"] .radar-rings span {
  animation-play-state: paused;
  opacity: .12;
}

.eye-glitch {
  position: absolute;
  z-index: 5;
  height: 2px;
  pointer-events: none;
  background: rgba(204, 255, 209, .52);
  box-shadow: 20px 0 rgba(255, 88, 73, .35), -16px 0 rgba(62, 135, 255, .22);
  mix-blend-mode: screen;
}

.eye-glitch--a {
  left: 28%;
  top: 34%;
  width: 47%;
  opacity: .27;
  animation: eye-glitch-a 6.7s steps(1) infinite;
}

.eye-glitch--b {
  left: 49%;
  top: 62%;
  width: 33%;
  height: 1px;
  opacity: .14;
  animation: eye-glitch-b 9.5s steps(1) infinite;
}

.stage.is-glitching .eye-parallax {
  animation: micro-glitch .18s steps(2) 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes scan-arc-turn {
  to { transform: rotate(360deg); }
}

@keyframes reticle-turn {
  to { transform: rotate(360deg); }
}

@keyframes dossier-scan {
  from { transform: translateY(0); }
  to { transform: translateY(520%); }
}

@keyframes alert-blink {
  0%, 52% { opacity: 1; }
  53%, 100% { opacity: .28; }
}

@keyframes threat-flutter {
  0%, 17%, 20%, 63%, 66%, 100% { opacity: .84; transform: scaleX(1); }
  18%, 19% { opacity: .45; transform: scaleX(.88); transform-origin: left; }
  64%, 65% { opacity: .68; transform: scaleX(.96); transform-origin: left; }
}

@keyframes mechanism-turn {
  to { transform: rotate(360deg); }
}

@keyframes mechanism-counter-turn {
  to { transform: rotate(-360deg); }
}

@keyframes mini-grid-turn {
  to { transform: rotate(360deg); }
}

@keyframes eye-scan {
  0%, 8% { transform: translateY(0); opacity: 0; }
  18% { opacity: .8; }
  82% { opacity: .8; }
  92%, 100% { transform: translateY(402px); opacity: 0; }
}

@keyframes radar-pulse {
  0% { transform: scale(.72); opacity: 0; }
  20% { opacity: .64; }
  100% { transform: scale(1.04); opacity: 0; }
}

@keyframes axis-pulse {
  0%, 100% { opacity: .43; }
  50% { opacity: .82; }
}

@keyframes vein-pulse {
  0%, 100% { opacity: .29; }
  50% { opacity: .51; }
}

@keyframes lid-glint {
  0%, 74%, 100% { stroke-opacity: .17; }
  79% { stroke-opacity: .42; }
  81% { stroke-opacity: .13; }
  84% { stroke-opacity: .29; }
}

@keyframes grid-drift {
  to { background-position: 0 52px, 72px 0; }
}

@keyframes radar-turn {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes page-scan {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: .8; }
  88% { opacity: .62; }
  100% { transform: translateY(114vh); opacity: 0; }
}

@keyframes noise-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5%, 1%); }
  50% { transform: translate(1%, -1.5%); }
  75% { transform: translate(1.5%, 1.5%); }
  100% { transform: translate(-1%, -.5%); }
}

@keyframes glitch-line-a {
  0%, 16%, 19%, 49%, 52%, 100% { transform: translateX(0); opacity: 0; }
  17% { transform: translateX(3.5%); opacity: .3; }
  18% { transform: translateX(-1%); opacity: .08; }
  50% { transform: translateX(-2.5%); opacity: .2; }
}

@keyframes glitch-line-b {
  0%, 7%, 9%, 64%, 67%, 100% { transform: scaleX(-1) translateX(0); opacity: 0; }
  8% { transform: scaleX(-1) translateX(4%); opacity: .25; }
  65% { transform: scaleX(-1) translateX(-2%); opacity: .14; }
}

@keyframes eye-glitch-a {
  0%, 23%, 25%, 72%, 74%, 100% { transform: translateX(0); opacity: .06; }
  24% { transform: translateX(10px); opacity: .38; }
  73% { transform: translateX(-16px); opacity: .29; }
}

@keyframes eye-glitch-b {
  0%, 43%, 45%, 100% { transform: translateX(0); opacity: .06; }
  44% { transform: translateX(-24px); opacity: .31; }
}

@keyframes micro-glitch {
  0% { transform: translate3d(var(--eye-shift-x), var(--eye-shift-y), 0); }
  33% { transform: translate3d(3px, -1px, 0) skewX(.25deg); }
  66% { transform: translate3d(-2px, 1px, 0) skewX(-.2deg); }
  100% { transform: translate3d(var(--eye-shift-x), var(--eye-shift-y), 0); }
}

@media (max-width: 720px) {
  .hud-code span:nth-child(3),
  .hud-code span:nth-child(6),
  .hud-code span:nth-child(9) {
    display: none;
  }

  .hud-code span:nth-child(4) {
    right: 0;
  }

  .eye-system {
    width: min(106vw, 75vh);
  }

  .stage[data-mode="track"] .threat-card {
    width: calc(100vw - 24px);
  }

  .threat-card {
    padding: 11px 12px 9px;
  }

  .threat-card__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }

  .threat-field {
    display: flex;
    min-height: 29px;
    padding: 3px 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
  }

  .threat-field strong,
  .threat-field span {
    width: 100%;
    text-align: left;
  }

  .threat-field strong {
    font-size: 7.8px;
  }

  .target-reticle {
    width: 39px;
    height: 39px;
  }

  .noise {
    opacity: .11;
  }
}

@media (max-width: 1100px) {
  .threat-card {
    top: auto;
    right: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    width: min(520px, calc(100vw - 24px));
    transform: translate(-50%, 16px);
    transform-origin: center bottom;
  }

  .stage[data-mode="track"] .threat-card {
    transform: translate(-50%, 0);
  }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .threat-card {
    top: 50%;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: auto;
    left: auto;
    width: min(310px, 46vw);
    transform: translate(14px, -50%);
    transform-origin: right center;
  }

  .stage[data-mode="track"] .threat-card {
    transform: translate(0, -50%);
  }

  .stage[data-mode="track"] .eye-system {
    transform: translateX(-7vw);
  }

  .threat-card__fields {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .threat-field {
    display: grid;
    min-height: 17px;
    padding: 0;
    grid-template-columns: 38% minmax(0, 1fr);
    gap: 6px;
    align-items: center;
  }

  .threat-field strong {
    width: auto;
    text-align: right;
    font-size: 7px;
  }

  .threat-field span {
    width: auto;
    font-size: 5.8px;
  }

  .threat-card__header,
  .threat-card__subject,
  .threat-card__level,
  .threat-card__footer {
    transform: scale(.94);
    transform-origin: left center;
  }
}

@media (max-width: 720px) and (orientation: portrait) and (max-height: 760px) {
  .stage[data-mode="track"] .eye-system {
    transform: translateY(-6vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mechanism,
  .mechanism__ring--b,
  .mechanism__ring--d,
  .radar-field,
  .eye-mini-grid {
    animation-duration: 120s;
  }

  .scan-arc {
    animation-duration: 16s;
  }

  .system-scan {
    animation-duration: 22s;
  }

  .noise,
  .glitch-scan {
    display: none;
  }
}
