/* ===========================================
   ANIMATIONS & MOVEMENT
   =========================================== */

/* ==== KEYFRAMES ==== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes clipReveal {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes drawLine {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes subtleZoom {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

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

.animate {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.animate--fade-up {
    transform: translateY(40px);
}
.animate--fade-down {
    transform: translateY(-40px);
}
.animate--fade-left {
    transform: translateX(-50px);
}
.animate--fade-right {
    transform: translateX(50px);
}
.animate--scale {
    transform: scale(0.92);
}
.animate--clip {
    clip-path: inset(0 100% 0 0);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
                clip-path 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate.is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    clip-path: inset(0 0 0 0);
}

/* Stagger helpers — JS adds these */
.animate[data-delay="100"] { transition-delay: 0.1s; }
.animate[data-delay="200"] { transition-delay: 0.2s; }
.animate[data-delay="300"] { transition-delay: 0.3s; }
.animate[data-delay="400"] { transition-delay: 0.4s; }
.animate[data-delay="500"] { transition-delay: 0.5s; }
.animate[data-delay="600"] { transition-delay: 0.6s; }

/* ==== INFINITE/CONTINUOUS ANIMATIONS ==== */

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

.float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

.pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Parallax hero image — very subtle slow zoom */
.parallax-zoom {
    animation: subtleZoom 20s ease-out forwards;
}

/* ==== TEXT REVEAL ==== */

.text-reveal {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}
.text-reveal__inner {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.text-reveal.is-visible .text-reveal__inner {
    transform: translateY(0);
}

/* Word-by-word reveal */
.word-reveal {
    display: inline-block;
}
.word-reveal__word {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.word-reveal.is-visible .word-reveal__word {
    opacity: 1;
    transform: translateY(0);
}
.word-reveal__word:nth-child(1) { transition-delay: 0.05s; }
.word-reveal__word:nth-child(2) { transition-delay: 0.15s; }
.word-reveal__word:nth-child(3) { transition-delay: 0.25s; }
.word-reveal__word:nth-child(4) { transition-delay: 0.35s; }
.word-reveal__word:nth-child(5) { transition-delay: 0.45s; }
.word-reveal__word:nth-child(6) { transition-delay: 0.55s; }
.word-reveal__word:nth-child(7) { transition-delay: 0.65s; }
.word-reveal__word:nth-child(8) { transition-delay: 0.75s; }

/* ==== SCROLL PROGRESS BAR ==== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-400), var(--green-600), var(--green-500));
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    z-index: 1001;
    width: 0;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(34, 169, 111, 0.4);
}

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

.hover-lift {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.hover-zoom-img {
    overflow: hidden;
}
.hover-zoom-img > * {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-zoom-img:hover > * {
    transform: scale(1.06);
}

.hover-glow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.hover-glow:hover {
    box-shadow: 0 0 30px rgba(34, 169, 111, 0.3);
    transform: translateY(-2px);
}

/* ==== MARQUEE (for brand strip) ==== */

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.marquee {
    overflow: hidden;
    width: 100%;
}
.marquee__track {
    display: flex;
    gap: 60px;
    animation: marquee 30s linear infinite;
    width: max-content;
}
.marquee:hover .marquee__track {
    animation-play-state: paused;
}

/* ==== NUMBER COUNTER (stat bounce) ==== */

@keyframes statBounce {
    0% { transform: translateY(10px); opacity: 0; }
    60% { transform: translateY(-3px); opacity: 1; }
    100% { transform: translateY(0); }
}

.stat-bounce {
    animation: statBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ==== PAGE TRANSITIONS ==== */

.page-enter {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ==== REDUCED MOTION ==== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate { opacity: 1; transform: none; clip-path: none; }
    .float, .float-slow, .pulse-slow, .gradient-animate { animation: none; }
}
