:root {
  --bg: #ffffff;
  --fg: #1a1d23;
  --muted: #5b6472;
  --border: #e6e8eb;
  --accent: #4f46e5;
  --accent-bg: #eef0ff;
  --code-bg: #0d1117;
  --max-width: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #e7e9ee;
    --muted: #9aa3b2;
    --border: #262a33;
    --accent: #818cf8;
    --accent-bg: #1a1a2e;
    --code-bg: #0a0c10;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
}

.site-header nav a {
  margin-left: 1.5rem;
  color: var(--fg);
  font-size: 0.95rem;
}

.site-header nav a.ext {
  color: var(--muted);
}

main.wrap {
  min-height: calc(100vh - 64px - 60px);
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero-body {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}
.button:hover { text-decoration: none; opacity: 0.9; }

.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  color: var(--fg);
  font-size: 0.95rem;
}

.sidebar li a:hover {
  background: var(--accent-bg);
  text-decoration: none;
}

.sidebar li a.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.breadcrumb span { padding: 0 0.35em; }

.content h1 { margin-top: 0; }

.content pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
}

.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.content :not(pre) > code {
  background: var(--accent-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.content table {
  border-collapse: collapse;
  width: 100%;
}

.content th, .content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer .wrap {
  height: 60px;
  display: flex;
  align-items: center;
}

@media (max-width: 720px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .site-header nav a {
    margin-left: 1rem;
  }
}
