/* ===== BASE & RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal[data-state="hidden"] {
    opacity: 0;
    transform: translateY(32px);
}

.reveal[data-state="visible"] {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-stagger[data-state="visible"] > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-state="visible"] > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-state="visible"] > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-state="visible"] > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.reveal-stagger[data-state="visible"] > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: translateY(0); }

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

/* ===== NAVBAR SCROLL STATE ===== */
#navbar.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

#navbar.scrolled .font-serif {
    color: #064e3b !important;
}

#navbar.scrolled a:not([class*="bg-"]) {
    color: rgba(6, 78, 59, 0.7) !important;
}

#navbar.scrolled a:not([class*="bg-"]):hover {
    color: #064e3b !important;
}

/* ===== MOBILE MENU ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

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

body.menu-open .mobile-link:nth-child(1) { transition-delay: 0ms; }
body.menu-open .mobile-link:nth-child(2) { transition-delay: 60ms; }
body.menu-open .mobile-link:nth-child(3) { transition-delay: 120ms; }
body.menu-open .mobile-link:nth-child(4) { transition-delay: 180ms; }
body.menu-open .mobile-link:nth-child(5) { transition-delay: 240ms; }

/* ===== SELECTION ===== */
::selection {
    background: #064e3b;
    color: #fefdf8;
}

/* ===== FOCUS ===== */
a:focus-visible, button:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== SMOOTH IMAGE LOADING ===== */
img {
    background-color: #d1fae5;
}

/* ===== ASPECT RATIO FALLBACK ===== */
.aspect-\[4\/5\] { aspect-ratio: 4/5; }
.aspect-\[16\/10\] { aspect-ratio: 16/10; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fefdf8;
}
::-webkit-scrollbar-thumb {
    background: #047857;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #064e3b;
}
