/* ================================================================
   HEADER — top nav bar, mobile menu, and the page-switching
   mechanism it controls (see nav.js in this same folder).
   ================================================================ */

/* Floats above scrolling content — solid, not glass, so it reads
   clearly against any content behind it. Background/text use the
   --shell-* tokens (see base.css): white bar with dark text by day,
   dark navy bar with white text by night — the same direction the
   rest of the page flips. */
.topbar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--topbar-height);
  background: var(--shell-bg);
  color: var(--shell-text);
  z-index: 100;
  transition: box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.topbar.is-scrolled { box-shadow: var(--shadow-overlay); }

/* Same fixed accent gradient used between home-page sections (see
   --gradient-divider in shared/base.css) — reads the same in both
   themes, unlike --shell-border. */
.topbar::after {
  content: "";
  position: absolute;
  inset-block-end: -2px;
  inset-inline: 0;
  height: 2px;
  background: var(--gradient-divider);
}

.topbar-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.brand-logo { height: 30px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 4px; }

/* Text destination links (Tiers/Process/Work/About) — distinct from
   the icon-only chat/quote action buttons next to them, since these
   are places to go, not actions to take. */
.nav-link {
  position: relative;
  color: var(--shell-text);
  text-decoration: none;
  font-weight: var(--weight-label);
  font-size: 0.92rem;
  padding-block: 8px;
  padding-inline: 10px;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link.is-active { opacity: 1; }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  inset-block-end: 2px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.mobile-toggle:hover { opacity: 1; }
.mobile-toggle:active { opacity: 0.7; }
.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--shell-text);
  border-radius: 2px;
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    inset-block-start: var(--topbar-height);
    inset-inline: 0;
    background: var(--shell-bg);
    color: var(--shell-text);
    border-block-end: 1px solid var(--shell-border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 4px;
    /* Kept in the layout (not display:none) so it can animate open —
       visibility, not display, is what keeps it out of the tab order
       and un-clickable while closed. */
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .nav-link { padding-block: 12px; }
  .nav-link.is-active::after { inset-block-end: 6px; }
  /* Overlays page content beneath it when open, so — unlike the
     resting cards elsewhere on the page — it earns a real shadow. */
  .nav-links.open {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    box-shadow: var(--shadow-overlay);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .mobile-toggle { display: flex; }

  @media (prefers-reduced-motion: reduce) {
    .nav-links { transition: opacity 0.01s linear, visibility 0s linear; transform: none; }
    .nav-links.open { transition: opacity 0.01s linear; }
  }
}


/* ---------- Page layout ----------
   Home is the only page left in <main> — "Get a Quote" is an
   overlay dialog now (see .quote-overlay in
   features/quote-wizard/quote-wizard.css), not a second view to
   swap to. This just keeps content clear of the fixed top bar. */
main { padding-block-start: var(--topbar-height); }
