:root {
  --hx-nav-bg: #0d1117;
  --hx-nav-surface: #161b22;
  --hx-nav-border: #2a2f3a;
  --hx-nav-text: #e6edf3;
  --hx-nav-muted: #a7b0bc;
  --hx-nav-green: #2ecc71;
  --hx-nav-max: 1120px;
  --hx-nav-gutter: 24px;
}

.hx-site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  width: 100%;
  border-bottom: 1px solid transparent;
  color: var(--hx-nav-text);
  transition: background 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
}

.hx-site-header--solid,
.hx-site-header.is-scrolled {
  background: rgba(13, 17, 23, 0.94);
  border-bottom-color: var(--hx-nav-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.hx-site-nav {
  position: relative;
  width: 100%;
  max-width: var(--hx-nav-max);
  min-height: 64px;
  margin: 0 auto;
  padding: 10px var(--hx-nav-gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}

.hx-site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--hx-nav-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.hx-site-brand:hover {
  color: var(--hx-nav-text);
  text-decoration: none;
}

.hx-site-brand img {
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hx-nav-border);
  border-radius: 8px;
}

.hx-site-brand-for {
  color: var(--hx-nav-green);
  font-weight: 600;
}

.hx-site-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.hx-site-links a,
.hx-site-menu-panel nav a {
  color: var(--hx-nav-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.hx-site-links a:hover,
.hx-site-links a[aria-current="page"],
.hx-site-menu-panel nav a:hover,
.hx-site-menu-panel nav a[aria-current="page"] {
  color: var(--hx-nav-text);
  text-decoration: none;
}

.hx-site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hx-site-email {
  max-width: 180px;
  overflow: hidden;
  color: var(--hx-nav-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hx-site-account-link,
.hx-site-signout {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hx-nav-border);
  border-radius: 7px;
  background: transparent;
  color: var(--hx-nav-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.hx-site-account-link {
  padding: 0 13px;
}

.hx-site-signout {
  padding: 0 10px;
  color: var(--hx-nav-muted);
}

.hx-site-account-link:hover,
.hx-site-account-link[aria-current="page"],
.hx-site-signout:hover {
  border-color: #454d59;
  background: var(--hx-nav-surface);
  color: var(--hx-nav-text);
  text-decoration: none;
}

.hx-site-signout:disabled,
.hx-site-menu-signout:disabled {
  opacity: 0.5;
  cursor: default;
}

.hx-site-menu {
  display: none;
}

.hx-site-menu summary {
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hx-nav-border);
  border-radius: 7px;
  color: var(--hx-nav-text);
  cursor: pointer;
  list-style: none;
}

.hx-site-menu summary::-webkit-details-marker {
  display: none;
}

.hx-site-menu summary:focus-visible {
  outline: 2px solid var(--hx-nav-green);
  outline-offset: 2px;
}

.hx-site-menu-icon {
  width: 15px;
  height: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hx-site-menu-icon i {
  display: block;
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}

.hx-site-menu[open] .hx-site-menu-icon i:nth-child(1) {
  transform: translateY(5.25px) rotate(45deg);
}

.hx-site-menu[open] .hx-site-menu-icon i:nth-child(2) {
  opacity: 0;
}

.hx-site-menu[open] .hx-site-menu-icon i:nth-child(3) {
  transform: translateY(-5.25px) rotate(-45deg);
}

.hx-site-menu-panel {
  position: absolute;
  top: calc(100% + 1px);
  right: var(--hx-nav-gutter);
  width: min(320px, calc(100vw - (var(--hx-nav-gutter) * 2)));
  padding: 8px;
  border: 1px solid var(--hx-nav-border);
  border-radius: 8px;
  background: var(--hx-nav-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

.hx-site-menu-panel nav {
  display: flex;
  flex-direction: column;
}

.hx-site-menu-panel nav a {
  padding: 10px 11px;
  border-radius: 5px;
}

.hx-site-menu-panel nav a:hover,
.hx-site-menu-panel nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.05);
}

.hx-site-menu-email {
  margin: 8px 11px 0;
  padding-top: 10px;
  border-top: 1px solid var(--hx-nav-border);
  color: var(--hx-nav-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hx-site-menu-email strong {
  color: var(--hx-nav-text);
  font-weight: 600;
}

.hx-site-menu-signout {
  width: calc(100% - 22px);
  margin: 9px 11px 5px;
  padding: 9px 10px;
  border: 1px solid var(--hx-nav-border);
  border-radius: 6px;
  background: transparent;
  color: var(--hx-nav-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.hx-site-menu-signout:hover {
  color: var(--hx-nav-text);
  border-color: #454d59;
}

@media (max-width: 900px) {
  :root {
    --hx-nav-gutter: 16px;
  }

  .hx-site-nav {
    min-height: 56px;
    padding-block: 8px;
    gap: 12px;
  }

  .hx-site-brand {
    font-size: 14px;
    gap: 8px;
  }

  .hx-site-brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .hx-site-links,
  .hx-site-email,
  .hx-site-signout {
    display: none;
  }

  .hx-site-actions {
    margin-left: auto;
  }

  .hx-site-account-link {
    min-height: 32px;
    padding-inline: 10px;
  }

  .hx-site-menu {
    display: block;
  }

  .hx-site-menu summary {
    display: flex;
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 380px) {
  .hx-site-brand-for {
    display: none;
  }
}
