/* ============================================================
   SHARED NAV — used identically on index + all case pages
   Self-contained: falls back to its own values if host CSS
   variables aren't defined.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=VT323&display=swap");

:where(.topnav) {
  --nav-canvas:    var(--canvas, #fcfcfb);
  --nav-ink:       var(--ink, #141413);
  --nav-primary:   var(--primary, #1F4D3A);
  --nav-primary-2: var(--primary-active, #143426);
  --nav-on-prim:   var(--on-primary, #ffffff);
  --nav-hair:      var(--hairline, #e6dfd8);
  --nav-strong:    var(--body-strong, #252523);
  /* Fixed value — independent of any per-page --max-w. Home pages use
     1320px; case pages use 1200px for reading-column width. The header
     must stay identical across both, so it doesn't inherit either. */
  --nav-max:       1320px;
}

/* Placeholder reserves the topnav's height before nav.js replaces it
   with the real <nav>. Without this the page renders 0px-tall, then
   shifts 65px down once the script runs — a visible flash on every
   page navigation. The placeholder also paints the canvas + hairline
   so the chrome looks identical the moment the next page loads. */
[data-site-nav] {
  display: block;
  min-height: 65px;
  background: var(--canvas, #fcfcfb);
  border-bottom: 1px solid var(--hairline, #e6dfd8);
}
@media (max-width: 768px) {
  [data-site-nav] { min-height: 53px; }
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--nav-canvas);
  /* Vertical padding only — horizontal padding moves into .topnav__inner
     so the inner content area matches .hero__inner / .section, which
     also place padding inside their max-width container. Matters on
     viewports wider than (--max-w + 2 × --pad-page); below that they
     coincide either way. */
  padding: 16px 0;
  border-bottom: 1px solid var(--nav-hair);
}

.topnav__inner {
  max-width: var(--nav-max);
  margin: 0 auto;
  /* Same horizontal padding the rest of the page uses inside its max
     container — this is the alignment guarantee: brand sits exactly on
     the page's left content rail, CTA exactly on the right. */
  padding: 0 var(--pad-page, 24px);
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Brand wordmark + sparkle */
.topnav .brand,
.topnav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--nav-ink);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color .15s ease;
}
.topnav .brand:hover,
.topnav__brand:hover {
  color: var(--nav-primary);
  text-decoration: none;
}
.topnav .brand__mark,
.topnav__brand-mark {
  width: 14px;
  height: 14px;
  color: var(--nav-ink);
  flex-shrink: 0;
}
.topnav .brand__word,
.topnav__brand-word {
  font-family: 'VT323', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

/* Links */
.topnav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  align-items: center;
}
.topnav__links a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nav-strong);
  transition: color .15s ease;
}
.topnav__links a:hover { color: var(--nav-primary); text-decoration: none; }

/* CTA */
.topnav__cta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--nav-primary);
  padding: 11px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  box-shadow: 4px 4px 0 var(--ink);
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.topnav__cta:hover {
  background: var(--nav-primary-2);
  color: #fff;
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

@media (max-width: 768px) {
  .topnav { padding: 12px 0; }
  .topnav__inner { padding: 0 20px; gap: 12px; }
  .topnav .brand__word,
  .topnav__brand-word { display: none; }
  .topnav__links { gap: 16px; }
  .topnav__cta { display: none; }
}
