/* ===== Efficient Ethereal Background =====
 * Static gradient blobs + compositor-only layer transforms.
 * Replaces animated radial-gradient custom properties on ::before/::after.
 */

:root {
  --scroll-progress-1: 0;
}

.ethereal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

/* Base sky + static ambient wash — fills gaps when blobs shift */
.ethereal-bg__base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 18% 22%, rgba(255, 175, 205, 0.38), transparent 72%),
    radial-gradient(ellipse 85% 65% at 78% 28%, rgba(165, 215, 255, 0.42), transparent 74%),
    radial-gradient(ellipse 80% 60% at 32% 82%, rgba(185, 255, 210, 0.36), transparent 72%),
    linear-gradient(180deg, #ffffff 0%, #f5f7ff 60%, #f7fcff 100%);
}

/*
 * Oversized centered layers — blur merges blobs; huge canvas prevents
 * clip/seam lines when layers drift or respond to mouse parallax.
 */
.ethereal-bg__layer {
  position: absolute;
  width: 280vmax;
  height: 280vmax;
  left: 50%;
  top: 50%;
  margin-left: -140vmax;
  margin-top: -140vmax;
  transform-origin: 50% 50%;
  will-change: transform;
  filter: blur(72px);
  -webkit-filter: blur(72px);
  backface-visibility: hidden;
}

.ethereal-bg__layer--primary {
  opacity: 0.9;
}

.ethereal-bg__layer--secondary {
  opacity: 0.55;
}

/* Pre-saturated colors (~1.4×) baked in — no filter: saturate() on the stack */
.ethereal-bg__blob {
  position: absolute;
  border-radius: 50%;
}

.ethereal-bg__blob--pink {
  width: min(150vw, 2200px);
  height: min(130vw, 1800px);
  left: 15%;
  top: 20%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 150, 190, 0.62) 0%,
    rgba(255, 170, 200, 0.38) 42%,
    rgba(255, 190, 215, 0.12) 68%,
    transparent 88%
  );
}

.ethereal-bg__blob--blue {
  width: min(140vw, 2000px);
  height: min(120vw, 1700px);
  left: 80%;
  top: 30%;
  background: radial-gradient(
    ellipse at center,
    rgba(150, 210, 255, 0.68) 0%,
    rgba(170, 220, 255, 0.42) 45%,
    rgba(190, 230, 255, 0.14) 70%,
    transparent 90%
  );
}

.ethereal-bg__blob--green {
  width: min(130vw, 1800px);
  height: min(120vw, 1700px);
  left: 30%;
  top: 85%;
  background: radial-gradient(
    ellipse at center,
    rgba(170, 255, 195, 0.62) 0%,
    rgba(190, 255, 210, 0.4) 44%,
    rgba(205, 255, 220, 0.12) 70%,
    transparent 90%
  );
}

.ethereal-bg__blob--pink,
.ethereal-bg__blob--blue,
.ethereal-bg__blob--green {
  transform: translate(-50%, -50%);
}

/* Secondary layer — muted depth tones */
.ethereal-bg__layer--secondary .ethereal-bg__blob--pink {
  background: radial-gradient(
    ellipse at center,
    rgba(220, 120, 150, 0.48) 0%,
    rgba(200, 130, 160, 0.28) 44%,
    rgba(210, 145, 170, 0.08) 72%,
    transparent 90%
  );
}

.ethereal-bg__layer--secondary .ethereal-bg__blob--blue {
  background: radial-gradient(
    ellipse at center,
    rgba(100, 160, 210, 0.52) 0%,
    rgba(120, 175, 220, 0.3) 46%,
    rgba(140, 190, 230, 0.08) 74%,
    transparent 90%
  );
}

.ethereal-bg__layer--secondary .ethereal-bg__blob--green {
  background: radial-gradient(
    ellipse at center,
    rgba(120, 190, 150, 0.5) 0%,
    rgba(140, 200, 165, 0.28) 44%,
    rgba(155, 210, 175, 0.08) 72%,
    transparent 90%
  );
}

/* Cheap film grain — static tiled SVG, no JS */
.ethereal-bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%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;
  background-size: 180px 180px;
}

@media (prefers-reduced-motion: reduce) {
  .ethereal-bg__layer {
    will-change: auto;
  }
}
