/* =========================================================
   Mobile menu: hamburger + right-hand flyout
   ========================================================= */

/* Hidden on desktop */
.nav-toggle,
.nav-backdrop {
    display: none;
}

.footer-company {
    font-size: 0.88rem;
}

@media (max-width: 720px) {
    /* A blurred header would trap the fixed flyout inside it, so go solid */
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg);
    }

    /* ----- Hamburger button ----- */
    .nav-toggle {
        position: relative;
        z-index: 2;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--surface);
        cursor: pointer;
        transition: border-color 0.2s ease, background 0.2s ease;
    }

    .nav-toggle:hover {
        border-color: var(--line-strong);
    }

    .nav-toggle:focus-visible {
        outline: 3px solid var(--focus);
        outline-offset: 3px;
    }

    .nav-toggle-bar {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: var(--text);
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    body.nav-open .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.nav-open .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ----- Flyout panel ----- */
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: min(320px, 86vw);
        padding: calc(var(--header-h) + 16px) 24px 24px;
        background: var(--surface);
        border-left: 1px solid var(--line);
        box-shadow: -20px 0 50px rgba(0, 0, 0, 0.18);
        font-size: 1.1rem;
        color: var(--text);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0s linear 0.28s;
        overflow-y: auto;
    }

    body.nav-open .nav {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.28s ease, visibility 0s;
    }

    .nav a {
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
        font-weight: 600;
    }

    .nav a:hover {
        color: var(--brand-dark);
    }

    /* Last link becomes the call-to-action button */
    .nav a:last-child {
        margin-top: 20px;
        padding: 0 22px;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 999px;
        background: var(--brand);
        color: var(--on-brand);
        box-shadow: 0 8px 20px var(--brand-glow);
    }

    .nav a:last-child:hover {
        background: var(--brand-dark);
        color: var(--on-brand);
    }

    /* ----- Backdrop ----- */
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 15;
        background: rgba(10, 14, 16, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }
}
