/* Stashpeak — shared site styles. Single source of truth for brand tokens, the top nav,
   and the dropdown. Page-specific styles live in each page's own <style>. */

:root {
    --accent: #6750a4;            /* TODO(brand): BRAND.md = #AD46FF — flip here once approved (one place now) */
    --accent-ink: #2b0051;
    --ink: #1c1b1f;
    --muted: #625b71;
    --line: rgba(103, 80, 164, 0.16);
    --nav-glass: rgba(43, 0, 81, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
body { font-family: 'Kumbh Sans', sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }

/* ---------------- Top navigation (shared, absolute overlay on the hero) ---------------- */
.nav {
    position: absolute; left: 50%; transform: translateX(-50%); top: 65px; z-index: 50;
    display: flex; align-items: center; justify-content: center; gap: 24px;
    height: 76px; padding: 0 40px 0 10px;
    border-radius: 167px;
}
/* Frost on a ::before (not on .nav itself) so .nav is NOT a backdrop-root —
   otherwise it would kill the dropdown panel's own backdrop-filter (Chromium). */
.nav::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: var(--nav-glass);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
a.nav-item, a.nav-text, .dropdown-item { text-decoration: none; }

.nav-item { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 17px; border-radius: 80px; }
.nav-brand {
    background: rgba(255, 255, 255, 0.04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2),
        inset 1px 0 0 rgba(255, 255, 255, 0.5),
        inset -1px 0 0 rgba(255, 255, 255, 0.2);
}
.nav-logo { width: 40px; height: 38px; display: block; flex-shrink: 0; }
.nav-text { font-family: 'Kumbh Sans', sans-serif; font-weight: 400; font-size: 22px; color: #fff; white-space: nowrap; flex-shrink: 0; }
.github-icon { width: 26px; height: 26px; display: block; flex-shrink: 0; }

/* dropdown */
.nav-dropdown { position: relative; display: flex; align-items: center; align-self: stretch; }
.nav-dropdown-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    background: none; border: none; cursor: pointer; padding: 0; line-height: 1;
    font-family: 'Kumbh Sans', sans-serif; font-weight: 400; font-size: 22px; color: #fff;
}
.nav-dropdown-toggle .caret { transition: transform .2s ease; opacity: .85; }
.nav-dropdown:hover .caret,
.nav-dropdown:focus-within .caret,
.nav-dropdown.open .caret { transform: rotate(180deg); }
/* wrapper is invisible; its transparent padding-top IS the visual gap AND keeps hover continuous */
.nav-dropdown-menu {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%) translateY(-6px);
    padding-top: 14px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown-panel {
    min-width: 210px; padding: 8px;
    background: var(--nav-glass);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-radius: 18px;
    /* same glass rim as the pill (.nav-brand) + a drop shadow for elevation */
    box-shadow:
        0 14px 34px rgba(43, 0, 81, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2),
        inset 1px 0 0 rgba(255, 255, 255, 0.5),
        inset -1px 0 0 rgba(255, 255, 255, 0.2);
}
.dropdown-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; border-radius: 12px;
    color: #fff; font-size: 18px; font-weight: 400; white-space: nowrap;
}
.dropdown-item:hover { background: rgba(255, 255, 255, 0.10); }
.dropdown-ico { width: 20px; height: 20px; flex-shrink: 0; }

@media (max-width: 768px) {
    .nav { gap: 14px; height: 64px; padding: 0 18px 0 10px; top: 30px; }
    .nav-item { padding: 6px 14px; }
    .nav-text, .nav-dropdown-toggle { font-size: 18px; }
    .nav-logo { width: 32px; height: 31px; }
}
@media (max-width: 430px) {
    .nav { gap: 9px; padding: 0 10px; height: 50px; top: 18px; }
    .nav-item { padding: 6px 10px; }
    .nav-text, .nav-dropdown-toggle { font-size: 15px; }
    .nav-logo { width: 26px; height: 25px; }
    .github-icon { width: 20px; height: 20px; }
}
/* Phones: drop the "Stashpeak" wordmark + "Github" label so the pill never
   exceeds the viewport. Leaves logo (home) + GitHub icon + Projects + Docs. */
@media (max-width: 480px) {
    .nav-brand .nav-text,
    .nav-item:not(.nav-brand) .nav-text { display: none; }
    .nav-brand { padding: 6px; }
    /* Center the dropdown under the whole (viewport-centered) pill instead of
       under the off-center Projects toggle: making .nav-dropdown static lets the
       menu's left:50% resolve against .nav. Works at every phone width. */
    .nav-dropdown { position: static; }
}
