/* ==========================================================================
   Recliptic Theme — Animations
   ========================================================================== */

/* ---------- Keyframes ---------- */

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(0, 200, 150, 0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes candle-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dot-appear {
    0% {
        opacity: 0;
        r: 0;
    }
    60% {
        opacity: 1;
        r: 5;
    }
    100% {
        opacity: 0.8;
    }
}

@keyframes peak-pulse {
    0% {
        opacity: 0.6;
        r: 6;
    }
    50% {
        opacity: 0;
        r: 18;
    }
    100% {
        opacity: 0;
        r: 18;
    }
}

@keyframes hud-blink {
    0% {
        opacity: 0 !important;
    }
    40% {
        opacity: 0.5 !important;
    }
    60% {
        opacity: 0.2 !important;
    }
    100% {
        opacity: 0.35 !important;
    }
}

@keyframes scan-sweep {
    0% {
        transform: translateX(-10px);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateX(1000px);
        opacity: 0;
    }
}

@keyframes float-particle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ---------- Scroll-triggered animations ---------- */

.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.signals-grid .animate-in:nth-child(1) { transition-delay: 0s; }
.signals-grid .animate-in:nth-child(2) { transition-delay: 0.1s; }
.signals-grid .animate-in:nth-child(3) { transition-delay: 0.2s; }
.signals-grid .animate-in:nth-child(4) { transition-delay: 0.3s; }
.signals-grid .animate-in:nth-child(5) { transition-delay: 0.4s; }
.signals-grid .animate-in:nth-child(6) { transition-delay: 0.5s; }

.posts-grid .animate-in:nth-child(1) { transition-delay: 0s; }
.posts-grid .animate-in:nth-child(2) { transition-delay: 0.1s; }
.posts-grid .animate-in:nth-child(3) { transition-delay: 0.2s; }

.about-features .animate-in:nth-child(1) { transition-delay: 0s; }
.about-features .animate-in:nth-child(2) { transition-delay: 0.15s; }
.about-features .animate-in:nth-child(3) { transition-delay: 0.3s; }

.about-timeline__step.animate-in:nth-child(2) { transition-delay: 0s; }
.about-timeline__step.animate-in:nth-child(4) { transition-delay: 0.15s; }
.about-timeline__step.animate-in:nth-child(6) { transition-delay: 0.3s; }

/* ---------- Hero particles ---------- */

.hero__particles .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: var(--brand-blue);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

/* ---------- Count-up ready state ---------- */

[data-animate="count-up"] .stats-bar__number {
    transition: none;
}

/* ---------- Reduced motion ---------- */

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

    .animate-in {
        opacity: 1;
        transform: none;
    }

    .ticker-bar__content {
        animation: none;
    }

    .hero__scroll {
        animation: none;
    }

    .hero-chart__line,
    .hero-chart__ma,
    .hero-chart__band {
        stroke-dashoffset: 0;
    }

    .hero-chart__area,
    .hero-chart__candle,
    .hero-chart__grid,
    .hero-chart__labels,
    .hc-dot,
    .hc-signal-buy,
    .hc-signal-sell {
        opacity: 1;
    }

    .hero-chart__hud {
        opacity: 0.35 !important;
    }

    .hero-chart__scan {
        display: none;
    }

    .hc-peak-ring {
        opacity: 0.3;
    }
}
