/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #fdfcfa;
    color: #1f3218;
}

::selection {
    background-color: #c5d9b0;
    color: #1f3218;
}

/* Nav */
.nav-text {
    color: #1f3218;
}

#navbar.scrolled .nav-text {
    color: #1f3218;
}

#navbar.scrolled {
    background-color: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(47, 75, 35, 0.08);
}

#navbar:not(.scrolled) .nav-text {
    color: #fdfcfa;
}

.nav-link {
    position: relative;
}

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

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

/* Mobile Menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

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

#menu-toggle.active #bar1 {
    transform: translateY(5px) rotate(45deg);
}

#menu-toggle.active #bar2 {
    opacity: 0;
}

#menu-toggle.active #bar3 {
    transform: translateY(-5px) rotate(-45deg);
    width: 1.5rem;
}

/* Mobile Links */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Hero Animations */
.hero-anim {
    opacity: 0;
    transform: translateY(24px);
    animation: heroFadeIn 0.8s ease forwards;
}

.hero-anim:nth-child(1) { animation-delay: 0.2s; }
.hero-anim:nth-child(2) { animation-delay: 0.4s; }
.hero-anim:nth-child(3) { animation-delay: 0.6s; }
.hero-anim:nth-child(4) { animation-delay: 0.8s; }
.hero-anim:nth-child(5) { animation-delay: 1.0s; }

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal-left {
        opacity: 0;
        transform: translateX(-30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal-right {
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal-up.visible,
    .reveal-left.visible,
    .reveal-right.visible {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* Menu hover lines */
.menu-item {
    position: relative;
}

.menu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #9dbe7d;
    transition: width 0.3s ease;
}

.menu-item:hover::after {
    width: 100%;
}

/* Image hover */
img {
    transition: opacity 0.5s ease;
}

img:hover {
    opacity: 0.9;
}

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

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9dbe7d;
}
