/* docs.html only. The rest of the site uses style.css. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0b0b0d;
  --panel: #141417;
  --panel-head: #1a1a1e;
  --line: #27272c;
  --text: #e4e4e7;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #b794f6;
  --topbar: 60px;
}

html {
  scroll-padding-top: calc(var(--topbar) + 20px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar);
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-sub {
  color: var(--faint);
}

.topbar-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 0.9rem;
}

.topbar-links a {
  color: var(--muted);
  white-space: nowrap;
}

.topbar-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.menu-button {
  display: none;
  padding: 4px 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

/* Page layout */
.layout {
  display: flex;
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar);
  flex: 0 0 280px;
  height: calc(100vh - var(--topbar));
  padding: 28px 16px 40px 24px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.sidebar .group {
  margin: 24px 0 6px 12px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.sidebar .group:first-child {
  margin-top: 0;
}

.sidebar a {
  display: block;
  padding: 5px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  border-radius: 6px;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}

.sidebar a.active {
  color: var(--accent);
  background: rgba(183, 148, 246, 0.1);
}

.content {
  flex: 1;
  min-width: 0;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 48px 40px;
}

/* Text */
h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 1.1rem;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
  line-height: 1.3;
}

h3 {
  margin: 28px 0 8px;
  font-size: 1.1rem;
}

section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

p {
  margin: 12px 0;
}

ul {
  margin: 12px 0 12px 22px;
}

li {
  margin-bottom: 4px;
}

:not(pre) > code {
  padding: 2px 6px;
  color: var(--text);
  font-size: 0.86em;
  background: var(--panel-head);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

td code {
  white-space: nowrap;
}

code {
  font-family: Consolas, 'Liberation Mono', Menlo, Monaco, monospace;
}

.hint {
  margin: 20px 0;
  padding: 12px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

/* Code blocks */
.code {
  margin: 18px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: stretch;
  min-height: 40px;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
}

.code-tab {
  padding: 0 16px;
  color: var(--faint);
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.code-label {
  align-self: center;
  padding: 0 16px;
  color: var(--text);
  font-size: 0.85rem;
}

.copy-button {
  margin: 6px 8px 6px auto;
  padding: 0 12px;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.copy-button:hover {
  color: var(--text);
  border-color: var(--faint);
}

pre {
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  scrollbar-color: var(--line) transparent;
}

pre + pre {
  border-top: 1px solid var(--line);
}

pre[hidden] {
  display: none;
}

.tok-comment {
  color: #71717a;
}

.tok-string {
  color: #a5d6a7;
}

.tok-keyword {
  color: #c4a7f7;
}

.tok-number {
  color: #f5b97f;
}

.tok-call {
  color: #8ec5fc;
}

/* Tables */
.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--panel-head);
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

.routes th, .routes td {
  padding: 9px 10px;
  white-space: nowrap;
}

.routes code {
  font-size: 0.8em;
}

footer {
  margin-top: 56px;
  padding-top: 20px;
  color: var(--faint);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .menu-button {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar);
    left: 0;
    z-index: 9;
    display: none;
    width: 280px;
    background: var(--bg);
  }

  .sidebar.open {
    display: block;
  }

  .content {
    padding: 32px 18px;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-links a:first-child, .brand-sub {
    display: none;
  }
}
