/* Base & Utilities */
html {
    scroll-behavior: smooth;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f0e3;
}
::-webkit-scrollbar-thumb {
    background: #93b996;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4a7f4e;
}

/* Focus visible */
*:focus-visible {
    outline: 3px solid #4a7f4e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(253, 252, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(45, 90, 61, 0.08);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: #2d5a3d;
    border-radius: 1px;
    transition: transform 0.2s ease;
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Mobile menu */
#mobile-menu {
    animation: menuSlideIn 0.3s ease forwards;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mobile-menu-link {
    transition: all 0.2s ease;
}

.mobile-menu-link:hover,
.mobile-menu-link:focus {
    transform: scale(1.02);
}

/* Body lock when menu open */
body.menu-open {
    overflow: hidden;
}

/* Scroll reveal animations (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        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);
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* Reduced motion: no animations */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Selection */
::selection {
    background: #dce8df;
    color: #1c3a27;
}
