/* ==========================================
   Scorpion Motorsports — Custom Styles
   ========================================== */

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background: #831333;
    color: #faf8f5;
}

/* ==========================================
   Navigation
   ========================================== */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .nav-logo-text {
    color: #1a1a1a;
}

/* ==========================================
   Mobile Menu
   ========================================== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Menu Toggle Animation */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ==========================================
   Service Cards
   ========================================== */
.service-card {
    transition: background-color 0.5s ease;
}

/* ==========================================
   Scroll Reveal Animations
   Only apply when user prefers motion
   ========================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* Fallback: ensure content is visible even if JS fails */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================
   Form Styles
   ========================================== */
select option {
    background: #faf8f5;
    color: #1a1a1a;
}

/* ==========================================
   Focus Visible Styles
   ========================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #831333;
    outline-offset: 2px;
}

/* ==========================================
   Smooth Image Loading
   ========================================== */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    #navbar,
    #mobileMenu,
    .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
