/* The docs sites at /docs/ (docs-kit/site.mjs): the SDK and the MCP. Tokens follow the hub's theme (src/theme.ts). */
:root {
  --bg: #f8f7f4;
  --paper: #ffffff;
  --ink: #0f1128;
  --text: #2b2a28;
  --muted: #6b6762;
  --line: #e8e5df;
  --soft: #f1efea;
  --accent: #e9484d;
  --accent-ink: #b8262b;
  --code-bg: #f6f5f1;
  --link: #1e63e9;
  --select: #fdecec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;
    --paper: #232020;
    --ink: #f4f1ec;
    --text: #e2ddd6;
    --muted: #a39d95;
    --line: #3f3a36;
    --soft: #2b2725;
    --accent: #ef6a6e;
    --accent-ink: #f59a9d;
    --code-bg: #262322;
    --link: #8ab1ff;
    --select: #3a2324;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--select); }

/* ---- top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); font: 600 18px/1 'Bricolage Grotesque', Inter, sans-serif;
}
.brand:hover { text-decoration: none; }
.brand span:last-child { color: var(--muted); font-weight: 600; }
.mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #e9484d 0%, #ef9563 100%); }
/* The sister sites, side by side in the header. */
.sisters { display: flex; gap: 2px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; }
.sisters a { padding: 3px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.sisters a:hover { color: var(--ink); text-decoration: none; }
.sisters a[aria-current='true'] { background: var(--paper); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--line); }
.version {
  font: 500 12px/1 'JetBrains Mono', ui-monospace, monospace;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px;
}
.top-links { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--ink); text-decoration: none; }
.menu {
  display: none; margin-left: 8px;
  font: 500 14px Inter, sans-serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; cursor: pointer;
}

/* ---- three columns: sidebar, page, on this page */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.sidebar {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
  padding: 24px 16px 40px 20px; border-right: 1px solid var(--line);
}
.nav-section { margin-bottom: 22px; }
.nav-section p {
  margin: 0 0 6px; padding: 0 10px;
  font: 600 12px/1.4 Inter, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.nav-section ul { list-style: none; margin: 0; padding: 0; }
.nav-section a {
  display: block; padding: 5px 10px; border-radius: 8px;
  color: var(--text); font-size: 14.5px; line-height: 1.4;
}
.nav-section a:hover { background: var(--soft); text-decoration: none; }
.nav-section a[aria-current='page'] { background: var(--select); color: var(--accent-ink); font-weight: 600; }

main { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; padding: 40px 40px 80px; }
article { min-width: 0; max-width: 780px; }
.toc { position: sticky; top: 92px; align-self: start; font-size: 13.5px; }
.toc p { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); }
.toc li.d3 a { padding-left: 24px; }
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.active { color: var(--accent-ink); border-left-color: var(--accent); }

/* ---- the page */
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
h1, h2, h3, h4 { color: var(--ink); font-family: 'Bricolage Grotesque', Inter, sans-serif; font-weight: 600; line-height: 1.25; }
h1 { font-size: 36px; margin: 0 0 10px; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 32px; }
h2 { font-size: 24px; margin: 48px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
h3 { font-size: 18px; margin: 32px 0 8px; }
h3 code { font-size: 0.92em; }
h4 { font-size: 16px; margin: 24px 0 8px; }
.anchor { float: left; margin-left: -22px; padding-right: 6px; color: var(--muted); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; text-decoration: none; }
p, ul, ol { margin: 0 0 16px; }
li { margin: 4px 0; }
strong { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
blockquote {
  margin: 0 0 20px; padding: 12px 16px;
  background: var(--soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
blockquote p:last-child { margin-bottom: 0; }

:not(pre) > code {
  font: 0.88em 'JetBrains Mono', ui-monospace, monospace;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px;
  overflow-wrap: anywhere;
}
.code { position: relative; margin: 0 0 20px; }
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px;
  font: 13.5px/1.6 'JetBrains Mono', ui-monospace, monospace;
}
.copy {
  position: absolute; top: 8px; right: 8px;
  font: 500 12px Inter, sans-serif; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.code:hover .copy, .copy:focus { opacity: 1; }
.shiki, .shiki span { color: var(--shiki-light); background-color: var(--shiki-light-bg); }
@media (prefers-color-scheme: dark) {
  .shiki, .shiki span { color: var(--shiki-dark); background-color: var(--shiki-dark-bg); }
}

.table { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--soft); color: var(--ink); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { white-space: normal; overflow-wrap: normal; word-break: normal; }
td:first-child { white-space: nowrap; }
td:first-child code { white-space: nowrap; overflow-wrap: normal; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); font-weight: 600; background: var(--paper);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }

/* ---- narrower screens */
@media (max-width: 1180px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu { display: inline-block; }
  .top-links { display: none; }
  .version { display: none; }
  .top { gap: 10px; padding: 0 12px; }
  .brand span:last-child { display: none; }
  .sisters a { padding: 3px 10px; }
  .menu { margin-left: auto; }
  .top-links + .menu { margin-left: auto; }
  .sidebar {
    display: none; position: fixed; inset: 60px 0 0 0; z-index: 9; height: auto;
    background: var(--bg); border-right: 0;
  }
  .sidebar.open { display: block; }
  main { padding: 28px 16px 64px; }
  h1 { font-size: 30px; }
  .anchor { display: none; }
}

/* ---- /docs/ itself */
.landing { max-width: 960px; margin: 0 auto; padding: 56px 20px 80px; display: block; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.site-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--text); }
.site-card:hover { border-color: var(--accent); text-decoration: none; }
.site-card strong { font: 600 20px/1.3 'Bricolage Grotesque', Inter, sans-serif; color: var(--ink); }
@media (max-width: 860px) { .landing { padding: 32px 16px 64px; } }
