/* ============================================
   VEER PATTA PUBLIC SCHOOL - ANIMATIONS
   Modern, subtle animations for enhanced UX
   ============================================ */

/* ============================================
   ANIMATION TIMING VARIABLES
   ============================================ */
:root {
  --animation-duration-fast: 200ms;
  --animation-duration-normal: 300ms;
  --animation-duration-slow: 500ms;
  --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --animation-easing-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --animation-easing-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --animation-easing-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --stagger-delay: 100ms;
  --stagger-delay-fast: 50ms;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Fade Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleUp {
  from {
    transform: scale(0.95);
  }

  to {
    transform: scale(1);
  }
}

/* Pulse Animation */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 30px rgba(var(--brand-green-rgb), 0.28);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 16px 40px rgba(var(--brand-green-rgb), 0.4);
  }
}

/* Gentle Pulse for Attention */
@keyframes gentlePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

/* Bounce Animation */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* Float Animation */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Shimmer Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }

  100% {
    background-position: 468px 0;
  }
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Typewriter Animation */
@keyframes typewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Underline Slide Animation */
@keyframes underlineSlide {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* Glow Animation */
@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(var(--brand-blue-rgb), 0.3);
  }

  50% {
    box-shadow: 0 0 20px rgba(var(--brand-blue-rgb), 0.6), 0 0 30px rgba(var(--brand-blue-rgb), 0.4);
  }
}

/* Number Counter Animation (used with JS) */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Page Fade In */
body {
  animation: fadeIn 0.4s var(--animation-easing);
}

/* Header Slide Down */
.site-header {
  animation: fadeDown 0.5s var(--animation-easing);
}

/* ============================================
   HERO SECTION ANIMATIONS
   ============================================ */

/* Hero Text Staggered Fade Up */
.hero h1 {
  animation: fadeUp 0.6s var(--animation-easing);
}

.hero p:first-of-type {
  animation: fadeUp 0.7s var(--animation-easing);
}

.hero p:has(.btn) {
  animation: fadeUp 0.8s var(--animation-easing);
}

/* Hero Image Float */
.hero img,
.hero video {
  animation: fadeIn 1s var(--animation-easing), float 6s ease-in-out infinite;
  animation-delay: 0.3s, 0.8s;
}

/* Hero Button Pulse (periodic) */
.hero .btn {
  animation: fadeUp 0.8s var(--animation-easing);
}

.hero .btn.pulse-active {
  animation: pulse 1s ease-in-out;
}

/* ============================================
   SCROLL-TRIGGERED ANIMATION CLASSES
   ============================================ */

/* Base class for scroll animations (invisible until triggered) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--animation-easing), transform 0.6s var(--animation-easing);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Animation Variants */
.animate-fadeUp {
  opacity: 0;
  transform: translateY(30px);
}

.animate-fadeUp.animated {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--animation-easing), transform 0.6s var(--animation-easing);
}

.animate-slideIn {
  opacity: 0;
  transform: translateX(-40px);
}

.animate-slideIn.animated {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.6s var(--animation-easing), transform 0.6s var(--animation-easing);
}

.animate-scaleIn {
  opacity: 0;
  transform: scale(0.9);
}

.animate-scaleIn.animated {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s var(--animation-easing), transform 0.5s var(--animation-easing);
}

/* ============================================
   STAGGER DELAYS FOR SEQUENTIAL ANIMATIONS
   ============================================ */

.stagger-1 {
  transition-delay: calc(1 * var(--stagger-delay)) !important;
}

.stagger-2 {
  transition-delay: calc(2 * var(--stagger-delay)) !important;
}

.stagger-3 {
  transition-delay: calc(3 * var(--stagger-delay)) !important;
}

.stagger-4 {
  transition-delay: calc(4 * var(--stagger-delay)) !important;
}

.stagger-5 {
  transition-delay: calc(5 * var(--stagger-delay)) !important;
}

.stagger-6 {
  transition-delay: calc(6 * var(--stagger-delay)) !important;
}

/* ============================================
   CARD STAGGER ANIMATIONS (For Cards Grid)
   ============================================ */

/* Cards that should be hidden until scrolled into view */
.card-stagger-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Revealed state - card becomes visible */
.card-stagger-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Specific delays for staggered reveal (override general stagger classes) */
.card-stagger-delay-1 {
  transition-delay: 0ms;
}

.card-stagger-delay-2 {
  transition-delay: 100ms;
}

.card-stagger-delay-3 {
  transition-delay: 200ms;
}

.card-stagger-delay-4 {
  transition-delay: 300ms;
}

.card-stagger-delay-5 {
  transition-delay: 400ms;
}

.card-stagger-delay-6 {
  transition-delay: 500ms;
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Button Hover Effects - Enhanced */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform var(--animation-duration-normal) var(--animation-easing-spring),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
  will-change: transform;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 28px rgba(var(--brand-blue-rgb), 0.3);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
  transition-duration: 100ms;
}

