/* Global mobile navigation. Keep this file loaded after page-specific styles. */
@font-face {
    font-family: 'Geist';
    src: url('fonts/Geist-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@media (max-width: 768px) {
    body .nav.container {
        gap: 0.75rem;
    }

    body .logo {
        order: 0;
        margin-right: 0;
    }

    body .logo.logo--theme-favicon .logo-img {
        display: none;
    }

    body .logo-theme-favicon {
        display: block;
        width: 32px;
        height: 32px;
        border-radius: 50%;
    }

    body .nav-right {
        order: 1;
        display: flex !important;
        align-items: center;
        gap: 0.55rem;
        margin-right: 0;
        margin-left: auto;
    }

    body .music-toggle {
        box-sizing: border-box;
        width: var(--nav-pill-width);
        height: var(--nav-pill-height);
        padding: 0;
        border: var(--nav-pill-border) solid currentColor;
        border-radius: var(--nav-pill-radius);
        background: transparent;
        color: currentColor;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body .music-wave {
        height: 18px;
        display: flex;
        align-items: center;
        gap: 3px;
    }

    body .music-wave span {
        display: block;
        width: 2px;
        height: 4px;
        border-radius: 999px;
        background: currentColor;
    }

    body .music-wave span:nth-child(2),
    body .music-wave span:nth-child(4) { height: 10px; }
    body .music-wave span:nth-child(3) { height: 18px; }

    body .mobile-menu-toggle {
        order: 2;
        width: var(--nav-pill-width);
        height: var(--nav-pill-height);
        border: var(--nav-pill-border) solid currentColor;
        border-radius: var(--nav-pill-radius);
    }

    body .nav-right .color-switcher-wrap,
    body .nav-right > .theme-toggle {
        display: none !important;
    }

    body.mobile-menu-open .header-bg {
        opacity: 0;
    }

    body.mobile-menu-open .header,
    body.mobile-menu-open .mobile-menu-toggle,
    body.mobile-menu-open .music-toggle {
        color: #fffaf2;
    }

    body.mobile-menu-open .music-toggle,
    body.mobile-menu-open .mobile-menu-toggle {
        border-color: rgba(255, 250, 242, 0.72);
        background: transparent;
    }

    body .mobile-menu {
        top: 0;
        right: 0;
        bottom: auto;
        left: 0;
        width: 100%;
        height: min(82svh, 720px);
        min-height: min(600px, calc(100svh - 16px));
        color: #fffaf2;
        background: var(--accent-surface, #334c05);
        border: 0;
        border-radius: 0 0 20px 20px;
        box-shadow: 0 22px 56px rgba(0, 0, 0, 0.24);
        transform: translate3d(0, -100%, 0);
        transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1),
                    visibility 0s linear 0.72s;
    }

    body::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(15, 18, 20, 0.22);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    }

    body.mobile-menu-open::after {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.35s ease, visibility 0s linear 0s;
    }

    body .mobile-menu.is-open {
        transform: translate3d(0, 0, 0);
        transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
                    visibility 0s linear 0s;
    }

    body .mobile-menu.is-closing {
        visibility: visible;
        opacity: 1;
        pointer-events: none;
        animation: mobileMenuSoftClose 0.78s cubic-bezier(0.65, 0, 0.35, 1) both;
    }

    @keyframes mobileMenuSoftClose {
        from { transform: translate3d(0, 0, 0); }
        to { transform: translate3d(0, -100%, 0); }
    }

    body .mobile-menu .mobile-menu-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        justify-items: stretch;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        height: 100%;
        padding: calc(var(--header-height) + 0.75rem) 24px 24px;
        gap: 0;
        overflow-y: auto;
    }

    body .mobile-menu-brand {
        display: flex;
        flex-direction: column;
        color: #fffaf2;
    }

    body .mobile-menu-brand-name,
    body .mobile-menu-brand-role {
        font-family: 'Instrument Serif', Georgia, serif;
        font-weight: 400;
        line-height: 1;
    }

    body .mobile-menu-brand-name {
        font-size: clamp(2.25rem, 10.5vw, 3rem);
        letter-spacing: 0.012em;
    }

    body .mobile-menu-brand-role {
        margin-top: 0.9rem;
        font-size: clamp(1.1rem, 5vw, 1.5rem);
        line-height: 1.1;
        letter-spacing: 0.025em;
    }

    body .mobile-menu-nav {
        width: 100%;
        margin: 0;
        align-self: center;
    }

    body .mobile-menu-link {
        display: flex;
        align-items: center;
        width: max-content;
        min-height: 72px;
        padding: 0.2rem 0;
        border: 0;
    }

    body .mobile-menu-link + .mobile-menu-link {
        margin-top: 0.5rem;
    }

    body .mobile-menu-link-text {
        font-family: 'Geist', sans-serif;
        font-size: clamp(3rem, 14vw, 4rem);
        font-weight: 400;
        line-height: 1.12;
        letter-spacing: -0.03em;
        color: #fffaf2;
    }

    body .mobile-menu-link--current .mobile-menu-link-text {
        color: rgba(255, 250, 242, 0.66) !important;
    }

    body .mobile-menu-lower {
        margin-top: 0;
        width: 100%;
        min-width: 0;
        justify-self: stretch;
    }

    body .mobile-menu-preferences {
        display: grid;
        width: 100%;
        gap: 1rem;
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 250, 242, 0.24);
    }

    body .mobile-menu-preference-row {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    body .mobile-menu-preference-label,
    body .mobile-menu-contact a {
        color: #fffaf2;
        font-family: 'Geist', sans-serif;
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.2;
    }

    body .mobile-menu-swatches {
        display: flex;
        align-items: center;
        gap: 0.875rem;
    }

    body .mobile-menu-swatches .color-swatch {
        width: 20px;
        height: 20px;
        border: 1px solid rgba(255, 250, 242, 0.5);
        opacity: 1;
        transform: none;
    }

    body .mobile-menu-swatches .color-swatch-matcha { background: #334c05; }
    body .mobile-menu-swatches .color-swatch-navy { background: #05204d; }
    body .mobile-menu-swatches .color-swatch-burgundy { background: #4d0505; }
    body .mobile-menu-swatches .color-swatch-brown { background: #3b2002; }

    body .mobile-menu-theme-toggle {
        display: inline-flex;
        width: 48px;
        height: 30px;
        color: #fffaf2;
    }

    body .mobile-menu-theme-toggle .theme-toggle-track {
        border-color: rgba(255, 250, 242, 0.72);
        background: rgba(255, 255, 255, 0.08);
    }

    body .mobile-menu-theme-toggle .theme-toggle-thumb {
        background: #fffaf2;
        color: var(--accent-surface, #334c05);
    }

    body .mobile-menu-contact {
        width: 100%;
        min-height: 44px;
        margin-top: 1.4rem;
        padding-top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    body .mobile-menu-contact a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        text-decoration: none;
        opacity: 0.88;
    }
}

@media (max-width: 380px), (max-height: 700px) {
    body .mobile-menu-nav { margin: 0; }
    body .mobile-menu-link-text { font-size: clamp(2.55rem, 13vw, 3.25rem); }
    body .mobile-menu-brand-name { font-size: 2rem; }
    body .mobile-menu-brand-role { margin-top: 0.7rem; font-size: 1rem; }
    body .mobile-menu-link { min-height: 60px; }
    body .mobile-menu-link + .mobile-menu-link { margin-top: 0.5rem; }
    body .mobile-menu-preferences { gap: 0.75rem; padding-top: 1rem; }
    body .mobile-menu-contact { margin-top: 1rem; }
}
