/* ==========================================================================
   AGE-TGI-2S3 + QEC — Animation Styles
   ========================================================================== */

/* ── Scroll Reveal ──────────────────────────────────────────────────────── */
.reveal,
.reveal--left,
.reveal--right,
.reveal--scale {
    opacity: 0;
    transition:
        opacity 0.7s var(--ease-out),
        transform 0.7s var(--ease-out);
}

.reveal {
    transform: translateY(30px);
}

.reveal--left {
    transform: translateX(-40px);
}

.reveal--right {
    transform: translateX(40px);
}

.reveal--scale {
    transform: scale(0.92);
}

.reveal.is-visible,
.reveal--left.is-visible,
.reveal--right.is-visible,
.reveal--scale.is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}


/* ── Stagger Children ───────────────────────────────────────────────────── */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.5s var(--ease-out),
        transform 0.5s var(--ease-out);
}

.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.10s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.20s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.30s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.40s; }

.stagger-children.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}


/* ── Quantum Orb Pulse ─────────────────────────────────────────────────── */
@keyframes orb-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.06);
        opacity: 0.7;
    }
}

.orb-core {
    animation: orb-glow 3s ease-in-out infinite;
}

@keyframes orb-glow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(var(--c-primary-rgb), 0.4),
            0 0 40px rgba(var(--c-secondary-rgb), 0.2);
    }
    50% {
        box-shadow:
            0 0 30px rgba(var(--c-primary-rgb), 0.6),
            0 0 60px rgba(var(--c-secondary-rgb), 0.35),
            0 0 80px rgba(var(--c-accent-rgb), 0.15);
    }
}


/* ── Gradient Shift (Hero Title) ────────────────────────────────────────── */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero__title {
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}


/* ── Floating Metric ────────────────────────────────────────────────────── */
@keyframes float-metric {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* ── Counter Animation ──────────────────────────────────────────────────── */
.metric-card__value[data-count] {
    transition: color var(--duration-base);
}


/* ── Typing Cursor Blink ────────────────────────────────────────────────── */
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    color: var(--c-primary);
    animation: cursor-blink 1s step-end infinite;
    margin-left: 2px;
}


/* ── Circuit Line Flow ──────────────────────────────────────────────────── */
@keyframes circuit-flow {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.circuit-line {
    stroke-dasharray: 8 4;
    animation: circuit-flow 2s linear infinite;
}


/* ── Hover Glow ─────────────────────────────────────────────────────────── */
.hover-glow {
    transition:
        box-shadow var(--duration-base),
        transform var(--duration-base) var(--ease-out);
}

.hover-glow:hover {
    box-shadow:
        0 0 20px rgba(var(--c-primary-rgb), 0.15),
        0 0 40px rgba(var(--c-secondary-rgb), 0.08);
    transform: translateY(-4px);
}


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

.shimmer {
    background: linear-gradient(
        90deg,
        var(--c-surface) 25%,
        var(--c-surface-hover) 50%,
        var(--c-surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-md);
}


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

    .reveal,
    .reveal--left,
    .reveal--right,
    .reveal--scale {
        opacity: 1;
        transform: none;
    }

    .stagger-children > * {
        opacity: 1;
        transform: none;
    }
}