/* Navigation Link Underline Effect */
.nav-link {
  position: relative;
  transition: opacity var(--animation-duration-fast) var(--animation-easing);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--animation-duration-normal) var(--animation-easing);
}

.nav-link:hover::after {
  width: 100%;
}

/* Card Hover Lift Effect */
.hover-lift {
  transition: transform var(--animation-duration-normal) var(--animation-easing),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
  will-change: transform;
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(var(--brand-blue-rgb), 0.15);
}

/* Stat Cards and Program Cards - Enhanced with 3D */
.stat-card,
.stat,
.program-card,
.program {
  transform-style: preserve-3d;
  transition: transform var(--animation-duration-normal) var(--animation-easing-smooth),
    box-shadow var(--animation-duration-normal) var(--animation-easing),
    border-color var(--animation-duration-normal) var(--animation-easing);
  will-change: transform;
  position: relative;
}

.stat-card::before,
.stat::before,
.program-card::before,
.program::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.05), rgba(var(--brand-green-rgb), 0.05));
  opacity: 0;
  transition: opacity var(--animation-duration-normal) var(--animation-easing);
  border-radius: inherit;
  z-index: -1;
}

.stat-card:hover,
.stat:hover {
  transform: translateY(-6px) scale(1.02) rotateX(2deg);
  box-shadow: 0 20px 40px rgba(var(--brand-blue-rgb), 0.18),
    0 0 0 1px rgba(var(--brand-blue-rgb), 0.08);
}

.stat-card:hover::before,
.stat:hover::before {
  opacity: 1;
}

.program-card:hover,
.program:hover {
  transform: translateY(-8px) rotateY(1deg) rotateX(-1deg);
  box-shadow: 0 24px 48px rgba(var(--brand-blue-rgb), 0.2),
    0 0 0 2px rgba(var(--brand-blue-rgb), 0.1);
  border-color: var(--brand-blue);
}

.program-card:hover::before,
.program:hover::before {
  opacity: 1;
}

/* ============================================
   FORM INPUT ANIMATIONS
   ============================================ */

.admissions-form input,
.admissions-form textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  transition: border-color var(--animation-duration-normal) var(--animation-easing),
    box-shadow var(--animation-duration-normal) var(--animation-easing),
    transform var(--animation-duration-fast) var(--animation-easing);
}

.admissions-form input:focus,
.admissions-form textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(var(--brand-blue-rgb), 0.15);
  transform: scale(1.01);
}

/* Glow Effect Class */
.hover-glow {
  transition: box-shadow var(--animation-duration-normal) var(--animation-easing);
}

.hover-glow:focus,
.hover-glow:hover {
  box-shadow: 0 0 0 4px rgba(var(--brand-blue-rgb), 0.2);
}

/* ============================================
   WHATSAPP BUTTON ANIMATIONS
   ============================================ */

.whatsapp-float {
  transition: transform var(--animation-duration-normal) var(--animation-easing),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
  will-change: transform;
}

.whatsapp-float:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.25);
  animation: bounce 0.6s ease;
}

/* Periodic Attention Pulse for WhatsApp */
.whatsapp-float.attention-pulse {
  animation: gentlePulse 2s ease-in-out;
}

/* ============================================
   GALLERY FILTER ANIMATIONS
   ============================================ */

.pill {
  position: relative;
  transition: all var(--animation-duration-normal) var(--animation-easing);
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--brand-blue-rgb), 0.2);
}

.pill.active {
  transform: scale(1.05);
}

/* Gallery Items Fade In - Enhanced */
.gallery-item {
  overflow: hidden;
  position: relative;
  transition: opacity var(--animation-duration-normal) var(--animation-easing),
    transform var(--animation-duration-normal) var(--animation-easing-smooth),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
}

.gallery-item img {
  transition: transform var(--animation-duration-slow) var(--animation-easing-smooth);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(var(--brand-blue-rgb), 0.2);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

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

/* Shimmer Effect for Loading Images */
.loading-shimmer {
  background: linear-gradient(to right,
      #f0f0f0 0%,
      #e0e0e0 20%,
      #f0f0f0 40%,
      #f0f0f0 100%);
  background-size: 800px 100%;
  animation: shimmer 2s linear infinite;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg,
      #f0f0f0 25%,
      #e0e0e0 50%,
      #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

/* Image Lazy Load Fade In */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.4s var(--animation-easing);
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

/* Typewriter Effect for Principal's Message */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--brand-blue);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
  display: inline-block;
}

.typewriter.finished {
  border-right: none;
}

/* Highlight Animation for Statistics */
.stat h3,
.stat-card h3 {
  transition: color var(--animation-duration-normal) var(--animation-easing),
    transform var(--animation-duration-normal) var(--animation-easing);
}

.stat:hover h3,
.stat-card:hover h3 {
  transform: scale(1.1);
  color: var(--brand-green);
}

/* Number Counter Class */
.counter {
  animation: countUp 0.6s var(--animation-easing);
}

/* ============================================
   TESTIMONIAL ANIMATIONS
   ============================================ */

.testimonial {
  transition: transform var(--animation-duration-normal) var(--animation-easing),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
}

.testimonial:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(var(--brand-blue-rgb), 0.12);
}

