:root {
  --bg: #0d0f14;
  --surface: #151820;
  --border: #1e2330;
  --accent: #4f8ef7;
  --accent-hover: #6aa0ff;
  --accent-dim: #2a4a8a;
  --green: #34d399;
  --success: #00bc8c;
  --text: #e2e8f0;
  --muted: #64748b;
  --code-bg: #0a0c10;
  --warning: #f59e0b;
  --warning-bg: #1e293b;
  --warning-fg: #cbd5e1;
  --radius: 8px;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  color-scheme: dark;
}

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

/* Dark scrollbars */
html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border) var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

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

/* Focus ring for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

.nav-logo span { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

nav ul a { color: var(--muted); font-size: 0.9rem; }
nav ul a:hover { color: var(--text); text-decoration: none; }

.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
}
.nav-cta:hover { background: var(--accent-hover); text-decoration: none; }

/* ── Hero ── */
.hero {
  max-width: 800px;
  margin: 5rem auto 3rem;
  padding: 0 2rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.btn-secondary:hover { border-color: var(--muted); text-decoration: none; }

/* ── Endpoint pill ── */
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 3rem;
}
.endpoint-pill code { color: var(--text); }

/* ── Features grid ── */
.section { max-width: 1000px; margin: 0 auto 5rem; padding: 0 2rem; }
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.section > p { color: var(--muted); margin-bottom: 2.5rem; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.tool-card-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.tool-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.tool-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.badge-free { background: rgba(52,211,153,0.12); color: var(--green); }
.badge-paid { background: rgba(79,142,247,0.12); color: var(--accent); }
.badge-pro  { background: rgba(251,191,36,0.15); color: var(--warning); border: 1px solid rgba(251,191,36,0.35); }
.badge-ai   { background: rgba(168,85,247,0.12); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }

/* ── Pricing comparison table ── */
.pc-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  min-width: 480px;
}

.pc-table th:nth-child(1),
.pc-table td:nth-child(1) { width: 55%; }
.pc-table th:nth-child(2),
.pc-table td:nth-child(2) { width: 20%; }
.pc-table th:nth-child(3),
.pc-table td:nth-child(3) { width: 25%; }

.pc-table thead th {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
}

.pc-col-feature,
.pc-col-tier {
  padding: 1rem 1rem;
}

.pc-col-feature {
  vertical-align: middle;
}

.pc-col-tier {
  text-align: center;
  border-left: 1px solid var(--border);
  vertical-align: middle;
}

.pc-col-pro {
  background: rgba(79,142,247,0.04);
}

.pc-pro-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.6rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.pc-tier-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.pc-tier-price {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.pc-tier-price span { font-size: 0.85rem; font-weight: 400; color: var(--muted); }



.pc-section-row {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.pc-section-row td {
  padding: 0.35rem 1rem;
}

.pc-table tbody tr {
  border-top: 1px solid var(--border);
}

.pc-table tbody tr:hover { background: rgba(255,255,255,0.015); }

.pc-col-feature code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.pc-col-feature span {
  font-size: 0.75rem;
  color: var(--muted);
}

.pc-limit-label {
  font-size: 0.85rem;
  color: var(--text);
}

.pc-check { color: var(--green); font-size: 1rem; }
.pc-dash  { color: var(--muted); font-size: 1rem; }

.pc-val {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  font-family: var(--mono);
  vertical-align: middle;
}

.plan-cta {
  display: block;
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.plan-cta-primary {
  background: var(--accent);
  color: #fff;
}
.plan-cta-primary:hover { background: var(--accent-hover); text-decoration: none; }

.plan-cta-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.plan-cta-secondary:hover { border-color: var(--muted); text-decoration: none; }

@media (max-width: 640px) {
  .pc-col-feature span { display: none; }
  .pc-table { min-width: 400px; }
  .pc-col-feature, .pc-col-tier { padding: 0.6rem 0.5rem; }
  .pc-tier-price { font-size: 1.2rem; }
  .plan-cta { font-size: 0.72rem; padding: 0.3rem 0.35rem; }
}

/* ── Code block ── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

.code-block .cm { color: #4b5563; }
.code-block .kw { color: #c084fc; }
.code-block .st { color: #34d399; }
.code-block .fn { color: #60a5fa; }
.code-block .nu { color: #fb923c; }
.code-block .py { color: #e2e8f0; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* ── Shared components ── */
.callout-warning {
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  padding: 10px 14px;
  margin: 0 0 1.5rem;
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--warning-fg);
  line-height: 1.55;
}
.callout-warning strong { color: var(--warning); }
.callout-warning a { color: var(--accent); }

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  font-size: 0.75rem;
  transition: all .15s;
}
.copy-btn.copied { color: var(--success); border-color: rgba(0,188,140,.25); }

/* ── Docs specific ── */
.docs-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  gap: 3rem;
}

.docs-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  align-self: flex-start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.docs-sidebar h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}

.docs-sidebar h3:first-child { margin-top: 0; }

.docs-sidebar ul { list-style: none; }
.docs-sidebar li { margin-bottom: 0.3rem; }
.docs-sidebar a { font-size: 0.85rem; color: var(--muted); }
.docs-sidebar a:hover { color: var(--text); text-decoration: none; }
.docs-sidebar a.active { color: var(--accent); }

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

.docs-content h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.docs-content p.lead {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.docs-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 3rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
}

.docs-content h2:first-of-type { border-top: none; margin-top: 0; }

.docs-content h3 {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  margin: 2rem 0 0.5rem;
}

.docs-content p { color: var(--muted); margin-bottom: 1rem; }
.docs-content ul { color: var(--muted); padding-left: 1.5rem; margin-bottom: 1rem; }
.docs-content li { margin-bottom: 0.3rem; }

.inline-code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  color: var(--text);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.param-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.param-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.param-table td:first-child { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }
.param-table td:nth-child(2) { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }
.param-table td:nth-child(3) { color: var(--muted); }

.response-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.status-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.4rem;
}
.status-ok     { background: rgba(52,211,153,0.12); color: var(--green); }
.status-pending { background: rgba(251,146,60,0.12); color: #fb923c; }
.status-empty  { background: rgba(100,116,139,0.12); color: var(--muted); }

@media (max-width: 700px) {
  .docs-layout { flex-direction: column; padding: 1rem; }
  .docs-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border: none;
    border-radius: 0;
    background: none;
    padding: 0 0 0.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .docs-sidebar h3 { display: none; }
  .docs-sidebar ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
  .docs-sidebar li { margin-bottom: 0; }
  .hero h1 { font-size: 2rem; }
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ── Mobile: global ── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; height: auto; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  nav ul { gap: 0.75rem; flex-wrap: wrap; justify-content: center; width: 100%; padding-bottom: 0.25rem; position: static; transform: none; }

  .hero { margin: 3rem auto 2rem; padding: 0 1rem; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 0.95rem; }

  .section { padding: 0 1rem; margin-bottom: 3rem; }
  .section h2 { font-size: 1.4rem; }

  .tools-grid { grid-template-columns: 1fr; }

  .code-block { font-size: 0.75rem; padding: 0.75rem 1rem; }

  footer { padding: 1.5rem 1rem; font-size: 0.75rem; }

  /* Scrollable param tables on mobile */
  .param-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .param-table td, .param-table th { padding: 0.4rem 0.5rem; font-size: 0.78rem; }
}
