/* One navigation component for the full and restricted landing page.
   The original classes/links remain; native details works without scripts. */
.landing-header {
    position: sticky;
    top: max(12px, env(safe-area-inset-top, 0px));
    z-index: 20;
    margin: 16px auto 0;
    width: min(1560px, calc(100% - 32px));
    background: var(--qi-surface);
    border: 1px solid var(--qi-line);
    border-radius: var(--qi-radius-default);
}
.landing-nav {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    min-width: 0;
}
.landing-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; color: var(--qi-text); text-decoration: none; }
.landing-brand:hover { color: var(--qi-text); text-decoration: none; }
.landing-logo, .landing-logo-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; object-fit: contain; filter: none; }
.landing-brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.landing-brand-text strong { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.landing-brand-text em { max-width: 28ch; font-size: 14px; font-style: normal; color: var(--qi-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-navigation { min-width: 0; }
.landing-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-width: 44px; min-height: 44px; padding: 8px 12px;
    color: var(--qi-text); border: 1px solid var(--qi-control-line);
    border-radius: var(--qi-radius-small); cursor: pointer; list-style: none;
    font-size: 14px;
}
.landing-menu-toggle::-webkit-details-marker { display: none; }
.landing-menu-toggle svg { width: 20px; height: 20px; flex-shrink: 0; }
.landing-links { display: flex; flex-wrap: wrap; gap: 4px 16px; min-width: 0; }
.landing-navigation[open] .landing-links {
    position: absolute; inset-inline: 0; top: calc(100% + 8px);
    padding: 16px; border: 1px solid var(--qi-line); border-radius: var(--qi-radius-default);
    background: var(--qi-surface); box-shadow: var(--qi-shadow);
    max-height: min(60svh, 480px); overflow-y: auto;
}
.landing-link {
    display: inline-flex; align-items: center; min-height: 44px;
    padding: 8px; color: var(--qi-muted); font-size: 14px; text-decoration: none;
    overflow-wrap: anywhere; max-width: 100%;
}
.landing-link:hover { color: var(--qi-text); text-decoration: underline; text-underline-offset: 4px; }
.landing-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.landing-actions .landing-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; font-size: 14px; white-space: normal; box-shadow: none; transition: opacity var(--qi-motion-fast) ease; }
.landing-actions .landing-btn:hover { transform: none; opacity: 1; }
.landing-actions .btn-primary { background: var(--brand-action-bg, var(--brand-accent, #6366f1)); color: var(--brand-action-fg, var(--brand-action-ink, #000)); border: 1px solid transparent; --bs-btn-active-bg: var(--brand-action-bg, var(--brand-accent, #6366f1)); --bs-btn-active-color: var(--brand-action-fg, var(--brand-action-ink, #000)); --bs-btn-active-border-color: transparent; --bs-btn-focus-box-shadow: none; }
/* Light surface: the brand's own ink on the first accent tone that carries it at AA
   (app/ui_palette.readable_action_pair). :where() keeps the rule's weight equal to the line above. */
:where(html[data-theme="light"], body.light-mode) .landing-actions .btn-primary { background: var(--brand-action-strong, var(--brand-accent, #6366f1)); color: var(--brand-action-strong-ink, var(--brand-action-ink, #000)); }
.landing-actions .btn-secondary { background: var(--qi-surface); color: var(--qi-text); border: 1px solid var(--qi-control-line); }
@media (min-width: 1440px) {
    .landing-nav { grid-template-columns: auto minmax(0, 1fr) auto; }
    .landing-navigation.is-enhanced .landing-menu-toggle { display: none; }
    .landing-navigation.is-enhanced[open] .landing-links {
        position: static; padding: 0; border: 0; box-shadow: none;
        background: none; max-height: none; overflow: visible; justify-content: center;
    }
}
@media (max-width: 599px) {
    .landing-nav { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; }
    .landing-brand-text em, .landing-menu-toggle span { display: none; }
    .landing-actions { grid-column: 1 / -1; }
    .landing-actions .landing-btn { flex: 1 1 0; }
    .landing-links { flex-direction: column; }
}

/* Bounded shared glass; opaque by default, never on the page/overlay. */
@media screen {
    .landing-header,
    .landing-navigation[open] .landing-links {
        background-color: var(--qi-surface);
        background-image: linear-gradient(160deg, var(--qi-glass-sheen), transparent 58%),
            radial-gradient(ellipse at 12% 0, var(--qi-ambient-glow), transparent 65%);
        box-shadow: var(--qi-glass-shadow);
    }
    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .landing-header,
    .landing-navigation[open] .landing-links {
            background-color: var(--qi-glass-surface);
            backdrop-filter: var(--qi-glass-blur);
            -webkit-backdrop-filter: var(--qi-glass-blur);
        }
    }
}
@media (prefers-reduced-transparency: reduce), print {
    .landing-header,
    .landing-navigation[open] .landing-links {
        background: var(--qi-surface);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }
}
@media (forced-colors: active) {
    .landing-header,
    .landing-navigation[open] .landing-links {
        background: Canvas; color: CanvasText; border-color: CanvasText;
        box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    }
}

/* Enhanced desktop links are part of the header, not a second blurred pane. */
@media (min-width: 1440px) {
    .landing-navigation.is-enhanced[open] .landing-links {
        background: none; box-shadow: none;
        backdrop-filter: none; -webkit-backdrop-filter: none;
    }
}
