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

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

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

/* Scroll animation base */
.scroll-animate {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header scroll state */
#site-header {
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

#site-header.scrolled {
    background: rgba(250, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

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

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

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

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

#mobile-menu.hidden {
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.mobile-link {
    display: block;
}

/* Custom focus styles */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #4a7c34;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Subtle gradient text effect for hero */
.font-serif em {
    font-style: italic;
}

/* Smooth image loading */
img {
    display: block;
    max-width: 100%;
}

/* Selection color */
::selection {
    background: #dce9d8;
    color: #1e3517;
}
