/* ==========================================================================
   Animationer — breathe, molekyle (halo/twinkle/shimmer), constellation
   + reduced-motion override
   ========================================================================== */

/* --- Breathe ------------------------------------------------------------ */

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.003); }
}
.breathe {
  animation: breathe 8s ease-in-out infinite;
}

/* --- Constellation (ambient, skjult på mobil) --------------------------- */

.constellation-ambient {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
@media (max-width: 767px) {
  .constellation-ambient { display: none; }
}

/* --- Molekyle ----------------------------------------------------------- */

.molekyle .molekyle-halo,
.molekyle .triangle,
.molekyle .dot {
  transform-origin: center;
  transform-box: fill-box;
  will-change: opacity, transform;
}

/* HALO — én cirkel ånder ind og ud */
.molekyle--anim-halo .molekyle-halo {
  animation: molekyle-halo-pulse 4.8s ease-in-out infinite;
  transform-origin: center;
  transform-box: view-box;
}
@keyframes molekyle-halo-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50%       { opacity: 1.00; transform: scale(1.10); }
}

/* TWINKLE — noderne blinker sekventielt */
.molekyle--anim-twinkle .dot {
  animation: molekyle-twinkle 3.2s ease-in-out infinite;
}
.molekyle--anim-twinkle .dot:nth-child(1) { animation-delay: 0s; }
.molekyle--anim-twinkle .dot:nth-child(2) { animation-delay: -0.6s; }
.molekyle--anim-twinkle .dot:nth-child(3) { animation-delay: -1.2s; }
.molekyle--anim-twinkle .dot:nth-child(4) { animation-delay: -1.8s; }
.molekyle--anim-twinkle .dot:nth-child(5) { animation-delay: -2.4s; }
@keyframes molekyle-twinkle {
  0%, 100% { opacity: 1.0;  transform: scale(1.00); }
  50%       { opacity: 0.30; transform: scale(0.72); }
}

/* SHIMMER — trekant-fills ånder */
.molekyle--anim-shimmer .triangle {
  animation: molekyle-shimmer 4.4s ease-in-out infinite;
}
.molekyle--anim-shimmer .triangle:nth-child(1) { animation-delay: 0s; }
.molekyle--anim-shimmer .triangle:nth-child(2) { animation-delay: -0.9s; }
.molekyle--anim-shimmer .triangle:nth-child(3) { animation-delay: -1.8s; }
.molekyle--anim-shimmer .triangle:nth-child(4) { animation-delay: -2.7s; }
.molekyle--anim-shimmer .triangle:nth-child(5) { animation-delay: -3.6s; }
@keyframes molekyle-shimmer {
  0%, 100% { opacity: 0.05; }
  50%       { opacity: 0.32; }
}

/* --- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
