/* Shared top bar of the public pages (templates/_site_nav.html). It brings its own colours (the family tokens in
   docs/ui-tokens.md: top bar, line, muted ink, filled accent), so it looks the same on the
   landing.css pages and on the family-token pages (about, API docs, agent, request); light/dark follows data-theme,
   which theme.js always sets. Class names all start with "tnav" so the pages' own rules don't reach in. */
.tnav {
  --tnav-bg: rgba(37, 39, 42, 0.86);
  --tnav-text: #e6e6e6;
  --tnav-text-2: #9aa0a6;
  --tnav-line: #3f4144;
  --tnav-hover: rgba(230, 230, 230, 0.06);
  --tnav-cta-bg: #4a6ae6;
  --tnav-cta-hover: #5b79ec;
  --tnav-cta-text: #fff;
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-sizing: border-box; width: 100%; min-height: 60px; padding: 10px clamp(16px, 4vw, 32px);
  background: var(--tnav-bg); color: var(--tnav-text);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--tnav-line);
  font: 500 14px/1.2 var(--font-sans, "Geist", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif);
  letter-spacing: normal;
}
:root[data-theme="light"] .tnav {
  --tnav-bg: rgba(243, 241, 234, 0.88);
  --tnav-text: #141413;
  --tnav-text-2: #6b6a65;
  --tnav-line: #eae8e1;
  --tnav-hover: rgba(20, 20, 19, 0.06);
  --tnav-cta-bg: #2b4fd8;
  --tnav-cta-hover: #2341b5;
  --tnav-cta-text: #fff;
}
.tnav *, .tnav *::before, .tnav *::after { box-sizing: border-box; }
.tnav a { color: inherit; text-decoration: none; }
.tnav-brand { display: inline-flex; align-items: center; min-height: 40px; gap: 10px; flex: none; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.tnav-brand img { width: 24px; height: 24px; border-radius: 6px; display: block; }
.tnav-links { display: flex; gap: 2px; min-width: 0; }
.tnav-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 11px; border-radius: 10px; color: var(--tnav-text-2); white-space: nowrap; transition: color 0.15s, background 0.15s; }
.tnav-links a:hover { color: var(--tnav-text); background: var(--tnav-hover); }
.tnav-links a[aria-current="page"] { color: var(--tnav-text); background: var(--tnav-hover); }
.tnav-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.tnav-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 40px; min-width: 40px; padding: 0 10px; margin: 0;
  border: 1px solid var(--tnav-line); border-radius: 10px; background: transparent; color: inherit;
  font: inherit; font-size: 13px; cursor: pointer; transition: background 0.15s;
}
.tnav-icon:hover { background: var(--tnav-hover); }
.tnav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.tnav-lang svg { width: 13px; height: 13px; opacity: 0.6; }
#theme-button.tnav-icon { padding: 0; }
.tnav .i-moon { display: none; }
:root[data-theme="light"] .tnav .i-sun { display: none; }
:root[data-theme="light"] .tnav .i-moon { display: block; }
.tnav-quiet { display: inline-flex; align-items: center; min-height: 40px; padding: 0 9px; border-radius: 10px; color: var(--tnav-text-2); white-space: nowrap; }
.tnav-quiet:hover { color: var(--tnav-text); background: var(--tnav-hover); }
.tnav-cta {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--tnav-cta-bg); color: var(--tnav-cta-text) !important; font-weight: 600; white-space: nowrap; transition: background 0.15s;
}
.tnav-cta:hover { background: var(--tnav-cta-hover); }
.tnav [data-auth][hidden] { display: none !important; }

/* Narrower screens: the page links drop to a second row that scrolls sideways instead of wrapping. */
@media (max-width: 900px) {
  .tnav { flex-wrap: wrap; row-gap: 6px; padding-bottom: 6px; }
  .tnav-links { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
  .tnav-links::-webkit-scrollbar { display: none; }
  .tnav-links a { padding: 0 9px; font-size: 13px; }
}
/* Spanish "Iniciar sesión" + "Registrarse" don't fit beside the brand on a phone; Sign up's page has a sign-in tab too. */
@media (max-width: 480px) {
  .tnav-actions { gap: 4px; }
  .tnav-lang svg { display: none; }
  :root[lang^="es"] .tnav-quiet { display: none; }
}
@media (max-width: 350px) {
  .tnav-quiet { display: none; }
  .tnav-cta { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) { .tnav * { transition: none !important; } }
