/* ============================================================
   LabHit Docs — brand-consistent static documentation styles
   ============================================================ */

:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, Menlo, monospace;
  --amber: #e08a3c;
  --purple: #a855f7;
  --green: #3fb950;
  --blue: #4f8ef7;
  --grad: linear-gradient(135deg, #e08a3c, #a855f7);
  --sidebar-w: 264px;
  --toc-w: 232px;
  --topbar-h: 60px;
  --radius: 10px;
  --maxw: 760px;
}

/* ---------- Dark (default) ---------- */
html[data-theme="dark"] {
  --bg: #0e0c14;
  --surface: #12101a;
  --surface-2: #161422;
  --text: #e0e6ed;
  --muted: #9da5ae;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --code-bg: #0b0a11;
  --code-text: #d6dbe2;
  --inline-code-bg: rgba(168, 85, 247, 0.13);
  --inline-code-text: #e3c9ff;
  --link: #c79bff;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --card-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  --table-head: #191624;
  --table-stripe: rgba(255, 255, 255, 0.02);
  --selection: rgba(168, 85, 247, 0.32);
  /* highlight.js tokens */
  --hl-comment: #6c7280;
  --hl-keyword: #c490f7;
  --hl-string: #88d49b;
  --hl-number: #e0a96d;
  --hl-title: #6fa8f7;
  --hl-type: #e0a05a;
  --hl-attr: #6fa8f7;
  --hl-meta: #8b93a0;
  --hl-tag: #4f8ef7;
  --hl-name: #e08a3c;
  --hl-symbol: #88d49b;
}

/* ---------- Light "Dawn" ---------- */
html[data-theme="light"] {
  --bg: #f6f3f0;
  --surface: #efe9f4;
  --surface-2: #ece5f3;
  --text: #2c2833;
  --muted: #5e5870;
  --border: rgba(28, 20, 40, 0.10);
  --border-strong: rgba(28, 20, 40, 0.18);
  --code-bg: #efe9f4;
  --code-text: #2c2833;
  --inline-code-bg: rgba(139, 63, 199, 0.10);
  --inline-code-text: #7a2fb8;
  --link: #8b3fc7;
  --shadow: 0 12px 36px rgba(60, 40, 90, 0.16);
  --card-shadow: 0 14px 30px rgba(60, 40, 90, 0.16);
  --table-head: #e7dff0;
  --table-stripe: rgba(28, 20, 40, 0.025);
  --selection: rgba(168, 85, 247, 0.22);
  /* highlight.js tokens */
  --hl-comment: #8a8398;
  --hl-keyword: #8b3fc7;
  --hl-string: #2e7d4f;
  --hl-number: #b5701f;
  --hl-title: #2f6bd8;
  --hl-type: #a85a14;
  --hl-attr: #2f6bd8;
  --hl-meta: #6b6478;
  --hl-tag: #2f6bd8;
  --hl-name: #a85a14;
  --hl-symbol: #2e7d4f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection); }

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

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 650;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.35);
}
.brand-name { font-size: 17px; letter-spacing: -0.01em; }
.brand-docs {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Search box */
.search {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
#search-input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search-input::placeholder { color: var(--muted); }
#search-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}
.search-key {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(60vh, 460px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
}
.search-results[hidden] { display: none; }
.search-empty { padding: 18px 14px; color: var(--muted); font-size: 14px; text-align: center; }
.sr-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}
.sr-item:hover, .sr-item.active { background: var(--surface-2); text-decoration: none; }
.sr-item.active { outline: 1px solid var(--border-strong); }
.sr-page { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--purple); margin-bottom: 2px; }
.sr-title { font-size: 14px; font-weight: 550; }
.sr-snippet { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.sr-item mark { background: rgba(224, 138, 60, 0.28); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Top actions */
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ============================================================
   Layout
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 26px 14px 40px 20px;
  border-right: 1px solid var(--border);
}
.nav-group { margin-bottom: 22px; }
.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px;
  margin-bottom: 8px;
}
.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
  border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
  border-left-color: var(--amber);
  font-weight: 550;
}

