/* ==========================================================================
   Sibyl Labs header host styles (lab-header v1, 2026-10-13)
   The header that carries the lab menu (components/lab-menu.html markup, lab-menu.css, lab-menu.js),
   shared by the labs pages that load this sheet: /, /products, /agent, /get-started, /brain,
   /memory-vs-vector-db, /terms, /os and /pro/welcome. One file, so the header is the same everywhere.
   /products/memory and the checkout pages carry the same rules inline (their replay scripts own them).

   Load order in the head: the page's own <style>, then /fonts/ruwudu.css, /components/lab-menu.css,
   then this file (it overrides the page's leftover tokens and sizes at equal specificity).

   Values match the header on /products/memory: wordmark Sweet Sans Pro 16.2px, menu and CTA text in
   Ruwudu (scoped to the header and the panel, so a page whose body is still IBM Plex Mono gets the
   same header), 1180px grid, nav-inverse tokens (dark header on a light page, creme header under
   html.dark). The menu's own type sizes are the component defaults; /products/memory overrides them
   page-scoped (operator type scale-up, 2026-10-02).
   ========================================================================== */

:root {
  /* nav-inverse tokens: the header always contrasts the body (same values as every labs page) */
  --nav-bg:        #16120b;
  --nav-surface:   #221b10;
  --nav-ink:       #f4efe2;
  --nav-ink-mute:  #b3a98d;
  --nav-rule:      rgba(244,239,226,0.12);
  --nav-accent:    #cda85f;
  --nav-cta-bg:    #a88c46;
  --nav-cta-ink:   #16120b;
  --nav-cta-hover: #c6a458;
}
html.dark {
  --nav-bg:        #f5f1e6;
  --nav-surface:   #ede6d3;
  --nav-ink:       #16120b;
  --nav-ink-mute:  #6a6356;
  --nav-rule:      rgba(21,17,10,0.12);
  --nav-accent:    #6f5316;   /* deep ochre: 5.9:1 as text on the creme header */
  --nav-cta-bg:    #16120b;
  --nav-cta-ink:   #f5f1e6;
  --nav-cta-hover: #2c271d;
}

/* the labs sub-font inside the header and the menu panel, whatever the page body uses */
.nav, .lm-panel { --font-mono: 'Ruwudu', Georgia, serif; }

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem max(var(--gutter, 1.25rem), env(safe-area-inset-left)) 1rem max(var(--gutter, 1.25rem), env(safe-area-inset-right));
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-rule);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.nav-inner {
  max-width: var(--grid-max, 1180px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav a:focus-visible, .nav button:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }
.nav .lm-top a, .nav .wordmark, .nav .lm-noscript a { border: 0; text-decoration: none; }

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0125rem;
  line-height: normal;
  color: var(--nav-ink);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: color .25s ease;
}
.wordmark:hover { color: var(--nav-ink); }
.wordmark .brand-name { color: var(--nav-ink); display: inline-block; }
.wordmark .brand-mark {
  width: 0;
  height: 28px;
  flex-shrink: 0;
  transition: width 0.3s var(--ease);
}
.wordmark .brand-mark.has-logo {
  width: 32px;
  background-image: url("/sibyl-labs-logo-light.png");   /* creme mark on the dark header (light mode) */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
html.dark .wordmark .brand-mark.has-logo { background-image: url("/sibyl-labs-logo.png"); }   /* dark mark on the creme header */

/* theme toggle (lightbulb) placed inside .lm-right; its geometry lives in components/lab-menu.css */
.nav-theme-toggle { cursor: pointer; background: transparent; font: inherit; }
.nav-theme-toggle svg { transition: opacity 0.2s var(--ease); }
.nav-theme-toggle .bulb-rays { opacity: 1; transition: opacity 0.2s var(--ease); }   /* rays on in light mode */
html.dark .nav-theme-toggle .bulb-rays { opacity: 0; }
.nav-theme-toggle .bulb-fill { opacity: 0.9; transition: opacity 0.2s var(--ease); }  /* filament dims in dark */
html.dark .nav-theme-toggle .bulb-fill { opacity: 0.35; }
@media (pointer: coarse) { .lm-right .nav-theme-toggle { width: 44px; height: 44px; } }

/* Meet the Agent */
.nav-cta-agent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 0.84375rem;
  font-weight: 600;
  line-height: 1.7;   /* the body line height of /products/memory and the checkouts: a 39px pill, as there */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--nav-cta-ink);
  border: none;
  border-radius: 999px;
  background: var(--nav-cta-bg);
  text-decoration: none;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background-color 0.22s ease, color 0.22s ease;
}
.nav-cta-agent:hover {
  color: var(--nav-cta-ink);
  background: var(--nav-cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18);
}
@media (pointer: coarse) { .nav-cta-agent { min-height: 44px; } }

