/* No animation exists until the progressive-enhancement script is ready. */
.cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle] {
  animation: cosmic-star-breathe 9s ease-in-out infinite;
  animation-play-state: paused;
}
.cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle]:nth-child(2n) {
  animation-duration: 11s;
  animation-delay: -4s;
}
.cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle]:nth-child(3n) {
  animation-duration: 7s;
  animation-delay: -2s;
}
.cosmic-motion-enabled .cosmic-scene.cosmic-motion-visible [data-cosmic-twinkle] {
  animation-play-state: running;
}
@keyframes cosmic-star-breathe {
  0%, 100% { opacity: .34; }
  50% { opacity: .76; }
}
/* Native motion path follows the actual ellipse; unsupported engines keep
   the authored static dot instead of approximating a different orbit. */
@supports (offset-path: ellipse(50% 50% at 50% 50%)) {
  .cosmic-motion-ready .cosmic-scene .cosmic-orbit-light {
    left: 0;
    top: 0;
    offset-path: ellipse(50% 50% at 50% 50%);
    offset-anchor: center;
    offset-rotate: 0deg;
    animation: cosmic-orbit-pass 38s linear infinite;
    animation-play-state: paused;
  }
  .cosmic-motion-enabled .cosmic-scene.cosmic-motion-visible .cosmic-orbit-light {
    animation-play-state: running;
  }
}
@keyframes cosmic-orbit-pass {
  from { offset-distance: 64%; }
  to { offset-distance: 164%; }
}
/* One brief acknowledgement on the logo; never an ongoing hover loop. */
.site-header .brand { position: relative; }
.site-header .brand::after {
  content: '';
  pointer-events: none;
  position: absolute;
  width: 38px;
  height: 12px;
  left: 2px;
  top: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: rotate(-22deg);
  opacity: 0;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cosmic-motion-enabled .site-header .brand:hover::after {
    animation: cosmic-logo-glint .3s ease-out 1;
  }
}
@keyframes cosmic-logo-glint {
  0%, 100% { opacity: 0; }
  40% { opacity: .5; }
}
/* On narrow screens only two stars breathe; the orbit stays still. */
@media (max-width: 640px) {
  .cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle] {
    animation-name: none;
  }
  .cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle]:nth-child(3),
  .cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle]:nth-child(8) {
    animation-name: cosmic-star-breathe;
    animation-duration: 11s;
  }
  .cosmic-motion-ready .cosmic-scene .cosmic-orbit-light {
    animation: none;
    offset-path: none;
    left: 18%;
    top: 11%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cosmic-motion-ready .cosmic-scene [data-cosmic-twinkle],
  .cosmic-motion-ready .cosmic-scene .cosmic-orbit-light,
  .site-header .brand::after { animation: none !important; }
  .cosmic-motion-ready .cosmic-scene .cosmic-orbit-light {
    offset-path: none;
    left: 18%;
    top: 11%;
  }
}
