/* ── Nav ─────────────────────────────────── */
nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.7rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-brand {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.3px;
    color: var(--txt);
    text-decoration: none;
    margin-right: auto;
}

.nav-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

nav a {
    color: var(--dim);
    text-decoration: none;
    font-size: 0.82rem;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
nav a:hover { color: var(--txt); }
nav a.on { color: var(--accent); }

.nav-item-dropdown { position: relative; display: flex; align-items: center; }

/* Bridges the gap between the link and the menu below it so the pointer
   never leaves .nav-item-dropdown's hover area while crossing it — without
   this, moving the mouse from the link toward the menu drops :hover midway
   and the menu closes before it's reached. */
.nav-item-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.5rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.5rem;
    padding: 0.4rem;
    min-width: 160px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px oklch(0 0 0 / 0.35);
    z-index: 20;
}

.nav-item-dropdown:hover .dropdown-menu { display: flex; }
.nav-item-dropdown.open .dropdown-menu { display: flex; }

.dropdown-menu a {
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}
.dropdown-menu a:hover { color: var(--txt); background: var(--line); }