/* ============================================
   FORM SUBMISSION ANIMATIONS
   ============================================ */

/* Loading Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  margin-left: 8px;
}

/* Success Animation */
@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-icon {
  animation: successPop 0.5s var(--animation-easing-bounce);
}

/* ============================================
   GRADIENT BACKGROUND ANIMATION
   ============================================ */

.hero {
  background: linear-gradient(160deg,
      #F8F9FE 0%,
      #ffffff 50%,
      #F8F9FE 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* ============================================
   PARALLAX EFFECT (SUBTLE)
   ============================================ */

.parallax-element {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Applied via JavaScript based on scroll position */

/* ============================================
   CUSTOM TEXT SELECTION
   ============================================ */

::selection {
  background-color: var(--brand-blue);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--brand-blue);
  color: #ffffff;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* ============================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================ */

@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;
  }

  /* Disable floating and parallax effects */
  .hero img,
  .hero video {
    animation: none !important;
  }

  .parallax-element {
    transform: none !important;
  }

  /* Keep opacity transitions for accessibility */
  .animate-on-scroll,
  .animate-fadeUp,
  .animate-slideIn,
  .animate-scaleIn {
    opacity: 1 !important;
    transform: none !important;
  }
}

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

/* Use will-change sparingly for better performance */
.btn:hover,
.program-card:hover,
.stat-card:hover,
.whatsapp-float:hover {
  will-change: transform;
}

/* Remove will-change after animation completes */
.btn,
.program-card,
.stat-card,
.whatsapp-float {
  will-change: auto;
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.fade-in {
  animation: fadeIn 0.5s var(--animation-easing);
}

.fade-up {
  animation: fadeUp 0.6s var(--animation-easing);
}

.slide-in-left {
  animation: slideInLeft 0.6s var(--animation-easing);
}

.slide-in-right {
  animation: slideInRight 0.6s var(--animation-easing);
}

.scale-in {
  animation: scaleIn 0.5s var(--animation-easing);
}

.bounce-once {
  animation: bounce 0.6s ease;
}

.pulse-once {
  animation: pulse 1s ease;
}

/* ============================================
   FOCUS VISIBLE ENHANCEMENTS
   ============================================ */

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  animation: glow 1.5s ease-in-out infinite;
}

/* ============================================
   RIPPLE EFFECT FOR BUTTONS
   Enhanced micro-interactions
   ============================================ */

.btn,
.cta-btn,
.mobile-nav-link {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   MODERN ANIMATION ENHANCEMENTS (2025)
   ============================================ */

/* 3D Tilt Effect */
@keyframes tiltIn {
  from {
    opacity: 0;
    transform: rotateY(-10deg) rotateX(5deg) scale(0.95);
  }

  to {
    opacity: 1;
    transform: rotateY(0) rotateX(0) scale(1);
  }
}

/* Gradient Flow Animation */
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Border Draw Animation */
@keyframes borderDraw {
  0% {
    stroke-dashoffset: 1000;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* Shake Animation for Errors */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

/* Icon Bounce In */
@keyframes iconBounceIn {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }

  50% {
    transform: scale(1.1) rotate(10deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* Slide and Fade (diagonal) */
@keyframes slideInDiagonal {
  from {
    opacity: 0;
    transform: translate(-20px, -20px);
  }

  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* Glow Pulse */
@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(var(--brand-blue-rgb), 0.3);
  }

  50% {
    box-shadow: 0 0 20px rgba(var(--brand-blue-rgb), 0.6),
      0 0 30px rgba(var(--brand-blue-rgb), 0.4);
  }
}

/* Wave Animation for Dividers */
@keyframes wave {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

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

/* 3D Card Tilt on Hover */
.hover-tilt-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform var(--animation-duration-normal) var(--animation-easing-smooth);
}

.hover-tilt-3d:hover {
  transform: rotateY(2deg) rotateX(-2deg) translateY(-8px);
}

/* Gradient Shift on Hover */
.hover-gradient {
  background-size: 200% 200%;
  transition: background-position var(--animation-duration-slow) var(--animation-easing-smooth);
}

.hover-gradient:hover {
  background-position: 100% 50%;
}

/* Scale with Glow */
.hover-scale-glow {
  transition: transform var(--animation-duration-normal) var(--animation-easing-spring),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
}

.hover-scale-glow:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(var(--brand-blue-rgb), 0.25),
    0 0 20px rgba(var(--brand-blue-rgb), 0.15);
}

/* Border Glow Effect */
.hover-border-glow {
  position: relative;
  transition: all var(--animation-duration-normal) var(--animation-easing);
}

.hover-border-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--brand-blue), var(--brand-green), var(--brand-blue));
  background-size: 300% 300%;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--animation-duration-normal) var(--animation-easing);
  z-index: -1;
  animation: gradientFlow 3s ease infinite;
}

