/* ========================================
   Cranston Automotive — Custom Styles
   ======================================== */

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

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: #1a4d2e;
    color: #faf9f6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f3ee;
}

::-webkit-scrollbar-thumb {
    background: #8fb896;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d5e3a;
}

/* ========================================
   Scroll Reveal Animations
   Progressive enhancement — content is
   visible by default, JS adds animation
   ======================================== */
.reveal {
    opacity: 1;
    transform: none;
    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: 0;
    transform: translateY(30px);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }

/* ========================================
   Navbar
   ======================================== */
#navbar {
    background: transparent;
    backdrop-filter: none;
}

#navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(26, 77, 46, 0.08);
}

#navbar.scrolled .font-serif,
#navbar.scrolled .text-forest-900 {
    color: #1a4d2e !important;
}

#navbar.scrolled .text-forest-600 {
    color: #2d5e3a !important;
}

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

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

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

/* Hamburger Animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

body.menu-open #menu-btn .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

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

body.menu-open #menu-btn .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 1.5rem;
}

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

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

/* ========================================
   Services Grid
   ======================================== */
#services .group:hover .bg-forest-100 {
    background-color: #1a4d2e !important;
}

#services .group:hover svg {
    stroke: #fff !important;
}

/* ========================================
   Buttons
   ======================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #1a4d2e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   Map
   ======================================== */
iframe {
    filter: saturate(0.6) contrast(1.1);
    transition: filter 0.5s ease;
}

iframe:hover {
    filter: saturate(0.8) contrast(1.05);
}

/* ========================================
   Utility
   ======================================== */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.1;
    }
}
