/* css/animations.css - High Quality Industry Standard Animations */

/* 1. Base states for Scroll Reveal (Intersection Observer) */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 2. Staggered Hero Entrance */
.hero-animate > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-animate > *:nth-child(1) { animation-delay: 0.08s; }
.hero-animate > *:nth-child(2) { animation-delay: 0.16s; }
.hero-animate > *:nth-child(3) { animation-delay: 0.24s; }
.hero-animate > *:nth-child(4) { animation-delay: 0.32s; }
.hero-animate > *:nth-child(5) { animation-delay: 0.40s; }
.hero-animate > *:nth-child(6) { animation-delay: 0.48s; }

@keyframes fadeUpIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. Stat Card and Pillar Card Animation (Scaling & Pop-In) */
.stat-card, .pillar-card {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.stat-card.is-visible, .pillar-card.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Stagger stats */
.stats-row > *:nth-child(1) { transition-delay: 0.08s; }
.stats-row > *:nth-child(2) { transition-delay: 0.16s; }
.stats-row > *:nth-child(3) { transition-delay: 0.24s; }
.stats-row > *:nth-child(4) { transition-delay: 0.32s; }

/* Stagger pillars */
.pillars-grid > *:nth-child(1) { transition-delay: 0.08s; }
.pillars-grid > *:nth-child(2) { transition-delay: 0.16s; }
.pillars-grid > *:nth-child(3) { transition-delay: 0.24s; }
.pillars-grid > *:nth-child(4) { transition-delay: 0.32s; }

/* 4. Filter Chip Micro-Interaction */
.category-filter-nav .filter-chip {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.25s;
}

.category-filter-nav .filter-chip:active {
    transform: scale(0.96);
}

/* 5. Tool Card Kinetic Hover */
.tool-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, background-color 0.25s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

/* 6. Living Pulse for Security Indicator */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 6px var(--accent-emerald);
        opacity: 0.9;
    }
    50% {
        box-shadow: 0 0 14px var(--accent-emerald), 0 0 20px rgba(16, 185, 129, 0.4);
        opacity: 1;
    }
}

.pulse-dot {
    animation: pulseGlow 2.4s ease-in-out infinite;
}

/* 7. Accessibility - Prefers Reduced Motion (WCAG AA Compliance) */
@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-up,
    .hero-animate > *,
    .stat-card,
    .pillar-card {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .pulse-dot {
        animation: none !important;
    }
}