.hover-border-glow:hover::before {
  opacity: 1;
}

/* ============================================
   ENHANCED BUTTON MICRO-INTERACTIONS
   ============================================ */

/* Enhanced Button with Multiple States */
.btn-enhanced {
  position: relative;
  overflow: hidden;
  transition: all var(--animation-duration-normal) var(--animation-easing-spring);
}

.btn-enhanced::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-enhanced:hover::before {
  width: 300px;
  height: 300px;
}

.btn-enhanced:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 24px rgba(var(--brand-blue-rgb), 0.25);
}

.btn-enhanced:active {
  transform: translateY(-1px) scale(0.98);
  transition-duration: 100ms;
}

/* Loading State for Buttons */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  right: 12px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Success State Animation */
.btn-success {
  background: var(--brand-green) !important;
  animation: successPop 0.5s var(--animation-easing-bounce);
}

.btn-error {
  animation: shake 0.5s ease;
}

/* ============================================
   ENHANCED CARD ANIMATIONS
   ============================================ */

/* Modern Card with 3D Lift */
.card-modern {
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--animation-duration-normal) var(--animation-easing-smooth),
    box-shadow var(--animation-duration-normal) var(--animation-easing);
}

.card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(var(--brand-blue-rgb), 0.1), rgba(var(--brand-green-rgb), 0.1));
  opacity: 0;
  transition: opacity var(--animation-duration-normal) var(--animation-easing);
  border-radius: inherit;
  z-index: -1;
}

.card-modern:hover {
  transform: translateY(-10px) rotateX(2deg);
  box-shadow: 0 20px 40px rgba(var(--brand-blue-rgb), 0.2),
    0 0 0 1px rgba(var(--brand-blue-rgb), 0.1);
}

.card-modern:hover::before {
  opacity: 1;
}

/* Stagger with Spring Easing */
.stagger-spring-1 {
  animation-delay: calc(1 * var(--stagger-delay-fast));
}

.stagger-spring-2 {
  animation-delay: calc(2 * var(--stagger-delay-fast));
}

.stagger-spring-3 {
  animation-delay: calc(3 * var(--stagger-delay-fast));
}

.stagger-spring-4 {
  animation-delay: calc(4 * var(--stagger-delay-fast));
}

.stagger-spring-5 {
  animation-delay: calc(5 * var(--stagger-delay-fast));
}

.stagger-spring-6 {
  animation-delay: calc(6 * var(--stagger-delay-fast));
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

/* Floating Label Animation */
.form-group {
  position: relative;
}

.floating-label {
  position: absolute;
  top: 16px;
  left: 12px;
  color: var(--muted-text);
  pointer-events: none;
  transition: all var(--animation-duration-normal) var(--animation-easing-spring);
  background: white;
  padding: 0 4px;
}

.form-input:focus~.floating-label,
.form-input:not(:placeholder-shown)~.floating-label {
  top: -8px;
  left: 8px;
  font-size: 0.75rem;
  color: var(--brand-blue);
}

/* Input Success State */
.form-input.success {
  border-color: var(--brand-green);
  animation: successPop 0.3s var(--animation-easing-spring);
}

.form-input.success::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-green);
  font-weight: bold;
  animation: iconBounceIn 0.5s var(--animation-easing-bounce);
}

/* Input Error State */
.form-input.error {
  border-color: var(--brand-red);
  animation: shake 0.5s ease;
}

/* ============================================
   NAVIGATION ENHANCEMENTS
   ============================================ */

/* Active Indicator Slide */
.nav-active-indicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: var(--brand-blue);
  transition: all var(--animation-duration-normal) var(--animation-easing-spring);
  border-radius: 2px 2px 0 0;
}

/* Icon Bounce on Hover */
.nav-icon {
  transition: transform var(--animation-duration-fast) var(--animation-easing-bounce);
}

.nav-link:hover .nav-icon {
  animation: bounce 0.6s ease;
}

/* ============================================
   IMAGE & GALLERY ENHANCEMENTS
   ============================================ */

/* Clip Path Reveal */
@keyframes clipReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

.image-reveal {
  animation: clipReveal 0.8s var(--animation-easing-smooth);
}

/* Hover Zoom Effect */
.image-zoom {
  overflow: hidden;
}

