/* ===================================
   ANIMATIONS & KEYFRAMES
   =================================== */

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.2;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.3;
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gradient Shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}


/* ===================================
   PAGE LOAD ANIMATIONS
   =================================== */

/* Hero Section Entry */
.hero-title {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-cta {
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-visual {
  animation: fadeIn 1s ease-out 0.4s both;
}

/* Navbar Entry */
.navbar {
  animation: slideInDown 0.6s ease-out both;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===================================
   SCROLL REVEAL ANIMATIONS
   =================================== */

/* Base scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
}

.scroll-reveal.revealed {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animations for grids */
.service-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.service-card:nth-child(1).revealed {
  transition-delay: 0.1s;
}

.service-card:nth-child(2).revealed {
  transition-delay: 0.2s;
}

.feature-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

.feature-item:nth-child(1).revealed {
  transition-delay: 0.1s;
}

.feature-item:nth-child(2).revealed {
  transition-delay: 0.2s;
}

.feature-item:nth-child(3).revealed {
  transition-delay: 0.3s;
}

.feature-item:nth-child(4).revealed {
  transition-delay: 0.4s;
}


/* ===================================
   TILT EFFECT (3D Cards)
   =================================== */

[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

/* L'effet tilt sera géré par JavaScript */
[data-tilt]:hover {
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.02);
}


/* ===================================
   HOVER EFFECTS
   =================================== */

/* Smooth hover lift */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

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

.service-card:hover .service-icon,
.feature-item:hover .feature-icon,
.contact-item:hover .contact-icon {
  transform: scale(1.1) rotate(5deg);
}


/* ===================================
   MOBILE MENU ANIMATIONS
   =================================== */

.mobile-menu {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active .mobile-nav-link {
  animation: slideInLeft 0.4s ease-out backwards;
}

.mobile-menu.active .mobile-nav-link:nth-child(1) {
  animation-delay: 0.1s;
}

.mobile-menu.active .mobile-nav-link:nth-child(2) {
  animation-delay: 0.2s;
}

.mobile-menu.active .mobile-nav-link:nth-child(3) {
  animation-delay: 0.3s;
}

.mobile-menu.active .mobile-nav-link:nth-child(4) {
  animation-delay: 0.4s;
}

.mobile-menu.active .mobile-cta {
  animation: scaleIn 0.4s ease-out 0.5s backwards;
}


/* ===================================
   GRADIENT ANIMATIONS
   =================================== */

/* Animated gradient background for hero orbs */
.gradient-orb {
  background-size: 200% 200%;
  animation: float 20s ease-in-out infinite, gradientShift 10s ease infinite;
}

.orb-1 {
  animation-delay: 0s, 0s;
}

.orb-2 {
  animation-delay: 5s, 3s;
}


/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* 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;
  }

  .gradient-orb {
    animation: none !important;
  }

  .floating-card {
    animation: none !important;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}

/* GPU acceleration for smooth animations */
.service-card,
.feature-item,
.btn,
.nav-link,
[data-tilt] {
  will-change: transform;
}

/* Remove will-change after animation completes to save resources */
.service-card.revealed,
.feature-item.revealed {
  will-change: auto;
}


/* ===================================
   LOADING STATES
   =================================== */

/* Skeleton loading (si besoin futur) */
@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}