/* ==========================================================================
   WHITE BELT / AWREAi - Animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */

/* Hero gradient animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Scroll indicator bounce */
@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(10px) rotate(45deg);
    }
    60% {
        transform: translateY(5px) rotate(45deg);
    }
}

/* Audio waveform animation */
@keyframes wave {
    0%, 100% {
        transform: scaleY(0.5);
    }
    50% {
        transform: scaleY(1);
    }
}

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse glow */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(114, 47, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(114, 47, 55, 0);
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Line draw */
@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* --------------------------------------------------------------------------
   Hero Animations
   -------------------------------------------------------------------------- */

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.fade-in-delay-2 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.fade-in-delay-3 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* --------------------------------------------------------------------------
   Scroll-Triggered Animations
   -------------------------------------------------------------------------- */

/* Elements that animate when scrolled into view */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children animation */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 300ms; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 400ms; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 500ms; }

/* Scale on scroll */
.scale-on-scroll {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-on-scroll.visible {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   Interactive Animations
   -------------------------------------------------------------------------- */

/* Button hover lift */
.btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

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

.btn:active {
    transform: translateY(0);
}

/* Card hover effect */
.tech-card,
.audio-card,
.use-case-card,
.comparison-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tech-card:hover,
.audio-card:hover,
.use-case-card:hover {
    transform: translateY(-4px);
}

/* Icon hover */
.tech-icon,
.audio-icon,
.use-case-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}

.tech-card:hover .tech-icon,
.audio-card:hover .audio-icon,
.use-case-card:hover .use-case-icon {
    transform: scale(1.1);
}

/* Nav link underline animation */
.nav-link::after {
    transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   Architecture Diagram Animations
   -------------------------------------------------------------------------- */

.arch-node {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.arch-node:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Animated lines - draw effect */
.arch-line {
    position: relative;
    overflow: hidden;
}

.arch-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    animation: linePulse 2s ease-in-out infinite;
}

@keyframes linePulse {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Pipeline pulse */
.arch-cognitive .arch-node,
.arch-emotional .arch-node {
    animation: subtlePulse 3s ease-in-out infinite;
}

.arch-emotional .arch-node {
    animation-delay: 1.5s;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(44, 62, 45, 0.1);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(44, 62, 45, 0.1);
    }
}

/* --------------------------------------------------------------------------
   Audio Player Animations
   -------------------------------------------------------------------------- */

.audio-btn {
    position: relative;
    overflow: hidden;
}

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

.audio-btn:active::before {
    width: 200px;
    height: 200px;
}

/* Playing state animations */
.audio-card.playing {
    animation: pulseGlow 2s ease-in-out infinite;
}

.audio-card.playing .audio-icon {
    animation: float 2s ease-in-out infinite;
}

/* Waveform bars */
.wave-bar {
    transform-origin: bottom;
}

/* --------------------------------------------------------------------------
   Section Reveal Animations
   -------------------------------------------------------------------------- */

.section-header {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Comparison Section Animations
   -------------------------------------------------------------------------- */

.comparison-list li {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.comparison-card.visible .comparison-list li {
    opacity: 1;
    transform: translateX(0);
}

.comparison-card.visible .comparison-list li:nth-child(1) { transition-delay: 0.1s; }
.comparison-card.visible .comparison-list li:nth-child(2) { transition-delay: 0.2s; }
.comparison-card.visible .comparison-list li:nth-child(3) { transition-delay: 0.3s; }
.comparison-card.visible .comparison-list li:nth-child(4) { transition-delay: 0.4s; }
.comparison-card.visible .comparison-list li:nth-child(5) { transition-delay: 0.5s; }

/* Divider animation */
.comparison-divider span {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s ease-out 0.3s, transform 0.4s ease-out 0.3s;
}

.comparison-grid.visible .comparison-divider span {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   Loading States
   -------------------------------------------------------------------------- */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --------------------------------------------------------------------------
   Reduced Motion Preference
   -------------------------------------------------------------------------- */

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

    .hero-background {
        animation: none;
        background-position: 0% 50%;
    }

    .scroll-arrow {
        animation: none;
    }

    .wave-bar {
        animation: none;
    }

    .animate-on-scroll,
    .scale-on-scroll,
    .section-header {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Page Load Animation
   -------------------------------------------------------------------------- */

body {
    opacity: 0;
    animation: pageLoad 0.5s ease-out forwards;
}

@keyframes pageLoad {
    to {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   Smooth Scroll Enhancement
   -------------------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
