/* Professional Scroll Animations CSS */
/* Optimized for smooth performance across all devices */

/* Base animation classes - elements start hidden */
.scroll-animate,
.scroll-animate-card,
.scroll-animate-image,
.scroll-animate-button {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Section animations - Fade up */
.scroll-animate {
    transform: translateY(50px);
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--animation-order) * 0.1s);
}

/* Card animations - Fade up with scale */
.scroll-animate-card {
    transform: translateY(30px) scale(0.95);
}

.scroll-animate-card.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: calc(var(--animation-order) * 0.15s);
}

/* Image animations - Fade in with slight zoom */
.scroll-animate-image {
    transform: scale(0.9);
    filter: blur(5px);
}

.scroll-animate-image.animate-in {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    transition-delay: calc(var(--animation-order) * 0.2s);
}

/* Button animations - Fade in with bounce */
.scroll-animate-button {
    transform: translateY(20px);
}

.scroll-animate-button.animate-in {
    opacity: 1;
    transform: translateY(0);
    animation: bounceIn 0.6s ease-out;
    animation-delay: calc(var(--animation-order) * 0.1s);
    animation-fill-mode: both;
}

/* Keyframe animations */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero section special animation */
.hero-section {
    animation: fadeInUp 1s ease-out;
}

/* Stagger animations for grid items */
.grid>*:nth-child(1) {
    --animation-order: 0;
}

.grid>*:nth-child(2) {
    --animation-order: 1;
}

.grid>*:nth-child(3) {
    --animation-order: 2;
}

.grid>*:nth-child(4) {
    --animation-order: 3;
}

.grid>*:nth-child(5) {
    --animation-order: 4;
}

.grid>*:nth-child(6) {
    --animation-order: 5;
}

/* Smooth transitions for hover effects */
.scroll-animate.animate-in *,
.scroll-animate-card.animate-in *,
.scroll-animate-image.animate-in *,
.scroll-animate-button.animate-in * {
    transition: all 0.3s ease;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .scroll-animate,
    .scroll-animate-card,
    .scroll-animate-image,
    .scroll-animate-button {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }

    .scroll-animate.animate-in,
    .scroll-animate-card.animate-in,
    .scroll-animate-image.animate-in,
    .scroll-animate-button.animate-in {
        transition: none;
        animation: none;
    }
}

/* Performance optimization */
.scroll-animate,
.scroll-animate-card,
.scroll-animate-image,
.scroll-animate-button {
    will-change: opacity, transform;
}

.scroll-animate.animate-in,
.scroll-animate-card.animate-in,
.scroll-animate-image.animate-in,
.scroll-animate-button.animate-in {
    will-change: auto;
}