/*
 * Shared Stellar night-sky ambience — /, /mission/, /contact/, /login/.
 * Inactive for Light/Dark. Motion respects prefers-reduced-motion.
 */

#aa-stellar-ambience {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
}

html[data-theme="stellar"] #aa-stellar-ambience.is-active {
  opacity: 1;
  visibility: visible;
}

.aa-stellar-ambience__field {
  position: absolute;
  inset: 0;
}

.aa-stellar-ambience__star {
  position: absolute;
  width: var(--aa-star-size, 1.5px);
  height: var(--aa-star-size, 1.5px);
  margin: calc(var(--aa-star-size, 1.5px) * -0.5) 0 0 calc(var(--aa-star-size, 1.5px) * -0.5);
  border-radius: 50%;
  background: rgba(210, 232, 255, var(--aa-star-opacity, 0.6));
  box-shadow: 0 0 calc(var(--aa-star-size, 1.5px) * 2) rgba(124, 206, 255, 0.35);
  will-change: opacity;
}

.aa-stellar-ambience__star--bright {
  background: rgba(230, 244, 255, var(--aa-star-opacity, 0.85));
  box-shadow:
    0 0 3px rgba(150, 220, 255, 0.5),
    0 0 6px rgba(124, 206, 255, 0.28);
}

.aa-stellar-ambience__star.is-glint {
  animation: aa-stellar-star-glint 1.1s ease-out;
}

@keyframes aa-stellar-star-glint {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.8);
    box-shadow:
      0 0 4px rgba(180, 230, 255, 0.85),
      0 0 10px rgba(124, 206, 255, 0.55);
  }
}

.aa-stellar-ambience__shoot {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(220, 240, 255, 0.95);
  box-shadow:
    0 0 4px rgba(150, 220, 255, 0.9),
    -40px 20px 12px 0 rgba(124, 206, 255, 0.18),
    -80px 40px 18px 0 rgba(96, 178, 255, 0.08);
  transform: rotate(var(--aa-shoot-angle, -22deg));
  animation: aa-stellar-shoot 1.1s ease-in forwards;
  will-change: transform, opacity;
}

@keyframes aa-stellar-shoot {
  0% {
    opacity: 0;
    transform: rotate(var(--aa-shoot-angle, -22deg)) translate(0, 0) scale(1);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--aa-shoot-angle, -22deg)) translate(140px, 70px) scale(0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aa-stellar-ambience__star.is-glint {
    animation: none;
  }

  .aa-stellar-ambience__shoot {
    display: none !important;
  }
}
