/* ============================================================
   CLOUDIX AI — animations.css
   GPU-safe animations (transform + opacity only)
   ============================================================ */

/* ── Keyframes ────────────────────────────────────────────── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

@keyframes gridScroll {
  0%   { background-position: 0 0; }
  100% { background-position: 0 60px; }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.45); }
  70%  { box-shadow: 0 0 0 14px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes barGrow {
  from { width: 0; }
}

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

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ripple {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── Scroll-Reveal System ─────────────────────────────────── */
/* Applied to elements via [data-reveal] attribute.
   JS IntersectionObserver adds .is-visible when in viewport. */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal="left"] {
  transform: translateX(-28px);
}

[data-reveal="right"] {
  transform: translateX(28px);
}

[data-reveal="scale"] {
  transform: scale(0.93);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays via data-reveal-delay attribute set inline by JS */
/* (no CSS needed — JS sets style.transitionDelay) */

/* ── Nav Drawer Animation ─────────────────────────────────── */
.nav-drawer.is-open {
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Hero Section Entrance ────────────────────────────────── */
.hero-badge {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-title {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-subtitle {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.hero-cta-group {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

.hero-social-proof {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.hero-visual {
  animation: fadeInRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-float-card--1 {
  animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both,
             floatY 5s ease-in-out 1.5s infinite;
}

.hero-float-card--2 {
  animation: fadeInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both,
             floatY 7s ease-in-out 2s infinite;
}

/* ── Metric Bar (niche section) ───────────────────────────── */
.metric-bar-fill.is-animated {
  animation: barGrow 1.2s ease-out forwards;
}

/* ── Skeleton shimmer (trust logos placeholder) ───────────── */
.logo-pill {
  background-image: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-2) 50%,
    var(--surface) 75%
  );
  background-size: 400px 100%;
}

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

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

  .hero-badge,
  .hero-title,
  .hero-subtitle,
  .hero-cta-group,
  .hero-social-proof,
  .hero-visual,
  .hero-float-card--1,
  .hero-float-card--2 {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
