.cosmic-parallax-bg {
  --cosmic-animation-iteration: infinite;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 70%,
      rgb(139 92 246 / 0.28),
      rgb(74 38 160 / 0.14),
      transparent 60%
    ),
    radial-gradient(
      circle at 18% 24%,
      rgb(180 132 255 / 0.08),
      transparent 24rem
    ),
    radial-gradient(circle at 82% 18%, rgb(80 70 228 / 0.1), transparent 22rem),
    linear-gradient(180deg, #040716 0%, #090b20 34%, #171039 64%, #04020b 100%);
  pointer-events: none;
}

.cosmic-parallax-bg__nebula {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 50% 72%,
      rgb(180 132 255 / 0.18),
      transparent 35rem
    ),
    radial-gradient(
      ellipse at 50% 92%,
      rgb(80 70 228 / 0.2),
      transparent 30rem
    ),
    linear-gradient(180deg, rgb(3 0 20 / 0) 0%, rgb(3 2 10 / 0.48) 90%);
  opacity: 1;
}

.cosmic-parallax-bg__stars {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--star-size);
  height: var(--star-size);
  background: transparent;
  border-radius: 50%;
  animation: cosmic-star-drift linear var(--cosmic-animation-iteration);
  will-change: transform;
}

.cosmic-parallax-bg__stars::after {
  position: absolute;
  top: 2200px;
  left: 0;
  width: var(--star-size);
  height: var(--star-size);
  background: transparent;
  border-radius: 50%;
  box-shadow: inherit;
  content: "";
}

.cosmic-parallax-bg__stars--1 {
  animation-duration: 88s;
  opacity: 0.8;
}

.cosmic-parallax-bg__stars--2 {
  animation-duration: 132s;
  opacity: 0.7;
}

.cosmic-parallax-bg__stars--3 {
  animation-duration: 188s;
  opacity: 0.58;
}

.cosmic-parallax-bg__planet-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.cosmic-parallax-bg__bottom-fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 28vh;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgb(3 2 10 / 0.64) 48%,
    #03020a 100%
  );
  pointer-events: none;
}

@media (max-width: 760px) {
  .cosmic-parallax-bg__planet-scene {
    transform: translateY(48px);
  }

  .cosmic-parallax-bg__bottom-fade {
    height: 96px;
  }
}

@keyframes cosmic-star-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, -2200px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-parallax-bg__stars {
    animation: none;
  }
}
