/* =============================================
   EMBER — Animation Utilities & Keyframes
   ============================================= */

/* ---- Base animation states ---- */
[data-animate] {
    will-change: transform, opacity;
}

[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(40px);
}

[data-animate="fade-up"].animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s var(--ease-out),
                transform 0.8s var(--ease-out);
}

[data-animate="text-reveal"] .hero-title-word,
[data-animate="text-reveal"] .hero-title-ampersand {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 1s var(--ease-out);
}

[data-animate="text-reveal"].animated .hero-title-word,
[data-animate="text-reveal"].animated .hero-title-ampersand {
    transform: translateY(0);
}

/* ---- Stagger delays ---- */
[data-animate="fade-up-stagger"] > * {
    opacity: 0;
    transform: translateY(30px);
}

[data-animate="fade-up-stagger"].animated > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s var(--ease-out),
                transform 0.8s var(--ease-out);
}

[data-animate="fade-up-stagger"].animated > *:nth-child(1) { transition-delay: 0s; }
[data-animate="fade-up-stagger"].animated > *:nth-child(2) { transition-delay: 0.1s; }
[data-animate="fade-up-stagger"].animated > *:nth-child(3) { transition-delay: 0.2s; }
[data-animate="fade-up-stagger"].animated > *:nth-child(4) { transition-delay: 0.3s; }

/* ---- Parallax image ---- */
[data-animate="parallax-image"] .about-image-wrapper {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.2s var(--ease-smooth);
}

[data-animate="parallax-image"].animated .about-image-wrapper {
    clip-path: inset(0 0 0% 0);
}

/* ---- Magnetic button effect ---- */
[data-magnetic] {
    transition: transform 0.3s var(--ease-elastic);
}

/* ---- Glow pulse ---- */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(var(--color-accent-rgb), 0.1);
    }
    50% {
        box-shadow: 0 0 40px rgba(var(--color-accent-rgb), 0.2);
    }
}

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

/* ---- Line grow ---- */
@keyframes lineGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ---- Fade in up ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Scale in ---- */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---- Ripple effect ---- */
@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* ---- Counter number animation ---- */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Shimmer effect ---- */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

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

/* ---- Preloader exit (handled in style.css) ---- */

/* ---- Loading skeleton ---- */
@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .grain-overlay {
        display: none;
    }

    .marquee-track {
        animation: none;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
}

