/* ============================================================================
   KIT · CHROME — the sticky top navigation shell. Generic: the brand text and
   links are passed in by the app (see navbar() in Rust). Mobile collapse is CSS.
   ========================================================================= */

/* Sticky, frosted top bar shared by both pages */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-3) var(--space-6);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
}
.topbar__brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-weight: var(--weight-bold); color: var(--text); text-decoration: none;
  letter-spacing: var(--tracking-tight);
}
.topbar__logo { color: var(--accent-text); font-size: var(--text-lg); }
.topbar__links { display: flex; gap: var(--space-1); }
.topbar__link {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-2);
  color: var(--text-muted); text-decoration: none;
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  transition: background var(--transition), color var(--transition);
}
.topbar__link:hover { background: var(--hover-tint); color: var(--text); }
.topbar__link--active { background: var(--accent-soft); color: var(--accent-text); }
[data-mono] .topbar__link--active { background: var(--accent); color: var(--on-accent); }
.topbar__controls { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
/* The links + controls live in one flex strip on desktop; the burger is hidden. */
.topbar__menu { display: flex; align-items: center; gap: var(--space-5); flex: 1; }
.topbar__burger {
  display: none; place-items: center; margin-left: auto;
  width: 2.25rem; height: 2.25rem; padding: 0; border: none; border-radius: var(--radius-2);
  background: transparent; color: var(--text); cursor: pointer;
  transition: background var(--transition);
}
.topbar__burger:hover { background: var(--hover-tint); }
.topbar__burger svg { width: 1.4rem; height: 1.4rem; }

/* Mobile: collapse links + controls behind the burger into a dropdown panel.
   Anchored to the (positioned) sticky bar, so it overlays content rather than
   pushing it down. Fixes the horizontal overflow the single flex row caused. */
@media (max-width: 720px) {
  .topbar__burger { display: grid; }
  .topbar__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: var(--space-4); flex: none;
    padding: var(--space-4) var(--space-6);
    background: var(--surface); box-shadow: var(--shadow-3);
    display: none;
  }
  .topbar__menu.is-open { display: flex; }
  .topbar__links { flex-direction: column; gap: var(--space-1); }
  .topbar__link { padding: var(--space-3); }
  .topbar__controls { margin-left: 0; justify-content: space-between; }
}