.image-zoom img {
  transition: transform var(--animation-duration-slow) var(--animation-easing-smooth);
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

.anim-tilt-in {
  animation: tiltIn 0.6s var(--animation-easing-spring);
}

.anim-diagonal {
  animation: slideInDiagonal 0.5s var(--animation-easing);
}

.anim-glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

.anim-shake {
  animation: shake 0.5s ease;
}

.anim-icon-bounce {
  animation: iconBounceIn 0.6s var(--animation-easing-bounce);
}

/* ============================================
   TESTIMONIAL CAROUSEL ANIMATIONS
   ============================================ */

/* Note: Main .testimonial-slide styles are in style.css */

/* Testimonial Dot Animation */
.testimonial-dot {
  transition: all var(--animation-duration-normal) var(--animation-easing-spring);
  transform: scale(1);
}

.testimonial-dot.active {
  transform: scale(1.3);
  animation: gentlePulse 1.5s ease-in-out infinite;
}

.testimonial-dot:hover {
  transform: scale(1.2);
}

/* Quote Icon Pulse */
.quote-icon {
  animation: float 4s ease-in-out infinite;
  opacity: 0.15;
}

/* ============================================
   WIZARD PROGRESS ANIMATIONS
   ============================================ */

/* Progress Bar Fill Animation */
.wizard-progress-fill {
  transition: width 0.6s var(--animation-easing-spring);
  position: relative;
  overflow: hidden;
}

.wizard-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: shimmer 2s ease-in-out infinite;
}

/* Wizard Step Transitions */
.wizard-step {
  opacity: 0.5;
  transform: scale(0.95);
  transition: all var(--animation-duration-normal) var(--animation-easing-spring);
}

.wizard-step.active {
  opacity: 1;
  transform: scale(1);
  animation: gentlePulse 1.5s ease-in-out;
}

.wizard-step.completed {
  opacity: 1;
  transform: scale(1);
}

.wizard-step.completed .wizard-step-number {
  animation: successPop 0.4s var(--animation-easing-bounce);
}

/* Wizard Content Transitions */
.wizard-content {
  animation: fadeUp 0.5s var(--animation-easing);
}

/* ============================================
   FEE CALCULATOR ANIMATIONS
   ============================================ */

/* Result Fade In */
.fee-result {
  animation: fadeUp 0.6s var(--animation-easing);
}

/* Fee Table Row Animation */
.fee-table tr {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInLeft 0.4s var(--animation-easing) forwards;
}

.fee-table tr:nth-child(1) {
  animation-delay: 0.05s;
}

.fee-table tr:nth-child(2) {
  animation-delay: 0.1s;
}

.fee-table tr:nth-child(3) {
  animation-delay: 0.15s;
}

.fee-table tr:nth-child(4) {
  animation-delay: 0.2s;
}

.fee-table tr:nth-child(5) {
  animation-delay: 0.25s;
}

.fee-table tr:nth-child(6) {
  animation-delay: 0.3s;
}

/* Total Amount Highlight */
.total-amount {
  animation: scaleIn 0.6s var(--animation-easing-bounce);
}

.total-row {
  animation: glowPulse 2s ease-in-out 1;
}

/* ============================================
   STATS DASHBOARD ANIMATIONS
   ============================================ */

/* Stats Counter Animation */
.stat-number {
  animation: countUp 1s var(--animation-easing-spring);
}

/* Stats Card Reveal - Visible by default, animation as progressive enhancement */
.stats-grid .stat-card-modern {
  /* Cards are ALWAYS visible by default for progressive enhancement */
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: all 0.5s var(--animation-easing);
}

/* Only apply hidden state if JavaScript has added the waiting-for-animation class */
.stats-grid.js-animate .stat-card-modern:not(.animated) {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
}

.stats-grid.js-animate .stat-card-modern:nth-child(1) {
  transition-delay: 0.1s;
}

.stats-grid.js-animate .stat-card-modern:nth-child(2) {
  transition-delay: 0.2s;
}

.stats-grid.js-animate .stat-card-modern:nth-child(3) {
  transition-delay: 0.3s;
}

.stats-grid.js-animate .stat-card-modern:nth-child(4) {
  transition-delay: 0.4s;
}

.stats-grid .stat-card-modern.animated,
.stats-grid.js-animate .stat-card-modern.animated {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */

/* Glass Card Shimmer */
@keyframes glassShimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

.glass-shimmer::before {
  animation: glassShimmer 3s ease-in-out infinite;
}

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

@keyframes gradientText {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.gradient-text-animated {
  background-size: 200% 200%;
  animation: gradientText 3s ease infinite;
}

/* ============================================
   ENHANCED FADE IN ANIMATION
   ============================================ */

.animate-fadeIn {
  opacity: 0;
  animation: fadeIn 0.6s var(--animation-easing) forwards;
}

/* ============================================
   MODERN MARKETING-FIRST ANIMATIONS (2025)
   Mobile-optimized, GPU-accelerated
   ============================================ */

/* Gradient Text Shimmer Effect */
@keyframes textShimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

.text-shimmer {
  background: linear-gradient(90deg,
      var(--brand-blue) 0%,
      var(--brand-green) 25%,
      var(--brand-yellow) 50%,
      var(--brand-green) 75%,
      var(--brand-blue) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 4s linear infinite;
}

/* Blob Morphing Background Animation */
@keyframes blobMorph {

  0%,
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(0deg) scale(1);
  }

  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }

  50% {
    border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    transform: rotate(180deg) scale(1.05);
  }

  75% {
    border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
  }
}

.blob-animate {
  animation: blobMorph 12s ease-in-out infinite;
  will-change: border-radius, transform;
}

/* Touch Pulse Feedback for Mobile */
@keyframes touchPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--brand-blue-rgb), 0.4);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 15px rgba(var(--brand-blue-rgb), 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--brand-blue-rgb), 0);
  }
}

