/* Animations and Transitions */

/* Variables specifically for animation timing */
:root {
    --transition-speed-fast: 0.2s;
    --transition-speed-normal: 0.4s;
    --transition-speed-slow: 0.8s;
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

    to {
        opacity: 1;
    }
}

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

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

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Utility Classes for Scroll Animations (tied to Intersection Observer in JS) */
.animate-on-scroll {
    opacity: 0;
    /* Hidden by default */
}

/* When the JS adds the 'is-visible' class, the animation triggers */
.animate-on-scroll.is-visible {
    animation-duration: var(--transition-speed-slow);
    animation-timing-function: var(--ease-smooth);
    animation-fill-mode: forwards;
}

.fade-in.is-visible {
    animation-name: fadeIn;
}

.fade-up.is-visible {
    animation-name: fadeUp;
}

.fade-left.is-visible {
    animation-name: fadeLeft;
}

.fade-right.is-visible {
    animation-name: fadeRight;
}

.scale-up.is-visible {
    animation-name: scaleUp;
}

/* Stagger Effects */
.stagger-1.is-visible {
    animation-delay: 0.1s;
}

.stagger-2.is-visible {
    animation-delay: 0.2s;
}

.stagger-3.is-visible {
    animation-delay: 0.3s;
}

.stagger-4.is-visible {
    animation-delay: 0.4s;
}

.stagger-5.is-visible {
    animation-delay: 0.5s;
}

/* Continuous Micro-animations */
.floating {
    animation: float 6s ease-in-out infinite;
}

/* Image Reveal Effect */
.image-reveal-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.image-reveal-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-warm);
    transform-origin: right;
    transition: transform 1s var(--ease-smooth);
    z-index: 1;
}

.image-reveal-wrapper.is-visible::after {
    transform: scaleX(0);
}

.image-reveal-wrapper img {
    opacity: 0;
    transition: opacity 0.1s;
}

.image-reveal-wrapper.is-visible img {
    opacity: 1;
    transition-delay: 0.3s;
}