/* ============================================
   ANIMATIONS CSS - GSAP-inspired scroll animations
   ============================================ */

/* ── Scroll-triggered reveal animations ── */
[data-animate] {
    will-change: opacity, transform;
}

[data-animate].revealed {
    opacity: 1;
    transform: none !important;
}

/* Stagger delays for child elements */
[data-stagger]>*:nth-child(1) {
    transition-delay: 0ms;
}

[data-stagger]>*:nth-child(2) {
    transition-delay: 80ms;
}

[data-stagger]>*:nth-child(3) {
    transition-delay: 160ms;
}

[data-stagger]>*:nth-child(4) {
    transition-delay: 240ms;
}

[data-stagger]>*:nth-child(5) {
    transition-delay: 320ms;
}

[data-stagger]>*:nth-child(6) {
    transition-delay: 400ms;
}

[data-stagger]>*:nth-child(7) {
    transition-delay: 480ms;
}

[data-stagger]>*:nth-child(8) {
    transition-delay: 560ms;
}

/* ── Parallax layer ── */
.parallax-layer {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ── Smooth text reveal ── */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal-inner {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.7s var(--ease-out-expo);
}

.text-reveal.revealed .text-reveal-inner {
    transform: translateY(0);
}

/* ── Floating animation ── */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* ── Pulse glow ── */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

.animate-pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* ── Shimmer effect ── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.animate-shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 215, 0, 0.06) 40%,
            rgba(255, 215, 0, 0.12) 50%,
            rgba(255, 215, 0, 0.06) 60%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

/* ── Marquee pause on hover ── */
.block-marquee-stats:hover .marquee-track {
    animation-play-state: paused;
}

/* ── Card hover tilt ── */
.hover-tilt {
    transition: transform 0.3s ease;
}

/* ── Cursor follower ── */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* ── Page transition ── */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--background);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition-overlay.active {
    opacity: 1;
}

/* ── Counter tick animation ── */
@keyframes counterTick {
    0% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-2px);
    }

    50% {
        transform: translateY(0);
    }

    75% {
        transform: translateY(2px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ── Gradient border animation ── */
@keyframes gradientBorder {
    0% {
        border-color: rgba(255, 215, 0, 0.2);
    }

    50% {
        border-color: rgba(99, 102, 241, 0.3);
    }

    100% {
        border-color: rgba(255, 215, 0, 0.2);
    }
}

.animate-border {
    animation: gradientBorder 4s ease-in-out infinite;
}

/* ── Scroll Progress Line (Dynamic Line on Scroll) ── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform-origin: top left;
    transform: scaleX(0);
    z-index: 100000;
    pointer-events: none;
    box-shadow: 0 1px 10px rgba(255, 215, 0, 0.4);
}

/* ── Custom Cursor Ring ── */
.cursor-ring {
    position: fixed;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    background: rgba(255, 215, 0, 0.08);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    will-change: transform, width, height, background-color, border-color;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        height 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        background-color 0.3s ease,
        border-color 0.3s ease;
}

/* ── Split Text Classes ── */
.word-outer {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    margin-right: 0.28em;
    line-height: 1.2;
}

.word-inner {
    display: inline-block;
    transform: translateY(110%);
    transition: none;
    /* Let GSAP handle transition */
}

/* ── Mask Overlay Curtain for Page transitions ── */
.wipe-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    z-index: 99999;
    transform: translateY(100%);
    pointer-events: none;
    display: none;
}

/* Custom styles for Magnetic hover / cursor */
.cursor-hover-active {
    border-color: var(--accent) !important;
    background: rgba(236, 72, 153, 0.15) !important;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
    }
}