.touch-pulse:active {
  animation: touchPulse 0.4s ease-out;
}

/* CTA Attention Glow */
@keyframes ctaGlow {

  0%,
  100% {
    box-shadow: 0 8px 24px rgba(var(--brand-blue-rgb), 0.3),
      0 0 0 0 rgba(var(--brand-blue-rgb), 0.4);
  }

  50% {
    box-shadow: 0 12px 32px rgba(var(--brand-blue-rgb), 0.4),
      0 0 20px 8px rgba(var(--brand-blue-rgb), 0.2);
  }
}

.cta-glow {
  animation: ctaGlow 2.5s ease-in-out infinite;
}

/* Floating Particles Effect (CSS-only) */
@keyframes floatParticle {

  0%,
  100% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-100vh) translateX(20px) rotate(360deg);
    opacity: 0;
  }
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: floatParticle 8s ease-in-out infinite;
}

.particle:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
  animation-duration: 10s;
}

.particle:nth-child(2) {
  left: 30%;
  animation-delay: 2s;
  animation-duration: 12s;
}

.particle:nth-child(3) {
  left: 50%;
  animation-delay: 4s;
  animation-duration: 8s;
}

.particle:nth-child(4) {
  left: 70%;
  animation-delay: 1s;
  animation-duration: 11s;
}

.particle:nth-child(5) {
  left: 90%;
  animation-delay: 3s;
  animation-duration: 9s;
}

/* Text Reveal Word by Word */
@keyframes wordReveal {
  0% {
    opacity: 0;
    transform: translateY(20px) rotateX(-20deg);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0);
    filter: blur(0);
  }
}

.word-reveal {
  display: inline-block;
  opacity: 0;
  animation: wordReveal 0.6s var(--animation-easing-spring) forwards;
}

.word-reveal:nth-child(1) {
  animation-delay: 0.1s;
}

.word-reveal:nth-child(2) {
  animation-delay: 0.2s;
}

.word-reveal:nth-child(3) {
  animation-delay: 0.3s;
}

.word-reveal:nth-child(4) {
  animation-delay: 0.4s;
}

.word-reveal:nth-child(5) {
  animation-delay: 0.5s;
}

.word-reveal:nth-child(6) {
  animation-delay: 0.6s;
}

