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

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

body {
    margin: 0;
    background-color: #0A1628;
    color: #ffffff;
}

/* ── Nav ── */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #5EEAD4;
    transition: width 0.25s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-nav-link {
    position: relative;
}

/* ── Navbar scroll state ── */
nav.scrolled {
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(94, 234, 212, 0.08);
}

/* ── Reveal animations (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(28px);
        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);
    }

    /* Stagger children */
    .reveal-grid > .reveal {
        transition-delay: calc(var(--i, 0) * 80ms);
    }
}

/* Default state: always visible if JS is disabled or reduced motion */
.reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(28px);
    }
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #060D18;
}

::-webkit-scrollbar-thumb {
    background: rgba(94, 234, 212, 0.25);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 234, 212, 0.45);
}

/* ── Selection ── */
::selection {
    background: rgba(94, 234, 212, 0.3);
    color: #ffffff;
}

/* ── Image loading placeholder ── */
img {
    background-color: rgba(255, 255, 255, 0.04);
}

/* ── Smooth anchor offset ── */
section[id] {
    scroll-margin-top: 80px;
}

/* ── Mobile menu animation ── */
#mobile-menu {
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu.hiding {
    animation: slideUp 0.2s ease-in forwards;
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}
