/* Base styles & resets */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

/* Scroll reveal — progressive enhancement, hidden by default so JS-unavailable users see content */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger children */
    .grid .scroll-reveal:nth-child(2) { transition-delay: 0.08s; }
    .grid .scroll-reveal:nth-child(3) { transition-delay: 0.16s; }
    .grid .scroll-reveal:nth-child(4) { transition-delay: 0.24s; }
    .grid .scroll-reveal:nth-child(5) { transition-delay: 0.32s; }
    .grid .scroll-reveal:nth-child(6) { transition-delay: 0.40s; }
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Mobile link transition */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
}

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

::-webkit-scrollbar-track {
    background: #0a1628;
}

::-webkit-scrollbar-thumb {
    background: #1a3a5c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #234b73;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5eead4;
    outline-offset: 2px;
    border-radius: 4px;
}

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