/* oneshot docs — light default, dark via prefers-color-scheme */

:root {
  --bg: #fff;
  --bg-subtle: #f7f7f8;
  --bg-code: #f3f3f5;
  --border: #e5e5e5;
  --border-hover: #ccc;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --accent: #000;
  --link: #1a1a1a;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-w: 200px;
  --mobile-h: 44px;
  --radius: 5px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --bg-subtle: #191919;
    --bg-code: #161616;
    --border: #2a2a2a;
    --border-hover: #3a3a3a;
    --text: #e5e5e5;
    --text-secondary: #999;
    --text-muted: #666;
    --accent: #fff;
    --link: #e5e5e5;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); font-size: 14px; line-height: 1.65; color: var(--text); background: var(--bg); }
a { color: var(--link); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--text-secondary); }
code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-code); padding: 0.1em 0.3em; border-radius: 3px; }
pre code { background: none; padding: 0; border-radius: 0; }
ul { list-style: none; }
:focus-visible { outline: 1px solid var(--text-muted); outline-offset: 2px; }

.skip-link {
  position: absolute; top: 0.5rem; left: 1rem; z-index: 200;
  transform: translateY(-180%); background: var(--accent); color: var(--bg);
  border-radius: 3px; padding: 0.3rem 0.6rem; font-family: var(--mono); font-size: 0.7rem;
}
.skip-link:focus-visible { transform: translateY(0); }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; transition: transform 0.2s;
}
.sidebar-header {
  padding: 1rem 0.85rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.logo-link { display: flex; align-items: center; gap: 0.35rem; color: var(--text); text-decoration: none; }
.logo-icon { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }
.logo-text { font-family: var(--mono); font-size: 0.9rem; font-weight: 600; }
.version-badge {
  font-family: var(--mono); font-size: 0.6rem; color: var(--text-muted);
  background: var(--bg-subtle); padding: 0.1rem 0.35rem; border-radius: 3px;
}
.sidebar-nav { flex: 1; padding: 0.5rem; overflow-y: auto; }
.nav-link {
  display: block; padding: 0.3rem 0.5rem; font-size: 0.8rem;
  color: var(--text-secondary); border-radius: 3px; text-decoration: none;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); font-weight: 500; }
.sidebar-footer {
  padding: 0.6rem 0.85rem; border-top: 1px solid var(--border); display: flex; gap: 0.6rem;
}
.footer-link {
  display: flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem; color: var(--text-muted); text-decoration: none;
}
.footer-link:hover { color: var(--text-secondary); }
.footer-link svg { flex-shrink: 0; }

/* Mobile */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  height: var(--mobile-h); background: var(--bg); border-bottom: 1px solid var(--border);
  z-index: 99; align-items: center; padding: 0 0.6rem; gap: 0.4rem;
}
.mobile-logo {
  display: flex; align-items: center; gap: 0.35rem; color: var(--text);
  font-family: var(--mono); font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.menu-toggle {
  background: none; border: none; cursor: pointer; padding: 4px;
  display: flex; flex-direction: column; gap: 4px; width: 20px;
}
.menu-toggle span { display: block; height: 1.5px; background: var(--text-secondary); border-radius: 1px; transition: all 0.2s; }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 99; }

/* Content */
.content { margin-left: var(--sidebar-w); min-height: 100vh; }

/* Hero */
.hero { padding: 4rem 2.5rem 3rem; border-bottom: 1px solid var(--border); max-width: 860px; }
.hero-badge { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }
.hero-title { font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--text); margin-bottom: 0.75rem; letter-spacing: -0.03em; }
.hero-accent { color: var(--text-secondary); }
.hero-subtitle { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 1.5rem; line-height: 1.5; }
.hero-diagram { margin-bottom: 1.5rem; }
.diagram-flow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-secondary);
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: 0.4rem 0.8rem; border-radius: var(--radius);
}
.diagram-node { color: var(--text-muted); }
.diagram-node.highlight { color: var(--text); }
.diagram-arrow { color: var(--text-muted); }
.hero-install { margin-bottom: 1.25rem; }
.install-block {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-code); border: 1px solid var(--border);
  padding: 0.4rem 0.8rem; border-radius: var(--radius);
  font-family: var(--mono); font-size: 0.8rem; color: var(--text);
}
.install-block code { background: none; padding: 0; color: inherit; font-size: inherit; }
.hero-actions { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.hero-quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.quick-command-card { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem; }
.quick-command-kicker { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.4rem; }
.quick-command-card .code-block { margin: 0 0 0.4rem; }
.quick-command-desc { color: var(--text-secondary); font-size: 0.75rem; line-height: 1.4; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; padding: 0.4rem 0.8rem;
  font-family: var(--font); font-size: 0.75rem; font-weight: 500;
  border-radius: var(--radius); cursor: pointer; border: none; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { opacity: 0.8; color: var(--bg); }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--border-hover); }

