/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(42, 184, 120, 0.3);
    color: white;
}

/* Scroll Reveal Animations — progressive enhancement via JS */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
    .scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
    .scroll-reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* Floating Card Animations */
@media (prefers-reduced-motion: no-preference) {
    .floating-card {
        animation: float 4s ease-in-out infinite;
    }
    
    .floating-card:nth-child(2) {
        animation-delay: -1.3s;
        animation-duration: 4.5s;
    }
    
    .floating-card:nth-child(3) {
        animation-delay: -2.6s;
        animation-duration: 3.8s;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Navbar Transition */
.nav-scrolled {
    background-color: rgba(11, 17, 32, 0.95) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
}

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

::-webkit-scrollbar-track {
    background: #0B1120;
}

::-webkit-scrollbar-thumb {
    background: #1B2744;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #243356;
}

/* Focus Styles */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #2AB878;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Form Select Arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232AB878' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Mobile Menu Animation */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Button Ripple Effect */
button, a {
    position: relative;
    overflow: hidden;
}

/* Image Loading Placeholder */
img {
    background-color: #1B2744;
}

/* Print Styles */
@media print {
    nav, #contact-form, #form-success, .floating-card {
        display: none !important;
    }
    
    body {
        background: white;
        color: #111;
    }
    
    .bg-midnight-900, .bg-midnight-800, .bg-midnight-700 {
        background: white !important;
    }
}
