/* Scroll Animation Base Styles */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
  will-change: opacity, transform;
}

/* Fallback: If JS fails, show elements after 3 seconds */
@keyframes fallback-show {
  to { opacity: 1; transform: none; }
}
.animate-on-scroll:not(.animate) {
  animation: fallback-show 0.5s ease-out 3s forwards;
}

/* When element is in view and animated */
.animate-on-scroll.animate {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
  animation: none; /* Cancel fallback if JS works */
}

/* Different animation types */
.fade-up {
  transform: translateY(30px);
}

.fade-down {
  transform: translateY(-30px);
}

.fade-left {
  transform: translateX(30px);
}

.fade-right {
  transform: translateX(-30px);
}

.fade-in {
  transform: translateY(0);
  opacity: 0;
}

.zoom-in {
  transform: scale(0.95);
}

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

/* Animation staggering via delay classes */
.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

.delay-300 {
  transition-delay: 0.3s;
}

.delay-400 {
  transition-delay: 0.4s;
}

.delay-500 {
  transition-delay: 0.5s;
}

/* Mobile optimization - reduce animation distance on smaller screens */
@media (max-width: 767px) {
  /* Disable scroll animations on mobile for better performance */
  .animate-on-scroll,
  .animate-on-scroll.animate,
  [data-animate],
  [data-animate].animate {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
    animation: none !important;
  }
  
  .fade-up, .fade-down, .fade-left, .fade-right, .zoom-in, .zoom-out,
  .delay-100, .delay-200, .delay-300, .delay-400, .delay-500 {
    transform: none !important;
    transition-delay: 0s !important;
  }
  
  /* Partner logo scroll animation - must be explicit for mobile Safari */
  @-webkit-keyframes scroll-logos {
    0% { -webkit-transform: translateX(0); transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); transform: translateX(-50%); }
  }
  @keyframes scroll-logos {
    0% { -webkit-transform: translateX(0); transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); transform: translateX(-50%); }
  }
  
  .partner-logos {
    -webkit-animation: scroll-logos 25s linear infinite !important;
    animation: scroll-logos 25s linear infinite !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Reduce motion preference support */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    transition: opacity 0.5s ease-out;
    transform: none !important;
  }
  
  .fade-up, .fade-down, .fade-left, .fade-right, .zoom-in, .zoom-out {
    transform: none;
  }
}

/* ===========================================
   Progress Tile Pulse Animation
   Using only GPU-composited properties (transform, opacity)
   =========================================== */
@keyframes pulse-glow {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.progress-tile.active {
  animation: pulse-glow 2s infinite ease-in-out;
  background-color: var(--color-dark);
  border-color: var(--color-accent-purple);
  box-shadow: 0 0 20px 0 rgba(var(--color-accent-purple-rgb), 0.4);
  z-index: 1;
  will-change: transform, opacity;
}

.progress-tile.active .tile-icon {
  transform: scale(1.1);
  transition: transform 0.3s ease;
} 