/* Shared mobile top bar — life + craft (keep quiet, not tacky) */
@keyframes navDotBreath {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.92); }
}
@keyframes navLivePulse {
    50% { opacity: 0.35; }
}

@media (max-width: 1000px) {
    :root { --mobile-menu-nav-offset: 58px; }

    .top-nav {
        padding: 0 5vw;
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(58px + env(safe-area-inset-top, 0px));
        background:
            linear-gradient(180deg, rgba(8, 8, 8, 0.92) 0%, rgba(5, 5, 5, 0.78) 100%);
        border-bottom-color: rgba(255, 255, 255, 0.08);
        box-shadow:
            inset 0 -1px 0 rgba(230, 32, 32, 0.18),
            0 12px 28px rgba(0, 0, 0, 0.28);
        overflow: hidden;
    }
    [data-theme="light"] .top-nav {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 250, 250, 0.9) 100%);
        border-bottom-color: rgba(0, 0, 0, 0.08);
        box-shadow:
            inset 0 -1px 0 rgba(230, 32, 32, 0.14),
            0 10px 24px rgba(0, 0, 0, 0.05);
    }
    .top-nav.scrolled {
        height: calc(52px + env(safe-area-inset-top, 0px));
        background:
            linear-gradient(180deg, rgba(6, 6, 6, 0.96) 0%, rgba(4, 4, 4, 0.9) 100%);
        box-shadow:
            inset 0 -1px 0 rgba(230, 32, 32, 0.28),
            0 14px 32px rgba(0, 0, 0, 0.4);
    }
    [data-theme="light"] .top-nav.scrolled {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 248, 248, 0.94) 100%);
        box-shadow:
            inset 0 -1px 0 rgba(230, 32, 32, 0.2),
            0 12px 28px rgba(0, 0, 0, 0.07);
    }

    .top-nav::before {
        content: '';
        position: absolute;
        left: -8%; top: -40%;
        width: 42%; height: 160%;
        pointer-events: none; z-index: 0;
        background: radial-gradient(ellipse at center, rgba(230, 32, 32, 0.16) 0%, transparent 68%);
        opacity: 0.85;
    }
    [data-theme="light"] .top-nav::before {
        background: radial-gradient(ellipse at center, rgba(230, 32, 32, 0.1) 0%, transparent 68%);
    }
    .top-nav::after {
        content: '';
        position: absolute;
        left: 5vw; right: 5vw; bottom: 0; height: 1px;
        pointer-events: none; z-index: 2;
        background: linear-gradient(90deg,
            var(--brand-red, #e62020) 0%,
            rgba(230, 32, 32, 0.35) 22%,
            rgba(255, 255, 255, 0.12) 55%,
            transparent 100%);
        opacity: 0.9;
    }
    [data-theme="light"] .top-nav::after {
        background: linear-gradient(90deg,
            var(--brand-red, #e62020) 0%,
            rgba(230, 32, 32, 0.28) 24%,
            rgba(0, 0, 0, 0.1) 58%,
            transparent 100%);
    }

    .nav-links { display: none; }
    .nav-logo-wrap,
    .nav-actions {
        position: relative;
        z-index: 1;
    }
    .nav-logo-wrap {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .nav-logo-wrap::before {
        content: '';
        width: 2px; height: 16px;
        background: var(--brand-red, #e62020);
        box-shadow: 0 0 10px rgba(230, 32, 32, 0.45);
        flex: 0 0 auto;
        opacity: 0.9;
    }
    .nav-logo {
        font-size: 1.15rem;
        letter-spacing: 0.04em;
        line-height: 1;
    }
    .nav-logo span {
        display: inline-block;
        animation: navDotBreath 2.8s ease-in-out infinite;
    }

    .nav-actions { gap: 7px; }
    .theme-btn {
        width: 36px; height: 36px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-color, #fff);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
    }
    [data-theme="light"] .theme-btn {
        border-color: rgba(0, 0, 0, 0.12);
        background: rgba(255, 255, 255, 0.75);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    .theme-btn:hover,
    .theme-btn:active {
        color: var(--brand-red, #e62020);
        border-color: rgba(230, 32, 32, 0.45);
        transform: none;
        background: rgba(230, 32, 32, 0.08);
    }

    .nav-cta {
        padding: 8px 12px;
        font-size: 0.54rem;
        letter-spacing: 0.12em;
        border-color: rgba(255, 255, 255, 0.16);
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        white-space: nowrap;
    }
    [data-theme="light"] .nav-cta {
        border-color: rgba(0, 0, 0, 0.12);
        background: rgba(255, 255, 255, 0.8);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
    }
    .nav-cta span {
        position: relative;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        animation: none;
    }
    .nav-cta span::before {
        content: '';
        display: block;
        width: 5px; height: 5px;
        background: var(--brand-red, #e62020);
        border-radius: 50%;
        box-shadow: 0 0 8px var(--brand-red, #e62020);
        animation: navLivePulse 1.8s ease-in-out infinite;
        flex: 0 0 auto;
    }

    .nav-toggle {
        display: inline-flex;
        width: 40px; height: 40px;
        border-radius: 8px;
    }
    .nav-toggle-bar:nth-child(1) { top: 13px; left: 10px; width: 18px; }
    .nav-toggle-bar:nth-child(2) { top: 19px; right: 10px; width: 11px; }
    .nav-toggle-bar:nth-child(3) { top: 25px; left: 10px; width: 14px; }
}

@media (max-width: 600px) {
    :root { --mobile-menu-nav-offset: 54px; }
    .top-nav {
        height: calc(54px + env(safe-area-inset-top, 0px));
    }
    .top-nav.scrolled {
        height: calc(48px + env(safe-area-inset-top, 0px));
    }
    .nav-logo { font-size: 1.1rem; }
    .nav-logo-wrap { gap: 8px; }
    .nav-logo-wrap::before { height: 14px; }
    .nav-cta { padding: 8px 11px; font-size: 0.52rem; }
    .nav-toggle { width: 38px; height: 38px; }
    .theme-btn { width: 34px; height: 34px; }
}

@media (max-width: 380px) {
    .nav-cta span { display: none; }
    .nav-cta { padding: 8px 12px; }
    .nav-cta::after {
        content: '↗';
        color: var(--text-color, #fff);
        font-weight: 700;
        position: relative;
        z-index: 1;
    }
    .nav-cta:hover::after { color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-logo span,
    .nav-cta span::before { animation: none !important; }
}
