/* DatIQ Help — standalone styles.
   Reuses the DatIQ design-system tokens so the help site matches the app.
   Generated companion to docs/build-help.mjs. */

:root {
  --accent: #4f46e5;
  --accent-strong: color-mix(in srgb, var(--accent) 84%, #000);
  --accent-contrast: #fff;
  --r: 14px;
  --r-sm: 9px;
  --r-pill: 999px;
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 28%, transparent);
}
[data-theme="light"] {
  --bg: #f6f8fb; --surface: #fff; --surface-2: #f4f6fa; --surface-hover: #f0f3f8;
  --border: #e6eaf0; --border-strong: #d3dae5;
  --text: #11192a; --text-2: #5a6577; --text-3: #97a0b0;
  --shadow-sm: 0 1px 2px rgba(17,25,42,.05), 0 1px 1px rgba(17,25,42,.04);
  --shadow: 0 4px 12px -4px rgba(17,25,42,.10), 0 2px 6px -2px rgba(17,25,42,.06);
  --shadow-accent: 0 10px 26px -8px color-mix(in srgb, var(--accent) 55%, transparent);
  --code-bg: #0e1422; --code-text: #d7e0f0;
}
[data-theme="dark"] {
  --bg: #080b14; --surface: #111726; --surface-2: #19202f; --surface-hover: #1c2433;
  --border: #232b3d; --border-strong: #303a50;
  --text: #f2f5fa; --text-2: #9aa6bb; --text-3: #616c82;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 6px 16px -6px rgba(0,0,0,.55), 0 2px 6px -2px rgba(0,0,0,.4);
  --shadow-accent: 0 12px 30px -8px color-mix(in srgb, var(--accent) 60%, transparent);
  --code-bg: #0b1020; --code-text: #cdd7ea;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15.5px; line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px); height: 64px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff; box-shadow: var(--shadow-accent);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--text); }
.brand-name b { color: var(--accent); }
.brand-help {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 3px 8px;
  border-radius: var(--r-pill); margin-left: 4px; vertical-align: middle;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.nav-link {
  font-size: .92em; font-weight: 550; color: var(--text-2);
  padding: 8px 13px; border-radius: var(--r-sm);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ── Layout ──────────────────────────────────────────────── */
.layout { display: flex; align-items: flex-start; max-width: 1280px; margin: 0 auto; }

.sidebar {
  position: sticky; top: 64px; align-self: flex-start;
  width: 280px; flex-shrink: 0; height: calc(100vh - 64px);
  overflow-y: auto; padding: 24px 14px 40px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.side-label {
  font-size: .68em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); padding: 14px 12px 6px;
}
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-link {
  display: flex; align-items: center; gap: 9px;
  font-size: .9em; font-weight: 500; color: var(--text-2);
  padding: 8px 12px; border-radius: var(--r-sm); line-height: 1.35;
}
.side-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-num {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; font-size: .76em; font-weight: 700;
  background: var(--surface-2); color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.side-link.active .side-num { background: var(--accent); color: #fff; }

.content {
  flex: 1; min-width: 0; padding: clamp(24px, 4vw, 52px) clamp(20px, 4vw, 56px) 64px;
}
.doc { max-width: 820px; }

/* ── Doc header ──────────────────────────────────────────── */
.doc-head { margin-bottom: 32px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.kicker {
  display: inline-block; font-size: .74em; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.doc-head h1 { margin: 0; font-size: clamp(30px, 4.5vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; }
.doc-sub { margin: 14px 0 0; font-size: 1.12em; color: var(--text-2); font-weight: 450; }

/* ── Doc body ────────────────────────────────────────────── */
.doc h2 {
  margin: 46px 0 14px; font-size: 1.62em; font-weight: 750; letter-spacing: -.02em;
  padding-top: 12px; scroll-margin-top: 80px;
}
.doc h3 { margin: 32px 0 10px; font-size: 1.24em; font-weight: 700; letter-spacing: -.01em; scroll-margin-top: 80px; }
.doc h4 { margin: 24px 0 8px; font-size: 1.05em; font-weight: 700; }
.doc p { margin: 0 0 15px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 24px; }
.doc li { margin: 5px 0; }
.doc li > ul, .doc li > ol { margin: 6px 0 6px; }
.doc strong { font-weight: 700; color: var(--text); }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* inline code */
.doc code {
  font-family: var(--mono); font-size: .86em;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 6px; border-radius: 6px;
}
/* code blocks */
.doc pre.code {
  background: var(--code-bg); color: var(--code-text);
  border-radius: var(--r); padding: 18px 20px; overflow-x: auto;
  margin: 0 0 20px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); line-height: 1.5;
}
.doc pre.code code {
  font-family: var(--mono); font-size: .82em; background: none; color: inherit; padding: 0;
  white-space: pre;
}

/* blockquote */
.doc blockquote {
  margin: 0 0 20px; padding: 14px 20px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2);
}
.doc blockquote p { margin: 0 0 8px; }
.doc blockquote p:last-child { margin: 0; }
.doc blockquote strong { color: var(--text); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.doc table { width: 100%; border-collapse: collapse; font-size: .92em; background: var(--surface); }
.doc th, .doc td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 700; font-size: .92em; color: var(--text); white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.doc td code { white-space: nowrap; }

/* figures / screenshots */
.doc figure { margin: 8px 0 26px; }
.doc figure img, .doc img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
}
.doc figcaption { margin-top: 10px; font-size: .86em; color: var(--text-3); text-align: center; }

/* ── Overview nav cards ──────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.nav-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .18s, border-color .18s;
}
.nav-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.nc-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; font-size: .95em; background: var(--accent-soft); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.nc-title { font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.nc-desc { font-size: .86em; color: var(--text-3); margin-top: 3px; line-height: 1.45; }

/* ── Prev / next ─────────────────────────────────────────── */
.page-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--border); }
.pn-btn {
  display: flex; flex-direction: column; gap: 3px; max-width: 48%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 18px; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .12s;
}
.pn-btn:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.pn-next { text-align: right; margin-left: auto; }
.pn-dir { font-size: .76em; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.pn-title { font-weight: 650; color: var(--text); }

.doc-foot { max-width: 820px; margin-top: 40px; font-size: .84em; color: var(--text-3); }

/* ── Mobile nav ──────────────────────────────────────────── */
.side-toggle {
  display: none; margin-bottom: 20px;
  font-family: inherit; font-weight: 600; font-size: .9em; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 9px 14px; cursor: pointer;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 64px; z-index: 30;
    background: var(--surface); width: 300px;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .side-toggle { display: inline-block; }
}
