/* ══════════════════════════════════════════════════════════════════
   TrudLink — Animations
   ══════════════════════════════════════════════════════════════════ */

/* ─── Pulse ─── */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(0.95); }
}

/* ─── Float ─── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* ─── Scroll-triggered Animations ─── */
[data-animate] {
    opacity: 0;
    transform: translateY(40px);
    transition:
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-left"] {
    transform: translateX(60px);
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stagger delays */
[data-animate-delay="0"] { transition-delay: 0s; }
[data-animate-delay="1"] { transition-delay: 0.12s; }
[data-animate-delay="2"] { transition-delay: 0.24s; }
[data-animate-delay="3"] { transition-delay: 0.36s; }
[data-animate-delay="4"] { transition-delay: 0.48s; }
[data-animate-delay="5"] { transition-delay: 0.60s; }

/* ─── Hero Particle ─── */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift-x, 20px)) scale(0.5);
        opacity: 0;
    }
}

/* ─── Counter animation ─── */
.hero__stat-number {
    transition: all 0.3s ease;
}

/* ─── Card hover glow ─── */
.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 193, 7, 0.06),
        transparent 50%
    );
    pointer-events: none;
}

.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card:hover::before {
    opacity: 1;
}

/* ─── Smooth FAQ toggle ─── */
.faq__answer {
    overflow: hidden;
    animation: faqOpen 0.3s ease-out;
}

@keyframes faqOpen {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

/* ─── Button ripple effect ─── */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
    border-radius: inherit;
}

.btn:active::after {
    transform: scale(2.5);
    opacity: 1;
    transition: transform 0s, opacity 0s;
}

/* ─── 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;
    }
}
