/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Nav ── */
.nav-link {
    position: relative;
    padding-bottom: 2px;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
    border-radius: 1px;
}
.nav-link:hover::after { width: 100%; }

#navbar.scrolled {
    background: rgba(254, 252, 243, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(5, 150, 105, 0.08), 0 4px 24px rgba(5, 150, 105, 0.06);
}
#navbar.scrolled .nav-text { color: #064e3b; }

/* ── Hero Entrances ── */
.hero-entrance {
    opacity: 0;
    transform: translateY(24px);
    animation: heroIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-entrance:nth-child(2) { animation-delay: 0.12s; }
.hero-entrance:nth-child(3) { animation-delay: 0.24s; }
.hero-entrance:nth-child(4) { animation-delay: 0.36s; }
.hero-entrance:nth-child(5) { animation-delay: 0.48s; }

@keyframes heroIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Floating Decorations ── */
.hero-float {
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

.hero-deco {
    animation: pulse-deco 8s ease-in-out infinite;
}
@keyframes pulse-deco {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.1); }
}

/* ── Scroll Reveal ── */
.reveal {
    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);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Default state for reduced-motion: always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-entrance {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .hero-float { animation: none; }
    .hero-deco { animation: none; }
}

/* Progressive enhancement: hide by default, reveal with JS */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
    }
}

/* ── Mobile Menu ── */
.mobile-link {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(5, 150, 105, 0.08);
    transition: color 0.2s, padding-left 0.2s;
}
.mobile-link:hover { color: #059669; padding-left: 8px; }

#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #D9F99D; }
::-webkit-scrollbar-thumb { background: #059669; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #047857; }

/* ── Selection ── */
::selection { background: #D9F99D; color: #064e3b; }

/* ── Focus Visible ── */
:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Form Select Arrow ── */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
