:root {
  --bg: #fafafa;
  --fg: #111;
  --muted: rgba(0, 0, 0, 0.6);
  --faint: rgba(0, 0, 0, 0.4);
  --line: rgba(0, 0, 0, 0.1);
}

html { scroll-behavior: smooth; }

body.docs-body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
  min-height: 100vh;
  margin: 0;
}

body.docs-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.docs-header-inner,
.docs-footer-inner,
.docs-shell {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.docs-header-inner {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.docs-mark {
  width: 2rem;
  height: 2rem;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.docs-brand-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--muted);
}

.docs-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.docs-nav a {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--faint);
  text-decoration: none;
}

.docs-nav a:hover,
.docs-nav a.is-active {
  color: #000;
}

.docs-shell {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.docs-side {
  position: sticky;
  top: 4.5rem;
  align-self: start;
}

.docs-side p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 1.25rem 0 0.4rem;
}

.docs-side p:first-child { margin-top: 0; }

.docs-side a {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
}

.docs-side a:hover,
.docs-side a.is-active {
  color: #000;
}

.prose {
  max-width: 48rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.78);
}

.prose > *:first-child { margin-top: 0; }

.prose h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #000;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 650;
  color: #000;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.prose h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111;
  margin: 1.5rem 0 0.5rem;
}

.prose h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
}

.prose p, .prose ul, .prose ol, .prose pre, .prose table, .prose blockquote {
  margin: 0 0 1rem;
}

.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: 0.25rem 0; }
.prose li > ul, .prose li > ol { margin: 0.25rem 0 0.5rem; }

.prose a { color: #000; }
.prose a:hover { text-decoration-thickness: 2px; }

.prose code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1em 0.35em;
}

.prose pre, .prose .highlight {
  background: #fff;
  border: 1px solid var(--line);
  overflow-x: auto;
}

.prose pre {
  padding: 1rem 1.1rem;
  font-size: 0.8rem;
  line-height: 1.55;
  font-family: "JetBrains Mono", monospace;
}

.prose .highlight { margin: 0 0 1rem; }
.prose .highlight pre {
  margin: 0;
  border: 0;
  background: transparent;
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
  background: #fff;
}

.prose th {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  background: #fff;
}

.prose blockquote {
  border-left: 2px solid #000;
  padding: 0.15rem 0 0.15rem 1rem;
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.docs-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem 0;
}

.docs-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--faint);
}

.docs-footer a {
  color: var(--faint);
  text-decoration: none;
  margin-left: 1.25rem;
}

.docs-footer a:hover { color: var(--muted); }

@media (max-width: 800px) {
  .docs-brand-name { display: none; }
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1.5rem;
  }
  .docs-side {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
  }
  .docs-side p {
    flex-basis: 100%;
    margin: 0.5rem 0 0;
  }
  .docs-side p:first-child { margin-top: 0; }
  .docs-side a { padding: 0; }
}

.highlight .k, .highlight .kd, .highlight .kn { color: rgba(0,0,0,0.45); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .mi { color: #059669; }
.highlight .n, .highlight .nb, .highlight .nc, .highlight .nf { color: rgba(0,0,0,0.8); }
.highlight .c, .highlight .c1 { color: rgba(0,0,0,0.4); }
.highlight .o, .highlight .p { color: rgba(0,0,0,0.45); }
