/* ─── Base & Utilities ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; -webkit-font-smoothing: antialiased; }

/* ─── Scroll Animations (progressive enhancement) ─── */
.scroll-anim {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-active .scroll-anim {
    opacity: 0;
    transform: translateY(24px);
}

.js-active .scroll-anim.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-anim { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ─── Navbar ─── */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: transparent;
    transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.nav-scrolled #navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ─── Mobile Menu ─── */
#mobileMenu {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#mobileMenu.open {
    pointer-events: all;
    opacity: 1;
}

.mobile-link {
    display: block;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

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

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

/* ─── Menu Button ─── */
#menuBtn { display: flex; }
.menu-line { transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease; }

#menuBtn[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
}
#menuBtn[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
}
#menuBtn[aria-expanded="true"] .menu-line:nth-child(3) {
    width: 24px;
    transform: translateY(-4.5px) rotate(-45deg);
}

/* ─── Hero Gradient ─── */
.hero-gradient {
    background: linear-gradient(
        135deg,
        #1a4a2e 0%,
        #166534 25%,
        #15803d 50%,
        #1d4ed8 75%,
        #4f46e5 100%
    );
    position: relative;
}

.hero-pattern {
    background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.08) 1px, transparent 1px),
                      radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 60px 60px, 40px 40px;
}

/* ─── Focus Styles ─── */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #166534;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── Selection ─── */
::selection {
    background: rgba(22, 101, 52, 0.2);
    color: #166534;
}
