:root {
  color-scheme: dark;
  --cyan: 76, 226, 255;
  --blue: 35, 132, 255;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #020711;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.stage-wrap {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(var(--blue), .08), transparent 39%),
    #020711;
}

.stage {
  position: relative;
  width: min(100vw, calc(100vh * 1672 / 941));
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  isolation: isolate;
  background: #020711;
}

.base-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  user-select: none;
  pointer-events: none;
}

.ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(42px);
  pointer-events: none;
  z-index: 2;
  opacity: .18;
  mix-blend-mode: screen;
}

.ambient-a {
  width: 28%;
  aspect-ratio: 1;
  left: 36%;
  top: 25%;
  background: radial-gradient(circle, rgba(var(--cyan), .38), transparent 68%);
  animation: ambientBreath 5.6s ease-in-out infinite;
}

.ambient-b {
  width: 55%;
  aspect-ratio: 1;
  left: 22.5%;
  top: 2%;
  background: radial-gradient(circle, transparent 52%, rgba(var(--blue), .08) 62%, transparent 74%);
  animation: ambientBreath 8s ease-in-out infinite reverse;
}

.center-pulse,
.center-sheen {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}

.center-pulse {
  width: 24.5%;
  aspect-ratio: 1;
  border: 1px solid rgba(var(--cyan), .35);
  box-shadow:
    0 0 18px rgba(var(--cyan), .22),
    inset 0 0 22px rgba(var(--blue), .08);
  opacity: 0;
}

.pulse-a { animation: pulseRing 4.4s ease-out infinite; }
.pulse-b { animation: pulseRing 4.4s 2.2s ease-out infinite; }

.center-sheen {
  width: 21%;
  aspect-ratio: 1;
  overflow: hidden;
  opacity: .32;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.13) 47%, transparent 62%);
  transform: rotate(-16deg);
  animation: sheen 6.5s ease-in-out infinite;
}

.hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
  mix-blend-mode: screen;
}

.orbit {
  fill: none;
  stroke: rgba(var(--cyan), .18);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 3 22;
  transform-origin: 836px 472px;
}

.orbit-1 { animation: orbitCW 24s linear infinite; opacity: .42; }
.orbit-2 { animation: orbitCCW 36s linear infinite; opacity: .28; stroke-dasharray: 2 30; }
.orbit-3 { animation: orbitCW 55s linear infinite; opacity: .20; stroke-dasharray: 1 42; }

.particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: screen;
}

.motion-toggle {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 9;
  padding: 8px 12px;
  border: 1px solid rgba(129, 231, 255, .22);
  border-radius: 999px;
  color: rgba(225, 249, 255, .82);
  background: rgba(2, 14, 29, .55);
  backdrop-filter: blur(10px);
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
}

.stage:hover .motion-toggle,
.motion-toggle:focus-visible { opacity: 1; }
.motion-toggle:hover { background: rgba(7, 33, 58, .72); }

.stage.paused *,
.stage.paused *::before,
.stage.paused *::after {
  animation-play-state: paused !important;
}

@keyframes pulseRing {
  0% { scale: .9; opacity: 0; }
  16% { opacity: .34; }
  100% { scale: 1.45; opacity: 0; }
}

@keyframes ambientBreath {
  0%, 100% { transform: scale(.95); opacity: .12; }
  50% { transform: scale(1.06); opacity: .22; }
}

@keyframes sheen {
  0%, 38% { transform: translateX(-20%) rotate(-16deg); opacity: 0; }
  52% { opacity: .28; }
  68%, 100% { transform: translateX(22%) rotate(-16deg); opacity: 0; }
}

@keyframes orbitCW { to { transform: rotate(360deg); } }
@keyframes orbitCCW { to { transform: rotate(-360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ambient,
  .center-pulse,
  .center-sheen,
  .orbit { animation: none !important; }
  .motion-toggle { display: none; }
}
