/* STRAX user wiki — a reading surface, not an app.
   Palette follows the STRAX brand kit: deep navy ink, orange accent, warm neutral paper. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ground: #f6f7f9;
  --ink: #10192b;
  --ink-soft: #4a5768;
  --ink-faint: #5f6d81; /* ≥4.5:1 on paper and ground — WCAG AA for small text */
  --line: #e2e6ec;
  --line-soft: #eef1f5;
  --brand: #0e1f33;
  --accent: #f26a1b;
  --accent-text: #b64a08; /* accent as TEXT on paper — the raw accent is only 3:1 */
  --accent-soft: #fff2e9;
  --link: #1f5fa8;
  --code-bg: #f3f5f8;
  --note: #eef4fc;
  --note-line: #b8d0ee;
  --tip: #eefaf2;
  --tip-line: #a9dfc2;
  --warn: #fff6e8;
  --warn-line: #f0cd94;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 25, 43, .06), 0 8px 24px rgba(16, 25, 43, .06);
  --sidebar-w: 280px;
  --topbar-h: 56px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131a24;
  --ground: #0d131b;
  --ink: #e7edf5;
  --ink-soft: #a8b6c8;
  --ink-faint: #7d8ca1;
  --line: #26313f;
  --line-soft: #1c2531;
  --brand: #e7edf5;
  --accent: #ff8340;
  --accent-text: #ff9a63;
  --accent-soft: #33210f;
  --link: #7fb4f0;
  --code-bg: #0f1620;
  --note: #131f2e;
  --note-line: #27405c;
  --tip: #10241a;
  --tip-line: #235c3e;
  --warn: #2a2113;
  --warn-line: #6a5327;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.65 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #10192b; color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img { height: 26px; width: auto; display: block; }
.topbar .brand span {
  padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line);
  color: var(--ink-faint); font-weight: 500; font-size: 13px; white-space: nowrap;
}
.menu, .theme {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1;
}
.menu:hover, .theme:hover { background: var(--ground); color: var(--ink); }
.menu { display: none; }

/* ── Search ──────────────────────────────────────────────────────────────── */
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--ground); color: var(--ink); font: inherit; font-size: 14px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--paper); }
.results {
  position: absolute; top: 40px; left: 0; right: 0; z-index: 50;
  max-height: 60vh; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.sel { background: var(--accent-soft); text-decoration: none; }
.results .r-t { font-weight: 600; font-size: 14px; }
.results .r-s { color: var(--ink-faint); font-size: 12px; }
.results .r-d { color: var(--ink-soft); font-size: 13px; }
.results .none { padding: 14px; color: var(--ink-faint); font-size: 14px; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.layout { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 18px 10px 40px 18px;
  background: var(--paper); border-right: 1px solid var(--line);
}
.nav-group { margin-bottom: 4px; }
.nav-group > summary {
  cursor: pointer; list-style: none; padding: 7px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint);
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::before { content: "▸ "; display: inline-block; width: 14px; transition: transform .15s; }
.nav-group[open] > summary::before { content: "▾ "; }
.nav-group > summary:hover { background: var(--ground); color: var(--ink); }
.nav-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 14px; }
.nav-group li a {
  display: block; padding: 6px 10px; border-radius: 7px;
  color: var(--ink-soft); font-size: 14px;
}
.nav-group li a:hover { background: var(--ground); color: var(--ink); text-decoration: none; }
.nav-group li a.active {
  background: var(--accent-soft); color: var(--ink); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

main {
  flex: 1 1 auto; min-width: 0;
  max-width: 900px; margin: 0 auto;
  padding: 28px 40px 80px;
}

/* ── Prose ───────────────────────────────────────────────────────────────── */
.crumb { font-size: 13px; color: var(--ink-faint); margin-bottom: 18px; }
.crumb span { margin: 0 6px; opacity: .6; }
.crumb b { color: var(--ink-soft); font-weight: 600; }

main h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
main h2 {
  font-size: 22px; line-height: 1.3; letter-spacing: -.01em;
  margin: 40px 0 12px; padding-top: 14px; border-top: 1px solid var(--line);
}
main h3 { font-size: 17px; margin: 26px 0 8px; }
main h4 { font-size: 15px; margin: 20px 0 6px; color: var(--ink-soft); }
main p { margin: 0 0 14px; }
.lede { font-size: 17px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 22px; }

main ul, main ol { margin: 0 0 14px; padding-left: 22px; }
main li { margin-bottom: 6px; }
main li > ul, main li > ol { margin-top: 6px; }

main code {
  background: var(--code-bg); border: 1px solid var(--line-soft);
  padding: 1px 5px; border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 13px;
}
main pre {
  background: var(--code-bg); border: 1px solid var(--line);
  padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; margin: 0 0 16px;
}
main pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.55; }

main blockquote {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft);
}
main blockquote p:last-child { margin-bottom: 0; }

