/* ── Mobile Hamburger Menu ─────────────────── */

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn span:nth-child(1) {
    margin-bottom: 4px;
}

.hamburger-btn span:nth-child(3) {
    margin-top: 4px;
}

/* Morphing to X */
.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* ── Responsive Breakpoint ───────────────── */
@media (max-width: 1024px) {
    .hamburger-btn {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .main-nav {
        display: block !important;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-primary);
        border-left: 1px solid var(--border-subtle);
        z-index: 1000;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding-top: 5rem;
    }

    .main-nav.open {
        right: 0;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }

    .main-nav ul li {
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }

    .main-nav.open ul li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Staggered animation */
    .main-nav.open ul li:nth-child(1) {
        transition-delay: 0.05s;
    }

    .main-nav.open ul li:nth-child(2) {
        transition-delay: 0.10s;
    }

    .main-nav.open ul li:nth-child(3) {
        transition-delay: 0.15s;
    }

    .main-nav.open ul li:nth-child(4) {
        transition-delay: 0.20s;
    }

    .main-nav.open ul li:nth-child(5) {
        transition-delay: 0.25s;
    }

    .main-nav.open ul li:nth-child(6) {
        transition-delay: 0.30s;
    }

    .main-nav.open ul li:nth-child(7) {
        transition-delay: 0.35s;
    }

    .main-nav.open ul li:nth-child(8) {
        transition-delay: 0.40s;
    }

    .main-nav ul li a {
        display: block;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    .main-nav ul li a:hover,
    .main-nav ul li a.active {
        background: rgba(79, 142, 255, 0.08);
    }

    .main-nav ul li a.nav-cta {
        margin-top: 0.5rem;
        text-align: center;
    }

    /* Adjust header for mobile */
    .site-header .container {
        justify-content: space-between;
    }
}