/* Base reset & custom utilities */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

/* Preloader animations */
@keyframes fadeInOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

#preloader {
    animation: fadeInOut 2.2s ease-in-out forwards;
}

/* Mobile menu transitions */
#mobile-menu {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(4, 11, 22, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Scroll reveal base — progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

/* Focus visible for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 1px solid rgba(61, 179, 134, 0.5);
    outline-offset: 2px;
}

/* Custom input autofill */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #040B16 inset !important;
    -webkit-text-fill-color: #ffffff !important;
}