/* Content */
.content {
  min-width: 0;
  padding: 38px 44px 80px;
}
.article {
  max-width: var(--maxw);
  margin: 0 auto;
}
.content.is-wide .article { max-width: 1000px; }

/* Landing page: no right rail, content spans wider */
body[data-page="index"] .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
body[data-page="index"] .toc { display: none; }

/* TOC rail */
.toc {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 36px 20px 40px 8px;
}
.toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc-list a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.toc-list a:hover { color: var(--text); text-decoration: none; }
.toc-list a.active { color: var(--amber); border-left-color: var(--amber); }
.toc-list .toc-h3 a { padding-left: 26px; font-size: 12.5px; }

/* ============================================================
   Article typography
   ============================================================ */
.article h1 {
  font-size: 33px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 700;
}
.article h2 {
  font-size: 23px;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 650;
}
.article h3 { font-size: 18px; margin: 30px 0 10px; font-weight: 650; }
.article h4 { font-size: 15.5px; margin: 24px 0 8px; font-weight: 650; color: var(--text); }
.article h2:hover .anchor, .article h3:hover .anchor { opacity: 0.6; }
.anchor {
  opacity: 0;
  margin-left: 8px;
  color: var(--purple);
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.15s;
}
.anchor:hover { opacity: 1 !important; text-decoration: none; }
.article h1, .article h2, .article h3, .article h4 { scroll-margin-top: calc(var(--topbar-h) + 16px); }

.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { margin: 5px 0; }
.article li > ul, .article li > ol { margin: 5px 0; }
.article strong { color: var(--text); font-weight: 650; }
.article hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

.article blockquote {
  margin: 0 0 16px;
  padding: 2px 16px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}

/* Inline code */
.article :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  word-break: break-word;
}
.article a code { color: var(--link); }

/* Tables */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.article thead th {
  background: var(--table-head);
  text-align: left;
  font-weight: 650;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.article th, .article td {
  border: 1px solid var(--border);
  padding: 9px 13px;
  vertical-align: top;
}
.article tbody tr:nth-child(even) { background: var(--table-stripe); }
.article td code, .article th code { white-space: nowrap; }

/* ============================================================
   Code blocks
   ============================================================ */
.article pre {
  position: relative;
  margin: 0 0 22px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.article pre:hover { border-color: var(--border-strong); }
.article pre > code {
  display: block;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--code-text);
  padding: 16px 18px;
  overflow-x: auto;
  background: transparent;
  -webkit-overflow-scrolling: touch;
  -moz-tab-size: 2;
  tab-size: 2;
}
/* Thin, theme-aware scrollbars for code */
.article pre > code::-webkit-scrollbar { height: 9px; }
.article pre > code::-webkit-scrollbar-track { background: transparent; }
.article pre > code::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--code-bg);
}
.article pre > code::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s, transform 0.15s, color 0.15s, border-color 0.15s;
}
.article pre:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; transform: translateY(0); }
.copy-btn:hover { color: var(--text); border-color: var(--purple); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }
@media (hover: none) { .copy-btn { opacity: 1; } }

