/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(61, 184, 154, 0.3);
    color: #0B1D3A;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0B1D3A;
}
::-webkit-scrollbar-thumb {
    background: #1E4573;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3DB89A;
}

/* Reveal Animations - Progressive Enhancement */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 0;
        transform: translateY(40px);
    }
    .reveal-left {
        transform: translateX(-40px);
    }
    .reveal-right {
        transform: translateX(40px);
    }
    
    .reveal-up.revealed,
    .reveal-left.revealed,
    .reveal-right.revealed {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

/* Navbar Transition */
#navbar {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

#navbar.scrolled {
    background: rgba(6, 15, 31, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(61, 184, 154, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

/* Menu Lines Animation */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#menu-toggle.active .menu-line:nth-child(3) {
    width: 20px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Link Animation */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Hover underline for nav links */
nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #3DB89A;
    transition: width 0.3s ease;
}

nav a:not(.ml-4):hover::after {
    width: 100%;
}

nav a:not(.ml-4) {
    position: relative;
}

/* Image hover effects */
img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 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='%239DB3D6' 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;
}

/* Subtle pattern overlay for hero */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(ellipse at 50% 50%, rgba(61, 184, 154, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Print styles */
@media print {
    #navbar, #menu-toggle, #mobile-menu {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
}
