/* ── Base & Typography ── */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F5F0E8;
}
::-webkit-scrollbar-thumb {
    background: #A8D5BC;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6BBF96;
}

/* ── Selection ── */
::selection {
    background: #D5E8DD;
    color: #174330;
}

/* ── Mobile Menu Animation ── */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 1;
}

#mobileMenu .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobileMenu .mobile-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Hamburger Animation ── */
#mobileMenu.open #menuLine1 {
    transform: rotate(45deg) translate(5px, 5px);
}
#mobileMenu.open #menuLine2 {
    opacity: 0;
}
#mobileMenu.open #menuLine3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        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);
    }
    .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; }
}

/* ── Navbar Scrolled State ── */
#navbar.scrolled {
    background: rgba(250, 248, 245, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(23, 67, 48, 0.08);
}

/* ── Image Hover ── */
.group img {
    will-change: transform;
}

/* ── Form Focus Styles ── */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(45, 163, 118, 0.15);
}

/* ── Smooth Section Transitions ── */
section {
    position: relative;
}

/* ── Print Styles ── */
@media print {
    #navbar, #mobileMenu, #contactForm { display: none; }
    body { color: #000; background: #fff; }
    .bg-emerald-900, .bg-emerald-700, .bg-emerald-950 { background: #174330 !important; color: #fff !important; }
}
