/* ============================================================
   ANOXIS — animations.css
   Keyframe library and reveal utilities.
   Use these by adding data-reveal attributes to HTML elements;
   scroll.js applies the visible state when the element enters view.
   ============================================================ */

/* ---------- Base reveal state ---------- */

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Child stagger: set via data-reveal-stagger="80" (ms per child step) */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ---------- Fade up ---------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.anim-fade-up {
  animation: fadeUp var(--dur-slow) var(--ease-out) both;
}

/* ---------- Mask reveal (hero text) ---------- */

@keyframes maskReveal {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

.anim-mask-reveal {
  animation: maskReveal var(--dur-extra) var(--ease-both) both;
  display: inline-block;
}

.anim-mask-reveal--delay-1 { animation-delay: 120ms; }
.anim-mask-reveal--delay-2 { animation-delay: 240ms; }
.anim-mask-reveal--delay-3 { animation-delay: 360ms; }

/* ---------- Gradient drift (main landing hero background) ---------- */

@keyframes gradientDrift {
  0% {
    transform: translate3d(-4%, -2%, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(4%, 2%, 0) rotate(2deg);
  }
  100% {
    transform: translate3d(-4%, -2%, 0) rotate(0deg);
  }
}

.hero-gradient {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(60% 60% at 30% 40%, rgba(125, 211, 252, 0.16) 0%, transparent 60%),
    radial-gradient(50% 50% at 70% 60%, rgba(125, 211, 252, 0.08) 0%, transparent 60%);
  filter: blur(40px);
  animation: gradientDrift 16s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.hero-gradient--subtle {
  opacity: 0.6;
}

/* ---------- Scroll progress indicator ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--color-accent);
  z-index: 200;
  width: 0;
  transition: width var(--dur-fast) linear;
}

/* ---------- Number counter base ---------- */

[data-count-to] {
  font-variant-numeric: tabular-nums;
}

/* ---------- Pulse (for live status indicators) ---------- */

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(125, 211, 252, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(125, 211, 252, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(125, 211, 252, 0);
  }
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulseRing 2s ease-out infinite;
}

/* ---------- Shimmer (for skeleton loading or accent highlight) ---------- */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.anim-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-surface) 0%,
    var(--color-surface-2) 50%,
    var(--color-surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
}

/* ---------- Tab / toggle transitions ---------- */

.tab-panel {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tab-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  pointer-events: auto;
}

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

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

  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-gradient {
    animation: none;
  }

  .pulse-dot {
    animation: none;
  }
}
