.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background var(--dur-base) var(--ease-out-soft),
    border-color var(--dur-base) var(--ease-out-soft),
    backdrop-filter var(--dur-base) var(--ease-out-soft),
    box-shadow var(--dur-base) var(--ease-out-soft);
}

.navbar-scrolled,
.navbar-solid {
  background: var(--color-page-glass);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--color-gray);
  box-shadow: 0 8px 24px -20px var(--color-shadow-soft);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding-top: 16px;
  padding-bottom: 16px;
}

.navbar-logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--type-logo-nav-family);
  font-style: var(--type-logo-nav-style);
  font-size: var(--type-logo-nav-size);
  line-height: var(--type-logo-nav-height);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
}

.navbar-logo-primary {
  font-weight: var(--font-weight-bold);
  color: var(--color-ink);
}

.navbar-logo-secondary {
  font-weight: var(--font-weight-thin);
  color: var(--color-magenta-mist);
}

.navbar-logo-image {
  display: block;
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.navbar-links {
  display: none;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-link {
  font-family: var(--type-nav-family);
  font-weight: var(--type-nav-weight);
  font-style: var(--type-nav-style);
  font-size: var(--type-nav-size);
  line-height: var(--type-nav-height);
  color: var(--color-muted);
  transition: color var(--dur-base) var(--ease-out-soft);
}

.navbar-link:hover,
.navbar-link-active {
  color: var(--color-magenta);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-theme {
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
}

.navbar-theme-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 68px;
  height: 36px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--color-gray);
  background: var(--color-charcoal);
  box-shadow: inset 0 1px 2px var(--color-shadow-soft);
}

.navbar-theme-option {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--color-muted);
  transition: color var(--dur-base) var(--ease-out-soft);
}

.navbar-theme-svg {
  width: 16px;
  height: 16px;
}

.navbar-theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--gradient-magenta);
  box-shadow: 0 8px 18px -10px var(--color-shadow-lift);
  transition: transform var(--dur-base) var(--ease-out-soft);
  z-index: 0;
}

[data-theme="light"] .navbar-theme-option-light,
:root:not([data-theme="dark"]) .navbar-theme-option-light {
  color: var(--color-white);
}

[data-theme="dark"] .navbar-theme-knob {
  transform: translateX(32px);
}

[data-theme="dark"] .navbar-theme-option-dark {
  color: var(--color-white);
}

[data-theme="dark"] .navbar-theme-option-light {
  color: var(--color-muted);
}

.navbar-theme:hover .navbar-theme-track {
  border-color: var(--color-magenta-mist);
}

.navbar-theme:focus-visible {
  outline: 2px solid var(--color-magenta);
  outline-offset: 3px;
  border-radius: 999px;
}

/* Scoped to .navbar deliberately: the element also carries .button-primary, and
   button.css loads later, so an unscoped rule loses the tie on display and the
   CTA reappears on phones — where it wraps to two lines and grows the header.
   The drawer carries its own "Let's Talk", so nothing is lost here. */
.navbar .navbar-cta {
  display: none;
}

.navbar-menu {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--color-gray);
  background: var(--color-charcoal);
  color: var(--color-ink);
  display: grid;
  place-items: center;
  font-family: var(--type-ui-small-family);
  font-weight: var(--type-ui-small-weight);
  font-style: var(--type-ui-small-style);
  font-size: var(--type-ui-small-size);
  line-height: var(--type-ui-small-height);
}

.navbar-drawer {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--color-gray);
  background: var(--color-charcoal);
}

.navbar-drawer.navbar-drawer-open {
  display: flex;
}

.navbar-drawer .navbar-link {
  font-family: var(--type-nav-family);
  font-weight: var(--type-nav-weight);
  font-style: var(--type-nav-style);
  font-size: var(--type-nav-size);
  line-height: var(--type-nav-height);
}

@media (min-width: 768px) {
  .navbar-links {
    display: flex;
  }

  .navbar .navbar-cta {
    display: inline-flex;
  }

  .navbar-menu {
    display: none;
  }

  .navbar-drawer {
    display: none !important;
  }
}
