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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a1f3f;
}
::-webkit-scrollbar-thumb {
    background: #2a4a72;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5eead4;
}

/* Loader */
#loader {
    transition: opacity 0.5s ease;
}
#loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Scroll animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.from-left {
    transform: translateX(-30px);
}

.reveal.from-right {
    transform: translateX(30px);
}

.reveal.from-bottom {
    transform: translateY(40px);
}

/* Scroll reveal - only active when JS is available and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .reveal-hidden {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .reveal-hidden.from-left {
        transform: translateX(-30px);
    }
    .reveal-hidden.from-right {
        transform: translateX(30px);
    }
    .reveal-hidden.revealed {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

/* Scroll down animation */
@keyframes scrollDown {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}
.animate-scroll-down {
    animation: scrollDown 1.5s ease-in-out infinite;
}

/* Mobile menu */
#mobileMenu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#mobileMenu.open {
    opacity: 1;
    pointer-events: auto;
}
#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

/* Service card hover */
.service-card {
    transition: transform 0.3s ease, background 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Nav scroll state */
.nav-scrolled {
    background: rgba(10, 31, 63, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

/* Selection */
::selection {
    background: #5eead4;
    color: #0a1f3f;
}

/* Image aspect ratios */
img {
    max-width: 100%;
    height: auto;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print */
@media print {
    nav, #mobileMenu, #loader, #contactForm {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}
