/* Shared site chrome: nav + footer. SINGLE SOURCE OF TRUTH.
   Markup lives in scripts/partials/{nav,footer}.html and is injected into every
   page by scripts/build-chrome.py (run on edit + from deploy.sh). Self-contained:
   relies only on each page's :root CSS variables, never on .container. */

/* Dark UA chrome: native scrollbars (the playground editor/output panels) +
   form controls render dark, matching the theme. Inherits to all descendants. */
html { color-scheme: dark; }

/* ============ Navigation ============ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  text-transform: lowercase;
  flex-shrink: 0;
}
.wordmark .chev {
  color: var(--accent);
  font-weight: 700;
  display: inline-block;
  margin-right: 0.18em;
  transition: color 0.2s ease-out;
}
.wordmark:hover .chev { color: var(--accent-hover); }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 30px);
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-light);
  text-decoration: none;
  transition: color 0.2s ease-out;
  white-space: nowrap;
}
.nav-link:hover { color: var(--accent-hover); }
.nav-link.active { color: var(--white); }
.nav-cta { color: var(--white); font-weight: 700; }
.nav-cta:hover { color: var(--accent-hover); }

/* ============ Footer ============ */
.footer {
  padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--border);
}
.footer-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 80px);
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted-dim);
}
/* The footer link row must wrap: its 5 links (incl. the email) are wider than a
   phone, and each .nav-link is white-space:nowrap, so without this it forces
   horizontal scroll once .footer-meta stacks to a column on mobile. */
.footer-meta .nav-links { flex-wrap: wrap; }

@media (max-width: 768px) {
  nav { padding: 16px 0; }
  .nav-links { gap: 16px; }
  .nav-link.hide-sm { display: none; }
  .footer-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
}
