/* ============================================================
   PREMIUM TEXT ANIMATION — text-animate.css
   Scope: .animated-text-block
   Technique: Word-by-word curtain lift (overflow clip + translateY)
   Trigger: IntersectionObserver (scroll-based)
   Safe: Does NOT touch any existing styles
   ============================================================ */

/* Each animated element gets this class via JS */
.animated-text-block {
  overflow: visible;
}

/* Every WORD is wrapped in .atb-word (added by JS). */
.atb-clip {
  display: inline-block;
  vertical-align: bottom;
  line-height: inherit;
}

/* The actual word — starts to the right, slides left into place */
.atb-word {
  display: inline-block;
  transform: translateX(60px);
  opacity: 0;
  /* blur-to-sharp + ease-out for premium feel */
  filter: blur(4px);
  transition:
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.9s cubic-bezier(0.16, 1, 0.3, 1),
    filter    1.0s  cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
}

/* State: visible — triggered by JS adding .atb-in to the block */
.animated-text-block.atb-in .atb-word {
  transform: translateY(0);
  opacity: 1;
  filter: blur(0px);
}

/* Stagger delays — up to 20 words, each 60 ms apart */
.animated-text-block.atb-in .atb-word:nth-child(1)  { transition-delay: 0.00s; }
.animated-text-block.atb-in .atb-word:nth-child(2)  { transition-delay: 0.06s; }
.animated-text-block.atb-in .atb-word:nth-child(3)  { transition-delay: 0.12s; }
.animated-text-block.atb-in .atb-word:nth-child(4)  { transition-delay: 0.18s; }
.animated-text-block.atb-in .atb-word:nth-child(5)  { transition-delay: 0.24s; }
.animated-text-block.atb-in .atb-word:nth-child(6)  { transition-delay: 0.30s; }
.animated-text-block.atb-in .atb-word:nth-child(7)  { transition-delay: 0.36s; }
.animated-text-block.atb-in .atb-word:nth-child(8)  { transition-delay: 0.42s; }
.animated-text-block.atb-in .atb-word:nth-child(9)  { transition-delay: 0.48s; }
.animated-text-block.atb-in .atb-word:nth-child(10) { transition-delay: 0.54s; }
.animated-text-block.atb-in .atb-word:nth-child(11) { transition-delay: 0.60s; }
.animated-text-block.atb-in .atb-word:nth-child(12) { transition-delay: 0.66s; }
.animated-text-block.atb-in .atb-word:nth-child(13) { transition-delay: 0.72s; }
.animated-text-block.atb-in .atb-word:nth-child(14) { transition-delay: 0.78s; }
.animated-text-block.atb-in .atb-word:nth-child(15) { transition-delay: 0.84s; }
.animated-text-block.atb-in .atb-word:nth-child(16) { transition-delay: 0.90s; }
.animated-text-block.atb-in .atb-word:nth-child(17) { transition-delay: 0.96s; }
.animated-text-block.atb-in .atb-word:nth-child(18) { transition-delay: 1.02s; }
.animated-text-block.atb-in .atb-word:nth-child(19) { transition-delay: 1.08s; }
.animated-text-block.atb-in .atb-word:nth-child(20) { transition-delay: 1.14s; }

/* ── Hero-specific stagger offsets ─────────────────────────
   When an .animated-text-block has a data-atb-delay, the
   entire block starts its animation that many ms later.
   Handled inline via JS setting transition-delay per word.
   ────────────────────────────────────────────────────────── */

/* Respect user reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .atb-word {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    transition: none !important;
    /* Ensure no horizontal offset when motion is reduced */
  }

  [data-animate-btn] {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ── Button / block-level slide-in ──────────────────────────
   Used for elements that should NOT have text split (e.g. buttons)
   Animates the whole element right-to-left, same feel as words.
   ────────────────────────────────────────────────────────── */
[data-animate-btn] {
  transform: translateX(60px);
  opacity: 0;
  filter: blur(4px);
  transition:
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    opacity   0.9s cubic-bezier(0.16, 1, 0.3, 1),
    filter    1.0s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
}

[data-animate-btn].atb-in {
  transform: translateX(0);
  opacity: 1;
  filter: blur(0px);
}
