/* ============================================
   Scott Cramer Motorsports — Custom Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    min-height: 100vh;
}

/* Selection Color */
::selection {
    background-color: #a81a34;
    color: #fff;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    will-change: transform;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #fb7185;
    transition: width 0.2s ease;
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 60%;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
    max-height: 0;
}

.mobile-menu.open {
    max-height: 400px;
}

.mobile-nav-link {
    display: block;
}

/* ============================================
   Hero Section
   ============================================ */
#hero {
    position: relative;
}

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a81a34, #ff5c3a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* ============================================
   Why Us Cards
   ============================================ */
.why-card {
    position: relative;
}

.why-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a81a34, #ff5c3a);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.why-card:hover::after {
    transform: scaleX(1);
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement: content is visible
   by default, JS adds the animation class.
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered delays */
    .reveal:nth-child(1) { transition-delay: 0.05s; }
    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.15s; }
    .reveal:nth-child(4) { transition-delay: 0.2s; }
    .reveal:nth-child(5) { transition-delay: 0.25s; }
    .reveal:nth-child(6) { transition-delay: 0.3s; }
}

/* ============================================
   Contact Form
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ============================================
   Back to Top
   ============================================ */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#back-to-top:not(.visible) {
    transform: translateY(10px);
}

/* ============================================
   Focus Visible (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid #a81a34;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    html {
        scroll-padding-top: 70px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    html {
        scroll-padding-top: 80px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar,
    #back-to-top,
    .reveal {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
    }
}
