/* ============================================================
   Shared public navbar — one bar across the landing + every
   public section, modelled on the blog's nav (the clean one).
   Self-contained: does not inherit page vars, and supports BOTH
   theme systems in the codebase (html.light and [data-theme]).
   ============================================================ */
:root {
  --snav-bg: rgba(9, 9, 11, .72);
  --snav-line: #17131F;
  --snav-fg: #FFFFFF;
  --snav-fg2: #C7C2D6;
  --snav-hover: #A47CF0;
}
html.light, html[data-theme="light"] {
  --snav-bg: rgba(255, 255, 255, .82);
  --snav-line: #E8E4F0;
  --snav-fg: #16121F;
  --snav-fg2: #514B63;
}

.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--snav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--snav-line);
}
.site-nav .snav-in {
  max-width: 1180px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 16px;
}
/* Three groups: brand · links · actions. The two outer groups share the leftover
   space equally (flex:1 1 0), which parks the links in the true centre of the bar
   no matter how wide the brand or the CTA happen to be. */
.site-nav .snav-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--snav-fg); font-weight: 700; font-size: 19px; text-decoration: none;
  flex: 1 1 0; min-width: 0;
}
.site-nav .snav-actions {
  display: flex; align-items: center; gap: 14px;
  flex: 1 1 0; min-width: 0; justify-content: flex-end;
  font-size: 14px; font-weight: 600;
}
.site-nav .snav-actions > * { flex: 0 0 auto; white-space: nowrap; }
.site-nav .snav-actions a { color: var(--snav-fg2); text-decoration: none; transition: color .18s ease; }
.site-nav .snav-actions a:hover { color: var(--snav-hover); }
.site-nav .snav-actions a.snav-cta:hover { color: #fff; }
.site-nav .snav-brand svg { width: 34px; height: 34px; border-radius: 10px; }

/* Never wrap: the row shrinks, then scrolls — a link is never cut off. */
.site-nav .snav-links {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  font-size: 14px; font-weight: 600;
  flex-wrap: nowrap; min-width: 0; flex: 0 1 auto;
}
.site-nav .snav-links > a,
.site-nav .snav-links > button { flex: 0 0 auto; white-space: nowrap; }
.site-nav .snav-links a { color: var(--snav-fg2); text-decoration: none; transition: color .18s ease; }
.site-nav .snav-links a:hover { color: var(--snav-hover); }

.site-nav .snav-cta {
  background: linear-gradient(150deg, #8250E7, #6A3AD1);
  color: #fff !important; padding: 9px 18px; border-radius: 11px;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 18px rgba(130, 80, 231, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.site-nav .snav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(130, 80, 231, .45); }

.site-nav .snav-thm {
  background: transparent; border: 1px solid var(--snav-line); color: var(--snav-fg2);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
}
.site-nav .snav-thm .snav-sun { display: none; }
html.light .site-nav .snav-thm .snav-sun,
html[data-theme="light"] .site-nav .snav-thm .snav-sun { display: inline; }
html.light .site-nav .snav-thm .snav-moon,
html[data-theme="light"] .site-nav .snav-thm .snav-moon { display: none; }

/* Progressive tightening, then scroll — mirrors tools/fix-nav.mjs */
@media (max-width: 1100px) {
  .site-nav .snav-links { gap: 15px; font-size: 13.5px; }
  .site-nav .snav-actions { gap: 11px; font-size: 13.5px; }
}
@media (max-width: 900px) and (min-width: 761px) {
  /* Tablet band: links scroll rather than get cut. Below 760 we switch to a burger. */
  .site-nav .snav-brand, .site-nav .snav-actions { flex: 0 0 auto; }
  .site-nav .snav-links {
    flex: 1 1 auto; justify-content: flex-start;
    gap: 13px; font-size: 13px;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
  }
  .site-nav .snav-links::-webkit-scrollbar { display: none; }
}

/* ── mobile burger: the inline links were unreachable on phones (horizontal
   scroll with no affordance). Under 760px we hide them and show a real menu. ── */
.site-nav .snav-burger {
  display: none; flex-direction: column; gap: 5px; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto; background: none; border: 0; cursor: pointer; padding: 0;
}
.site-nav .snav-burger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--snav-fg); transition: transform .22s ease, opacity .18s ease; }
.site-nav.snav-open .snav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.snav-open .snav-burger span:nth-child(2) { opacity: 0; }
.site-nav.snav-open .snav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav .snav-drop {
  display: none; flex-direction: column; padding: 8px 16px 16px;
  border-top: 1px solid var(--snav-line); background: var(--snav-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.site-nav.snav-open .snav-drop { display: flex; }
.site-nav .snav-drop a { color: var(--snav-fg); text-decoration: none; font-size: 15px; font-weight: 600; padding: 13px 4px; border-bottom: 1px solid var(--snav-line); }
.site-nav .snav-drop a:last-child { border-bottom: 0; }
.site-nav .snav-drop a.snav-cta { margin-top: 12px; text-align: center; border: 0; color: #fff; }

@media (max-width: 760px) {
  .site-nav .snav-links,
  .site-nav .snav-actions .snav-thm,
  .site-nav .snav-actions a:not(.snav-cta) { display: none; }
  .site-nav .snav-burger { display: flex; }
  .site-nav .snav-in { padding: 10px 14px; gap: 8px; }
  .site-nav .snav-brand { font-size: 17px; flex: 1 1 auto; }
  .site-nav .snav-brand svg { width: 30px; height: 30px; }
  .site-nav .snav-cta { padding: 8px 14px; font-size: 13px; }
}
