/* ===== v2026 · HUD chrome — top bar, menu, stats, hero, bottom, layers ===== */

/* ===== HUD: shared ===== */
.hud {
    position: fixed;
    z-index: 30;
    font-family: var(--font-mono);
    pointer-events: auto;
}

/* corner clip helper (cut top-right) */
.hud-clip {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

/* ===== HUD top bar ===== */
.hud-top {
    top: 0; left: 0; right: 0;
    padding: 16px var(--pad);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14.5px; letter-spacing: 0.06em;
    background: linear-gradient(180deg, rgba(3,6,15,0.92), rgba(3,6,15,0));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hud-brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
    color: var(--accent);
    font-size: 16px;
    text-shadow: 0 0 12px var(--accent);
    transform: translateY(-1px);
}
.brand-name { color: var(--fg); font-weight: 600; font-size: 15px; letter-spacing: 0.10em; }
.brand-sep  { color: var(--fg-mute); }
.brand-role { color: var(--accent); font-size: 14.5px; letter-spacing: 0.12em; }
.hud-meta   { display: inline-flex; align-items: center; gap: 12px; color: var(--fg-dim); font-size: 14.5px; }
.hud-clock  { color: var(--fg); font-variant-numeric: tabular-nums; }
.hud-sep    { color: var(--fg-mute); }
.hud-status { display: inline-flex; align-items: center; gap: 10px; color: var(--accent-soft); }

/* Language picker — two flag chips right of SYSTEM ONLINE.
   Visual treatment matches .layer-btn: dim by default, lit when active. */
.lang-group {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 6px;
}
.lang-btn {
    appearance: none;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.lang-btn:hover {
    opacity: 0.85;
    border-color: rgba(111, 214, 255, 0.3);
}
.lang-btn.active {
    opacity: 1;
    border-color: rgba(111, 214, 255, 0.28);
    background: rgba(255, 255, 255, 0.02);
}
.lang-flag {
    font-size: 19px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.45));
}
.lang-btn.active .lang-flag {
    filter: drop-shadow(0 0 6px rgba(111, 214, 255, 0.45));
}
.dot-pulse {
    width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    100% { box-shadow: 0 0 0 12px rgba(74, 222, 128, 0); }
}

/* ===== HUD menu (left) — bottom-anchored, aligns with the operator card /
   bottom-HUD baseline like the LAYERS card on the right edge. */
