/* Micro Animations - TECH:⑨ */

/* Fade in animation for scroll-triggered elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease;
}

.animate-on-scroll.animate {
  animation: fadeInUp 0.6s ease forwards;
}

/* Stagger animation delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Hover micro-animations */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.btn:hover::before {
  left: 100%;
}

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

.hero-stats .stat-item {
  animation: float 6s ease-in-out infinite;
}

.hero-stats .stat-item:nth-child(2) {
  animation-delay: -2s;
}

.hero-stats .stat-item:nth-child(3) {
  animation-delay: -4s;
}

/* Icon hover animations */
.service-icon,
.contact-icon {
  transition: transform 0.3s ease, fill 0.3s ease;
}

.service-card:hover .service-icon,
.contact-method:hover .contact-icon {
  transform: scale(1.1);
  fill: var(--color-accent);
}

/* Mobile menu animation */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Form focus animations */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(123, 132, 113, 0.1);
}

/* Social link hover animation */
.social-link {
  transition: all 0.3s ease;
}

.social-link:hover {
  transform: translateY(-3px);
}

/* Testimonial quote animation */
.testimonial-quote::before {
  content: '"';
  font-size: 4rem;
  color: var(--color-accent);
  opacity: 0.3;
  position: absolute;
  top: -10px;
  left: 10px;
  font-family: var(--font-heading);
}

.testimonial-card {
  position: relative;
  transition: transform 0.3s ease;
}

.testimonial-card:hover {
  transform: scale(1.02);
}

/* Loading state for form submission */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse animation for important elements */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-on-hover:hover {
  animation: pulse 1s ease-in-out;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-stats .stat-item {
    animation: none;
  }
}