/* Sections */
.section { padding: 2.5rem 2.5rem; border-bottom: 1px solid var(--border); max-width: 860px; }
.section-title { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.section-desc { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.5rem; }
.subsection-title { font-family: var(--mono); font-size: 0.9rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 0.5rem; }
.text-muted { color: var(--text-muted); }

/* Pipeline */
.pipeline { display: flex; align-items: flex-start; margin: 1rem 0; overflow-x: auto; padding-bottom: 0.5rem; }
.pipeline-step { flex: 1; min-width: 0; text-align: center; }
.step-number { font-family: var(--mono); font-size: 0.6rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.step-icon {
  width: 32px; height: 32px; margin: 0 auto 0.4rem;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.step-icon svg { width: 14px; height: 14px; color: var(--text-secondary); }
.step-title { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; color: var(--text); margin-bottom: 0.15rem; }
.step-engine { display: inline-block; font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.2rem; }
.engine-claude { color: #7c3aed; }
.engine-codex { color: #16a34a; }
@media (prefers-color-scheme: dark) {
  .engine-claude { color: #a78bfa; }
  .engine-codex { color: #4ade80; }
}
.step-desc { font-size: 0.65rem; color: var(--text-muted); line-height: 1.35; }
.pipeline-connector { flex: 0 0 4px; height: 1px; background: var(--border); margin-top: 32px; }
.pipeline-note { display: flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }
.pipeline-note svg { flex-shrink: 0; }

/* Steps */
.steps-list { display: flex; flex-direction: column; gap: 0.75rem; }
.numbered-step { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.numbered-step-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem; background: var(--bg-subtle); border-bottom: 1px solid var(--border);
}
.numbered-step-num {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-code); border: 1px solid var(--border); color: var(--text-secondary);
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600; border-radius: 50%; flex-shrink: 0;
}
.numbered-step-header h3 { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; }
.numbered-step-body { padding: 0.7rem; }
.numbered-step-body p { margin-bottom: 0.4rem; color: var(--text-secondary); font-size: 0.8rem; }
.numbered-step-body p:last-child { margin-bottom: 0; }
.prereq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.prereq-col h4 { font-family: var(--mono); font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.prereq-col ul li { color: var(--text-secondary); font-size: 0.75rem; padding: 0.1rem 0 0.1rem 0.6rem; position: relative; }
.prereq-col ul li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 3px; height: 3px; background: var(--text-muted); border-radius: 50%; }
.prereq-col ul li a { color: var(--text); }

/* Code */
.code-block {
  position: relative; background: var(--bg-code); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 0.4rem 0; overflow: hidden;
}
.code-block pre { padding: 0.5rem 0.7rem; overflow-x: auto; font-size: 0.75rem; line-height: 1.55; }
.code-block.compact pre { padding: 0.4rem 0.6rem; }
.copy-btn {
  position: absolute; top: 0.3rem; right: 0.3rem;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 3px;
  padding: 0.2rem; cursor: pointer; color: var(--text-muted); opacity: 0;
  transition: opacity 0.15s; display: flex; align-items: center; justify-content: center;
}
.code-block:hover .copy-btn, .install-block:hover .copy-btn, .install-block .copy-btn { opacity: 1; }
.install-block .copy-btn { position: static; opacity: 0.4; background: transparent; border: none; }
.install-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text-secondary); }
.copy-btn.copied { color: #16a34a; }
.copy-status {
  position: fixed; right: 0.6rem; bottom: 0.6rem; z-index: 150;
  padding: 0.4rem 0.6rem; border-radius: 3px; border: 1px solid var(--border);
  background: var(--bg-subtle); color: var(--text); font-size: 0.7rem;
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.copy-status.visible { opacity: 1; transform: translateY(0); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0.4rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
th {
  text-align: left; padding: 0.4rem 0.6rem; background: var(--bg-subtle); color: var(--text-muted);
  font-family: var(--mono); font-size: 0.65rem; font-weight: 500; letter-spacing: 0.03em;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
}
td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }

/* Grids */
.examples-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.5rem; }
.example-card { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; }
.example-card h4 { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.25rem; }
.example-card .code-block { margin: 0; }

.linear-flow { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.75rem 0; }
.linear-step {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.6rem; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius);
}
.linear-num {
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-code); border: 1px solid var(--border); border-radius: 50%;
  font-family: var(--mono); font-size: 0.6rem; color: var(--text-muted); flex-shrink: 0;
}
.linear-step p { color: var(--text-secondary); font-size: 0.75rem; }

.custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.custom-card { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.custom-card h3 { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.custom-card p { color: var(--text-secondary); font-size: 0.75rem; margin-bottom: 0.35rem; }
.file-list { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.35rem 0; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.25rem 0.4rem; background: var(--bg-code); border: 1px solid var(--border);
  border-radius: 3px; font-size: 0.75rem;
}
.file-item code { color: var(--text); background: none; padding: 0; }
.file-item span { color: var(--text-muted); font-size: 0.65rem; }

/* Footer */
.footer { padding: 1.5rem 2.5rem; }
.footer-content { max-width: 400px; }
.footer-brand {
  display: flex; align-items: center; gap: 0.3rem; margin-bottom: 0.25rem;
  color: var(--text-muted); font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
}
.footer-brand .logo-icon { width: 12px; height: 12px; }
.footer-tagline { font-size: 0.7rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 1024px) {
  .section { padding: 1.5rem 1.25rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .custom-grid, .examples-grid { grid-template-columns: 1fr; }
  .hero-quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .content { margin-left: 0; padding-top: var(--mobile-h); }
  html { scroll-padding-top: calc(var(--mobile-h) + 0.75rem); }
  .hero { padding: 1.5rem 1rem; }
  .hero-title { font-size: 1.5rem; }
  .section { padding: 1.25rem 1rem; }
  .pipeline { flex-direction: column; align-items: center; }
  .pipeline-step { flex: none; width: 100%; max-width: 180px; }
  .pipeline-connector { width: 1px; height: 8px; margin: 0; }
  .prereq-grid { grid-template-columns: 1fr; }
  .copy-btn, .install-block .copy-btn { opacity: 1; }
  .file-item { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
}
