.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-base);
  isolation: isolate;
}

.bg-base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 52% -12%, rgba(255, 255, 255, 0.28), transparent 62%),
    radial-gradient(ellipse 60% 50% at 15% 10%, var(--accent-violet-soft), transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 30%, var(--accent-blue-soft), transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 100%, var(--accent-cyan-soft), transparent 70%),
    linear-gradient(180deg, #07071a 0%, var(--bg-base) 60%, #03030c 100%);
}

.bg-network-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.88;
  mix-blend-mode: screen;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  will-change: transform;
}

.bg-blob--violet {
  top: -12%;
  left: -8%;
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.85) 0%, rgba(124, 58, 237, 0.25) 45%, transparent 70%);
  opacity: 0.42;
}

.bg-blob--blue {
  top: 10%;
  right: -15%;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.75) 0%, rgba(59, 130, 246, 0.22) 45%, transparent 70%);
  opacity: 0.36;
}

.bg-blob--cyan {
  bottom: -20%;
  left: 20%;
  width: 65vmax;
  height: 65vmax;
  background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.7) 0%, rgba(6, 182, 212, 0.2) 45%, transparent 70%);
  opacity: 0.46;
}

.bg-blob--magenta {
  top: 40%;
  left: 35%;
  width: 35vmax;
  height: 35vmax;
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.45) 0%, rgba(99, 102, 241, 0.18) 50%, transparent 75%);
  opacity: 0.28;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 90%);
  opacity: 0.18;
}

.bg-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  opacity: 0.08;
  mix-blend-mode: overlay;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, transparent 20%, rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.72) 100%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 34%, rgba(0, 0, 0, 0.64) 100%);
  pointer-events: none;
}

.bg-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(124, 58, 237, 0.6) 40%, transparent 70%);
  filter: blur(2px);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity var(--t-med);
  pointer-events: none;
}

.bg-cursor.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .bg-blob--violet  { animation: bg-float-a 22s ease-in-out infinite; }
  .bg-blob--blue    { animation: bg-float-b 28s ease-in-out infinite; }
  .bg-blob--cyan    { animation: bg-float-c 34s ease-in-out infinite; }
  .bg-blob--magenta { animation: bg-float-d 26s ease-in-out infinite; }
}

@keyframes bg-float-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(8vw, 6vh, 0) scale(1.08); }
}

@keyframes bg-float-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-7vw, 5vh, 0) scale(1.1); }
}

@keyframes bg-float-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(5vw, -7vh, 0) scale(1.05); }
}

@keyframes bg-float-d {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-6vw, -5vh, 0) scale(1.12); }
}
