/* ─── Base & Utilities ─── */
*, *::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 Link Underline ─── */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #E8645B;
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* ─── Navbar Scroll State ─── */
#navbar.scrolled {
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* ─── Mobile Menu ─── */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}
#mobile-menu.open .mobile-link {
    animation: fadeUp 0.3s ease forwards;
    opacity: 1;
}
#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* ─── Hamburger Animation ─── */
.menu-line { transition: all 0.3s ease; }
#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 5px;
}

/* ─── Stat Card Float ─── */
.stat-card {
    animation: float 6s ease-in-out infinite;
}
.stat-card:nth-child(2) { animation-delay: -2s; }
.stat-card:nth-child(3) { animation-delay: -4s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* ─── Scroll Reveal (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal[data-delay="80ms"] { transition-delay: 80ms; }
    .reveal[data-delay="160ms"] { transition-delay: 160ms; }
}

/* When JS is disabled, all content is visible by default */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

/* ─── Custom 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='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ─── Selection Color ─── */
::selection {
    background: rgba(232, 100, 91, 0.15);
    color: #16161b;
}

/* ─── Focus Visible ─── */
:focus-visible {
    outline: 2px solid #E8645B;
    outline-offset: 2px;
}

/* ─── Smooth scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f7f7f8; }
::-webkit-scrollbar-thumb { background: #d4d4de; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #adadb8; }
