/* ==========================================================================
   animations.css — atmosphere motion, reveal system, reduced-motion rules
   Motion is slow, weightless, and physical. Nothing bounces or spins.
   ========================================================================== */

/* ---- Ambient background atmosphere ---- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(120% 90% at 15% 0%, var(--bg-3) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}

.atmosphere__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.atmosphere__orb--cyan {
  top: -10%;
  left: -8%;
  width: min(60vw, 780px);
  height: min(60vw, 780px);
  background: radial-gradient(circle, var(--light-cyan) 0%, rgba(127, 227, 239, 0) 70%);
  animation: drift-a var(--duration-ambient) ease-in-out infinite alternate;
}

.atmosphere__orb--peach {
  bottom: -15%;
  right: -10%;
  width: min(55vw, 700px);
  height: min(55vw, 700px);
  background: radial-gradient(circle, var(--light-peach) 0%, rgba(255, 185, 143, 0) 70%);
  opacity: 0.35;
  animation: drift-b calc(var(--duration-ambient) * 1.3) ease-in-out infinite alternate;
}

.atmosphere__orb--lavender {
  top: 30%;
  right: 15%;
  width: min(40vw, 560px);
  height: min(40vw, 560px);
  background: radial-gradient(circle, var(--light-lavender) 0%, rgba(182, 166, 255, 0) 70%);
  opacity: 0.3;
  animation: drift-c calc(var(--duration-ambient) * 1.6) ease-in-out infinite alternate;
}

.atmosphere__grain {
  position: absolute;
  inset: -10%;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift-a {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(6%, 8%) scale(1.08);
  }
}

@keyframes drift-b {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-7%, -5%) scale(1.1);
  }
}

@keyframes drift-c {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-5%, 6%) scale(0.94);
  }
}

/* ---- Scroll / load reveal system ----
   JS toggles .is-visible on elements with [data-reveal] via
   IntersectionObserver. Starts blurred + offset, resolves to sharp. */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition: opacity var(--duration-slow) var(--ease-glass),
    transform var(--duration-slow) var(--ease-glass),
    filter var(--duration-slow) var(--ease-glass);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

[data-reveal-group] > * {
  transition-delay: calc(var(--reveal-index, 0) * 90ms);
}

/* ---- Reduced motion: mandatory ---- */

@media (prefers-reduced-motion: reduce) {
  .atmosphere__orb {
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
