/* ============================================
   AM Heating & Air — Scroll Animations
   ============================================ */

/* Base: hidden state for scroll-triggered elements */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-in"] {
  transform: translateY(0);
}

[data-animate="slide-left"] {
  transform: translateX(-40px);
}

[data-animate="slide-right"] {
  transform: translateX(40px);
}

[data-animate="scale-in"] {
  transform: scale(0.92);
}

[data-animate="slide-up"] {
  transform: translateY(30px);
}

/* Visible state — triggered by Intersection Observer */
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger children animation */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 0.12s; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 0.19s; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 0.26s; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 0.33s; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 0.40s; }
[data-stagger].is-visible > *:nth-child(7) { transition-delay: 0.47s; }
[data-stagger].is-visible > *:nth-child(8) { transition-delay: 0.54s; }

[data-stagger].is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Hero text entrance */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-fade-up {
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-fade-up-delay-1 {
  opacity: 0;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-fade-up-delay-2 {
  opacity: 0;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.hero-fade-up-delay-3 {
  opacity: 0;
  animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

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

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

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

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

/* Pulse glow for CTA buttons */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(3, 105, 161, 0.4); }
  50% { box-shadow: 0 0 20px 5px rgba(3, 105, 161, 0.15); }
}

.pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Counter animation number styling */
[data-count] {
  font-variant-numeric: tabular-nums;
}

/* Smooth image reveal on load */
.img-reveal {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.img-reveal.loaded {
  opacity: 1;
}

/* Parallax-ready sections */
.parallax-bg {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Navbar scroll shadow enhancement */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08) !important;
}

/* Image hover zoom for cards */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Gradient text for headings */
.gradient-text {
  background: linear-gradient(135deg, #0369A1, #0284C7, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Star rating shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.star-shimmer {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 25%, #f59e0b 50%, #fbbf24 75%, #f59e0b 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-fade-up,
  .hero-fade-up-delay-1,
  .hero-fade-up-delay-2,
  .hero-fade-up-delay-3 {
    animation: none !important;
    opacity: 1 !important;
  }
  .animate-float,
  .animate-float-delay,
  .animate-float-slow,
  .pulse-glow {
    animation: none !important;
  }
}
