/* ==========================================================================
   Animations & Micro-interactions
   Per CLAUDE.md: Keep animations understated—this is not a flashy portfolio
   - Simple fade-in (no dramatic movements)
   - Stagger animations for grid items (80ms delay)
   - NO parallax effects—keep it professional and fast
   ========================================================================== */

/* ==========================================================================
   Keyframe Animations - Subtle, Professional
   ========================================================================== */

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

@keyframes fadeInSimple {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Page Load Animations - Simple fade
   ========================================================================== */

.hero__name {
    animation: fadeIn 0.5s ease-out 0.05s both;
}

.hero__title {
    animation: fadeIn 0.5s ease-out 0.15s both;
}

.hero__accent-line {
    animation: expandLine 0.6s ease-out 0.3s both;
}

.hero__subtitle {
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.hero__actions {
    animation: fadeIn 0.5s ease-out 0.5s both;
}

@keyframes expandLine {
    from {
        opacity: 0;
        width: 0;
    }
    to {
        opacity: 1;
        width: 100px;
    }
}

/* ==========================================================================
   Scroll-triggered Animations - Subtle fade-in
   ========================================================================== */

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

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

/* Stagger animations for grid items - 80ms delay per CLAUDE.md */
.fade-in.stagger-1 { transition-delay: 0.08s; }
.fade-in.stagger-2 { transition-delay: 0.16s; }
.fade-in.stagger-3 { transition-delay: 0.24s; }
.fade-in.stagger-4 { transition-delay: 0.32s; }
.fade-in.stagger-5 { transition-delay: 0.4s; }
.fade-in.stagger-6 { transition-delay: 0.48s; }

/* ==========================================================================
   Micro-interactions - Subtle hover effects
   Per CLAUDE.md:
   - Button hover: Subtle gold border glow
   - Links: Gold color on hover (not underline animation)
   - Cards: Very subtle lift effect (2px)
   ========================================================================== */

/* Button Hover - Subtle gold border glow */
.btn {
    transition: all var(--transition-medium);
}

.btn--primary:hover {
    box-shadow: 0 0 15px rgba(184, 134, 11, 0.3);
}

.btn--outline:hover,
.btn--outline-light:hover {
    box-shadow: 0 0 10px rgba(184, 134, 11, 0.2);
}

/* Links - Gold color on hover */
.nav__link,
.nav__connect,
.footer__link,
.insight-card__link,
.methodology__link,
.insights__more-link {
    transition: color var(--transition-fast);
}

/* Card Hover - Very subtle lift (2px) */
.expertise-card,
.insight-card,
.stat-item {
    transition: transform var(--transition-medium),
                border-color var(--transition-medium),
                box-shadow var(--transition-medium);
}

.expertise-card:hover {
    border-color: var(--color-gold-primary);
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-item:hover {
    transform: translateY(-2px);
}

/* Community items - subtle highlight */
.community__item {
    transition: background var(--transition-medium);
}

.community__item:hover {
    background: rgba(184, 134, 11, 0.05);
}

/* ==========================================================================
   Header Scroll Effects - Simple, not dramatic
   ========================================================================== */

.header {
    transition: background var(--transition-medium),
                box-shadow var(--transition-medium);
}

.header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Focus States - Gold accent for accessibility
   ========================================================================== */

.btn:focus-visible,
.nav__link:focus-visible,
.nav__connect:focus-visible,
.footer__link:focus-visible,
.insight-card__link:focus-visible,
.methodology__link:focus-visible {
    outline: 2px solid var(--color-gold-primary);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   Smooth Scroll Behavior
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Text Selection
   ========================================================================== */

::selection {
    background: var(--color-gold-accent);
    color: var(--color-text-primary);
}

::-moz-selection {
    background: var(--color-gold-accent);
    color: var(--color-text-primary);
}

/* ==========================================================================
   Custom Scrollbar - Subtle gold accent
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-alpha-black);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gold-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-light);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--color-warm-gray);
    border-top: 2px solid var(--color-gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* ==========================================================================
   Reduced Motion Preferences
   ========================================================================== */

@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;
    }

    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero__title,
    .hero__accent-line,
    .hero__subtitle,
    .hero__actions {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .btn:hover,
    .expertise-card:hover,
    .insight-card:hover,
    .stat-item:hover {
        transform: none;
    }
}

/* ==========================================================================
   Animation Performance Optimizations
   ========================================================================== */

.btn,
.expertise-card,
.insight-card,
.stat-item,
.community__item {
    will-change: transform, opacity;
}

/* Remove will-change after animation to save memory */
.animation-complete {
    will-change: auto;
}
