/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #07101f;
  --surface:   #0d1a2e;
  --card:      #111f35;
  --border:    #1a2e4a;
  --border-hi: #234069;
  --cyan:      #00c2e0;
  --cyan-dim:  #0099b5;
  --purple:    #7c3aed;
  --text:      #dde6f0;
  --text-dim:  #8da3bc;
  --text-faint:#4d6a87;
  --green:     #22c55e;
  --amber:     #f59e0b;
  --red:       #ef4444;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; }

code, pre {
  font-family: 'Fira Code', 'Cascadia Code', 'Menlo', monospace;
  font-size: 0.875em;
}

pre {
  background: #040b14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  line-height: 1.7;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section   { padding: 72px 0; }
.section-sm { padding: 48px 0; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 16, 31, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.01em;
}
.nav-brand span { color: var(--text-dim); font-weight: 400; }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 0.875rem;
  color: var(--text-dim);
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-cta {
  background: var(--cyan);
  color: #000 !important;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 16px;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav-cta:hover { background: #fff !important; color: #000 !important; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 96px 0 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(ellipse, rgba(0,194,224,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,194,224,0.1);
  border: 1px solid rgba(0,194,224,0.25);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: #fff;
}
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero-sub {
  font-size: 1.125rem;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--cyan);
  color: #000;
}
.btn-primary:hover { background: #fff; color: #000; }
.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-hi);
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-dim); }

/* ── Stats bar ────────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.stat-item {
  flex: 1;
  min-width: 160px;
  padding: 20px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hi); }
.card-icon {
  font-size: 1.75rem;
  margin-bottom: 14px;
  display: block;
}
.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.card p { font-size: 0.875rem; color: var(--text-dim); line-height: 1.6; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }

/* ── Section headings ─────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 12px;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.7;
}

/* ── Service cards ────────────────────────────────────────────────────────── */
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}
.service-card:hover { border-color: var(--cyan-dim); }
.service-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.service-name { font-size: 0.95rem; font-weight: 700; color: #fff; }
.service-price {
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(0,194,224,0.08);
  border: 1px solid rgba(0,194,224,0.2);
  border-radius: 6px;
  padding: 3px 10px;
}
.service-desc { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }
.service-endpoint {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-family: monospace;
  background: #040b14;
  border-radius: 4px;
  padding: 5px 9px;
  border: 1px solid var(--border);
}

/* ── Pricing table ────────────────────────────────────────────────────────── */
.price-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.price-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}
.price-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.price-table tr:last-child td { border-bottom: none; }
.price-table tr:hover td { background: rgba(255,255,255,0.02); }
.price-usdc { color: var(--cyan); font-weight: 700; }
.price-eth  { color: var(--text-faint); font-size: 0.8rem; }
.method-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0,194,224,0.1);
  border: 1px solid rgba(0,194,224,0.2);
  color: var(--cyan);
  font-family: monospace;
}

/* ── Code blocks ──────────────────────────────────────────────────────────── */
.code-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.inline-code {
  background: #040b14;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 0.85em;
  color: var(--cyan);
}

/* ── Agent.json callout ───────────────────────────────────────────────────── */
.agent-callout {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(0,194,224,0.08));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--radius);
  padding: 32px;
}
.agent-callout h3 { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.agent-callout p  { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 16px; line-height: 1.7; }

/* ── Flow steps ───────────────────────────────────────────────────────────── */
.flow-steps { display: flex; flex-direction: column; gap: 0; }
.flow-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.flow-step:last-child { border-bottom: none; }
.flow-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,194,224,0.15);
  border: 1px solid rgba(0,194,224,0.3);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.flow-body h4 { font-size: 0.9rem; font-weight: 600; color: #fff; margin-bottom: 4px; }
.flow-body p  { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }

/* ── Graph page ───────────────────────────────────────────────────────────── */
#graph-wrap {
  width: 100%;
  height: 620px;
  border-radius: var(--radius);
  background: #040b14;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
#graph-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.graph-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.graph-note {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Docs ─────────────────────────────────────────────────────────────────── */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; }
.docs-nav { position: sticky; top: 80px; }
.docs-nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.docs-nav a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all 0.15s;
}
.docs-nav a:hover { color: var(--text); background: var(--surface); }
.docs-nav a.active { color: var(--cyan); background: rgba(0,194,224,0.08); }
.docs-section { margin-bottom: 52px; scroll-margin-top: 80px; }
.docs-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.docs-section h3 { font-size: 1rem; font-weight: 700; color: #e2e8f0; margin: 24px 0 10px; }
.docs-section p  { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 14px; }
.docs-section ul { padding-left: 20px; margin-bottom: 14px; }
.docs-section li { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 6px; line-height: 1.6; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}
footer a { color: var(--text-faint); }
footer a:hover { color: var(--cyan); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { display: none; }
  .stat-item { min-width: 120px; }
  .hero { padding: 64px 0 48px; }
}
