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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Scroll-reveal utility (progressive enhancement — content is visible by default) */
.js-enabled .reveal-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-enabled .reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.js-enabled .reveal-up:nth-child(2) { transition-delay: 0.1s; }
.js-enabled .reveal-up:nth-child(3) { transition-delay: 0.2s; }
.js-enabled .reveal-up:nth-child(4) { transition-delay: 0.3s; }

/* Hero animations (only run after load, never block initial paint) */
.hero-eyebrow {
    opacity: 0;
    animation: heroFadeUp 0.8s 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-headline {
    opacity: 0;
    animation: heroFadeUp 0.8s 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-sub {
    opacity: 0;
    animation: heroFadeUp 0.8s 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-cta {
    opacity: 0;
    animation: heroFadeUp 0.8s 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section eyebrow */
.section-eyebrow {
    display: block;
}

/* Navbar scroll state */
#nav.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(20, 83, 45, 0.08);
}

/* Mobile menu */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(20, 83, 45, 0.08);
    transition: color 0.2s;
}

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

/* Mobile menu open state */
#mobile-menu.open {
    display: block;
}

#mobile-menu.hidden {
    display: none;
}

/* Menu button active state */
#menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 5rem;
}

/* 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;
    }

    .js-enabled .reveal-up {
        opacity: 1;
        transform: none;
    }

    .hero-eyebrow,
    .hero-headline,
    .hero-sub,
    .hero-cta {
        opacity: 1;
        animation: none;
    }
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
    border-radius: 4px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #14532d;
}
