.header {
  position: sticky;
  z-index: var(--layer-sticky);
  inset-block-start: 0;
  border-block-end: 1px solid var(--border-standard);
  background: color-mix(in srgb, var(--surface-primary) 94%, transparent);
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(var(--space-3));
}

.inner {
  display: grid;
  min-block-size: var(--header-min-block-size);
  inline-size: min(100%, var(--container-wide));
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  min-block-size: var(--size-touch-min);
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.mark {
  inline-size: 36px;
  block-size: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}


.navigation ul,
.drawerNavigation ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navigation ul {
  justify-content: center;
  gap: var(--space-1);
}

.navigation a,
.drawerNavigation a {
  display: inline-flex;
  min-block-size: var(--size-touch-min);
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.navigation a {
  padding-inline: var(--space-3);
}

.navigation a:hover,
.navigation a[aria-current],
.drawerNavigation a:hover,
.drawerNavigation a[aria-current] {
  background: var(--surface-muted);
  color: var(--interactive-primary);
}

.desktopControls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.actionDisabled,
.conversionDisabled {
  display: inline-flex;
  min-block-size: var(--size-touch-min);
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  background: var(--control-disabled-surface);
  color: var(--control-disabled-text);
  font-weight: 700;
  opacity: var(--opacity-disabled);
  white-space: nowrap;
}

.actionLink {
  display: inline-flex;
  min-block-size: var(--size-touch-min);
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding-block: var(--space-2);
  padding-inline: var(--space-3);
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.actionLink:hover {
  background: var(--interactive-primary);
  color: var(--text-inverse);
  border-color: var(--interactive-primary);
}

.conversionDisabled {
  border-color: var(--interactive-conversion);
}

.mobileActions,
.mobileNavigation {
  display: none;
}

.menuButton,
.closeButton {
  display: inline-grid;
  min-inline-size: var(--size-touch-min);
  min-block-size: var(--size-touch-min);
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.menuIcon {
  display: grid;
  inline-size: var(--space-5);
  gap: var(--space-1);
}

.menuIcon span {
  display: block;
  block-size: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.drawer {
  inline-size: min(88vw, 384px);
  max-inline-size: none;
  block-size: 100dvh;
  max-block-size: none;
  margin-block: 0;
  margin-inline: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
}

html[dir='rtl'] .drawer {
  margin-inline: auto 0;
}

.drawer::backdrop {
  background: var(--overlay-scrim);
}

.drawerPanel {
  display: flex;
  block-size: 100%;
  flex-direction: column;
  gap: var(--space-6);
  overflow-y: auto;
  padding: var(--space-5);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-overlay);
}

.drawerHeader {
  display: flex;
  min-block-size: var(--size-touch-min);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.closeButton {
  font-size: var(--type-heading-3-size);
  line-height: 1;
}

.drawerNavigation ul {
  flex-direction: column;
  gap: var(--space-1);
}

.drawerNavigation a {
  inline-size: 100%;
  padding-inline: var(--space-3);
}

.drawerControls,
.drawerActions {
  display: grid;
  gap: var(--space-4);
}

.drawerActions {
  margin-block-start: auto;
}

/*
 * Preserve the full navigation on laptop and tablet landscape widths.
 * Only the secondary controls collapse into the menu until the viewport
 * becomes too narrow for the five primary destinations.
 */
@media (min-width: 900px) and (max-width: 1279px) {
  .brandName {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .desktopControls {
    display: none;
  }

  .mobileActions,
  .mobileNavigation {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }
}

@media (max-width: 899px) {
  .inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .desktopNavigation,
  .desktopControls {
    display: none;
  }

  .mobileActions,
  .mobileNavigation {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }
}

@media (max-width: 559px) {
  .brandName {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mobileActions > .conversionDisabled {
    display: none;
  }
}

@media (forced-colors: active) {
  .header {
    backdrop-filter: none;
  }

  .mark,
  .actionDisabled,
  .conversionDisabled,
  .menuButton,
  .closeButton {
    border: 1px solid CanvasText;
  }
}

@media (max-width: 559px) {
  .mobileDemoTrigger {
    display: none;
  }
}
