/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
    50% {
        box-shadow: 0 0 40px var(--accent-glow);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Text Rotator Animation */
.text-rotator {
    display: inline-block;
    position: relative;
    height: 1.2em;
    overflow: hidden;
}

.rotating-text {
    display: inline-block;
    animation: rotateText 15s infinite;
}

@keyframes rotateText {
    0%, 20% { transform: translateY(0); }
    25%, 45% { transform: translateY(-1.2em); }
    50%, 70% { transform: translateY(-2.4em); }
    75%, 95% { transform: translateY(-3.6em); }
    100% { transform: translateY(-4.8em); }
}

/* Gradient Border Animation */
@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-border {
    position: relative;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    background-size: 200% 200%;
    animation: borderRotate 3s linear infinite;
    padding: 2px;
    border-radius: 12px;
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-primary); }
}

/* Staggered Children Animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.animated > * {
    animation: fadeIn 0.6s ease forwards;
}

.stagger-children.animated > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children.animated > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children.animated > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children.animated > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children.animated > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children.animated > *:nth-child(6) { animation-delay: 0.6s; }