/* Scroll Animations */

/* Section reveal animations */
.section {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition:
        opacity var(--transition-smooth),
        transform var(--transition-smooth);
}

.section-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Hero section: always visible */
.section-hero {
    opacity: 1;
    transform: none;
}

/* Stagger animations for child elements */
.stagger-item {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition:
        opacity 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Stagger delays - set by JavaScript */
.section-visible .stagger-item {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Manual stagger delays for hero */
.section-hero .stagger-item:nth-child(1) { transition-delay: 0.1s; }
.section-hero .stagger-item:nth-child(2) { transition-delay: 0.2s; }
.section-hero .stagger-item:nth-child(3) { transition-delay: 0.3s; }
.section-hero .stagger-item:nth-child(4) { transition-delay: 0.4s; }
.section-hero .stagger-item:nth-child(5) { transition-delay: 0.5s; }
.section-hero .stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Pinned section animations */
.section-pinned .priority-card {
    opacity: 0;
    transform: translate3d(-30px, 0, 0);
    transition:
        opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.section-pinned.section-visible .priority-card {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Staggered timing for priority cards */
.section-pinned .priority-card:nth-child(1) { transition-delay: 0s; }
.section-pinned .priority-card:nth-child(2) { transition-delay: 0.15s; }
.section-pinned .priority-card:nth-child(3) { transition-delay: 0.3s; }

/* Hover interactions */
@media (hover: hover) {
    .card:hover,
    .priority-card:hover,
    .deliverable-tile:hover {
        animation: subtle-float 3s ease-in-out infinite;
    }

    @keyframes subtle-float {
        0%, 100% {
            transform: translateY(-4px);
        }
        50% {
            transform: translateY(-8px);
        }
    }
}

/* Button interactions */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Chip hover effects */
.chip {
    position: relative;
    overflow: hidden;
}

.chip::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.chip:hover::after {
    transform: translateX(100%);
}

/* Loading state for hero */
.hero-headline,
.hero-subhead,
.hero-ctas {
    animation: fade-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.hero-headline {
    animation-delay: 0.1s;
}

.hero-subhead {
    animation-delay: 0.2s;
}

.hero-ctas {
    animation-delay: 0.3s;
}

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

/* Pulse animation for important elements */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    }
}

.callout-failure {
    animation: pulse-glow 3s ease-in-out infinite;
}

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

    .section,
    .stagger-item,
    .priority-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Focus animations */
@media (prefers-reduced-motion: no-preference) {
    :focus-visible {
        animation: focus-pulse 0.3s ease-out;
    }

    @keyframes focus-pulse {
        0% {
            outline-offset: 2px;
        }
        50% {
            outline-offset: 6px;
        }
        100% {
            outline-offset: 4px;
        }
    }
}
