/**
 * Career Care India - Lightweight Animations
 * Designed for playful preschool delight with accessibility & performance in mind.
 */

/* Gentle Floating & Bobbing */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(1deg);
    }
}

@keyframes floatReverse {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(10px) rotate(-1.5deg);
    }
}

/* Gentle Sun Rotation & Ray Glow */
@keyframes sunSpinSlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes sunPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

/* Twinkling Stars */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.15) rotate(15deg);
    }
}

/* Gentle Block Bouncing */
@keyframes blockBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Butterfly Flutter */
@keyframes butterflyFlight {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) translateX(6px) rotate(4deg);
    }
    50% {
        transform: translateY(-14px) translateX(-4px) rotate(-3deg);
    }
    75% {
        transform: translateY(-6px) translateX(4px) rotate(2deg);
    }
}

/* Cloud Drifting */
@keyframes cloudDrift {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(14px);
    }
}

/* Apply Animation Classes */
.anim-float {
    animation: floatSlow 4.5s ease-in-out infinite;
}

.anim-float-reverse {
    animation: floatReverse 5s ease-in-out infinite;
}

.anim-sun-spin {
    animation: sunSpinSlow 36s linear infinite;
    transform-origin: center;
}

.anim-sun-pulse {
    animation: sunPulse 3s ease-in-out infinite;
}

.anim-twinkle {
    animation: twinkle 2.4s ease-in-out infinite;
}

.anim-twinkle-delay {
    animation: twinkle 3s ease-in-out 1.2s infinite;
}

.anim-block {
    animation: blockBob 3.5s ease-in-out infinite;
}

.anim-butterfly {
    animation: butterflyFlight 6s ease-in-out infinite;
}

.anim-cloud {
    animation: cloudDrift 7s ease-in-out infinite;
}

/* Scroll Fade In */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Stagger Delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Accessibility: Strictly Respect Reduced Motion Preferences */
@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;
    }
    
    .anim-float,
    .anim-float-reverse,
    .anim-sun-spin,
    .anim-sun-pulse,
    .anim-twinkle,
    .anim-twinkle-delay,
    .anim-block,
    .anim-butterfly,
    .anim-cloud {
        animation: none !important;
    }

    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
