/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: #0a0c10; color: #e2e8f0; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Colours ──────────────────────────────────────────────── */
:root {
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --surface: #111827;
  --surface2: #1f2937;
  --border: #374151;
  --muted: #9ca3af;
  --green: #10b981;
  --red: #ef4444;
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(10,12,16,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; font-size: .875rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 6px; font-size: .875rem; font-weight: 500; transition: background .15s, color .15s; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { border: 1px solid var(--border); color: #e2e8f0; background: transparent; }
.btn-outline:hover { background: var(--surface2); }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: #e2e8f0; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { padding: 6rem 1.5rem 4rem; text-align: center; max-width: 860px; margin: 0 auto; }
.hero-badge { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: rgba(99,102,241,.15); color: var(--accent); font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 1.5rem; border: 1px solid rgba(99,102,241,.3); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 1.25rem; }
.hero h1 span { background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.125rem; color: var(--muted); max-width: 640px; margin: 0 auto 2rem; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Demo box ─────────────────────────────────────────────── */
.demo-section { max-width: 900px; margin: 0 auto 5rem; padding: 0 1.5rem; }
.demo-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.demo-header { padding: .75rem 1.25rem; background: var(--surface2); display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--border); font-size: .875rem; color: var(--muted); }
.demo-dot { width: 10px; height: 10px; border-radius: 50%; }
.demo-input-row { display: flex; gap: .75rem; padding: 1.25rem; align-items: center; }
.demo-input { flex: 1; padding: .6rem 1rem; background: #0a0c10; border: 1px solid var(--border); border-radius: 8px; color: #e2e8f0; font-size: .9rem; outline: none; font-family: 'Courier New', monospace; }
.demo-input:focus { border-color: var(--accent); }
.demo-output { padding: 0 1.25rem 1.25rem; }
.demo-output pre { background: #0a0c10; border-radius: 8px; padding: 1.25rem; font-size: .8rem; line-height: 1.8; overflow-x: auto; color: #a5b4fc; font-family: 'Courier New', monospace; min-height: 120px; }

/* ── Feature grid ─────────────────────────────────────────── */
.features-section { max-width: 1200px; margin: 0 auto 5rem; padding: 0 1.5rem; }
.section-title { text-align: center; font-size: 1.75rem; font-weight: 700; margin-bottom: .75rem; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 3rem; font-size: .95rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.feature-card p { font-size: .875rem; color: var(--muted); }
.feature-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(99,102,241,.15); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.1rem; }

/* ── Pricing ──────────────────────────────────────────────── */
.pricing-section { max-width: 1100px; margin: 0 auto 5rem; padding: 0 1.5rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem 1.5rem; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--accent); background: rgba(99,102,241,.06); }
.plan-name { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .5rem; }
.plan-card.featured .plan-name { color: var(--accent); }
.plan-price { font-size: 2.5rem; font-weight: 800; margin-bottom: .25rem; }
.plan-price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan-desc { font-size: .875rem; color: var(--muted); margin-bottom: 1.5rem; }
.plan-features { flex: 1; margin-bottom: 1.75rem; display: flex; flex-direction: column; gap: .6rem; font-size: .875rem; }
.plan-features li::before { content: '✓ '; color: var(--green); font-weight: 700; }

/* ── Code blocks ──────────────────────────────────────────── */
.code-block { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 1.5rem 0; }
.code-block-header { padding: .6rem 1rem; background: var(--surface2); font-size: .75rem; color: var(--muted); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.code-block pre { padding: 1.25rem; font-size: .82rem; line-height: 1.7; overflow-x: auto; font-family: 'Courier New', monospace; }
.hl-key { color: #f59e0b; }
.hl-str { color: #86efac; }
.hl-num { color: #a5b4fc; }
.hl-bool { color: #f472b6; }
.hl-comment { color: #6b7280; }

/* ── Docs layout ──────────────────────────────────────────── */
.docs-layout { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; display: grid; grid-template-columns: 220px 1fr; gap: 3rem; }
.docs-sidebar { position: sticky; top: 76px; align-self: start; }
.docs-sidebar h4 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .75rem; margin-top: 1.25rem; }
.docs-sidebar a { display: block; font-size: .875rem; color: var(--muted); padding: .3rem 0; }
.docs-sidebar a:hover, .docs-sidebar a.active { color: #e2e8f0; }
.docs-content h2 { font-size: 1.5rem; font-weight: 700; margin-top: 2.5rem; margin-bottom: .75rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.docs-content h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.docs-content h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: .5rem; }
.docs-content p { color: #cbd5e1; margin-bottom: 1rem; font-size: .95rem; }
.docs-content table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-bottom: 1.5rem; }
.docs-content th { text-align: left; padding: .5rem .75rem; background: var(--surface2); color: var(--muted); font-weight: 600; border: 1px solid var(--border); }
.docs-content td { padding: .5rem .75rem; border: 1px solid var(--border); }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .7rem; font-weight: 600; }
.badge-get { background: rgba(16,185,129,.15); color: var(--green); }
.badge-post { background: rgba(99,102,241,.15); color: #a5b4fc; }

/* ── Forms ────────────────────────────────────────────────── */
.form-page { max-width: 480px; margin: 4rem auto; padding: 0 1.5rem; }
.form-page h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: .5rem; }
.form-page p { color: var(--muted); margin-bottom: 2rem; font-size: .9rem; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .4rem; }
.form-group input, .form-group select { width: 100%; padding: .6rem .9rem; background: #0a0c10; border: 1px solid var(--border); border-radius: 8px; color: #e2e8f0; font-size: .9rem; outline: none; }
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.alert { padding: .75rem 1rem; border-radius: 8px; font-size: .875rem; margin-bottom: 1rem; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: var(--green); }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: var(--red); }
.key-display { background: #0a0c10; border: 1px solid var(--green); border-radius: 8px; padding: 1rem; font-family: 'Courier New', monospace; font-size: .85rem; word-break: break-all; color: var(--green); margin: 1rem 0; }

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.dashboard h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-sub { font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; }
.section-card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.key-meta { font-size: .875rem; }
.key-meta strong { display: block; font-family: 'Courier New', monospace; }
.key-meta span { color: var(--muted); font-size: .8rem; }
.tag { display: inline-block; padding: .2rem .6rem; border-radius: 4px; font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.tag-active { background: rgba(16,185,129,.12); color: var(--green); }
.tag-plan { background: rgba(99,102,241,.12); color: #a5b4fc; }
.chart-placeholder { background: #0a0c10; border-radius: 8px; height: 200px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .875rem; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 2rem 1.5rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .875rem; color: var(--muted); }
.footer ul { display: flex; gap: 1.5rem; }
.footer a:hover { color: #e2e8f0; }

/* ── Utility ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
