:root {
  color-scheme: light;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --header-h: 64px;
  --footer-h: 44px;
}

html { scroll-behavior: smooth; }

*, *::before, *::after { box-sizing: border-box; }

/* Fixed, translucent header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}

.site-header__wrap {
  height: var(--header-h);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Offset body content so it never hides behind fixed header */
body {
  padding-top: var(--header-h);
  /* Account for fixed header so footer aligns to bottom on mobile */
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
}

.site-header__brand {
  color: #1d1d1f;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.site-header__logo svg { display: block; }

.site-header__nav { display: inline-flex; gap: 0.9rem; }

/* Mobile nav toggle (hidden by default) */
.site-header__toggle {
  display: none !important;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.4rem;
  border-radius: 8px;
  cursor: pointer;
}

.site-header__link {
  color: rgba(29, 29, 31, 0.8);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease;
}

.site-header__link:hover {
  background: rgba(29, 29, 31, 0.08);
  color: #1d1d1f;
}

.site-header__link.is-active {
  background: rgba(29, 29, 31, 0.12);
  color: #1d1d1f;
}

/* Dark mode header */
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(33, 33, 36, 0.6);
    border-bottom-color: rgba(245, 245, 247, 0.14);
  }
  .site-header__brand { color: #f5f5f7; }
  .site-header__link { color: rgba(245, 245, 247, 0.8); }
  .site-header__link:hover, .site-header__link.is-active {
    background: rgba(245, 245, 247, 0.12);
    color: #f5f5f7;
  }
}

/* Footer */
.site-footer__wrap {
  max-width: 1120px;
  margin: 0 auto;
  min-height: var(--footer-h);
  padding: 0 1rem;
  color: rgba(29, 29, 31, 0.6);
  border-top: 1px solid rgba(29, 29, 31, 0.08);
  text-align: center;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Push footer to the bottom on short pages */
.site-footer { margin-top: auto; }

/* Ensure footer text centers on all devices */
.site-footer small { display: block; margin: 0 auto; text-align: center; width: 100%; }

@media (prefers-color-scheme: dark) {
  .site-footer__wrap {
    color: rgba(245, 245, 247, 0.65);
    border-top-color: rgba(245, 245, 247, 0.14);
  }
}

/* Responsive: collapse nav into hamburger */
@media (max-width: 720px) {
  .site-header__wrap { justify-content: space-between; }
  .site-header__toggle { display: inline-flex !important; align-items: center; justify-content: center; }
  .site-header__nav {
    position: absolute;
    top: var(--header-h);
    right: 0;
    left: 0;
    display: none !important;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(29,29,31,0.08);
  }
  .site-header.is-open .site-header__nav { display: flex !important; }
  .site-header__link { display: block; border-radius: 8px; }
}

@media (prefers-color-scheme: dark) and (max-width: 720px) {
  .site-header__nav {
    background: rgba(33, 33, 36, 0.80);
    border-bottom-color: rgba(245, 245, 247, 0.14);
  }
}
