.app-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.app-header-inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(28px, 3.4vw, 48px);
  min-height: 96px;
  max-width: 1440px;
  margin-inline: auto;
  padding: 18px 40px;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.app-header .wordmark {
  gap: 10px;
  min-height: 44px;
  white-space: nowrap;
}

.app-header .wordmark > span:first-of-type {
  font: 600 2.75rem/1 var(--serif);
  letter-spacing: -.075em;
}

.app-header .brand-leaf {
  width: 26px;
  height: 32px;
  margin: 0 2px 0 0;
}

.app-header-label {
  flex: none;
  border-left: 1px solid var(--border);
  padding-left: 20px;
  color: var(--muted);
  font: 500 .625rem/1.7 var(--sans);
  letter-spacing: .15em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-header-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: clamp(24px, 3vw, 40px);
  min-width: 0;
}

.app-header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2.2vw, 32px);
  min-width: 0;
}

.app-header-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
  font: 500 .8125rem/1.5 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms var(--ease);
}

.app-header-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--gold-dark);
  opacity: 0;
  content: "";
  transition: opacity 180ms var(--ease);
}

.app-header-nav a:hover,
.app-header-nav a[aria-current="page"] {
  color: var(--ink);
}

.app-header-nav a[aria-current="page"]::after {
  opacity: 1;
}

.app-header-account {
  display: flex;
  align-items: center;
  gap: 20px;
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.app-header-name {
  max-width: 160px;
  color: var(--muted);
  font: 400 .75rem/1.5 var(--sans);
  overflow-wrap: anywhere;
}

.app-header-account form {
  margin: 0;
}

.app-header-logout {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 0;
  color: var(--ink);
  font: 500 .75rem/1.5 var(--sans);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--input-border);
  cursor: pointer;
  transition: color 180ms var(--ease);
}

.app-header-logout:hover {
  color: var(--gold-dark);
}

.app-header-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--ink);
  font: 500 .8125rem/1.5 var(--sans);
  cursor: pointer;
}

.app-header-toggle:hover {
  background: var(--surface-soft);
}

.app-header-toggle svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.app-header-close-icon,
.app-header-toggle[aria-expanded="true"] .app-header-menu-icon {
  display: none;
}

.app-header-toggle[aria-expanded="true"] .app-header-close-icon {
  display: block;
}

.app-header-note {
  justify-self: end;
  color: var(--muted);
  font: 500 .625rem/1.6 var(--sans);
  letter-spacing: .13em;
  text-align: right;
}

.app-header :is(a, button):focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 5px;
}

@media (min-width: 861px) and (max-width: 1099px) {
  .app-header-inner {
    min-height: 88px;
    column-gap: 28px;
    padding-inline: 28px;
  }

  .app-header-label,
  .app-header-name {
    display: none;
  }

  .app-header-navigation {
    gap: 24px;
  }

  .app-header-nav {
    gap: 24px;
  }

  .app-header-account {
    padding-left: 20px;
  }
}

@media (max-width: 860px) {
  .app-header-inner {
    min-height: 80px;
    column-gap: 20px;
    padding: 14px 24px;
  }

  .app-header .wordmark > span:first-of-type {
    font-size: 2.375rem;
  }

  .app-header .brand-leaf {
    width: 23px;
    height: 28px;
  }

  .app-header-label,
  .app-header-note {
    display: none;
  }

  .app-header-navigation {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
  }

  .app-header[data-nav-ready] .app-header-navigation {
    display: none;
  }

  .app-header[data-menu-open] .app-header-navigation {
    display: grid;
  }

  .app-header[data-nav-ready] .app-header-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .app-header-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 4px 24px;
  }

  .app-header-nav a {
    justify-content: flex-start;
    min-height: 48px;
    padding-block: 10px;
    white-space: normal;
  }

  .app-header-account {
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--border);
    border-left: 0;
    padding: 8px 0 0;
  }

  .app-header-name {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .app-header-inner {
    min-height: 76px;
    padding: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-header * {
    transition: none;
  }
}
