/* ================================================================================
   ANIMATIONS.CSS - Keyframes and Animation Classes
   ================================================================================ */

/* ===== KEYFRAME ANIMATIONS ===== */

/* 1. Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 2. Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 4. Timeline Dot Pop */
@keyframes dotPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* 5. Timeline Content Slide */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* ===== SCROLL ANIMATION CLASSES ===== */

/* Timeline Item Animations */
.timeline-item {
    opacity: 0;
}

.timeline-item.visible .timeline-dot {
    animation: dotPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.timeline-item.visible .timeline-content {
    animation: slideInFromLeft 0.6s ease-out 0.2s forwards;
}

/* Desktop: alternate slide directions */
@media (min-width: 769px) {
    .timeline-item:nth-child(odd).visible .timeline-content {
        animation: slideInFromRight 0.6s ease-out 0.2s forwards;
    }
    
    .timeline-item:nth-child(even).visible .timeline-content {
        animation: slideInFromLeft 0.6s ease-out 0.2s forwards;
    }
}

.timeline-item.visible {
    opacity: 1;
}

.timeline-dot {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.timeline-content {
    opacity: 0;
}

/* 4. Animate on Scroll Base */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease-out;
}

/* 5. Animate In State */
.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* 6. Will-change for animated elements */
.hero-content,
.value-card,
.hub-card,
.animate-on-scroll {
    will-change: transform, opacity;
}

.path-background,
.hub-card-background {
    will-change: transform;
}

/* Smooth transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TAILORED INTELLIGENCE PAGE ANIMATIONS ===== */

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Grid Pulse Animation */
@keyframes gridPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Orbit Rotation */
@keyframes rotateOrbit {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Core Pulse */
@keyframes corePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 
            0 0 40px rgba(217,119,54,0.6),
            inset 0 0 20px rgba(255,255,255,0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 
            0 0 60px rgba(217,119,54,0.8),
            inset 0 0 30px rgba(255,255,255,0.5);
    }
}

/* Ring Expand */
@keyframes ringExpand {
    0% {
        width: 100px;
        height: 100px;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Trail Pulse */
@keyframes trailPulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1.5);
    }
}
