/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal animations — progressive enhancement via JS */
.scroll-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);
}

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f5f3ed;
}
::-webkit-scrollbar-thumb {
    background: #8fbc92;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5e9a66;
}

/* Selection color */
::selection {
    background: #2d5f37;
    color: #faf9f6;
}

/* Subtle image loading transition */
img {
    transition: opacity 0.4s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Nav background transition */
#navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(26, 76, 44, 0.08);
}

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

#navbar.scrolled .nav-link:hover {
    color: #3d7a48;
}

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

#navbar.scrolled #nav-logo {
    color: #2d5f37;
}

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

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

/* Form focus styles */
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(143, 188, 146, 0.3);
}

/* Smooth link transitions */
a {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Image aspect ratio fallback */
.aspect-\[4\/3\] {
    aspect-ratio: 4 / 3;
}
.aspect-\[3\/4\] {
    aspect-ratio: 3 / 4;
}
.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Print styles */
@media print {
    #navbar,
    #mobile-menu,
    .scroll-reveal {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}
