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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: color-mix(in srgb, #478556 30%, transparent);
    color: #1c4027;
}

/* Scroll reveal — progressive enhancement, content visible by default */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        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.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(250, 249, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(28, 64, 39, 0.08);
}

#navbar.scrolled .nav-link {
    color: #1c4027;
}

#navbar.scrolled #nav-brand {
    color: #1c4027;
}

#navbar.scrolled #nav-sub {
    color: #478556;
}

#navbar.scrolled #nav-logo path {
    fill: #478556;
    stroke: #2f663e;
}

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

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

.mobile-link {
    opacity: 1;
}

/* Menu button animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-btn.active .menu-line:nth-child(2) {
    transform: translateY(-6px) rotate(-45deg);
    opacity: 0;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Form focus states */
input:focus,
textarea:focus {
    outline: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: #97c5a0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #478556;
}

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