.hud-menu {
    left: var(--pad);
    top: auto;
    bottom: 56px;
    transform: none;
    width: 252px;
    padding: 16px;
    background: var(--hud-bg);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(111, 214, 255, 0.08),
        0 18px 50px rgba(3, 8, 30, 0.6),
        0 0 32px rgba(42, 92, 255, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 14px;
}
.menu-head {
    color: var(--accent);
    font-size: 11.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(111, 214, 255, 0.22);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}
.menu-head > span:first-child { flex: 1 1 auto; }

/* Toggle button (collapses .hud-menu / .hud-layers to header-only) */
.hud-toggle {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(111, 214, 255, 0.22);
    color: var(--accent);
    width: 22px; height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}
.hud-toggle:hover { background: rgba(111, 214, 255, 0.08); border-color: var(--accent); opacity: 1; }

/* ---- Collapse animation (hud-menu + hud-layers) -------------------------
   max-height transition gives a soft accordion feel; opacity + transform
   add a subtle slide-in. Panels animate their own width/padding too so the
   header chip shrinks gracefully. */
.hud-menu,
.hud-layers {
    transition:
        width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.3s ease,
        gap 0.3s ease;
    will-change: width, padding;
}

.menu-list,
.menu-foot,
.hud-layers > .layer-btn {
    overflow: hidden;
    transform-origin: top;
    transition:
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity   0.25s ease,
        margin    0.3s ease,
        padding   0.3s ease,
        transform 0.3s ease,
        border-width 0.25s ease;
}

/* Expanded baseline — generous max-heights so content never clips. */
.menu-list                 { max-height: 800px; opacity: 1; }
.menu-foot                 { max-height: 80px;  opacity: 1; }
.hud-layers > .layer-btn   { max-height: 60px;  opacity: 1; }

.menu-head,
.layers-head {
    transition:
        border-color 0.25s ease,
        padding 0.25s ease,
        margin 0.25s ease;
}

/* Collapsed state — header stays, body folds away. */
.hud-menu.collapsed .menu-list,
.hud-menu.collapsed .menu-foot,
.hud-layers.collapsed > .layer-btn {
    max-height: 0;
    min-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.hud-menu.collapsed .menu-head,
.hud-layers.collapsed .layers-head {
    border-bottom-color: transparent;
    padding-bottom: 0;
    margin-bottom: 0;
}

.hud-menu.collapsed {
    width: auto;
    min-width: 160px;
    padding: 10px 14px;
}
.hud-layers.collapsed {
    width: auto;
    min-width: 140px;
    padding: 10px 14px;
    gap: 0;
}
.menu-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.menu-btn {
    appearance: none;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-dim);
    font-family: var(--font-mono);
    font-size: 15px;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    display: inline-flex; align-items: center; gap: 12px;
}
.menu-btn span { color: var(--accent); font-size: 12.5px; opacity: 0.7; }
.menu-btn-ext  { text-decoration: none; justify-content: flex-start; }
.menu-btn-ext .menu-ext {
    margin-left: auto;
    color: var(--accent);
    opacity: 0.55;
    font-size: 12.5px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-btn-ext:hover .menu-ext { opacity: 1; transform: translate(2px, -2px); }
.menu-btn:hover {
    color: var(--fg);
    background: rgba(111, 214, 255, 0.06);
    border-color: rgba(111, 214, 255, 0.22);
}
.menu-btn.active {
    color: var(--fg);
    background: rgba(111, 214, 255, 0.12);
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(111, 214, 255, 0.18) inset;
}
.menu-btn.active span { color: var(--accent); opacity: 1; }
.menu-foot {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(111, 214, 255, 0.22);
    color: var(--fg-mute);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: right;
}

/* ===== ☰ MENU fab — phones/tablets only; desktop never shows it.
   Styled in responsive.css inside the ≤900 block. ===== */
.menu-fab { display: none; }

/* ===== HUD stats (hidden — kept in DOM for JS refs only) ===== */
.hud-stats { display: none !important; }
.hud-stats > div { display: flex; align-items: baseline; gap: 8px; }
.stat-k {
    color: var(--fg-mute);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 10px;
}
.stat-v {
    color: var(--fg);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(111, 214, 255, 0.32);
}

/* ===== Operator card (idle plate, bottom-center, discreet) ===== */
.hud-hero {
    left: 50%;
    bottom: 52px;
    transform: translate(-50%, 0);
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(7, 11, 24, 0.75);
    border: 1px solid var(--border-2);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 0 0 1px rgba(111, 214, 255, 0.08),
        0 14px 32px rgba(3, 8, 30, 0.55);
    transition: opacity 0.4s ease, transform 0.4s ease;
    max-width: min(740px, 80vw);
    white-space: nowrap;
}
.hud-hero.hidden {
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
}
.op-bar {
    width: 2px; height: 24px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    flex: 0 0 auto;
}
.op-body {
    display: flex; flex-direction: column; gap: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
}
.op-row1, .op-row2 {
    display: inline-flex; align-items: center; gap: 8px;
}
.op-eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid rgba(111, 214, 255, 0.32);
    border-radius: 3px;
}
.op-name {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--fg);
    text-transform: uppercase;
}
.op-role { color: var(--fg-dim); letter-spacing: 0.08em; }
.op-tag  { color: var(--accent-soft); letter-spacing: 0.14em; font-size: 10px; text-transform: uppercase; }
.op-sep  { color: var(--fg-mute); }
.op-hint { color: var(--fg-mute); font-size: 10.5px; letter-spacing: 0.04em; }

