/* Public navigation. Widths are independent of translated content. */
.site-header {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  backdrop-filter: blur(16px);
}
.nav-inner {
  width: min(var(--content-width, 1080px), calc(100% - 2 * var(--gutter)));
  height: 100%;
  margin: auto;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px auto;
  align-items: center;
  gap: 20px;
}
.site-header .brand {
  display: inline-flex;
  justify-self: start;
  align-items: baseline;
  gap: 3px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.header-brand { display: flex; align-items: baseline; gap: 8px; justify-self: start; min-width: 0; }
.brand-maker { color: var(--text); font-size: 12px; line-height: 1.4; white-space: nowrap; }
.brand-maker a { transition: color 160ms ease; text-decoration: none; }
.brand-maker a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 600px) {
  .header-brand { flex-direction: column; align-items: flex-start; gap: 0; }
  .brand-maker { padding-left: 14px; }
}
.desktop-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.nav-dropdown {
  min-width: 0;
}
.nav-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: var(--radius-small);
  padding: 0 10px;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--muted);
  cursor: pointer;
  transition:
    color var(--duration-hover) ease-out,
    background-color var(--duration-hover) ease-out;
}
.nav-dropdown summary::-webkit-details-marker {
  display: none;
}
.nav-dropdown[open] summary {
  color: var(--text);
  background: var(--surface-hover);
}
.nav-dropdown summary:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.mega-panel {
  position: absolute;
  top: 55px;
  right: 0;
  background: var(--surface);
  border: 0;
  z-index: 2;
}
.menu-grid {
  display: grid;
  border-radius: 6px;
}
.menu-grid a {
  display: flex;
  flex-direction: column;
}
.menu-grid strong {
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 20px;
  font-weight: var(--weight-ui);
}
.menu-grid a > span {
  color: var(--muted);
  font-size: var(--text-sm);
  word-break: keep-all;
  overflow-wrap: break-word;
}
.nav-utilities {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-action {
  width: auto;
  white-space: nowrap;
}
.mobile-menu {
  display: none;
}

.nav-direct {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: var(--text-sm);
}
.menu-context {
  color: var(--muted);
  font-size: var(--text-xs);
}

.button.button-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: var(--text-sm);
}
.preferences {
  display: flex;
  gap: var(--space-1);
}
.preference {
  position: relative;
}
.icon-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-small);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  list-style: none;
}
.icon-control::-webkit-details-marker {
  display: none;
}
.icon-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.preference-options {
  position: absolute;
  right: 0;
  top: 46px;
  background: var(--surface);
  z-index: 20;
}
.preference-options :is(button, a) {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
}

/* Compact navigation before the utility controls crowd the wordmark. */

