/* ============================================================
   background.css – Animated blob background + grain + vignette
   ============================================================ */

/* ---------- Container ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #07090d;
}

/* ---------- Blobs ----------
   Large soft radial-gradient circles that drift slowly.
   Transform-only animations for GPU compositing.
   ---------------------------------- */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.bg-blob-1 {
  width: 60vw;
  height: 60vh;
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(59, 63, 143, 0.35) 0%, transparent 70%);
  animation: blob-drift-1 55s ease-in-out infinite alternate;
}

.bg-blob-2 {
  width: 50vw;
  height: 55vh;
  top: 30%;
  right: -5%;
  background: radial-gradient(circle, rgba(31, 111, 120, 0.30) 0%, transparent 70%);
  animation: blob-drift-2 70s ease-in-out infinite alternate;
}

.bg-blob-3 {
  width: 55vw;
  height: 50vh;
  bottom: -10%;
  left: 20%;
  background: radial-gradient(circle, rgba(91, 58, 140, 0.28) 0%, transparent 70%);
  animation: blob-drift-3 85s ease-in-out infinite alternate;
}

.bg-blob-4 {
  width: 45vw;
  height: 45vh;
  top: 50%;
  left: -5%;
  background: radial-gradient(circle, rgba(28, 58, 110, 0.32) 0%, transparent 70%);
  animation: blob-drift-4 45s ease-in-out infinite alternate;
}

/* ---------- Keyframes ---------- */
@keyframes blob-drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(8%, 12%, 0) scale(1.15); }
}
@keyframes blob-drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-10%, 6%, 0) scale(0.9); }
}
@keyframes blob-drift-3 {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(8%, -8%, 0) scale(0.92); }
}
@keyframes blob-drift-4 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(12%, -5%, 0) scale(1.1); }
}

/* ---------- Noise overlay ----------
   Inline SVG feTurbulence prevents gradient banding on large dark areas. */
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  opacity: 0.035;
}

/* ---------- Vignette ---------- */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 80% at center, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-blob {
    animation: none !important;
  }
}
