/* ============================================================
   Tyler Immigration Law — animations.css
   Scroll-triggered animations, transitions, effects
   ============================================================ */

/* ── Fade-In-Up (IntersectionObserver controlled) ─────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stagger Delays ───────────────────────────────────────── */
.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.12s; }
.stagger-3 { transition-delay: 0.19s; }
.stagger-4 { transition-delay: 0.26s; }
.stagger-5 { transition-delay: 0.33s; }
.stagger-6 { transition-delay: 0.40s; }
.stagger-7 { transition-delay: 0.47s; }
.stagger-8 { transition-delay: 0.54s; }

/* ── Fade-In (no upward movement) ────────────────────────── */
.fade-in {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.fade-in.is-visible { opacity: 1; }

/* ── Slide-In-Left ────────────────────────────────────────── */
.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Gold Shimmer on Hero accent em ──────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.hero__title em {
  background: linear-gradient(
    90deg,
    var(--color-accent) 0%,
    #f0d080 40%,
    var(--color-accent) 60%,
    #b8942e 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s linear infinite;
  display: inline;
}

/* ── Hero Content Entrance ────────────────────────────────── */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__eyebrow {
  animation: heroFadeUp 0.7s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.hero__title {
  animation: heroFadeUp 0.7s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.hero__sub {
  animation: heroFadeUp 0.7s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

.hero__actions {
  animation: heroFadeUp 0.7s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

.hero__stats {
  animation: heroFadeUp 0.7s ease forwards;
  animation-delay: 1.0s;
  opacity: 0;
}

/* ── Language Toggle Crossfade ────────────────────────────── */
[data-lang] {
  transition: opacity 0.3s ease;
}

/* Outgoing language class (JS applies .lang-hiding momentarily) */
.lang-hiding [data-lang] {
  opacity: 0;
}

/* ── Nav Dropdown Appear ──────────────────────────────────── */
@keyframes dropdownFade {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-links__item:hover .nav-dropdown,
.nav-links__item:focus-within .nav-dropdown {
  animation: dropdownFade 0.2s ease forwards;
}

/* ── Mobile Nav Drawer ────────────────────────────────────── */
@keyframes drawerSlide {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.nav-mobile.is-open {
  animation: drawerSlide 0.25s ease forwards;
}

/* ── Card Enter ───────────────────────────────────────────── */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Applied via JS when IntersectionObserver fires on card grids */
.service-card.is-visible {
  animation: cardEnter 0.55s ease forwards;
}

/* ── Pulse on CTA phone number ────────────────────────────── */
@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* uncomment to enable subtle pulse on phone CTA:
.cta-banner__phone {
  animation: softPulse 3s ease infinite;
}
*/

/* ── Gold Divider Grow ────────────────────────────────────── */
.gold-divider {
  transition: width 0.5s ease;
}

/* ── Accordion Icon Spin ──────────────────────────────────── */
.accordion-trigger__icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Process Step Number Pop ──────────────────────────────── */
@keyframes stepPop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}

.process-step.is-visible .process-step__number {
  animation: stepPop 0.45s ease forwards;
}

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

  .fade-in-up,
  .fade-in,
  .slide-in-left {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__eyebrow,
  .hero__title,
  .hero__sub,
  .hero__actions,
  .hero__stats {
    opacity: 1;
    animation: none;
  }

  .hero__title em {
    -webkit-text-fill-color: var(--color-accent);
    animation: none;
  }
}
