html {
  scroll-padding-top: 96px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0;
  display: block;
  border-bottom: 1px solid #ffffff14;
  background: #090c11e6;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1160px, calc(100% - 48px));
  height: 76px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #11171e;
  color: var(--text);
  white-space: nowrap;
}

.home-link:hover {
  border-color: #3c5961;
  color: var(--cyan);
}

.zh-only {
  display: none;
}

html[lang="zh"] .en-only {
  display: none;
}

html[lang="zh"] .zh-only {
  display: inline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.hero {
  grid-template-columns: minmax(0, 760px);
  gap: 0;
}

@media (max-width: 800px) {
  .site-header {
    width: 100%;
  }

  .header-inner {
    width: calc(100% - 28px);
  }

  nav {
    gap: 10px;
  }

  nav a.home-link {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .home-link {
    gap: 4px;
    padding-inline: 10px;
  }

  .home-link .en-only,
  .home-link .zh-only {
    font-size: 0;
  }

  .home-link .en-only::after {
    content: "Home";
    font-size: 0.85rem;
  }

  .home-link .zh-only::after {
    content: "主页";
    font-size: 0.85rem;
  }
}

/* CN-007: Home is last in the DOM and stays at the header's far right. */
.site-header .header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  min-height: 76px;
}
.site-header .brand { min-width: 0; overflow: hidden; white-space: nowrap; }
.site-header .brand img { flex-shrink: 0; }
.site-header nav { justify-self: end; flex-wrap: nowrap; }
.site-header .home-link {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
  padding: 7px 12px;
  font-size: .875rem;
  line-height: 1.35;
}
html[lang^="zh"] .site-header .home-link .en-only { display: none; }
html[lang^="zh"] .site-header .home-link .zh-only { display: inline; }
.site-header .home-link .en-only, .site-header .home-link .zh-only { font-size: .875rem; }
.site-header .home-link .en-only::after, .site-header .home-link .zh-only::after { content: none; }
@media (max-width: 800px) {
  .site-header .header-inner { height: 64px; min-height: 64px; }
  .site-header nav { gap: 8px; }
}
@media (max-width: 480px) {
  .site-header .brand { font-size: 0; gap: 0; }
}
