/* Base & Reset */
*, *::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;
}

/* Scroll Reveal — progressive enhancement, hidden by default */
.js-enabled .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Staggered reveal delays */
.js-enabled .reveal:nth-child(2) { transition-delay: 0.1s; }
.js-enabled .reveal:nth-child(3) { transition-delay: 0.2s; }
.js-enabled .reveal:nth-child(4) { transition-delay: 0.3s; }

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

#navbar.scrolled #nav-logo {
    color: #ffffff;
}

/* Mobile menu transitions */
#mobile-menu {
    animation: slideDown 0.3s ease forwards;
}

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

/* Custom selection color */
::selection {
    background: color-mix(in srgb, #14b8a6 60%, transparent);
    color: #0f172a;
}

/* Subtle gradient text utility */
.text-gradient {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth image loading */
img {
    loading: lazy;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .js-enabled .reveal {
        opacity: 1;
        transform: none;
    }
    img {
        transition: none;
    }
    .group:hover img {
        transform: none;
    }
}

/* Focus visible */
:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mobile link hover */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-link:last-child {
    border-bottom: none;
}

/* Menu item hover */
li:hover > div > span:first-child {
    color: #14b8a6;
    transition: color 0.2s ease;
}

/* Button press effect */
button, a {
    -webkit-tap-highlight-color: transparent;
}

button:active, a:active {
    transform: scale(0.98);
}
