/* ========================================
   Animations & Micro-interactions
   ======================================== */

/* --- Scroll Reveal — clip-path mask reveal --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms var(--ease-editorial),
              transform 800ms var(--ease-editorial);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-reveal="fade"] {
  transform: none;
}

.animate-on-scroll[data-reveal="left"] {
  transform: translateX(-32px);
}
.animate-on-scroll[data-reveal="left"].visible {
  transform: translateX(0);
}

.animate-on-scroll[data-reveal="right"] {
  transform: translateX(32px);
}
.animate-on-scroll[data-reveal="right"].visible {
  transform: translateX(0);
}

/* Stagger delays for grid children */
.bento .animate-on-scroll:nth-child(2),
.gallery .animate-on-scroll:nth-child(2),
.requirements-grid .animate-on-scroll:nth-child(2) { transition-delay: 60ms; }
.bento .animate-on-scroll:nth-child(3),
.gallery .animate-on-scroll:nth-child(3),
.requirements-grid .animate-on-scroll:nth-child(3) { transition-delay: 120ms; }
.bento .animate-on-scroll:nth-child(4),
.gallery .animate-on-scroll:nth-child(4),
.requirements-grid .animate-on-scroll:nth-child(4) { transition-delay: 180ms; }
.bento .animate-on-scroll:nth-child(5),
.gallery .animate-on-scroll:nth-child(5) { transition-delay: 240ms; }
.bento .animate-on-scroll:nth-child(6),
.gallery .animate-on-scroll:nth-child(6) { transition-delay: 300ms; }
.gallery .animate-on-scroll:nth-child(7) { transition-delay: 360ms; }
.gallery .animate-on-scroll:nth-child(8) { transition-delay: 420ms; }

.faq-list .animate-on-scroll:nth-child(2) { transition-delay: 50ms; }
.faq-list .animate-on-scroll:nth-child(3) { transition-delay: 100ms; }
.faq-list .animate-on-scroll:nth-child(4) { transition-delay: 150ms; }
.faq-list .animate-on-scroll:nth-child(5) { transition-delay: 200ms; }
.faq-list .animate-on-scroll:nth-child(6) { transition-delay: 250ms; }
.faq-list .animate-on-scroll:nth-child(7) { transition-delay: 300ms; }

/* Word-by-word reveal for hero title */
.hero-title-line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1000ms var(--ease-editorial);
}

.hero.is-loaded .hero-title-line > span {
  transform: translateY(0);
}

.hero.is-loaded .hero-title-line:nth-child(1) > span { transition-delay: 100ms; }
.hero.is-loaded .hero-title-line:nth-child(2) > span { transition-delay: 250ms; }
.hero.is-loaded .hero-title-line:nth-child(3) > span { transition-delay: 400ms; }

/* --- Button shimmer --- */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: translateX(-100%);
  transition: transform 700ms var(--ease-editorial);
  pointer-events: none;
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

/* --- Magnetic button container --- */
.magnetic {
  display: inline-flex;
  position: relative;
  will-change: transform;
  transition: transform 300ms var(--ease-out);
}

.magnetic > * {
  pointer-events: auto;
}

/* --- FAQ answer transition --- */
.faq-answer {
  animation: faqSlideIn 400ms var(--ease-editorial);
}

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

/* --- Modal entrance --- */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* --- Number counter element --- */
.count-up {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* --- Generic hover-scale image --- */
.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform 1.2s var(--ease-editorial);
}

.hover-zoom:hover img {
  transform: scale(1.05);
}

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

  .hero-blob,
  .marquee-track,
  .hero-visual-img {
    animation: none !important;
    transform: none !important;
  }

  .animate-on-scroll,
  .hero-title-line > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
