/* ========================================
   Martin's Automotive — Custom Styles
   ======================================== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: #e8a018;
    color: #2a131e;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
    backdrop-filter: blur(0px);
    transition: background-color 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(76, 38, 57, 0.08);
}

#navbar.scrolled .menu-line {
    background-color: #4c2639;
}

/* Mobile Menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

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

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

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

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

#hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, #faf8f5, transparent);
    pointer-events: none;
}

/* ========================================
   Service Cards
   ======================================== */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* ========================================
   Testimonial Cards
   ======================================== */
.testimonial-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.testimonial-card:nth-child(1) { transition-delay: 0.05s; }
.testimonial-card:nth-child(2) { transition-delay: 0.15s; }
.testimonial-card:nth-child(3) { transition-delay: 0.25s; }

/* ========================================
   About Section Image
   ======================================== */
#about img {
    transition: transform 0.8s ease;
}

#about:hover img {
    transform: scale(1.02);
}

/* ========================================
   CTA Section
   ======================================== */
#cta {
    position: relative;
}

/* ========================================
   Contact Form
   ======================================== */
select option {
    background-color: #faf8f5;
    color: #4c2639;
}

/* ========================================
   Smooth Scroll Offset for Fixed Nav
   ======================================== */
section[id] {
    scroll-margin-top: 80px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 767px) {
    section[id] {
        scroll-margin-top: 60px;
    }
}

@media (min-width: 768px) {
    /* Subtle parallax-like effect on hero image */
    #hero {
        will-change: transform;
    }
}

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

/* ========================================
   Print Styles
   ======================================== */
@media print {
    nav, #contact-form, .service-card, .testimonial-card {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
