/* ============================================
   S R Machine — Custom Styles
   Classic & Elegant Auto Repair Website
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-burgundy-800: #6e1a31;
    --color-burgundy-700: #861d37;
    --color-burgundy-600: #a82948;
    --color-burgundy-300: #f2a4b5;
    --color-burgundy-200: #f9d0d9;
    --color-burgundy-100: #fce7eb;
    --color-cream-50: #fefcfb;
    --color-cream-100: #fdf8f5;
    --color-slate-900: #0f172a;
    --color-slate-850: #1e293b;
    --color-slate-600: #475569;
    --color-slate-500: #64748b;
    --color-slate-400: #94a3b8;
    --color-slate-300: #cbd5e1;
    --color-slate-200: #e2e8f0;
    --color-slate-100: #f1f5f9;
    
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', system-ui, sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-slate-850);
    background-color: var(--color-cream-50);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Selection --- */
::selection {
    background-color: var(--color-burgundy-800);
    color: var(--color-cream-50);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-cream-100);
}
::-webkit-scrollbar-thumb {
    background: var(--color-burgundy-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-burgundy-600);
}

/* --- Navbar --- */
#navbar {
    background: rgba(254, 252, 251, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: var(--transition-smooth);
}

#navbar.scrolled {
    background: rgba(254, 252, 251, 0.97);
    border-bottom-color: var(--color-burgundy-200);
    box-shadow: 0 1px 20px rgba(110, 26, 49, 0.06);
}

/* --- Hero Section --- */
#hero {
    background: linear-gradient(135deg, var(--color-cream-50) 0%, var(--color-cream-100) 100%);
}

/* --- 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, var(--color-burgundy-800), var(--color-burgundy-600));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* --- Testimonial Cards --- */
.testimonial-card {
    position: relative;
}

.testimonial-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(244, 164, 181, 0);
    transition: box-shadow 0.5s ease;
}

.testimonial-card:hover::after {
    box-shadow: inset 0 0 0 1px rgba(244, 164, 181, 0.4);
}

/* --- Form Inputs --- */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-burgundy-500) !important;
    box-shadow: 0 0 0 3px rgba(168, 41, 72, 0.1) !important;
}

/* --- Buttons --- */
button, a {
    transition: var(--transition-smooth);
}

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

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

#back-to-top:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(110, 26, 49, 0.3);
}

/* --- Mobile Menu --- */
#mobile-menu {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s 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; }

/* --- Menu Toggle Animation --- */
#menu-toggle.active #bar1 {
    transform: translateY(6px) rotate(45deg);
}
#menu-toggle.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}
#menu-toggle.active #bar3 {
    transform: translateY(-6px) rotate(-45deg);
    width: 1.5rem;
}

/* --- Scroll Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.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; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
    
    #hero {
        padding-top: 80px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #hero {
        padding-top: 96px;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
