/* ========================================
   The Simple Mechanic — Custom Styles
   Classic & Elegant Auto Repair Site
   ======================================== */

/* ---- Custom Properties ---- */
:root {
    --color-terracotta-50: #fbf4f1;
    --color-terracotta-100: #f5e6df;
    --color-terracotta-200: #ebccc0;
    --color-terracotta-300: #dfaa96;
    --color-terracotta-400: #d08368;
    --color-terracotta-500: #c46243;
    --color-terracotta-600: #b84d32;
    --color-terracotta-700: #9c402b;
    --color-terracotta-800: #823627;
    --color-terracotta-900: #6b2f23;
    --color-terracotta-950: #3d170e;

    --color-sand-50: #fdfcfa;
    --color-sand-100: #faf5ee;
    --color-sand-200: #f3e8d5;
    --color-sand-300: #e8d4b0;
    --color-sand-400: #d9be87;
    --color-sand-500: #c9a863;
    --color-sand-600: #b8924e;
    --color-sand-700: #977541;
    --color-sand-800: #7c6039;
    --color-sand-900: #665032;
    --color-sand-950: #382c1c;
}

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

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: var(--color-terracotta-200);
    color: var(--color-terracotta-900);
}

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

/* ---- Scroll Reveal Animations ---- */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(24px);
    }
    
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger delays for grid items */
    .grid > .scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
    .grid > .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
    .grid > .scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
    .grid > .scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
    .grid > .scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
    .grid > .scroll-reveal:nth-child(6) { transition-delay: 0.3s; }
}

/* ---- Navbar Transition ---- */
#navbar {
    background-color: transparent;
}

#navbar.scrolled {
    background-color: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .font-serif {
    color: var(--color-sand-950) !important;
}

/* ---- Hero Scroll Indicator ---- */
@keyframes scrollDown {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.animate-scroll-down {
    animation: scrollDown 1.5s ease-in-out infinite;
}

/* ---- Mobile Menu ---- */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

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

/* ---- Menu Button Animation ---- */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg);
    top: 7px;
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg);
    top: 7px;
}

/* ---- Nav Links Underline ---- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--color-terracotta-500);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ---- Service Card Image Hover ---- */
.group:hover .group-hover\\:scale-105 {
    transform: scale(1.05);
}

/* ---- Form Select Arrow ---- */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23977541' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ---- Button Ripple Effect ---- */
button, a {
    -webkit-tap-highlight-color: transparent;
}

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

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

/* ---- Utility: Focus Visible ---- */
:focus-visible {
    outline: 2px solid var(--color-terracotta-500);
    outline-offset: 2px;
}
