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

:root {
  --black:  #000000;
  --white:  #ffffff;
  --accent: #fdbe16;
  --muted:  #888888;
  --border: #1e1e1e;
  --panel:  #0d0d0d;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
}

.nav-logo { font-weight: bold; font-size: 1.1rem; color: var(--white); }
.nav-logo em { color: var(--muted); font-style: normal; }
.nav-logo span { color: var(--muted); }
.nav-logo, .nav-logo:hover { color: var(--white); text-decoration: none; }

.nav-back { font-size: 0.8rem; color: var(--muted); transition: color 0.15s; }
.nav-back:hover { color: var(--white); text-decoration: none; }

/* Prism theme overrides — match site palette */
code[class*="language-"],
pre[class*="language-"],
pre code[class*="language-"] {
  background: var(--panel) !important;
  font-family: 'SF Mono', 'Fira Code', monospace !important;
  font-size: 0.875rem !important;
  text-shadow: none !important;
}

pre[class*="language-"] {
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 1.25rem 1.5rem !important;
  margin: 1rem 0 1.5rem !important;
}

.token.string    { color: #98c379; }
.token.number    { color: #d19a66; }
.token.boolean,
.token.null      { color: #d19a66; }
.token.property  { color: #61afef; }
.token.operator,
.token.punctuation { color: #666; }
.token.comment   { color: #444; }

/* Copy button */
.pre-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(40,40,40,0.85);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.25rem;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  z-index: 1;
}

.pre-copy-btn:hover { color: #d4d4d4; border-color: #666; }

.docs-downloads {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
  display: inline-block;
}

.btn-ghost:hover { border-color: #444; text-decoration: none; }

.docs-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
  gap: 1rem;
  align-items: start;
  min-width: 0;
}

.docs-content { min-width: 0; }

.docs-nav {
  position: sticky;
  top: 80px;
  font-size: 0.9rem;
}

.docs-nav-section {
  margin-bottom: 1.75rem;
}

.docs-nav-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

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

.docs-nav li { margin-bottom: 0.3rem; }

.docs-nav a {
  color: #666;
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.6;
}

.docs-nav a:hover { color: var(--white); text-decoration: none; }
.docs-nav a.active { color: var(--white); }

.docs-content h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.docs-content .docs-intro {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 400;
  margin-bottom: 3rem;
}

.docs-content section {
  padding: 0;
  margin-bottom: 4rem;
}

.docs-content h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.03em;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--white);
  scroll-margin-top: 80px;
}

.docs-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--white);
}

.docs-content p {
  font-size: 1rem;
  color: #aaa;
  line-height: 1.8;
  margin-bottom: 1rem;
  font-weight: 400;
}

.docs-content ul, .docs-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.docs-content li {
  font-size: 1rem;
  color: #aaa;
  line-height: 1.8;
  margin-bottom: 0.3rem;
  font-weight: 400;
}

.docs-content strong { color: var(--white); font-weight: 600; }

.docs-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: #ccc;
}

pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  max-width: 100%;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: #ccc;
  line-height: 1.7;
}

.callout {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout p {
  margin-bottom: 0;
  font-size: 1rem;
  color: #bbb;
}

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

.table-wrap { overflow-x: auto; max-width: 100%; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 0.5rem 0.85rem;
  background: var(--panel);
  color: var(--white);
  font-weight: 700;
  border: 1px solid var(--border);
}

td {
  padding: 0.5rem 0.85rem;
  color: #aaa;
  border: 1px solid var(--border);
  line-height: 1.6;
  font-weight: 400;
  vertical-align: top;
}

td code { font-size: 0.85rem; }

.method {
  display: inline-block;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  margin-right: 0.4rem;
  letter-spacing: 0.04em;
}

.method-get    { background: #1a3a2a; color: #4ade80; }
.method-post   { background: #1a2a3a; color: #60a5fa; }
.method-put    { background: #2a2a1a; color: #fbbf24; }
.method-patch  { background: #2a1a3a; color: #c084fc; }
.method-delete { background: #3a1a1a; color: #f87171; }

.primitive-flow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
}

.primitive-flow .prim {
  color: var(--accent);
  font-weight: 700;
}

.primitive-flow .arrow {
  color: #444;
}

.primitive-flow .desc {
  color: #555;
  font-size: 0.72rem;
}

.status-badge {
  display: inline-block;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  font-weight: 700;
}

.status-next     { background: #1a2a3a; color: #60a5fa; }
.status-complete { background: #1a3a2a; color: #4ade80; }
.status-failed   { background: #3a1a1a; color: #f87171; }
.status-pending  { background: #2a2a1a; color: #fbbf24; }

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 5rem;
    gap: 0;
  }

  .docs-nav {
    display: none;
  }

  .docs-content h1 {
    font-size: 2.2rem;
  }

  .docs-downloads {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  pre[class*="language-"],
  pre {
    font-size: 0.72rem !important;
    padding: 1rem !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .primitive-flow {
    font-size: 0.72rem;
    padding: 1rem;
    gap: 0.5rem;
  }

  .docs-content h2 {
    font-size: 1.4rem;
  }
}
