/*
  ScaleNow Digital — Animations & Transitions
  Scroll-triggered fade-in animations matching scalenowdigital.lovable.app
*/

/* Page load animation */
@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: pageLoad 0.4s ease-out;
}

/* Hero section staggered animations - immediate on load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.hero-subtitle {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

.hero-buttons {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.6s backwards;
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for cards in same section */
.service-card:nth-child(1).animate-on-scroll { transition-delay: 0.05s; }
.service-card:nth-child(2).animate-on-scroll { transition-delay: 0.15s; }
.service-card:nth-child(3).animate-on-scroll { transition-delay: 0.25s; }

.work-item:nth-child(1).animate-on-scroll { transition-delay: 0.05s; }
.work-item:nth-child(2).animate-on-scroll { transition-delay: 0.15s; }
.work-item:nth-child(3).animate-on-scroll { transition-delay: 0.25s; }
.work-item:nth-child(4).animate-on-scroll { transition-delay: 0.35s; }

.process-step:nth-child(1).animate-on-scroll { transition-delay: 0.05s; }
.process-step:nth-child(2).animate-on-scroll { transition-delay: 0.15s; }
.process-step:nth-child(3).animate-on-scroll { transition-delay: 0.25s; }

.benefit-card:nth-child(1).animate-on-scroll { transition-delay: 0.05s; }
.benefit-card:nth-child(2).animate-on-scroll { transition-delay: 0.1s; }
.benefit-card:nth-child(3).animate-on-scroll { transition-delay: 0.15s; }
.benefit-card:nth-child(4).animate-on-scroll { transition-delay: 0.2s; }

/* Section titles and subtitles */
.section-title.animate-on-scroll {
  transform: translateY(20px);
}

.section-subtitle.animate-on-scroll {
  transform: translateY(15px);
  transition-delay: 0.1s;
}

/* Smooth transitions for theme changes */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body,
.navbar,
.service-card,
.work-item,
.benefit-card,
.footer,
.form-group input,
.form-group textarea {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Hover transitions */
.service-card,
.work-item,
.benefit-card,
.btn {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              background-color 0.3s ease,
              color 0.3s ease;
}

/* Work image zoom on hover */
.work-image {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation links */
.nav-menu a {
  position: relative;
  transition: color 0.2s ease;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Form focus transitions */
.form-group input,
.form-group textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

/* Respect reduced motion preferences */
@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;
  }
  
  .hero-title,
  .hero-subtitle,
  .hero-buttons,
  .animate-on-scroll {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
