/* ============================================================
   A.J. Consulting Services — Animations
   ============================================================ */

/* ── Scroll Reveal Base States ── */
.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-fade-in {
  opacity: 0;
  transition: opacity 0.65s ease;
}

.animate-slide-right {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-slide-left {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ── Visible State ── */
.animate-fade-up.is-visible,
.animate-fade-in.is-visible,
.animate-slide-right.is-visible,
.animate-slide-left.is-visible,
.animate-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Staggered Delays ── */
.card:nth-child(1),
[class*="animate-"]:nth-child(1) { transition-delay: 0ms; }
.card:nth-child(2),
[class*="animate-"]:nth-child(2) { transition-delay: 80ms; }
.card:nth-child(3),
[class*="animate-"]:nth-child(3) { transition-delay: 160ms; }
.card:nth-child(4),
[class*="animate-"]:nth-child(4) { transition-delay: 240ms; }

.stagger-1 { transition-delay: 0ms !important; }
.stagger-2 { transition-delay: 100ms !important; }
.stagger-3 { transition-delay: 200ms !important; }
.stagger-4 { transition-delay: 300ms !important; }
.stagger-5 { transition-delay: 400ms !important; }
.stagger-6 { transition-delay: 500ms !important; }

/* ── Scroll Indicator Bounce ── */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(8px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.scroll-indicator {
  animation: bounce 1.8s infinite;
}

/* ── Pulse ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Shimmer for gradient elements ── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ── Floating animation for hero elements ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* ── Fade-in for page load ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content > * {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-content > *:nth-child(4) { animation-delay: 0.55s; }
.hero-content > *:nth-child(5) { animation-delay: 0.7s; }

/* ── Hover Transitions (global enhancements) ── */
a,
button {
  transition: color var(--transition-base), background-color var(--transition-base),
              border-color var(--transition-base), box-shadow var(--transition-base),
              transform var(--transition-bounce);
}

/* ── Counter animation support ── */
[data-target] {
  display: inline-block;
  min-width: 2ch;
  text-align: center;
}

/* ── Gold underline animation ── */
@keyframes expandLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.section-header.is-visible::after {
  animation: expandLine 0.6s ease 0.3s both;
}

/* ── 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;
    scroll-behavior: auto !important;
  }

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

  .hero-content > * {
    animation: none;
    opacity: 1;
  }

  .scroll-indicator {
    animation: none;
  }
}