/* Enhanced Entrance Slide Up */
@keyframes slideUpReveal {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up-reveal {
  opacity: 0;
  animation: slideUpReveal 0.7s var(--animation-easing-out-back) forwards;
}

/* Staggered Children Reveal */
.stagger-children>* {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpReveal 0.5s var(--animation-easing) forwards;
}

.stagger-children>*:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger-children>*:nth-child(2) {
  animation-delay: 0.1s;
}

.stagger-children>*:nth-child(3) {
  animation-delay: 0.15s;
}

.stagger-children>*:nth-child(4) {
  animation-delay: 0.2s;
}

.stagger-children>*:nth-child(5) {
  animation-delay: 0.25s;
}

.stagger-children>*:nth-child(6) {
  animation-delay: 0.3s;
}

/* Premium Card Hover with 3D Tilt */
.premium-card {
  transition: transform 0.4s var(--animation-easing-smooth),
    box-shadow 0.4s var(--animation-easing);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.premium-card:hover {
  transform: translateY(-12px) rotateX(4deg) rotateY(-2deg);
  box-shadow: 0 24px 48px rgba(var(--brand-blue-rgb), 0.2),
    0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Icon Pop Animation */
@keyframes iconPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.icon-pop {
  animation: iconPop 0.5s var(--animation-easing-bounce) forwards;
}

/* Wave Divider Animation */
@keyframes waveDivider {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.wave-divider {
  animation: waveDivider 15s linear infinite;
}

/* Gradient Border Animation */
@keyframes borderGradientRotate {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.animated-border {
  position: relative;
}

.animated-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green), var(--brand-yellow), var(--brand-green), var(--brand-blue));
  background-size: 300% 100%;
  animation: borderGradientRotate 4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

/* Subtle Breathe Effect for Stats */
@keyframes breathe {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

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

/* Entrance Zoom */
@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.zoom-in {
  opacity: 0;
  animation: zoomIn 0.6s var(--animation-easing-spring) forwards;
}

/* Mobile-specific: Reduced animations for performance */
@media (max-width: 600px) {
  .blob-animate {
    animation-duration: 20s;
    /* Slower for better mobile perf */
  }

  .particle {
    display: none;
    /* Disable particles on mobile for performance */
  }

  .text-shimmer {
    animation-duration: 6s;
    /* Slower shimmer on mobile */
  }

  .premium-card:hover {
    transform: translateY(-8px);
    /* Simpler transform on mobile */
  }
}

/* Low-end device optimizations */
@media (prefers-reduced-motion: reduce) {

  .blob-animate,
  .text-shimmer,
  .particle,
  .cta-glow,
  .breathe,
  .wave-divider {
    animation: none !important;
  }

  .word-reveal,
  .slide-up-reveal,
  .zoom-in,
  .icon-pop,
  .stagger-children>* {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ============================================
   MODERN SCROLL ANIMATIONS (MOBILE-FIRST 2025)
   Optimized for mobile devices and 3G networks
   Uses GPU-accelerated transforms only
   ============================================ */

/* =====================
   SCROLL REVEAL BASE CLASSES
   Mobile-optimized transitions
   ===================== */

/* Scroll reveal base - items hidden until triggered */
.scroll-reveal {
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out,
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0.6s;
  will-change: transform, opacity;
}

.scroll-reveal.revealed {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Remove will-change after animation completes for performance */
.scroll-reveal.revealed.transition-done {
  will-change: auto;
}

/* =====================
   SCROLL REVEAL VARIANTS
   Different animation styles
   ===================== */

/* Fade Up - Default, works great on mobile */
.scroll-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease-out,
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-fade-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Fade In Left - For alternating layouts */
.scroll-fade-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.5s ease-out,
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-fade-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Fade In Right - For alternating layouts */
.scroll-fade-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s ease-out,
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-fade-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Scale Up - Great for cards and images */
.scroll-scale-up {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-scale-up.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Blur Fade - Premium feel, use sparingly on mobile */
.scroll-blur-fade {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(8px);
  transition: opacity 0.6s ease-out,
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.6s ease-out;
}

.scroll-blur-fade.revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Slide Up Bounce - For CTA buttons and important elements */
.scroll-bounce-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.4s ease-out,
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-bounce-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Rotate In - For icons and badges */
.scroll-rotate-in {
  opacity: 0;
  transform: rotate(-10deg) scale(0.8);
  transition: opacity 0.5s ease-out,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-rotate-in.revealed {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* =====================
   STAGGERED SCROLL REVEALS
   Children animate sequentially
   ===================== */

.scroll-stagger>* {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.4s ease-out,
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-stagger.revealed>* {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for sequential reveal */
.scroll-stagger.revealed>*:nth-child(1) {
  transition-delay: 0.05s;
}

.scroll-stagger.revealed>*:nth-child(2) {
  transition-delay: 0.1s;
}

.scroll-stagger.revealed>*:nth-child(3) {
  transition-delay: 0.15s;
}

.scroll-stagger.revealed>*:nth-child(4) {
  transition-delay: 0.2s;
}

.scroll-stagger.revealed>*:nth-child(5) {
  transition-delay: 0.25s;
}

.scroll-stagger.revealed>*:nth-child(6) {
  transition-delay: 0.3s;
}

.scroll-stagger.revealed>*:nth-child(7) {
  transition-delay: 0.35s;
}

.scroll-stagger.revealed>*:nth-child(8) {
  transition-delay: 0.4s;
}

/* Faster stagger variant for mobile grids */
.scroll-stagger-fast>* {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out,
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-stagger-fast.revealed>* {
  opacity: 1;
  transform: translateY(0);
}

.scroll-stagger-fast.revealed>*:nth-child(1) {
  transition-delay: 0s;
}

.scroll-stagger-fast.revealed>*:nth-child(2) {
  transition-delay: 0.05s;
}

.scroll-stagger-fast.revealed>*:nth-child(3) {
  transition-delay: 0.1s;
}

.scroll-stagger-fast.revealed>*:nth-child(4) {
  transition-delay: 0.15s;
}

.scroll-stagger-fast.revealed>*:nth-child(5) {
  transition-delay: 0.2s;
}

.scroll-stagger-fast.revealed>*:nth-child(6) {
  transition-delay: 0.25s;
}

/* =====================
   SECTION REVEAL ANIMATIONS
   Full section reveals with backgrounds
   ===================== */

/* Section fade with subtle slide */
.section-reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.7s ease-out,
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Section clip reveal - content slides up from below */
.section-clip-reveal {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-clip-reveal.revealed {
  clip-path: inset(0 0 0 0);
}

/* Section with reveal line */
.section-line-reveal {
  position: relative;
}

.section-line-reveal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.section-line-reveal.revealed::before {
  width: min(200px, 60%);
}

/* =====================
   SCROLL PROGRESS EFFECTS
   Elements that animate based on scroll position
   ===================== */

/* Scroll-driven opacity */
.scroll-opacity {
  transition: opacity 0.15s ease-out;
}

/* Parallax-like subtle shift */
.scroll-shift {
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* =====================
   MOBILE-SPECIFIC SCROLL ANIMATIONS
   Lighter animations for better performance
   ===================== */

@media (max-width: 768px) {

  /* Reduce movement distance on mobile */
  .scroll-reveal,
  .scroll-fade-up {
    transform: translateY(25px);
  }

  .scroll-fade-left,
  .scroll-fade-right {
    transform: translateX(25px);
  }

  .scroll-stagger>*,
  .scroll-stagger-fast>* {
    transform: translateY(15px);
  }

  /* Faster transitions on mobile for snappier feel */
  .scroll-reveal,
  .scroll-fade-up,
  .scroll-fade-left,
  .scroll-fade-right,
  .scroll-scale-up {
    transition-duration: 0.4s;
  }

  /* Disable blur effect on mobile for performance */
  .scroll-blur-fade {
    filter: none;
    transform: translateY(20px);
  }

  .scroll-blur-fade.revealed {
    filter: none;
  }

  /* Simpler section reveals on mobile */
  .section-reveal {
    transform: translateY(40px);
    transition-duration: 0.5s;
  }

  /* Disable clip animation on low-end devices */
  .section-clip-reveal {
    clip-path: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  }

  .section-clip-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
   SCROLL-LINKED HEADER EFFECTS
   Header transforms based on scroll
   ===================== */

.site-header {
  transition: background-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

/* Compact header on scroll */
.site-header.header-scrolled {
  background: rgba(254, 254, 254, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Hide header on scroll down, show on scroll up */
.site-header.header-hidden {
  transform: translateY(-100%);
}

.site-header.header-visible {
  transform: translateY(0);
}

/* =====================
   SCROLL PROGRESS INDICATOR
   Visual scroll progress bar
   ===================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  z-index: 9999;
  transform-origin: left;
  transition: width 0.1s ease-out;
  border-radius: 0 2px 2px 0;
}

/* =====================
   SCROLL-DRIVEN COUNTERS
   Numbers that animate when visible
   ===================== */

.scroll-counter {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease-out,
    transform 0.5s ease-out;
}

.scroll-counter.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   INTERSECTION-BASED LAZY IMAGES
   Image reveal on scroll
   ===================== */

.lazy-image {
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.6s ease-out,
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lazy-image.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Image container with shimmer placeholder */
.image-container {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg,
      #f0f0f0 25%,
      #e8e8e8 50%,
      #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.image-container.loaded {
  animation: none;
  background: transparent;
}

/* =====================
   SCROLL-TRIGGERED DECORATIVE ELEMENTS
   Visual flair that appears on scroll
   ===================== */

/* Animated decorative line */
.scroll-line {
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.scroll-line.revealed {
  width: 100%;
}

/* Animated circle/dot */
.scroll-dot {
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s ease-out,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-dot.revealed {
  opacity: 1;
  transform: scale(1);
}

/* =====================
   PERFORMANCE: LOW-END DEVICE HANDLING
   Disable complex animations on weak hardware
   ===================== */

/* Class added by JS when device is low-end */
.low-end-device .scroll-blur-fade {
  filter: none !important;
}

.low-end-device .scroll-reveal,
.low-end-device .scroll-fade-up,
.low-end-device .scroll-fade-left,
.low-end-device .scroll-fade-right,
.low-end-device .scroll-scale-up,
.low-end-device .scroll-bounce-up,
.low-end-device .scroll-rotate-in {
  transition-duration: 0.3s;
}

.low-end-device .section-reveal {
  transition-duration: 0.4s;
}

.low-end-device .scroll-stagger>*,
.low-end-device .scroll-stagger-fast>* {
  transition-duration: 0.25s;
}

/* Disable stagger delays on very slow devices */
.low-end-device .scroll-stagger.revealed>*,
.low-end-device .scroll-stagger-fast.revealed>* {
  transition-delay: 0s !important;
}

/* =====================
   REDUCED MOTION: ACCESSIBILITY
   Respect user preferences
   ===================== */

@media (prefers-reduced-motion: reduce) {

  .scroll-reveal,
  .scroll-fade-up,
  .scroll-fade-left,
  .scroll-fade-right,
  .scroll-scale-up,
  .scroll-blur-fade,
  .scroll-bounce-up,
  .scroll-rotate-in,
  .section-reveal,
  .section-clip-reveal,
  .scroll-stagger>*,
  .scroll-stagger-fast>*,
  .lazy-image,
  .scroll-counter {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }

  .scroll-line {
    width: 100% !important;
    transition: none !important;
  }

  .scroll-dot {
    opacity: 1 !important;
    transform: scale(1) !important;
    transition: none !important;
  }

  .section-line-reveal::before {
    width: min(200px, 60%) !important;
    transition: none !important;
  }

  .section-clip-reveal {
    clip-path: none !important;
  }

  .site-header.header-hidden {
    transform: none !important;
  }

  .scroll-progress {
    display: none;
  }
}