/* Shared by the landing and generated OBD pages. */

.site-header {
  --page: #07131d;
  --page-soft: #0c1b28;
  --surface-raised: #172938;
  --ink: #f1f6f8;
  --ink-soft: #d6e2e6;
  --muted: #93a8b2;
  --line: rgba(235, 244, 247, 0.12);
  --blue-strong: #a7c8d8;
  --blue-line: rgba(126, 168, 189, 0.28);
  --action: #c9945a;
  --action-strong: #e2ad70;
  --brand-strong: var(--blue-strong);
  --shadow-card: 0 16px 38px rgba(0, 0, 0, 0.30);
  --shadow-button: 0 14px 34px rgba(201, 148, 90, 0.20);
  --max: 1160px;
  --page-gutter: clamp(22px, 5vw, 72px);
  --page-gutter-mobile: clamp(16px, 5vw, 24px);
  font-family: "IBM Plex Sans", "Public Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.site-header a {
  text-decoration: none;
}

.site-header .brand {
  font-weight: 400;
}

.site-header .brand-copy small {
  font-weight: 400;
}

.site-header button {
  font-family: inherit;
}

.site-header .language-toggle a {
  display: grid;
  place-items: center;
  font-size: 13.3333px;
}

.site-header {
  width: min(var(--max), calc(100% - (var(--page-gutter) * 2)));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 2.5vw, 34px);
  min-height: 76px;
  padding-inline: clamp(16px, 2.4vw, 30px);
  border: 1px solid var(--line);
  border-top: 0;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  background: rgba(16, 31, 45, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
}

.site-header .brand,
.site-header .header-actions,
.site-header .nav-links,
.site-header .language-toggle {
  display: flex;
  align-items: center;
}

.site-header .brand {
  gap: 12px;
  min-width: 250px;
}

.site-header .brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 2px;
  border: 1px solid var(--blue-line);
  border-radius: 15px;
  background: linear-gradient(145deg, var(--surface-raised), var(--page-soft));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.site-header .brand-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-header .brand-copy {
  display: grid;
  gap: 2px;
}

.site-header .brand-copy strong {
  color: var(--ink);
  font-weight: 800;
}

.site-header .brand-copy small {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.site-header .nav-links {
  justify-content: center;
  gap: clamp(14px, 1.8vw, 24px);
}

.site-header .nav-links a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 700;
}

.site-header .nav-links a:hover {
  color: var(--brand-strong);
}

.site-header .header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.site-header .mobile-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(19, 37, 54, 0.86);
  color: var(--ink);
  cursor: pointer;
}

.site-header .mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.site-header .mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.site-header .language-toggle {
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(19, 37, 54, 0.86);
}

.site-header .language-toggle :is(button, a) {
  font-family: "IBM Plex Mono", "IBM Plex Sans", monospace;
  min-width: 38px;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.site-header .language-toggle :is(button, a).active {
  color: var(--page);
  background: var(--action);
}

.site-header .button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.site-header .button:hover {
  transform: translateY(-1px);
}

.site-header .button-primary {
  color: var(--page);
  background: var(--action);
  box-shadow: var(--shadow-button);
}

.site-header .button-primary:hover {
  background: var(--action-strong);
}

@media (max-width: 1060px) {

  .site-header {
    grid-template-columns: 1fr;
    padding-block: 12px;
  }

  .site-header .nav-links,
  .site-header .header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {

  .site-header {
    width: min(var(--max), calc(100% - (var(--page-gutter-mobile) * 2)));
  }

  .site-header {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: auto;
    padding: 12px;
    border-radius: 18px;
  }

  .site-header .brand {
    min-width: 0;
  }

  .site-header .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .site-header .brand-copy small,
  .site-header .nav-links {
    display: none;
  }

  .site-header .mobile-menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
  }

  .site-header .nav-links.mobile-open {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .site-header .nav-links.mobile-open a {
    width: 100%;
    padding: 12px 10px;
    border-radius: 12px;
  }

  .site-header .nav-links.mobile-open a:hover,
  .site-header .nav-links.mobile-open a:focus-visible {
    background: rgba(126, 168, 189, 0.1);
  }

  .site-header .header-actions {
    justify-self: end;
    justify-content: flex-end;
  }

  .site-header .language-toggle :is(button, a) {
    min-width: 42px;
    min-height: 40px;
  }

  .site-header .header-cta {
    display: none;
  }

  .site-header .button {
    width: 100%;
  }
}


/* Keep article anchors and keyboard skips clear of the shared sticky header. */
.code-page .code-skip { z-index: 40; }
@media (min-width: 721px) {
  .code-page .code-category-section, .code-article section { scroll-margin-top: 260px; }
  .code-toc { top: 260px; }
}
@media (min-width: 1061px) {
  .code-page .code-category-section, .code-article section { scroll-margin-top: 100px; }
  .code-toc { top: 100px; }
}