@media (max-width: 900px) {
  .site-header {
    height: 60px;
  }
  .nav-inner {
    width: calc(100% - 2 * var(--gutter));
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
  }
  .site-header .brand {
    font-size: var(--text-base);
    gap: 2px;
  }
  .site-header .brand-symbol {
    width: 1cap;
    height: 1cap;
  }
  .desktop-nav {
    display: none;
  }
  .nav-action {
    display: none;
  }
  .mobile-menu {
    display: block;
  }
  .mobile-menu > summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 34px;
    cursor: pointer;
    list-style: none;
    font-size: var(--text-xs);
    white-space: nowrap;
    color: var(--muted);
  }
  .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu > summary {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Shared navigation and utility surfaces. */
.nav-dropdown {
  position: relative;
}
.nav-dropdown > summary {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-control);
  white-space: nowrap;
  padding-inline: 16px;
}
.nav-direct {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-control);
  white-space: nowrap;
  padding-inline: 16px;
}
.nav-dropdown[open] > summary {
  background: var(--neutral-hover);
  color: var(--text);
}
.nav-dropdown > summary:hover {
  background: var(--neutral-hover);
  color: var(--text);
}
.nav-direct:hover {
  background: var(--neutral-hover);
  color: var(--text);
}
.nav-direct[aria-current="page"] {
  background: var(--neutral-hover);
  color: var(--text);
}
.nav-dropdown .mega-panel {
  top: calc(100% + 8px);
  right: 0;
}
.nav-dropdown .mega-panel::before {
  content: "";
  position: absolute;
  inset: -8px 0 auto;
  height: 8px;
}
.mega-panel {
  width: 360px;
  max-width: calc(100vw - 48px);
  padding: 8px;
  border-radius: var(--radius-popover);
  box-shadow: var(--shadow-popover);
}
.product-panel {
  width: 360px;
  max-width: calc(100vw - 48px);
  padding: 8px;
  border-radius: var(--radius-popover);
  box-shadow: var(--shadow-popover);
}
.resources-panel {
  width: 360px;
  max-width: calc(100vw - 48px);
  padding: 8px;
  border-radius: var(--radius-popover);
  box-shadow: var(--shadow-popover);
}
.menu-grid {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  gap: 2px;
  background: transparent;
}
.product-panel .menu-grid {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  gap: 2px;
  background: transparent;
}
.menu-grid a {
  min-height: 0;
  padding: 12px;
  gap: 4px;
  border-radius: var(--radius-option);
}
.product-panel .menu-grid a {
  min-height: 0;
  padding: 12px;
  gap: 4px;
  border-radius: var(--radius-option);
}
.resources-panel .menu-grid a {
  min-height: 0;
  padding: 12px;
  gap: 4px;
  border-radius: var(--radius-option);
}
.menu-grid a:hover {
  background: var(--neutral-hover);
}
.menu-grid a:focus-visible {
  background: var(--neutral-hover);
}
.menu-grid a > span {
  line-height: 1.5;
}
.menu-context {
  padding: 8px 12px 12px;
}
.floating-preferences {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 30;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.floating-preferences .icon-control {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.preference-options {
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 32px);
  max-height: calc(100svh - 112px);
  overflow-y: auto;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-option);
  background: var(--bg);
  box-shadow: 0 4px 16px var(--shadow);
}
.preference-options :is(button, a) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: var(--radius-small);
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
}
.preference-label {
  flex: 1;
}
.language-preference .preference-options {
  min-width: 144px;
}
.theme-preference .preference-options {
  min-width: 168px;
}
.preference-option-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.preference-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
:is([aria-pressed="true"], [aria-current="page"]) > .preference-check::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 4px 2px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.icon-control:hover {
  background: var(--neutral-hover);
  color: var(--text);
}
.preference[open] > .icon-control {
  background: var(--neutral-hover);
  color: var(--text);
}
.preference-options :is(button, a):is([aria-pressed="true"], [aria-current="page"]) {
  background: transparent;
  color: var(--text);
}
.preference-options :is(button, a):hover {
  background: var(--neutral-hover);
  color: var(--text);
}
.preference-options :is(button, a):focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.cake-control {
  position: relative;
}
.cake-control:disabled {
  opacity: 0.4;
  cursor: default;
}
.cake-control[hidden] {
  display: none;
}
.floating-preferences .cake-count {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.cake-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 50%;
  background: var(--neutral-selected);
  color: var(--text);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.cake-reset-icon {
  display: none;
}
.cake-control[data-reset="true"] .cake-slice-icon {
  display: none;
}
.cake-control[data-reset="true"] .cake-reset-icon {
  display: block;
}
.nav-direct {
  transition:
    color var(--duration-hover) ease-out,
    background-color var(--duration-hover) ease-out;
}
.menu-grid a {
  transition:
    color var(--duration-hover) ease-out,
    background-color var(--duration-hover) ease-out;
}
.icon-control {
  transition:
    color var(--duration-hover) ease-out,
    background-color var(--duration-hover) ease-out;
}
.preference-options :is(button, a) {
  transition:
    color var(--duration-hover) ease-out,
    background-color var(--duration-hover) ease-out;
}
@media (min-width: 901px) and (max-width: 1100px) {
  .nav-inner {
    width: calc(100% - 40px);
    grid-template-columns: minmax(0, 1fr) 354px auto;
    gap: 12px;
  }
  .site-header .brand {
    font-size: 18px;
  }
  .desktop-nav {
    gap: 6px;
  }
  .nav-dropdown > summary {
    padding-inline: 12px;
  }
  .nav-direct {
    padding-inline: 12px;
  }
}
@media (max-width: 760px) {
  .floating-preferences {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown > summary {
    transition: none;
  }
  .nav-direct {
    transition: none;
  }
  .menu-grid a {
    transition: none;
  }
  .icon-control {
    transition: none;
  }
  .preference-options :is(button, a) {
    transition: none;
  }
}

.floating-preferences .preference-options {
  top: auto;
  bottom: calc(100% + 12px);
}

/* Selection persists while hovered; pressing gives a separate tactile state. */
.preference-options :is(button, a):is([aria-pressed="true"], [aria-current="page"]):hover {
  background: var(--neutral-selected);
}
.preference-options :is(button, a):active {
  background: var(--neutral-pressed);
}
.icon-control:active {
  background: var(--neutral-pressed);
}
.nav-dropdown > summary:active {
  background: var(--neutral-pressed);
}
.nav-direct:active {
  background: var(--neutral-pressed);
}
.menu-grid a:active {
  background: var(--neutral-pressed);
}

/* Public discovery: three direct destinations and one deployment conversation. */
.site-header .nav-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 20px; }
.site-header .desktop-nav { display: flex; gap: 4px; }
.site-header .nav-direct { width: auto; padding-inline: 12px; }
.header-utilities { display: flex; align-items: center; gap: 12px; }
.header-utilities .language-preference > summary { width: 64px; gap: 6px; }
.preference > .icon-control { border-radius: var(--radius-control); }
.header-utilities .language-preference > summary,
.footer-settings .theme-preference > summary { height: 36px; }
.language-current { font-size: 12px; line-height: 1; }
.header-utilities .preference-options { top: calc(100% + 6px); }
.floating-preferences:empty,
.floating-preferences:has(.cake-control[hidden]) { display: none; }
.footer-settings .theme-preference > summary { width: auto; gap: 8px; padding-inline: 10px; font-size: var(--text-sm); }
.footer-settings .preference-options { top: auto; bottom: calc(100% + 6px); }
@media (any-pointer: coarse) {
  .preference-options :is(button, a) { min-height: 44px; }
  .header-utilities .language-preference > summary,
  .footer-settings .theme-preference > summary { height: 44px; }
}
@media (max-width: 900px) {
  .site-header .nav-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .site-header .desktop-nav { display: none; }
  .header-utilities { gap: 4px; }
}

/* Language is a direct choice; the home capsule reveals navigation on scroll. */
.header-language, .mobile-dialog-language { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.header-language > svg, .mobile-dialog-language > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.language-segments { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); }
.language-segments a { display: grid; place-items: center; min-width: 34px; min-height: 30px; padding-inline: 8px; border-radius: 999px; font-size: 12px; line-height: 1; text-decoration: none; transition: color 160ms ease, background-color 160ms ease; }
.language-segments a:hover { color: var(--text); }
.language-segments a[aria-current="page"] { color: var(--text); background: var(--surface-hover); }
.site-header .desktop-nav { transition: none; }
.site-header[data-home]:not([data-compact]) .desktop-nav { opacity: 0; visibility: hidden; pointer-events: none; }
.site-header[data-home]:not([data-compact]) .mobile-menu { display: none; }
.site-header[data-home][data-compact] .header-language { display: none; }
@media (any-pointer: coarse) {
 .language-segments a { min-height: 44px; min-width: 40px; }
}
@media (prefers-reduced-motion: reduce) {
 .site-header .desktop-nav, .language-segments a { transition: none; }
}

/* Native top-layer navigation cannot be clipped by the floating header. */
html[data-mobile-menu-open="true"], html[data-mobile-menu-open="true"] body { overflow: hidden; }
.mobile-menu-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--bg); color: var(--text); overflow: auto; overscroll-behavior: none; }
.mobile-menu-dialog:not([open]) { display: none; }
.mobile-menu-dialog::backdrop { background: var(--bg); }
.mobile-dialog-content { min-height: 100%; display: flex; flex-direction: column; padding: 0 0 max(24px, env(safe-area-inset-bottom)); }
.mobile-dialog-header { position: sticky; top: 0; z-index: 1; width: calc(100% - 2 * var(--gutter)); min-height: 60px; margin-inline: auto; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bg); }
.mobile-menu-dialog .brand { font-size: 16px; }
.site-header[data-home][data-compact] .mobile-dialog-header { width: calc(100% - 48px); padding-inline: 16px calc(16px - 8px / 3); }
.mobile-dialog-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; justify-items: end; }
.mobile-dialog-close svg { width: 20px; height: 20px; }
.mobile-dialog-close { transition: color 160ms ease; }
.mobile-dialog-close:hover { background: transparent; color: var(--muted); }
.mobile-dialog-close:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.mobile-dialog-links { display: flex; flex-direction: column; margin: clamp(32px, 6dvh, 64px) var(--gutter) 0; }
.mobile-dialog-links a { display: block; padding-block: 24px; border-bottom: 1px solid color-mix(in srgb, var(--text) 22%, transparent); color: var(--text); font-size: 20px; font-weight: var(--weight-ui); line-height: 1.3; text-decoration: none; transition: color 160ms ease; }
.mobile-dialog-links a:hover { color: var(--muted); }
.mobile-dialog-footer { margin-top: auto; padding: 48px var(--gutter) 0; }
.site-header[data-home][data-compact] :is(.mobile-dialog-links, .mobile-dialog-footer) { margin-inline: 40px; }
.site-header[data-home][data-compact] .mobile-dialog-footer { padding-inline: 0; }
.mobile-dialog-language { width: fit-content; }
.mobile-menu-dialog[open] .mobile-dialog-links { animation: mobile-menu-enter 180ms ease-out; }
.mobile-menu-fallback { position: absolute; right: 0; top: 100%; width: min(320px, calc(100vw - 40px)); padding: 16px; border-radius: 12px; background: var(--bg); }
.mobile-menu-fallback a { display: block; padding: 12px; }
.mobile-menu[data-dialog-ready] .mobile-menu-fallback { display: none; }
@keyframes mobile-menu-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
 .mobile-menu-dialog[open] .mobile-dialog-links { animation: none; }
 .mobile-dialog-links a { transition: none; }
}

