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

:root {
  --bg:          #060608;
  --bg-2:        #0d0d12;
  --bg-3:        #13131a;
  --bg-4:        #1a1a24;
  --border:      #1c1c2a;
  --border-2:    #252535;
  --border-3:    #303045;
  --text:        #eeeef5;
  --text-2:      #8888a8;
  --text-3:      #44445a;
  --accent:      #f0b429;
  --accent-2:    #ff6b35;
  --accent-dim:  #9a7518;
  --accent-glow: rgba(240, 180, 41, 0.15);
  --accent-bg:   rgba(240, 180, 41, 0.07);
  --green:       #22d3a0;
  --red:         #ff5a65;
  --blue:        #4d9fff;
  --purple:      #b57bff;
  --sidebar-w:   268px;
  --header-h:    58px;
  --font-sans:   'Space Grotesk', sans-serif;
  --font-display:'Outfit', sans-serif;
  --font-mono:   'Space Mono', monospace;
  --radius:      9px;
  --transition:  150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

.page-wrapper { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  z-index: 200;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.header {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  background: rgba(6, 6, 8, 0.5);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
}

.sidebar-section {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child { border-bottom: none; }

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  padding: 8px 12px;
  margin-bottom: 8px;
}

.sidebar-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: all var(--transition);
}

.sidebar-item:hover {
  background: var(--bg-3);
  color: var(--text);
}

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

.sidebar-item-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.sidebar-item.active .sidebar-item-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.content {
  flex: 1;
  padding: 48px;
  max-width: 900px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-2);
}

.breadcrumb span:not(.breadcrumb-sep) {
  cursor: pointer;
  transition: color var(--transition);
}

.breadcrumb span:not(.breadcrumb-sep):hover {
  color: var(--accent);
}

.breadcrumb-sep { opacity: 0.5; }

.page-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  margin-bottom: 12px;
}

h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
  font-family: var(--font-display);
}

.lead {
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 32px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text);
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}

p { margin-bottom: 16px; }

code {
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--blue);
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: var(--font-mono);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}

.code-block-lang { font-family: var(--font-mono); }

.code-block-copy {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
}

.code-block-copy:hover {
  background: var(--bg-4);
  color: var(--accent);
}

.code-block pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

.callout {
  padding: 16px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin: 16px 0;
  display: flex;
  gap: 12px;
}

.callout-icon {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 16px;
}

.callout-body { flex: 1; }

.callout-note {
  background: var(--accent-bg);
  border-left-color: var(--accent);
  color: var(--text);
}

.callout-note .callout-icon { color: var(--accent); }

.callout-warning {
  background: rgba(255, 107, 53, 0.07);
  border-left-color: var(--accent-2);
}

.callout-warning .callout-icon { color: var(--accent-2); }

.callout-success {
  background: rgba(34, 211, 160, 0.07);
  border-left-color: var(--green);
}

.callout-success .callout-icon { color: var(--green); }

.callout-error {
  background: rgba(255, 90, 101, 0.07);
  border-left-color: var(--red);
}

.callout-error .callout-icon { color: var(--red); }

.table-wrap {
  margin: 16px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  color: var(--text-2);
}

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

tbody tr:hover { background: var(--bg-3); }

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

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

.tok-fn { color: var(--purple); font-weight: 600; }
.tok-cmt { color: var(--text-3); font-style: italic; }
.tok-flag { color: var(--accent-2); }
.tok-path { color: var(--green); }
.tok-str { color: var(--green); }
.tok-kw { color: var(--blue); }
.tok-type { color: var(--blue); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.6s ease-out forwards; }

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main-content { margin-left: 0; }
  .content { padding: 24px; }
  h1 { font-size: 32px; }
}