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

:root {
  --bg: #000; --surface: #0a0a0a; --text: #fff; --dim: #888; --muted: #555;
  --green: #22c55e; --green-dim: rgba(34,197,94,0.1);
  --border: rgba(255,255,255,0.08);
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --max: 720px;
}

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.7; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--green); color: var(--bg); }

/* Nav */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-nav .wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 50px; }
.site-nav .logo { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.site-nav .logo .mark { width: 22px; height: 22px; background: var(--text); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--bg); }
.site-nav .links { display: flex; gap: 24px; }
.site-nav .links a { font-size: 13px; color: var(--dim); text-decoration: none; }
.site-nav .links a:hover { color: var(--text); text-decoration: none; }
.site-nav .links a.active { color: var(--text); }
.site-nav .burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--dim); }
.site-nav .burger svg { width: 20px; height: 20px; }

@media (max-width: 700px) {
  .site-nav .burger { display: block; }
  .site-nav .links {
    display: none; position: fixed; top: 50px; left: 0; right: 0; height: 100vh;
    flex-direction: column; gap: 0;
    background: #000;
    padding: 12px 24px; z-index: 99;
  }
  .site-nav .links.open { display: flex; }
  .site-nav .links a { font-size: 18px; padding: 20px 0; border-bottom: 1px solid var(--border); display: block; }
}

/* Layout */
.page-wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.content-wrap { max-width: var(--max); }

/* Docs layout */
.docs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 48px; padding: 48px 0; }
.docs-sidebar { position: sticky; top: 74px; align-self: start; max-height: calc(100vh - 74px); overflow-y: auto; }
.docs-sidebar a { display: block; font-size: 13px; color: var(--dim); padding: 6px 0; text-decoration: none; border-left: 2px solid transparent; padding-left: 12px; }
.docs-sidebar a:hover { color: var(--text); text-decoration: none; }
.docs-sidebar a.active { color: var(--green); border-left-color: var(--green); }
.docs-sidebar .sidebar-section { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 20px; margin-bottom: 8px; padding-left: 12px; }
.docs-sidebar .sidebar-section:first-child { margin-top: 0; }

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; padding: 24px 0; }
  .docs-sidebar {
    position: static; max-height: none;
    display: flex; flex-wrap: wrap; gap: 4px;
    padding-bottom: 24px; margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
  }
  .docs-sidebar a { padding: 6px 12px; border-left: none; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); font-size: 12px; }
  .docs-sidebar a.active { background: var(--green-dim); border-color: rgba(34,197,94,0.2); }
  .docs-sidebar .sidebar-section { width: 100%; margin-top: 12px; padding-left: 0; }
  .docs-sidebar .sidebar-section:first-child { margin-top: 0; }
}

/* Blog list */
.blog-list { padding: 48px 0; }
.blog-list h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.blog-list .sub { font-size: 14px; color: var(--dim); margin-bottom: 40px; }
.blog-card { display: block; padding: 20px 0; border-top: 1px solid var(--border); text-decoration: none; }
.blog-card:hover { text-decoration: none; }
.blog-card:hover .blog-title { text-decoration: underline; text-underline-offset: 3px; }
.blog-card .blog-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 16px; }
.blog-card .blog-title { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; margin-bottom: 6px; }
.blog-card .blog-excerpt { font-size: 13px; color: var(--dim); line-height: 1.6; }

/* Article */
.article { padding: 48px 0 80px; }
.article-header { margin-bottom: 40px; }
.article-header .meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 16px; }
.article-header h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.article-header .lead { font-size: 16px; color: var(--dim); margin-top: 16px; line-height: 1.6; }

/* Prose */
.prose h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 40px; margin-bottom: 14px; padding-top: 20px; border-top: 1px solid var(--border); }
.prose h3 { font-size: 16px; font-weight: 600; margin-top: 28px; margin-bottom: 10px; }
.prose p { margin-bottom: 14px; color: rgba(255,255,255,0.85); font-size: 15px; }
.prose ul, .prose ol { margin-bottom: 14px; padding-left: 20px; color: rgba(255,255,255,0.85); font-size: 15px; }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: 0.85em; background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 4px; color: var(--green); }
.prose pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-x: auto; margin-bottom: 20px; }
.prose pre code { background: none; padding: 0; font-size: 12px; line-height: 1.7; color: var(--dim); }
.prose blockquote { border-left: 3px solid var(--green); padding-left: 16px; margin: 20px 0; color: var(--dim); font-style: italic; font-size: 15px; }
.prose img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); margin: 20px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 13px; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.prose th { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.prose td { color: var(--dim); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* Callout boxes */
.callout { border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin: 20px 0; font-size: 13px; }
.callout-info { border-color: rgba(96,165,250,0.2); background: rgba(96,165,250,0.04); }
.callout-warn { border-color: rgba(245,158,11,0.2); background: rgba(245,158,11,0.04); }
.callout-tip { border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.04); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.site-footer .wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer .left { font-size: 12px; color: var(--muted); }
.site-footer .right { display: flex; gap: 16px; }
.site-footer .right a { font-size: 12px; color: var(--dim); text-decoration: none; }
.site-footer .right a:hover { color: var(--text); }
