/* ─── Base & Utilities ─── */
*, *::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: rgba(20, 184, 166, 0.3);
    color: white;
}

/* ─── Scroll Reveal (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-up.revealed,
    .reveal-left.revealed,
    .reveal-right.revealed {
        opacity: 1;
        transform: translate(0, 0);
    }

    /* Hero animations */
    .hero-anim {
        opacity: 0;
        transform: translateY(20px);
        animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .hero-anim:nth-child(1) { animation-delay: 0.1s; }
    .hero-anim:nth-child(2) { animation-delay: 0.25s; }
    .hero-anim:nth-child(3) { animation-delay: 0.4s; }
    .hero-anim:nth-child(4) { animation-delay: 0.55s; }

    @keyframes heroReveal {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ─── Navbar ─── */
.nav-scrolled {
    background: rgba(8, 14, 26, 0.92) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-scrolled .menu-line {
    background: white;
}

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

.menu-toggle-active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle-active .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle-active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
    margin-right: 0;
}

/* ─── Form Focus Styles ─── */
input:focus,
textarea:focus {
    outline: none;
}

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

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

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

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

/* ─── Image Optimization ─── */
img {
    max-width: 100%;
    height: auto;
}

/* ─── Print Styles ─── */
@media print {
    nav, #contact-form, .reveal-up, .reveal-left, .reveal-right {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
