/* One persistent header for the homepage, blog index, and every article.
   The contact action sits outside the optional, horizontally scrolling links. */
html { scroll-padding-top: 110px; }
.skip-link { z-index: 1001; }
.site-header {
  position: sticky;
  top: 12px;
  z-index: 1000;
  isolation: isolate;
}
.site-header .header-actions { flex: 1 1 auto; }
.site-header .site-navigation {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  padding-block: 6px;
}
.site-header .site-navigation a {
  display: inline-flex;
  flex: 0 0 auto;
}
.site-header .site-contact {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--button-fill);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.site-header .site-contact:hover { background: var(--button-hover); }

@media (max-width: 640px) {
  html { scroll-padding-top: 145px; }
  .site-header {
    top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 10px;
    width: calc(100% - 24px);
    margin-top: 10px;
    padding: 9px 14px 7px;
    border-radius: 24px;
  }
  .site-header .wordmark { grid-area: 1 / 1; --brand-scale: .75; }
  .site-header .header-actions { display: contents; }
  .site-header .site-navigation {
    grid-area: 2 / 1 / 3 / -1;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    padding: 5px 2px 1px;
    border-top: 1px solid var(--line);
    font-size: 14px;
  }
  .site-header .site-contact { grid-area: 1 / 2; }
  .site-header .theme-toggle { grid-area: 1 / 3; }
}

@media (max-width: 440px) {
  .site-header { gap: 6px 8px; padding-inline: 12px; }
  .site-header .wordmark { --brand-scale: .68; }
  .site-header .site-contact { font-size: 13px; min-height: 34px; padding-inline: 10px; }
  .site-header .theme-toggle { width: 32px; height: 32px; }
}

@media (max-width: 360px) {
  .site-header { gap: 6px 7px; }
  .site-header .wordmark { --brand-scale: .55; }
  .site-header .site-contact { padding-inline: 9px; }
  .site-header .theme-toggle { width: 30px; height: 30px; }
}