/* layout: wordmark | primary links (centered, 1024px and up) | toggle + Menu + CTA.
   The right cluster is pinned to column 3 so it stays right when the center links hide. */
@media (min-width: 721px) {
  .nav-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
  .nav-inner > .wordmark { justify-self: start; grid-column: 1; }
  .nav-inner > .lm-top   { justify-self: center; grid-column: 2; }
  .nav-inner > .lm-right { justify-self: end; grid-column: 3; }
}
.lm-btn .lm-kbd { white-space: nowrap; }
/* narrow phones with a fine pointer: the shortcut hint would push Menu past the edge next to the toggle */
@media (max-width: 520px) { .lm-btn .lm-kbd { display: none; } }
/* phones: the 16px header gutter of /products/memory and the checkouts, whatever the page's content gutter */
@media (max-width: 600px) {
  .nav { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}
/* wordmark + toggle + Menu need 341px: a tighter right cluster from 373px, and under that the toggle steps
   out (measured: 360px would push Menu 5px past the edge). The theme stays the saved choice or light. */
@media (max-width: 720px) { .lm-right:has(> .nav-theme-toggle) { gap: 0.5rem; } }
@media (max-width: 372px) { .lm-right .nav-theme-toggle { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .nav, .nav-cta-agent, .nav-theme-toggle, .nav-theme-toggle svg, .wordmark .brand-mark { transition: none !important; }
}

/* 2026-10-14 operator: Sign in sits next to the wordmark (a smaller outline pill), Docs is an icon in the
   primary links. Both follow .lm-top's breakpoint: under 1024px they live in the Menu panel. */
.lm-left { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }
@media (min-width: 721px) { .nav-inner > .lm-left { justify-self: start; grid-column: 1; } }
.nav .lm-signin {
  display: inline-flex; align-items: center;
  padding: 0.28rem 0.75rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--nav-ink) 28%, transparent);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  line-height: 1.4; white-space: nowrap; text-decoration: none;
  color: var(--nav-ink-mute);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav .lm-signin:hover { color: var(--nav-ink); border-color: color-mix(in srgb, var(--nav-ink) 55%, transparent); }
.nav .lm-signin:focus-visible { outline: 2px solid var(--nav-accent); outline-offset: 2px; }
@media (max-width: 1023px) { .nav .lm-signin { display: none; } }
.lm-top a.lm-top-ico { display: inline-flex; align-items: center; }
.lm-top a.lm-top-ico svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Sign in: slight teal gradient (operator 2026-10-14) */
.nav .lm-signin {
  background: linear-gradient(135deg, rgba(54, 216, 202, 0.16) 0%, rgba(45, 110, 106, 0.26) 100%);
  border-color: rgba(54, 216, 202, 0.42);
  color: var(--nav-ink);
}
.nav .lm-signin:hover {
  background: linear-gradient(135deg, rgba(54, 216, 202, 0.26) 0%, rgba(45, 110, 106, 0.36) 100%);
  border-color: rgba(54, 216, 202, 0.7);
}
