/* ============================================
   Animations - CraftiFex Website
   ============================================ */

/* ---- Scroll Reveal ---- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].animated {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Stagger Delays ---- */
.features-grid .feature-card:nth-child(1) { transition-delay: 0.05s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.15s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.25s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.3s; }

.steps-grid .step-card:nth-child(1) { transition-delay: 0.05s; }
.steps-grid .step-card:nth-child(2) { transition-delay: 0.1s; }
.steps-grid .step-card:nth-child(3) { transition-delay: 0.15s; }
.steps-grid .step-card:nth-child(4) { transition-delay: 0.2s; }

.faq-list .faq-item:nth-child(odd) { transition-delay: 0.05s; }
.faq-list .faq-item:nth-child(even) { transition-delay: 0.1s; }

/* ---- Hero Entrance Animations ---- */
.hero-icon-wrap {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-headline {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.hero-subtitle {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero-actions {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.hero-badges {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.7s both;
}

.hero-device-wrap {
  animation: hero-device-enter 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s both;
}

.scroll-hint {
  animation: hero-enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.4s both;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-device-enter {
  from {
    opacity: 0;
    transform: translateY(48px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- Ambient Glow Drift ---- */
.hero-glow-1 {
  animation: glow-1 14s ease-in-out infinite;
}

.hero-glow-2 {
  animation: glow-2 18s ease-in-out infinite;
}

.hero-glow-3 {
  animation: glow-3 20s ease-in-out infinite;
}

@keyframes glow-1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.25; }
  33% { transform: translate(50px, 30px) scale(1.1); opacity: 0.4; }
  66% { transform: translate(-20px, 50px) scale(1.05); opacity: 0.3; }
}

@keyframes glow-2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.12; }
  50% { transform: translate(-40px, -30px) scale(1.2); opacity: 0.2; }
}

@keyframes glow-3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.08; }
  50% { transform: translate(30px, -20px) scale(1.15); opacity: 0.15; }
}

/* ---- Scroll Progress ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #fbbf24);
  z-index: 9999;
  transition: width 0.05s linear;
}

/* ---- Page Fade In ---- */
body {
  animation: page-in 0.4s ease-out;
}

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-icon-wrap,
  .hero-headline,
  .hero-subtitle,
  .hero-actions,
  .hero-badges,
  .hero-device-wrap,
  .scroll-hint {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
