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

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

body {
    margin: 0;
    overflow-x: hidden;
}

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

::selection {
    background: #4a7249;
    color: #fdfcfa;
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f0e8;
}
::-webkit-scrollbar-thumb {
    background: #b3c7b3;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8aad8a;
}

/* ── Navbar transition ──────────────────────────── */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(74, 114, 73, 0.08);
}

#navbar.scrolled .nav-text {
    color: #1d2c1d;
}

#navbar.scrolled .nav-link {
    color: #304a2f;
}

#navbar.scrolled .nav-link:hover {
    color: #4a7249;
}

#navbar.scrolled #menu-toggle {
    color: #1d2c1d;
}

/* ── Scroll indicator animation ─────────────────── */
@keyframes scroll-indicator {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.animate-scroll-indicator {
    animation: scroll-indicator 1.5s ease-in-out infinite;
}

/* ── Menu tabs ──────────────────────────────────── */
.menu-tab {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #8aad8a;
    transition: all 0.3s ease;
}

.menu-tab:hover {
    color: #d9e4d9;
}

.menu-tab.active {
    background: #4a7249;
    color: #fdfcfa;
    box-shadow: 0 4px 12px rgba(74, 114, 73, 0.3);
}

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

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

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

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }

/* ── Hamburger animation ────────────────────────── */
#bar1.open {
    transform: rotate(45deg) translate(4px, 4px);
}

#bar2.open {
    opacity: 0;
}

#bar3.open {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.5rem;
}

/* ── Scroll reveal (progressive enhancement) ───── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

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

/* Reduced motion: ensure everything is visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}
