/* ============================================
   MOTO ON — Animations
   Smooth transitions & scroll-triggered effects
   ============================================ */

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

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

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

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

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(196, 30, 42, 0.2); }
    50% { box-shadow: 0 0 25px rgba(196, 30, 42, 0.4); }
}

@keyframes hexFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes lineExpand {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Scroll Animation Base --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* --- Animation Classes --- */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out both;
}

.fade-in {
    animation: fadeIn 0.6s ease both;
}

.fade-in-down {
    animation: fadeInDown 0.7s ease-out both;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out both;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out both;
}

.scale-in {
    animation: scaleIn 0.5s ease-out both;
}

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

.hex-float {
    animation: hexFloat 6s ease-in-out infinite;
}

.bounce-down {
    animation: bounceDown 2s ease-in-out infinite;
}

/* --- Stagger Delays --- */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Stagger for scroll animations */
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

/* --- Transition Utilities --- */
.transition-all {
    transition: all 0.3s ease;
}

.transition-transform {
    transition: transform 0.3s ease;
}

.transition-opacity {
    transition: opacity 0.3s ease;
}

/* --- Hero entrance sequencing --- */
.hero-content .hero-welcome {
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.hero-content .hero-title {
    animation: fadeInUp 0.9s ease-out 0.4s both;
}

.hero-content .hero-subtitle {
    animation: fadeIn 0.8s ease-out 0.7s both;
}

.hero-content .hero-cta {
    animation: fadeInUp 0.7s ease-out 0.9s both;
}

.scroll-indicator {
    animation: fadeIn 1s ease-out 1.3s both;
}

/* --- Section divider animation --- */
.animate-on-scroll.visible .section-divider {
    animation: lineExpand 0.6s ease-out 0.3s both;
}

/* --- Loading skeleton shimmer --- */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-card) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ============================================
   REDUCED MOTION
   Respect user 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;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-content .hero-welcome,
    .hero-content .hero-title,
    .hero-content .hero-subtitle,
    .hero-content .hero-cta,
    .scroll-indicator {
        animation: none;
        opacity: 1;
    }
}
