*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background-color: rgba(45, 212, 191, 0.3);
    color: #f0f3f9;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Scroll reveal animations */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
}

/* Navbar transition */
.nav-scrolled {
    background-color: rgba(6, 18, 36, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(45, 212, 191, 0.08);
}

.nav-transparent {
    background-color: transparent !important;
    backdrop-filter: none;
    box-shadow: none;
}

/* Mobile menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

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

::-webkit-scrollbar-track {
    background: #061224;
}

::-webkit-scrollbar-thumb {
    background: #202b4e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2DD4BF;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2DD4BF;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Link underline animation */
a.underline-link {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}

a.underline-link:hover {
    background-size: 100% 1px;
}
