/* ============================================
   Site shell — graphite background + keycap nav, shared by every page with
   the main top nav (UX/UI, Motion, Vibes, About, Visitors, Typing) and the
   welcome gate. Loaded after each page's own stylesheet so these rules win.
   ============================================ */
:root {
    --page-bg: #161514;
    --page-surface: #1f1e1c;
    --page-surface-2: #2a2927;
    --page-line: rgba(255, 255, 255, 0.09);
    --page-muted: rgba(255, 255, 255, 0.6);
    --page-accent: #1180f9;
}

body {
    background: var(--page-bg);
}

/* Progressive blur behind the navbar — retinted from navy to the page bg */
.navbar::before {
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--page-bg) 98%, transparent) 0%,
        color-mix(in srgb, var(--page-bg) 78%, transparent) 25%,
        color-mix(in srgb, var(--page-bg) 55%, transparent) 50%,
        color-mix(in srgb, var(--page-bg) 30%, transparent) 75%,
        transparent 100%
    );
}

/* ---- Keyboard nav — each link is a keycap; the current page is the white
   key, and hovered keys dip like they're being pressed. ---- */
.nav-links {
    position: relative;
    gap: 1rem;
}

.nav-link {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 9px 14px 11px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    background: var(--page-surface-2);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
    font-family: 'Space Mono', monospace;
    font-size: var(--text-13);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--page-muted);
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.12s ease, translate 0.12s ease;
}

/* Hover — the key brightens and dips like it's being pressed */
.nav-link:hover {
    background: color-mix(in srgb, var(--page-surface-2) 80%, white 6%);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    color: #fff;
    translate: 0 2px;
}

.nav-link.active {
    background: #fff;
    border-color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
    color: var(--page-bg);
    translate: 0 1px;
}

.nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Page heading kept for screen readers and search; the active key in the nav
   already shows which page this is. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1200px) {
    .nav-link {
        padding: 8px 11px 10px;
        font-size: var(--text-12);
    }
}

@media (max-width: 640px) {
    .mobile-menu {
        background: color-mix(in srgb, var(--page-bg) 96%, transparent);
        gap: 14px;
    }

    /* ---- Mobile menu — same keycaps as the desktop nav, stacked as a
       column of wide keys. Hover/press uses `translate` so it doesn't fight
       the menu's enter/exit `transform` animations. ---- */
    .mobile-menu-link {
        width: min(280px, 76vw);
        padding: 16px 20px 19px;
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 8px;
        background: var(--page-surface-2);
        box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35);
        font-family: 'Space Mono', monospace;
        font-size: var(--text-16);
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        text-align: center;
        color: var(--page-muted);
        -webkit-tap-highlight-color: transparent;
        transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.12s ease, translate 0.12s ease;
    }

    .mobile-menu-link:hover,
    .mobile-menu-link:active {
        background: color-mix(in srgb, var(--page-surface-2) 80%, white 6%);
        box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35);
        color: #fff;
        translate: 0 3px;
    }

    .mobile-menu-link.active {
        background: #fff;
        border-color: #fff;
        box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
        color: var(--page-bg);
        translate: 0 1px;
    }

    .mobile-menu-link:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.8);
        outline-offset: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-link { transition: color 0.2s ease, background-color 0.2s ease; }
}