/* ===== HUD bottom ===== */
.hud-bottom {
    bottom: 0; left: 0; right: 0;
    padding: 10px var(--pad);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; letter-spacing: 0.06em;
    color: var(--fg-mute);
    background: linear-gradient(0deg, rgba(3,6,15,0.92), rgba(3,6,15,0));
    border-top: 1px solid var(--border);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hud-bottom .hud-controls { text-align: center; }
.hud-controls { color: var(--fg-dim); }
.hud-tag      { color: var(--accent); opacity: 0.55; text-transform: lowercase; }

/* ===== HUD layers (toggle pills, right side — mirrors .hud-menu on the left:
   bottom-anchored at the same baseline so the two side panels line up. ===== */
.hud-layers {
    top: auto;
    bottom: 56px;
    right: var(--pad);
    width: 232px;
    padding: 14px 16px;
    background: var(--hud-bg);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(111, 214, 255, 0.08),
        0 18px 50px rgba(3, 8, 30, 0.6),
        0 0 32px rgba(42, 92, 255, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hud-layers header,
.layers-head {
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(111, 214, 255, 0.22);
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}
.layers-head > span:first-child { flex: 1 1 auto; }
.layer-btn {
    appearance: none;
    display: inline-flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}
/* Rows look identical at rest — same dot color, same label color. Only the
   selection state (on) lights the row up with a border + subtle background. */
.layer-btn .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--lc);
    box-shadow: 0 0 10px var(--lc);
    opacity: 1;
    transition: box-shadow 0.2s ease;
}
.layer-btn:hover { border-color: rgba(111, 214, 255, 0.3); }
.layer-btn.on {
    color: var(--fg);
    border-color: rgba(111, 214, 255, 0.45);
    background: rgba(111, 214, 255, 0.06);
}
.layer-btn.on .dot { box-shadow: 0 0 16px var(--lc); }

/* ===== Desktop (>900): MISSIONS becomes a horizontal bar in the header zone,
   left-aligned under the brand name (not a centred float) — elegant pill rail
   with a drop-in entrance. Scoped to min-width:901 so the mobile drawer
   (responsive.css) is untouched. */
@media (min-width: 901px) {
    /* clean inline nav directly under the brand name — no card chrome */
    .hud-menu {
        left: calc(var(--pad) + 21px);          /* container starts at the brand-name x */
        right: auto;
        top: calc(var(--hud-top-h) - 12px);     /* hug the brand name */
        bottom: auto;
        transform: none;
        width: max-content;
        max-width: calc(100vw - var(--pad) * 2 - 28px);   /* full header width — fits all 9 on one line */
        padding: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        border: 0;
        border-radius: 0;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        animation: missionsDrop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
        font-size: 13px;
    }

    /* no MISSIONS label / toggle / footer in the header nav */
    .hud-menu .menu-head,
    .hud-menu .hud-toggle,
    .hud-menu .menu-foot { display: none; }

    /* items in one row, left-aligned, with "·" separators */
    .hud-menu .menu-list {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        max-height: none;
    }
    .hud-menu .menu-list li { display: inline-flex; align-items: center; }
    .hud-menu .menu-list li:first-child .menu-btn { padding-left: 0; }  /* "about" text flush under "ANDREBASSI" */
    .hud-menu .menu-list li:not(:last-child)::after {
        content: "·";
        color: var(--fg-mute);
        margin: 0 1px;
        opacity: 0.7;
    }
    .hud-menu .menu-btn {
        width: auto;
        padding: 4px 7px;
        gap: 5px;
        border: 0;
        border-radius: 5px;
        font-size: 12px;
        letter-spacing: 0.02em;
        white-space: nowrap;
        background: none;
        color: #cfd6ea;                          /* brighter than --fg-dim */
        animation: missionsPill 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .hud-menu .menu-btn > span:first-child { display: none; }   /* drop NN badge to fit 1 line */
    .hud-menu .menu-btn-ext .menu-ext { display: inline; margin-left: 2px; font-size: 10px; }
    .hud-menu .menu-btn:hover {
        color: var(--fg);
        transform: translateY(-1px);
        background: rgba(111, 214, 255, 0.10);
    }
    .hud-menu .menu-btn.active { color: var(--accent); background: rgba(111, 214, 255, 0.12); }

    /* staggered entrance per pill */
    .hud-menu .menu-list li:nth-child(1) .menu-btn { animation-delay: 0.18s; }
    .hud-menu .menu-list li:nth-child(2) .menu-btn { animation-delay: 0.22s; }
    .hud-menu .menu-list li:nth-child(3) .menu-btn { animation-delay: 0.26s; }
    .hud-menu .menu-list li:nth-child(4) .menu-btn { animation-delay: 0.30s; }
    .hud-menu .menu-list li:nth-child(5) .menu-btn { animation-delay: 0.34s; }
    .hud-menu .menu-list li:nth-child(6) .menu-btn { animation-delay: 0.38s; }
    .hud-menu .menu-list li:nth-child(7) .menu-btn { animation-delay: 0.42s; }
    .hud-menu .menu-list li:nth-child(8) .menu-btn { animation-delay: 0.46s; }
    .hud-menu .menu-list li:nth-child(9) .menu-btn { animation-delay: 0.50s; }
}

@keyframes missionsDrop {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes missionsPill {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
