nexus-header {
  display: block;
  height: 72px;
}

nexus-header[current="home"] {
  height: 0;
}

.nd-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid transparent;
  background: rgba(246, 247, 249, .76);
  backdrop-filter: blur(20px);
  transition: border-color .2s ease, background .2s ease;
}

.nd-header.scrolled {
  border-color: var(--border);
  background: rgba(246, 247, 249, .94);
}

.nd-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 720;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.nd-brand img {
  width: 30px;
  height: 30px;
}

.nd-desktop-nav {
  display: flex;
  align-items: center;
  gap: 27px;
  margin-left: auto;
}

.nd-desktop-nav a,
.nd-mobile-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
  transition: color .15s ease, background .15s ease;
}

.nd-desktop-nav a:hover,
.nd-desktop-nav a[aria-current="page"],
.nd-mobile-nav a:hover,
.nd-mobile-nav a[aria-current="page"] {
  color: var(--fg);
}
.nd-desktop-nav a[aria-current="page"],
.nd-mobile-nav a[aria-current="page"] {
  font-weight: 650;
}

.nd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nd-language-picker {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 3px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.nd-language-picker:hover {
  background: var(--surface-muted);
  color: var(--fg);
}

.nd-language-picker > svg:first-child {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nd-language-picker select {
  width: 30px;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 560;
}

.nd-language-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: .55;
}

.nd-cta,
.nd-mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 650;
}

.nd-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nd-menu-button span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: currentColor;
  transition: transform .2s ease, top .2s ease;
}

.nd-menu-button span:first-child { top: 15px; }
.nd-menu-button span:last-child { top: 23px; }
.nd-menu-button.open span:first-child { top: 19px; transform: rotate(45deg); }
.nd-menu-button.open span:last-child { top: 19px; transform: rotate(-45deg); }

.nd-mobile-nav {
  display: none;
}

@media (max-width: 1020px) {
  .nd-desktop-nav { display: none; }
  .nd-actions { margin-left: auto; }
  .nd-menu-button { display: block; }

  .nd-mobile-nav {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    display: grid;
    gap: 1px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: .18s ease;
  }

  .nd-mobile-nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nd-mobile-nav a {
    padding: 12px 13px;
    border-radius: 8px;
  }

  .nd-mobile-nav a:hover {
    background: var(--surface-muted);
  }

  .nd-mobile-cta {
    margin-top: 6px;
    color: var(--bg) !important;
  }
}

@media (max-width: 760px) {
  nexus-header { height: 64px; }
  nexus-header[current="home"] { height: 0; }

  .nd-header {
    height: 64px;
    gap: 12px;
    padding: 0 16px;
  }

  .nd-mobile-nav { top: 64px; }
  .nd-cta { display: none; }
  .nd-language-picker { min-height: 34px; padding: 0 2px; }
}

@media (prefers-color-scheme: dark) {
  .nd-header { background: rgba(17, 19, 23, .78); }
  .nd-header.scrolled { background: rgba(17, 19, 23, .94); }
}