/* highlight.js token colors (single source of truth, theme-aware) */
.hljs { color: var(--code-text); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-addition { color: var(--hl-string); }
.hljs-number, .hljs-bullet { color: var(--hl-number); }
.hljs-title, .hljs-title.function_, .hljs-function .hljs-title { color: var(--hl-title); }
.hljs-type, .hljs-class .hljs-title, .hljs-built_in, .hljs-builtin-name { color: var(--hl-type); }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-variable, .hljs-template-variable { color: var(--hl-attr); }
.hljs-meta, .hljs-comment .hljs-doctag { color: var(--hl-meta); }
.hljs-tag { color: var(--hl-tag); }
.hljs-name, .hljs-selector-id, .hljs-selector-class { color: var(--hl-name); }
.hljs-symbol, .hljs-link { color: var(--hl-symbol); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ============================================================
   Prev / next
   ============================================================ */
.prevnext {
  max-width: var(--maxw);
  margin: 48px auto 0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.prevnext a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.prevnext a:hover { border-color: var(--purple); background: var(--surface-2); text-decoration: none; }
.prevnext .pn-next { text-align: right; }
.pn-label { font-size: 12px; color: var(--muted); }
.pn-title { font-size: 15px; font-weight: 600; }

/* ============================================================
   Index / landing
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 48px;
  align-items: center;
  margin: 8px 0 20px;
}
.hero-copy { min-width: 0; }
.hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.hero .grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }

/* Hero code window + ambient glow */
.hero-visual { position: relative; min-width: 0; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% -4% 8% 10%;
  background: var(--grad);
  opacity: 0.13;
  filter: blur(48px);
  border-radius: 48px;
  z-index: 0;
  pointer-events: none;
}
.code-window {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--code-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cw-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cw-dots { display: inline-flex; gap: 6px; }
.cw-dots i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}
.cw-dots i:nth-child(1) { background: #e0654f; }
.cw-dots i:nth-child(2) { background: #e0a93c; }
.cw-dots i:nth-child(3) { background: #3fb950; }
.cw-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.code-window pre {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.code-window pre:hover { border: none; }
.code-window pre > code { font-size: 13px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--purple); }
.btn-primary { background: var(--grad); border: none; color: #1a1020; }
.btn-primary:hover { color: #1a1020; box-shadow: 0 8px 24px rgba(168, 85, 247, 0.32); }

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 16px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.doc-card {
  display: block;
  padding: 18px 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.15s, background 0.15s, box-shadow 0.16s ease;
}
.doc-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--purple);
  background: var(--surface-2);
  box-shadow: var(--card-shadow);
}
.doc-card .card-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  color: var(--amber);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.doc-card:hover .card-icon {
  color: var(--purple);
  border-color: color-mix(in srgb, var(--purple) 38%, var(--border));
  background: color-mix(in srgb, var(--purple) 10%, var(--surface-2));
}
.doc-card h3 { margin: 0 0 5px; font-size: 16px; font-weight: 650; }
.doc-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.doc-card .card-go { margin-top: 12px; font-size: 13px; color: var(--purple); font-weight: 600; transition: color 0.15s; }
.doc-card:hover .card-go { color: var(--amber); }

/* ============================================================
   Entrance motion (gated by prefers-reduced-motion)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: lh-fade-up 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
  .hero-copy .eyebrow { animation-delay: 0.02s; }
  .hero-copy h1 { animation-delay: 0.07s; }
  .hero-copy .lead { animation-delay: 0.13s; }
  .hero-copy .hero-cta { animation-delay: 0.19s; }
  .hero-visual { animation: lh-fade 0.7s ease 0.18s both; }
  .hero-visual::before { animation: lh-glow 7s ease-in-out infinite; }
  .card-grid .doc-card { animation: lh-fade 0.5s ease both; }
  .card-grid .doc-card:nth-child(2) { animation-delay: 0.05s; }
  .card-grid .doc-card:nth-child(3) { animation-delay: 0.10s; }
  .card-grid .doc-card:nth-child(4) { animation-delay: 0.15s; }
}
@keyframes lh-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes lh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lh-glow { 0%, 100% { opacity: 0.09; } 50% { opacity: 0.18; } }

@media (prefers-reduced-motion: reduce) {
  .doc-card:hover, .btn:hover, .prevnext a:hover { transform: none; }
}

/* ============================================================
   Mobile drawer + responsive
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-backdrop.open { opacity: 1; }
.drawer-backdrop[hidden] { display: none; }

@media (max-width: 1200px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .hamburger { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    height: 100vh;
    z-index: 55;
    background: var(--bg);
    border-right: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    padding-top: 22px;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 28px 22px 70px; }
  .brand-docs { display: none; }
  .search-key { display: none; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; margin-top: 4px; }
  .hero .lead { max-width: 100%; }
  .hero-visual { max-width: 540px; }
}

@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .search { max-width: none; }
  .brand-name { display: none; }
  .hero h1 { font-size: 31px; }
  .hero .lead { font-size: 16px; }
  .article h1 { font-size: 27px; }
  .content { padding: 22px 16px 60px; }
  .prevnext { flex-direction: column; }
}

/* Focus visibility for keyboard users */
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.nav-link:focus-visible, .toc-list a:focus-visible, .sr-item:focus-visible { outline-offset: -2px; }
