.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  /* Fluid side padding: fixed 20px floor on small screens, scales with
     viewport width, capped at 64px so wide desktop screens still get a
     generous but bounded content column. */
  padding-inline: clamp(20px, 4vw, 64px);
}

.prose {
  max-width: var(--prose-max);
}

.prose--wide {
  max-width: var(--prose-wide-max);
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Tighter on mobile/tablet, where Logo + Login + Register + the menu
     toggle all share one row down to 320px; desktop restores the wider
     gap below. */
  gap: var(--space-1);
  padding-block: var(--space-3);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: var(--font-size-md);
  color: var(--color-text);
  text-decoration: none;
}

.site-header__logo {
  display: block;
  height: 24px;
  width: auto;
}

.primary-nav {
  display: none;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav__list a {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 600;
}

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

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--space-1);
}

/* Compact Login/Register sizing for the mobile/tablet header row, where
   Logo + Login + Register + the menu toggle all need to fit on one line
   down to 320px. `min-height` (not just padding) keeps a consistent,
   comfortable tap target regardless of exact font-metrics rounding.
   Desktop restores full `.btn` sizing at the nav breakpoint below. */
.btn--compact {
  padding: 6px 8px;
  font-size: 0.75rem;
  min-height: 34px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Plain CSS hamburger — three bars (the middle one is the span's own
   background, the other two are pseudo-elements) — no icon font or
   image asset. Text label moved to aria-label since there's no room
   for a visible "Menu" word next to Login/Register on narrow screens. */
.nav-toggle__icon {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}

.nav-toggle__icon::before {
  top: -5px;
}

.nav-toggle__icon::after {
  top: 5px;
}

.mobile-nav {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

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

.mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-nav__list a {
  display: block;
  padding: var(--space-3) 0;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav__sublist {
  list-style: none;
  margin: 0;
  padding-left: var(--space-4);
}

.mobile-nav__sublist a {
  font-weight: 500;
  font-size: var(--font-size-sm);
}

/* 1120px: adding the "Download" nav item (8 top-level items now) raised
   the measured no-wrap minimum from ~970px to ~1069px — re-measured after
   that change rather than assumed. 1120px sits with a comfortable margin
   above that new minimum, same reasoning as the original 1024px value. */
@media (min-width: 1120px) {
  .site-header__bar {
    gap: var(--space-4);
  }

  .site-header__logo {
    height: 36px;
  }

  .primary-nav {
    display: block;
  }

  .header-actions {
    gap: var(--space-3);
  }

  /* Restore full `.btn` sizing — same padding/font-size as the base
     class — so desktop is visually identical to before this change. */
  .btn--compact {
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-sm);
    min-height: 0;
  }

  .nav-toggle {
    display: none;
  }

  .mobile-nav {
    display: none;
  }
}

main {
  display: block;
}

.section {
  padding-block: var(--space-section-y);
}

.section--tight {
  padding-block: var(--space-section-y-sm);
}

.breadcrumbs {
  padding-block: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.breadcrumbs__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}

.breadcrumbs__list li:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-2);
  color: var(--color-border);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.site-footer {
  background: var(--color-dark);
  color: #d9d9de;
  margin-top: var(--space-8);
}

.site-footer a {
  color: #d9d9de;
  text-decoration: none;
}

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

.footer-brand-row {
  padding-top: var(--space-7);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  display: inline-flex;
}

.footer-brand__logo {
  display: block;
  height: 40px;
  width: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  padding-block: var(--space-7);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .footer-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.footer-group h2 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9b9ba3;
  margin-bottom: var(--space-3);
}

.footer-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: var(--space-4);
  font-size: var(--font-size-sm);
  color: #9b9ba3;
}
