:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #f97316;
  --accent-dim: #f9731633;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
}

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

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

code, pre, .curl-command {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top Nav */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.btn-sm {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s;
}
.btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-icon {
  color: var(--accent);
  font-size: 20px;
}

h1 {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 16px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto 40px;
}

/* Curl Block */
.curl-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 520px;
  margin: 0 auto 32px;
  text-align: left;
}

.curl-block.compact {
  max-width: 100%;
  margin: 0;
  border-radius: 0 0 10px 10px;
}

.curl-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot.red { background: var(--red); }
.terminal-dot.yellow { background: var(--yellow); }
.terminal-dot.green { background: var(--green); }

.curl-label {
  color: var(--text-dim);
  font-size: 12px;
  margin-left: 8px;
  flex: 1;
}

.copy-btn {
  background: var(--border);
  border: none;
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: var(--accent);
  color: white;
}

.curl-command {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--green);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.curl-command code::before {
  content: '$ ';
  color: var(--text-dim);
}

/* Buttons */
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: #ea6c10;
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-align: center;
}

.section-sub {
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 40px;
}

/* Flow Diagram — Compact */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}

.flow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 220px;
}

.flow-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.flow-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.pill-more {
  border-style: dashed;
  border-color: var(--text-dim);
  color: var(--text-dim);
  font-style: italic;
}

.flow-arrow {
  font-size: 28px;
  color: var(--accent);
  font-weight: 300;
  flex-shrink: 0;
}

.flow-engine {
  background: linear-gradient(135deg, var(--accent-dim), #f9731615);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 16px 20px;
  text-align: center;
  flex-shrink: 0;
}

.flow-engine-logo {
  color: var(--accent);
  font-size: 22px;
}

.flow-engine-name {
  font-weight: 700;
  font-size: 14px;
  margin: 2px 0 8px;
}

.flow-engine-steps {
  display: flex;
  gap: 4px;
}

.flow-engine-steps span {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-dim);
  font-size: 14px;
}

/* Use Cases Grid */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.usecase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}

.usecase-card:hover {
  border-color: var(--accent);
}

.usecase-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.usecase-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.usecase-card p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

/* API Examples — Merged Section */
.api-examples {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.api-example {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.api-example-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.api-example-badge {
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.api-example-badge.pull { background: #22c55e22; color: var(--green); }
.api-example-badge.ask { background: #3b82f622; color: var(--blue); }
.api-example-badge.follow { background: #f9731633; color: var(--accent); }

.api-example-title {
  color: var(--text-dim);
  font-size: 14px;
}

/* Sources Grid */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
}

.source-card strong {
  font-size: 15px;
}

.source-card span {
  color: var(--text-dim);
  font-size: 13px;
}

.source-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 4px;
}

.source-add {
  border-style: dashed;
  border-color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}
.source-add:hover {
  background: var(--accent-dim);
}
.source-add strong {
  color: var(--accent);
}

/* API Table */
.api-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 700px;
  margin: 0 auto;
}

.api-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.api-method {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}
.api-method.get {
  background: #22c55e22;
  color: var(--green);
}
.api-method.post {
  background: #3b82f622;
  color: var(--blue);
}

.api-path {
  color: var(--green);
  font-size: 14px;
  flex: 1;
}

.api-row span {
  color: var(--text-dim);
  font-size: 13px;
}

/* Demo Block */
.demo-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.demo-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.demo-output {
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.footer-content p {
  color: var(--text-dim);
  margin-top: 8px;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 16px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

.footer-tagline {
  margin-top: 24px;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 32px; }
  .subtitle { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .sources-grid { grid-template-columns: repeat(2, 1fr); }
  .usecases-grid { grid-template-columns: 1fr; }
  .api-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .flow-diagram { flex-direction: column; gap: 12px; padding: 20px 16px; }
  .flow-col { max-width: 100%; }
  .flow-arrow { transform: rotate(90deg); font-size: 22px; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0 40px; }
  .sources-grid { grid-template-columns: 1fr; }
  .curl-command { font-size: 13px; }
  .top-nav { flex-direction: column; gap: 12px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