.site-header[data-home]:not([data-compact]) .nav-action { display: none; }

/* Without enhancement, keep native links/details available at every scroll position. */
html:not([data-navigation]) .site-header[data-home] .desktop-nav,
html[data-navigation="fallback"] .site-header[data-home] .desktop-nav { opacity: 1; visibility: visible; pointer-events: auto; }
html:not([data-navigation]) .site-header[data-home] .nav-action,
html[data-navigation="fallback"] .site-header[data-home] .nav-action { display: inline-flex; }
@media (max-width: 900px) {
 html:not([data-navigation]) .site-header[data-home] .mobile-menu,
 html[data-navigation="fallback"] .site-header[data-home] .mobile-menu { display: block; }
 html:not([data-navigation]) .site-header[data-home] .nav-action,
 html[data-navigation="fallback"] .site-header[data-home] .nav-action { display: none; }
}

.mobile-menu-fallback .fallback-language { display: flex; justify-content: flex-start; margin-top: 8px; }
.fallback-language > svg { display: none; }
.fallback-language .language-segments a { display: grid; padding: 8px; }
@media (max-width: 900px) {
 html:not([data-navigation]) .site-header[data-home] .header-language,
 html[data-navigation="fallback"] .site-header[data-home] .header-language { display: none; }
}
