.site-header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.75rem 1rem;
}

.brand { color: var(--ink); flex-shrink: 0; font-size: 1.08rem; font-weight: 780; letter-spacing: -0.03em; text-decoration: none; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 1rem; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.header-rule { position: relative; height: 2.75rem; }
.header-rule::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--line); }
.header-rule-inner { position: relative; max-width: var(--shell-width); height: 100%; margin: 0 auto; padding-inline: var(--shell-pad-x); }
.header-tools { position: relative; z-index: 1; display: flex; justify-content: end; align-items: center; gap: 0.5rem; width: max-content; height: 100%; margin-left: auto; padding-inline: 0.5rem; background: var(--bg); }
.theme-toggle, .palette-pick { flex-shrink: 0; width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 1rem; cursor: pointer; line-height: 1; padding: 0; transition: background 0.15s, color 0.15s; }
.theme-toggle:hover, .palette-pick:hover { background: var(--code-bg); color: var(--ink); }
.palette-pick { font-size: 0.9rem; }
.page-shell { max-width: var(--shell-width); margin: 0 auto; padding: 5rem var(--shell-pad-x) 6rem; }
.content { width: 100%; max-width: var(--content-width); }
.site-footer { text-align: center; padding: 2rem 1.75rem 3rem; }
.site-footer a { color: var(--muted); font-size: 0.82rem; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.sponsor-btn { display: inline-block; padding: 0.5rem 1.25rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9rem; font-weight: 600; color: var(--accent) !important; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.sponsor-btn:hover { background: color-mix(in oklab, var(--accent), var(--bg) 85%); border-color: var(--accent); }

@media (max-width: 640px) {
  .site-header-row { padding: 1rem 1.2rem 0.75rem; gap: 0.75rem; }
  .nav { gap: 0.6rem; }
  .page-shell { padding: 3rem 1.2rem 4rem; }
  h1 { margin-bottom: 1.5rem; font-size: clamp(2rem, 11vw, 3.4rem); }
}
