:root {
  --page: #f6f4ee;
  --ink: #1f2a24;
  --muted: #5d6b63;
  --accent: #2f7d5b;
  --panel: #ffffff;
  --line: #dcd8cc;
  --bar: #1f3a2d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #141a17;
    --ink: #e7ece8;
    --muted: #9fb0a6;
    --accent: #6fcf9f;
    --panel: #1c2420;
    --line: #2e3a33;
    --bar: #0f1512;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); }

.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 16px;
}

.placeholder .elf { font-size: 4.5rem; }
.placeholder h1 { margin: 0.5rem 0; }
.muted { color: var(--muted); font-size: 0.95rem; }

.site-footer {
  padding: 1rem 16px;
  text-align: center;
  border-top: 1px solid var(--line);
}

/* Docs page */
.docs-page { background: var(--page); }

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.9rem 16px;
  background: var(--bar);
  color: #fff;
}

.docs-topbar a { color: inherit; font-weight: 650; text-decoration: none; }
.docs-topbar span { color: #b9c9bf; font-size: 0.9rem; }

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 860px);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
}

.docs-toc {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow: auto;
  font-size: 0.92rem;
}

.docs-toc strong { display: block; margin-bottom: 0.75rem; }
.docs-toc ul { margin: 0; padding-left: 1.1rem; }
.docs-toc li { margin: 0.2rem 0; }

.docs-content { min-width: 0; }
.docs-content h1 { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.docs-content h1:first-child { margin-top: 0; border-top: 0; }

.docs-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1rem 0;
}

.docs-content th,
.docs-content td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

.docs-content code {
  background: var(--panel);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

.docs-content blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--panel);
}

@media (max-width: 760px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; max-height: none; }
}
