/* ==========================================================================
   Scroll Animation System
   Reusable animation keyframes and utility classes
   Works with ani.js for scroll-triggered animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   Animation Keyframes
   -------------------------------------------------------------------------- */

@keyframes ani-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ani-slide-in-left {
    from {
        transform: translateX(-120px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ani-slide-in-right {
    from {
        transform: translateX(120px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ani-slide-in-up {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes ani-slide-in-down {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes ani-scale-in {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ani-scale-up {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ani-rotate-in {
    from {
        transform: rotate(-15deg) scale(0.85);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes ani-zoom-in {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes ani-flip-in {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   Animation Utility Classes
   -------------------------------------------------------------------------- */

/* Hidden by default until triggered by JavaScript */
[class*="ani-"] {
    opacity: 0;
}

/* Active state applied by ani.js when element scrolls into view */
.ani-fade-in.ani-active {
    animation: ani-fade-in 1s ease-out forwards;
}

.ani-slide-in-left.ani-active {
    animation: ani-slide-in-left 1s ease-out forwards;
}

.ani-slide-in-right.ani-active {
    animation: ani-slide-in-right 1s ease-out forwards;
}

.ani-slide-in-up.ani-active {
    animation: ani-slide-in-up 1s ease-out forwards;
}

.ani-slide-in-down.ani-active {
    animation: ani-slide-in-down 1s ease-out forwards;
}

.ani-scale-in.ani-active {
    animation: ani-scale-in 1s ease-out forwards;
}

.ani-scale-up.ani-active {
    animation: ani-scale-up 0.8s ease-out forwards;
}

.ani-rotate-in.ani-active {
    animation: ani-rotate-in 1s ease-out forwards;
}

.ani-zoom-in.ani-active {
    animation: ani-zoom-in 0.8s ease-out forwards;
}

.ani-flip-in.ani-active {
    animation: ani-flip-in 1s ease-out forwards;
}

/* --------------------------------------------------------------------------
   Animation Timing Modifiers
   -------------------------------------------------------------------------- */

/* Speed variants - add to any animation class */
.ani-fast { animation-duration: 0.5s !important; }
.ani-slow { animation-duration: 1.5s !important; }
.ani-slower { animation-duration: 2s !important; }

/* Delay utilities for staggered animations */
.ani-delay-1 { animation-delay: 0.1s; }
.ani-delay-2 { animation-delay: 0.2s; }
.ani-delay-3 { animation-delay: 0.3s; }
.ani-delay-4 { animation-delay: 0.4s; }
.ani-delay-5 { animation-delay: 0.5s; }
.ani-delay-6 { animation-delay: 0.6s; }
.ani-delay-7 { animation-delay: 0.7s; }
.ani-delay-8 { animation-delay: 0.8s; }
.ani-delay-9 { animation-delay: 0.9s; }
.ani-delay-10 { animation-delay: 1s; }

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    [class*="ani-"] {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
}
