/* ── Base & Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        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:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
    .reveal:nth-child(5) { transition-delay: 0.35s; }
    .reveal:nth-child(6) { transition-delay: 0.4s; }
}

/* ── Navbar scroll state ── */
#navbar.scrolled {
    background: rgba(27, 67, 50, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
#navbar.scrolled .nav-link { color: rgba(255,255,255,0.85); }
#navbar.scrolled .nav-link:hover { color: #fff; }

/* ── Glass Card ── */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(27, 67, 50, 0.12);
}

/* ── Mobile Menu Transitions ── */
#mobileMenu {
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
#mobileMenu.open {
    max-height: 500px;
    opacity: 1;
}
#mobileMenu.closed {
    max-height: 0;
    opacity: 0;
}
.mobile-link {
    display: block;
}

/* ── Hamburger Animation ── */
#menuBtn[aria-expanded="true"] #bar1 {
    transform: translateY(8px) rotate(45deg);
}
#menuBtn[aria-expanded="true"] #bar2 {
    opacity: 0;
    transform: scaleX(0);
}
#menuBtn[aria-expanded="true"] #bar3 {
    transform: translateY(-8px) rotate(-45deg);
}

/* ── Button Focus Styles ── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3da365;
    outline-offset: 2px;
}

/* ── Selection Color ── */
::selection {
    background: rgba(61, 163, 101, 0.3);
    color: #1B4332;
}

/* ── Smooth Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f4f9f0; }
::-webkit-scrollbar-thumb { background: #a8d8b8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6fbf8a; }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
