/* ==========================================
   Neighbors Lawn & Garden — Custom Styles
   Classic & Elegant · Emerald + Cream
   ========================================== */

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

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

body {
    margin: 0;
    overflow-x: hidden;
}

/* --- Selection Color --- */
::selection {
    background-color: #1b5e20;
    color: #fefdf8;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9ee;
}
::-webkit-scrollbar-thumb {
    background: #a5d6a8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2e7d32;
}

/* --- Scroll Reveal Animations (progressive enhancement) --- */
.reveal-section {
    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);
}

/* Only apply hidden state when JS is enabled and user prefers motion */
.js-enabled .reveal-section {
    opacity: 0;
    transform: translateY(30px);
}

.js-enabled .reveal-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger children */
.js-enabled .reveal-section:nth-child(1) { transition-delay: 0s; }
.js-enabled .reveal-section:nth-child(2) { transition-delay: 0.1s; }
.js-enabled .reveal-section:nth-child(3) { transition-delay: 0.2s; }
.js-enabled .reveal-section:nth-child(4) { transition-delay: 0.3s; }
.js-enabled .reveal-section:nth-child(5) { transition-delay: 0.4s; }
.js-enabled .reveal-section:nth-child(6) { transition-delay: 0.5s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal-section,
    .js-enabled .reveal-section {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

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

#navbar.scrolled {
    background-color: rgba(254, 253, 248, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 20px rgba(13, 59, 18, 0.08);
}

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

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

.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(46, 125, 50, 0.1);
}

.mobile-link:last-child {
    border-bottom: none;
}

/* --- Image Hover Effects --- */
.group img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Button Focus States --- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2e7d32;
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Smooth anchor scroll offset for fixed nav --- */
section[id], header[id] {
    scroll-margin-top: 80px;
}

/* --- Image aspect ratio fallback --- */
img {
    max-width: 100%;
    height: auto;
}

/* --- Print Styles --- */
@media print {
    nav, #mobile-menu, button {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
    a {
        color: #000;
    }
    .reveal-section {
        opacity: 1 !important;
        transform: none !important;
    }
}
