/* The one header and footer every page shares: a name, three places, and a
   quiet line at the bottom. Page styles never restyle these. */
.site-header,
.site-footer {
  width: min(1200px, calc(100% - 96px));
  margin-inline: auto;
  font-family: var(--sans);
  color: var(--ink);
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 28px 22px;
  border-bottom: 1px solid var(--line);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 44px;
  font-weight: 600;
  font-size: 19px;
  font-family: var(--display);
  letter-spacing: -0.055em;
  white-space: nowrap;
  text-decoration: none;
}
.site-brand img {
  width: 26px;
  height: 26px;
}
.site-header nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
}
.site-header nav a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.site-header nav a {
  font-size: 16px;
}
.site-header nav a[aria-current] {
  color: var(--pen);
  text-decoration: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 2px;
}
.site-header a:hover,
.site-footer a:hover {
  color: var(--pen);
}
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 48px;
  padding-block: 26px 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.site-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
}

@media (max-width: 1000px) {
  .site-header,
  .site-footer {
    width: calc(100% - 64px);
  }
}
@media (max-width: 700px) {
  .site-header,
  .site-footer {
    width: calc(100% - 40px);
  }
  .site-header {
    padding-block: 18px 16px;
    gap: 12px;
  }
  .site-brand {
    font-size: 19px;
    gap: 0;
  }
  .site-brand img {
    width: 23px;
    height: 23px;
  }
  .site-header nav {
    gap: 18px;
  }
  .site-header nav a {
    font-size: 15px;
  }
  .site-footer {
    gap: 0 12px;
    padding-block: 20px 28px;
    font-size: 13px;
  }
  .site-footer p {
    font-size: 13px;
  }
  .site-footer nav {
    gap: 0 18px;
  }
}
@media (max-width: 350px) {
  .site-header nav { gap: 16px; }
}

.brand-period { color: var(--pen); }
.site-footer a { color: var(--ink-soft); }
@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; gap: 2px 20px; }
  .site-header nav { flex: 1 0 100%; }
}

/* Appearance is a single native toggle: always reachable, never a menu. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition-property: color, background-color, border-color, transform;
  transition-duration: var(--motion-feedback);
  transition-timing-function: var(--ease);
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--porcelain); border-color: var(--ink-soft); }
@media (prefers-reduced-motion: no-preference) {
  .theme-toggle:active:not(:disabled):not([aria-disabled="true"]) {
    transform: scale(var(--press-scale));
    transition-duration: var(--motion-feedback), var(--motion-feedback),
      var(--motion-feedback), var(--motion-press);
  }
}
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .theme-sun { display: none; }
.theme-toggle[aria-pressed="true"] .theme-moon { display: none; }
.theme-toggle[aria-pressed="true"] .theme-sun { display: block; }
@media (max-width: 600px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 2px;
  }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; }
  .theme-toggle { grid-column: 2; grid-row: 1; }
}
