/* ============================================================
   KIRA MOTORS — animations.css
   Keyframes, Révélations au scroll, Transitions hero
   ============================================================ */

/* ── Keyframes ── */
@keyframes loaderPulse {
  from { opacity: .5; transform: scale(.97); }
  to   { opacity: 1;  transform: scale(1); }
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,.4), 0 0 0 0 rgba(37,211,102,.4); }
  50%       { box-shadow: 0 4px 16px rgba(37,211,102,.4), 0 0 0 12px rgba(37,211,102,0); }
}

@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

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

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

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

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

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

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

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

@keyframes heroBtns {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Reveal classes (IntersectionObserver) ── */
[data-reveal] {
  opacity: 0;
  transition:
    opacity var(--km-transition-slow),
    transform var(--km-transition-slow);
}

[data-reveal="fade-up"] {
  transform: translateY(28px);
}

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

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

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

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

/* Stagger delays via data-delay */
[data-delay="0.1"] { transition-delay: 0.1s; }
[data-delay="0.15"] { transition-delay: 0.15s; }
[data-delay="0.2"] { transition-delay: 0.2s; }
[data-delay="0.25"] { transition-delay: 0.25s; }
[data-delay="0.3"] { transition-delay: 0.3s; }
[data-delay="0.35"] { transition-delay: 0.35s; }
[data-delay="0.4"] { transition-delay: 0.4s; }
[data-delay="0.45"] { transition-delay: 0.45s; }
[data-delay="0.5"] { transition-delay: 0.5s; }
[data-delay="0.6"] { transition-delay: 0.6s; }

/* ── Hero animations d'entrée ── */
.hero-animate .km-hero__eyebrow {
  animation: fadeUp .5s ease both;
  animation-delay: 0ms;
}

.hero-animate .km-hero__title-line1 {
  display: block;
  animation: heroLine1 .6s cubic-bezier(.4,0,.2,1) both;
  animation-delay: 0ms;
}

.hero-animate .km-hero__title-line2 {
  display: block;
  animation: heroLine2 .6s cubic-bezier(.4,0,.2,1) both;
  animation-delay: 150ms;
}

.hero-animate .km-hero__title-line3 {
  display: block;
  animation: heroLine2 .6s cubic-bezier(.4,0,.2,1) both;
  animation-delay: 250ms;
}

.hero-animate .km-hero__sub {
  animation: heroSub .6s ease both;
  animation-delay: 300ms;
}

.hero-animate .km-hero__btns {
  animation: heroBtns .6s ease both;
  animation-delay: 450ms;
}

.hero-animate .km-hero__stats {
  animation: heroStats .6s ease both;
  animation-delay: 550ms;
}

/* ── Compteurs animés ── */
.km-counter {
  display: inline-block;
}

/* ── Transitions pour les tabs/filtres ── */
.fade-filter-enter {
  animation: scaleIn .25s ease both;
}

/* ── Hover state améliorés ── */
.km-nav__mobile-link:nth-child(1)  { transition-delay: 0ms; }
.km-nav__mobile-link:nth-child(2)  { transition-delay: 50ms; }
.km-nav__mobile-link:nth-child(3)  { transition-delay: 100ms; }
.km-nav__mobile-link:nth-child(4)  { transition-delay: 150ms; }
.km-nav__mobile-link:nth-child(5)  { transition-delay: 200ms; }
.km-nav__mobile-link:nth-child(6)  { transition-delay: 250ms; }

/* ── Accessibility: respect prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

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

  .km-wa-float__btn {
    animation: none;
  }
}
