/* ===== BASE ===== */
*, *::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 {
    background: #9bc082;
    color: #1f3017;
}

/* ===== SCROLL REVEAL ===== */
.reveal-on-scroll {
    opacity: 1;
    transform: translateY(0);
    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-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

/* Stagger delays */
.reveal-on-scroll:nth-child(1) { transition-delay: 0.0s; }
.reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.reveal-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* ===== NAV SCROLL STATE ===== */
#site-header.scrolled {
    background: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(31, 48, 23, 0.08);
}

#site-header.scrolled #nav-logo {
    color: #1f3017;
}

#site-header.scrolled nav a:not(.bg-forest-800) {
    color: #283e1e;
}

#site-header.scrolled nav a:not(.bg-forest-800):hover {
    color: #54803a;
}

/* ===== MOBILE MENU ===== */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

/* ===== FORM STYLES ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #54803a !important;
    box-shadow: 0 0 0 3px rgba(84, 128, 58, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #c5dbb5;
}

/* ===== SMOOTH SCROLL OFFSET ===== */
section[id] {
    scroll-margin-top: 80px;
}

/* ===== IMAGE LOADING ===== */
img {
    display: block;
    max-width: 100%;
}

/* ===== FOCUS VISIBLE ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #54803a;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ===== PRINT ===== */
@media print {
    #site-header,
    #mobile-menu,
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
    #hero {
        min-height: auto;
        padding: 2rem 0;
    }
}
