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

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

body {
    min-height: 100vh;
    min-height: 100dvh;
}

/* Smooth scroll for Safari */
@supports (scroll-behavior: smooth) {
    html { scroll-behavior: smooth; }
}

/* Selection color */
::selection {
    background-color: rgba(22, 101, 52, 0.2);
    color: #052e16;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9ee;
}
::-webkit-scrollbar-thumb {
    background: #166534;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #15803d;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@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;
    }
    html { scroll-behavior: auto; }
}

/* Reveal animations — progressive enhancement, hidden by default */
.reveal {
    opacity: 1;
    transform: none;
}

@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; }
    .reveal-delay-5 { transition-delay: 0.5s; }
}

/* Navbar transition */
#site-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#site-header.scrolled {
    background: rgba(4, 19, 11, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#site-header:not(.scrolled) {
    background: transparent;
}

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

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

.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #86efac;
    transition: width 0.3s ease;
}

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

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Form select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23166534' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Subtle pattern for cream sections */
.bg-cream-50 {
    background-color: #fefdf8;
    background-image: radial-gradient(ellipse at 20% 50%, rgba(22, 101, 52, 0.02) 0%, transparent 50%);
}

.bg-cream-100 {
    background-color: #fdf9ee;
    background-image: radial-gradient(ellipse at 80% 20%, rgba(22, 101, 52, 0.03) 0%, transparent 50%);
}

/* Print styles */
@media print {
    #site-header, #back-to-top, #mobile-menu { display: none !important; }
    body { background: white; color: black; }
    a { color: black; text-decoration: underline; }
}
