/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scroll reveal animations — progressive enhancement, only when JS is available */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(15, 23, 42, 0.08);
}

.nav-scrolled .nav-logo-text {
    color: #0f172a;
}

.nav-scrolled a:not(.bg-midnight-900):not(.mobile-link) {
    color: #312e81;
}

.nav-scrolled a:not(.bg-midnight-900):not(.mobile-link):hover {
    color: #10b981;
}

.nav-transparent .nav-logo-text {
    color: #ffffff;
}

.nav-transparent a:not(.bg-midnight-900):not(.mobile-link) {
    color: rgba(255, 255, 255, 0.85);
}

.nav-transparent a:not(.bg-midnight-900):not(.mobile-link):hover {
    color: #86efac;
}

/* Mobile menu transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

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

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

::-webkit-scrollbar-thumb {
    background: #91a7ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4263eb;
}

/* Selection color */
::selection {
    background: #bbf7d0;
    color: #0f172a;
}

/* Button focus styles */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

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