/* ────────────────────────────────────────────────────────────────────
   Top navigation — Radiant-style solid dark bar
   --------------------------------------------------------------------
   Goals (vs. previous glass version):
   · Solid near-black background (no backdrop-filter, no gradient haze)
   · Sharp edges (≤ 2px radii on sub-controls; bar itself is square)
   · Strong active state: glowing red underline, high text contrast
   · Generous, calm spacing — feels editorial, not crowded

   Tokens used: --nav-bg, --nav-fg(*), --nav-divider, --nav-border,
                --nav-accent, --nav-accent-glow, --header-{height,pad-x},
                --header-link-pad, --c-red(-deep), --t-base, --ease-out,
                --radius-sm
   ──────────────────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding: 0 var(--header-pad-x);

  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-divider);
  color: var(--nav-fg-active);
}

/* Suppress the soft hairline overlay carried over from base.css —
   the solid border-bottom above already does the job, cleaner. */
.header::after { display: none; }

/* ─── Logo ─────────────────────────────────────────────────────── */

.header__logo {
  display: inline-flex;
  align-items: center;
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: -0.014em;
  color: var(--nav-fg-active);
  user-select: none;
}

.header__logo::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nav-accent);
  box-shadow: var(--nav-accent-glow);
  margin-right: 12px;
  flex-shrink: 0;
}

/* ─── Nav links ────────────────────────────────────────────────── */

.header__nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;

  /* No segmented background — links sit directly on the bar.
     Override prior glass container styles in case they linger. */
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--nav-fg);
  padding: 0 var(--header-link-pad);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
  transition:
    color var(--t-base) var(--ease-out),
    background-color var(--t-base) var(--ease-out);
}

.header__nav-link:not(.muted):hover {
  color: var(--nav-fg-active);
  background: var(--nav-bg-elevated);
}

.header__nav-link.muted {
  color: var(--nav-fg-muted);
  cursor: default;
}

/* Strong active state — text white + glowing red 2px underline.
   Pseudo is positioned inside the link's padding so the line tracks the
   visible label width, not the full hit area. */
.header__nav-link.active {
  color: var(--nav-fg-active);
  background: transparent;
}

.header__nav-link.active::after {
  content: "";
  position: absolute;
  left: var(--header-link-pad);
  right: var(--header-link-pad);
  bottom: 0;
  height: 2px;
  background: var(--nav-accent);
  border-radius: 1px 1px 0 0;
  box-shadow: var(--nav-accent-glow);
  pointer-events: none;
}

/* Legacy sliding indicator (replaced by per-link underline) */
.header__nav-indicator { display: none; }

/* ─── Actions cluster ─────────────────────────────────────────── */

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--nav-border);
  background: transparent;
  color: var(--nav-fg);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition:
    color var(--t-base) var(--ease-out),
    background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out);
}

.header__icon-btn:hover {
  color: var(--nav-fg-active);
  background: var(--nav-bg-elevated);
  border-color: rgba(255, 255, 255, 0.20);
}

.header__icon-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.header__icon-btn svg { display: block; }

.header__icon-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--nav-accent);
  box-shadow: 0 0 6px rgba(177, 18, 38, 0.7);
}

.header__icon-btn--avatar {
  background: var(--c-red, #b11226);
  color: #fff;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-color: var(--c-red-deep, #7a0c19);
}

.header__icon-btn--avatar:hover {
  background: var(--c-red-soft, #d94a4f);
  border-color: var(--c-red, #b11226);
  color: #fff;
}

/* Legacy decorations from earlier designs — explicitly suppressed */
.header__circle { display: none; }
.header__pill {
  font-size: 0.78rem;
  color: var(--nav-fg);
  border: 1px solid var(--nav-border);
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 960px) {
  .header {
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    padding: 0 16px;
  }
  .header__logo { font-size: 1rem; }
  .header__nav { overflow-x: auto; scrollbar-width: none; }
  .header__nav::-webkit-scrollbar { display: none; }
  .header__nav-link { padding: 0 14px; font-size: 0.84rem; }
}
