/* ================================================
   Animations — GSAP-compatible, IntersectionObserver
   ================================================ */

/* ── Fade In Variants ── */
.dsh-animate {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.dsh-animate.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

.dsh-animate-up {
    opacity: 0;
    transform: translateY(40px);
}

.dsh-animate-down {
    opacity: 0;
    transform: translateY(-40px);
}

.dsh-animate-left {
    opacity: 0;
    transform: translateX(-40px);
}

.dsh-animate-right {
    opacity: 0;
    transform: translateX(40px);
}

.dsh-animate-scale {
    opacity: 0;
    transform: scale(0.9);
}

.dsh-animate-up.is-visible,
.dsh-animate-down.is-visible,
.dsh-animate-left.is-visible,
.dsh-animate-right.is-visible,
.dsh-animate-scale.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ── Stagger delays ── */
.dsh-delay-100 {
    transition-delay: 0.1s;
}

.dsh-delay-200 {
    transition-delay: 0.2s;
}

.dsh-delay-300 {
    transition-delay: 0.3s;
}

.dsh-delay-400 {
    transition-delay: 0.4s;
}

.dsh-delay-500 {
    transition-delay: 0.5s;
}

.dsh-delay-600 {
    transition-delay: 0.6s;
}

.dsh-delay-700 {
    transition-delay: 0.7s;
}

.dsh-delay-800 {
    transition-delay: 0.8s;
}

/* ── Counter Animation ── */
.dsh-counter {
    font-family: var(--dsh-font-mono);
    font-size: var(--dsh-text-5xl);
    font-weight: 800;
    line-height: 1;
    color: var(--dsh-primary-600);
}

/* ── Floating Elements ── */
.dsh-float {
    animation: dshFloat 6s ease-in-out infinite;
}

.dsh-float-slow {
    animation: dshFloat 8s ease-in-out infinite;
}

.dsh-float-fast {
    animation: dshFloat 4s ease-in-out infinite;
}

@keyframes dshFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ── Pulse Glow ── */
.dsh-pulse-glow {
    animation: dshPulseGlow 3s ease-in-out infinite;
}

@keyframes dshPulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.2);
    }

    50% {
        box-shadow: 0 0 20px 10px rgba(30, 64, 175, 0.1);
    }
}

/* ── Gradient Shift ── */
.dsh-gradient-shift {
    background-size: 200% 200%;
    animation: dshGradientShift 8s ease infinite;
}

@keyframes dshGradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ── Shine Effect ── */
.dsh-shine {
    position: relative;
    overflow: hidden;
}

.dsh-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: rotate(30deg);
    animation: dshShine 6s ease-in-out infinite;
}

@keyframes dshShine {

    0%,
    100% {
        transform: rotate(30deg) translateX(-100%);
    }

    50% {
        transform: rotate(30deg) translateX(100%);
    }
}

/* ── Typing Effect ── */
.dsh-typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--dsh-primary-600);
    animation:
        dshTyping 3.5s steps(40, end),
        dshBlink 0.75s step-end infinite;
}

@keyframes dshTyping {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes dshBlink {
    50% {
        border-color: transparent;
    }
}

/* ── Scroll Progress ── */
.dsh-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dsh-primary-600), var(--dsh-emerald-500));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ── Hero Data Visualization Background ── */
.dsh-data-grid {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: dshGridPulse 10s ease-in-out infinite;
}

@keyframes dshGridPulse {

    0%,
    100% {
        opacity: 0.03;
    }

    50% {
        opacity: 0.08;
    }
}

/* ── Particle dots ── */
.dsh-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: dshParticle 15s linear infinite;
}

@keyframes dshParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ── Accordion animation ── */
.dsh-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 1.5rem;
}

.dsh-accordion-item.is-active .dsh-accordion-content {
    max-height: 500px;
    padding: 1rem 1.5rem 1.5rem;
}

.dsh-accordion-icon {
    transition: transform 0.3s ease;
}

.dsh-accordion-item.is-active .dsh-accordion-icon {
    transform: rotate(180deg);
}

/* ── Loading Spinner ── */
.dsh-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dsh-gray-200);
    border-top-color: var(--dsh-primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Skeleton Loading ── */
.dsh-skeleton {
    background: linear-gradient(90deg, var(--dsh-gray-200) 25%, var(--dsh-gray-100) 50%, var(--dsh-gray-200) 75%);
    background-size: 200% 100%;
    animation: dshSkeleton 1.5s ease-in-out infinite;
    border-radius: var(--dsh-radius-md);
}

@keyframes dshSkeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}