/* ========== BASE & RESET ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

/* ========== NAVBAR ========== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Scrolled navbar state */
.navbar-scrolled {
    background: rgba(253, 252, 250, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(45, 90, 61, 0.08);
}

.navbar-scrolled .nav-logo-text {
    color: #1c3a27 !important;
}

.navbar-scrolled .nav-logo-sub {
    color: #2d5a3d !important;
}

/* ========== MOBILE MENU ========== */
.mobile-menu-open {
    overflow: hidden;
}

#mobile-menu.menu-open {
    opacity: 1;
    pointer-events: all;
}

#menu-icon-close.menu-open {
    opacity: 1;
    scale: 1;
}

#menu-icon-open.menu-open {
    opacity: 0;
    scale: 0.75;
}

.mobile-nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    transform: translateX(8px);
}

/* ========== SCROLL REVEAL ========== */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

/* ========== SELECTION ========== */
::selection {
    background: #b8ccba;
    color: #1c3a27;
}

/* ========== FORM FOCUS ========== */
input:focus, select:focus, textarea:focus {
    outline: none;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #8fb392;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .font-serif {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
}