/* Tables scroll inside their own box so the page never scrolls sideways. */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
main table { border-collapse: collapse; width: 100%; font-size: 14px; }
main th, main td {
  border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top;
}
main th { background: var(--ground); font-weight: 600; white-space: nowrap; }
main td code { white-space: nowrap; }

/* ── Screenshots ─────────────────────────────────────────────────────────── */
.shot { margin: 0 0 22px; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: zoom-in; background: var(--paper);
}
.shot figcaption {
  margin-top: 8px; font-size: 13px; color: var(--ink-faint); text-align: center;
}

.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(9, 14, 22, .88);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* ── Callouts (blockquote-style, authored as > **Note** …) ───────────────── */
.callout {
  margin: 0 0 18px; padding: 12px 16px 12px 44px; position: relative;
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px;
}
.callout::before {
  position: absolute; left: 14px; top: 12px; font-size: 15px; line-height: 1.4;
}
.callout p:last-child { margin-bottom: 0; }
.callout.note { background: var(--note); border-color: var(--note-line); }
.callout.note::before { content: "ℹ"; }
.callout.tip { background: var(--tip); border-color: var(--tip-line); }
.callout.tip::before { content: "✓"; }
.callout.warn { background: var(--warn); border-color: var(--warn-line); }
.callout.warn::before { content: "▲"; font-size: 12px; }

/* ── Home ────────────────────────────────────────────────────────────────── */
main.home { max-width: 1040px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 26px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; color: var(--accent-text); }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { margin-bottom: 12px; }
.card li a { font-weight: 600; font-size: 14px; }
.card li span { display: block; color: var(--ink-faint); font-size: 13px; line-height: 1.45; }

/* ── Pager ───────────────────────────────────────────────────────────────── */
.pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
}
.pager a {
  flex: 0 1 46%; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-faint); margin-bottom: 2px; }
.pager .next { text-align: right; margin-left: auto; }

/* ── Public docs extras (unused by the internal wiki shell) ──────────────── */
.site-link {
  font-size: 13px; font-weight: 600; color: var(--ink-faint);
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
}
.site-link:hover { background: var(--ground); color: var(--ink); text-decoration: none; }
.docfoot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-faint);
}
.docfoot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.docfoot a { color: var(--ink-faint); }
.docfoot a:hover { color: var(--ink); }

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .menu { display: block; }
  .topbar .brand span { display: none; }
  .site-link { display: none; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 45;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  main { padding: 22px 18px 60px; }
  main h1 { font-size: 26px; }
  .pager { flex-direction: column; }
  .pager a { flex: 1 1 auto; }
}

@media print {
  .topbar, .sidebar, .pager, .crumb, .docfoot { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .shot img { box-shadow: none; }
}

/* The horizontal lockup is dark-on-light; swap to the light-wordmark master on dark. */
html[data-theme="dark"] .topbar .brand img { content: url("logo-dark.png"); }
