/* voltcube site chrome — shared across index.html, demo.html, docs.html.
   Owns top nav, footer, prose, code blocks, and the light/dark theme
   switch. Keep this file small and library-flavored: monochrome neutrals,
   one accent, no shadows or gradients. */

:root {
  --site-bg: #ffffff;
  --site-panel: #ffffff;
  --site-border: #e5e7eb;
  --site-border-strong: #d1d5db;
  --site-fg: #0f172a;
  --site-fg-muted: #475569;
  --site-fg-subtle: #94a3b8;
  /* Brand yellow — used for backgrounds (buttons, highlights, callout border).
     Pairs with the dark slate logo bolt for the high-voltage caution-sign
     palette. */
  --site-accent: #facc15;
  --site-accent-strong: #eab308;
  --site-accent-fg: #1f2937;
  /* Link/text accent — a darker amber that meets WCAG AA on white. Yellow
     itself is unreadable as text; this token exists so hyperlinks stay on
     brand without sacrificing contrast. */
  --site-link: #854d0e;
  --site-code-bg: #f7f7f8;
  --site-code-fg: #1f2937;
  --site-hover: #f3f4f6;
  --site-font: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --site-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --site-maxw: 960px;
}

:root[data-theme='dark'] {
  --site-bg: #0b0e14;
  --site-panel: #0f131b;
  --site-border: #1f2532;
  --site-border-strong: #2a3140;
  --site-fg: #e5e7eb;
  --site-fg-muted: #9ca3af;
  --site-fg-subtle: #6b7280;
  --site-accent: #facc15;
  --site-accent-strong: #fde047;
  --site-accent-fg: #1f2937;
  --site-link: #fde047;
  --site-code-bg: #11151d;
  --site-code-fg: #e5e7eb;
  --site-hover: #161b25;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--site-bg);
  color: var(--site-fg);
  font-family: var(--site-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Top nav ─────────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--site-bg);
  border-bottom: 1px solid var(--site-border);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.site-nav__inner {
  /* Full-width: brand pinned to the left edge of the viewport, nav links
     pinned to the right edge. Body content below stays centered at
     --site-maxw on marketing pages — only the nav goes edge-to-edge. */
  max-width: none;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--site-fg);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.site-brand__mark {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 auto;
}

.site-brand__badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--site-fg-subtle);
  border: 1px solid var(--site-border);
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 6px;
  letter-spacing: 0.04em;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__links a {
  font-size: 14px;
  color: var(--site-fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}

.site-nav__links a:hover {
  color: var(--site-fg);
  background: var(--site-hover);
}

.site-nav__links a[aria-current='page'] {
  color: var(--site-fg);
  font-weight: 600;
}

.site-nav__theme {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--site-fg-muted);
  font-size: 14px;
  border: 1px solid transparent;
}

.site-nav__theme:hover {
  background: var(--site-hover);
  color: var(--site-fg);
}

/* ── Page container ───────────────────────────────────────────────── */

.site-main {
  max-width: var(--site-maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.site-main--wide {
  max-width: 1200px;
}

/* ── Typography helpers ──────────────────────────────────────────── */

.site-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--site-fg-subtle);
  margin: 0 0 12px 0;
}

h1, h2, h3, h4 {
  color: var(--site-fg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 { font-size: 44px; margin: 0 0 16px 0; }
h2 { font-size: 24px; margin: 56px 0 16px 0; padding-top: 8px; }
h3 { font-size: 17px; margin: 28px 0 8px 0; }

.site-lede {
  font-size: 19px;
  line-height: 1.5;
  color: var(--site-fg-muted);
  margin: 0 0 32px 0;
  max-width: 640px;
}

p { margin: 0 0 16px 0; color: var(--site-fg); }
p.site-muted { color: var(--site-fg-muted); }

a { color: var(--site-link); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd {
  font-family: var(--site-mono);
  font-size: 0.88em;
  background: var(--site-code-bg);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--site-code-fg);
}

pre {
  background: var(--site-code-bg);
  border: 1px solid var(--site-border);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--site-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--site-code-fg);
  margin: 0 0 24px 0;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* Subtle syntax color via pseudo-classes (manual spans in HTML). */
.tk-keyword { color: #7c3aed; }
.tk-string  { color: #15803d; }
.tk-comment { color: var(--site-fg-subtle); font-style: italic; }
.tk-fn      { color: #2563eb; }
.tk-type    { color: #ea580c; }

:root[data-theme='dark'] .tk-keyword { color: #c084fc; }
:root[data-theme='dark'] .tk-string  { color: #86efac; }
:root[data-theme='dark'] .tk-fn      { color: #93c5fd; }
:root[data-theme='dark'] .tk-type    { color: #fdba74; }

/* ── Buttons ─────────────────────────────────────────────────────── */

.site-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 7px;
  border: 1px solid var(--site-border-strong);
  background: var(--site-panel);
  color: var(--site-fg);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.site-btn:hover {
  background: var(--site-hover);
  border-color: var(--site-fg-subtle);
  text-decoration: none;
}

.site-btn--primary {
  background: var(--site-accent);
  border-color: var(--site-accent);
  color: var(--site-accent-fg);
  font-weight: 600;
}

.site-btn--primary:hover {
  background: var(--site-accent-strong);
  border-color: var(--site-accent-strong);
  color: var(--site-accent-fg);
}

.site-btn__arrow {
  font-size: 1em;
  transition: transform 0.12s;
}

.site-btn:hover .site-btn__arrow { transform: translateX(2px); }

/* ── Tables ──────────────────────────────────────────────────────── */

.site-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0 0 24px 0;
}

.site-table th,
.site-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--site-border);
  vertical-align: top;
}

.site-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--site-fg-subtle);
  background: transparent;
}

.site-table td code {
  font-size: 12.5px;
}

/* ── Cards ──────────────────────────────────────────────────────── */

.site-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.site-card {
  background: var(--site-panel);
  border: 1px solid var(--site-border);
  border-radius: 10px;
  padding: 18px 20px;
}

.site-card h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
}

.site-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--site-fg-muted);
  line-height: 1.5;
}

/* ── Callouts ────────────────────────────────────────────────────── */

.site-callout {
  background: var(--site-code-bg);
  border: 1px solid var(--site-border);
  border-left: 3px solid var(--site-accent);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--site-fg-muted);
  margin: 0 0 24px 0;
}

.site-callout strong { color: var(--site-fg); font-weight: 600; }

/* ── Footer ──────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--site-border);
  padding: 28px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--site-fg-subtle);
}

.site-footer p { margin: 0 0 4px; }
.site-footer p:last-child { margin-bottom: 0; }

.site-footer__privacy {
  font-size: 12px;
  color: var(--site-fg-subtle);
  opacity: 0.85;
}

.site-footer a { color: var(--site-fg-muted); }

/* ── Mobile ──────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  h1 { font-size: 32px; }
  h2 { font-size: 20px; }
  .site-lede { font-size: 16px; }
  .site-nav__links a { padding: 6px 8px; font-size: 13px; }
  .site-nav__inner { padding: 10px 16px; gap: 12px; }
  .site-main { padding: 0 16px 60px; }
}
