.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  width: 94%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text-primary);
}

.nav-logo:hover {
  color: var(--color-primary);
}

.logo-icon {
  color: var(--color-primary);
  font-size: 1.25rem;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

.mobile-menu {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu ul {
  list-style: none;
  width: 94%;
  margin-inline: auto;
}

.mobile-menu li + li {
  border-top: 1px solid var(--color-border);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 0;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.site-footer {
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
}

.footer-content {
  text-align: center;
}

.footer-disclaimer {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  max-width: 40rem;
  margin-inline: auto;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: start;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
}

.footer-col ul {
  list-style: none;
}

.footer-col li + li {
  margin-top: 0.375rem;
}

.footer-col a {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

.footer-col a:hover {
  color: var(--color-primary);
}

.page-hero {
  padding-top: 5rem;
  padding-bottom: 1.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 40rem;
  line-height: 1.6;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  margin-bottom: 1rem;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.5rem;
}

.breadcrumb a {
  color: var(--color-text-tertiary);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.page-nav {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}

.page-nav-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-primary);
}

.page-nav-link:hover {
  color: var(--color-primary-dark);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 200;
  transition: width 50ms linear;
}

.back-to-top {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 23.4375rem) {
  .nav-container {
    width: min(90%, var(--max-width));
  }

  .mobile-menu ul {
    width: min(90%, var(--max-width));
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-col a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (min-width: 48rem) {
  .nav-links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .footer-links {
    grid-template-columns: repeat(4, 1fr);
  }

  .page-hero {
    padding-top: 6rem;
    padding-bottom: 2rem;
  }

  .page-hero h1 {
    font-size: clamp(1.75rem, 1.3rem + 2.5vw, 2.75rem);
  }

  .page-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
  }

  .breadcrumb ol {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .page-nav-content {
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
  }

  .back-to-top {
    bottom: 2rem;
    right: 2rem;
    font-size: 1.25rem;
  }
}
