/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a0f;
  --bg-card:     #12121a;
  --bg-card-hover: #1a1a28;
  --bg-code:     #0d0d15;
  --surface:     #1e1e2e;
  --border:      #2a2a3d;
  --border-glow: #4f46e540;
  --text:        #e4e4ef;
  --text-muted:  #8888a4;
  --text-dim:    #5a5a78;
  --accent:      #7c3aed;
  --accent-light:#a78bfa;
  --accent-glow: #7c3aed30;
  --green:       #34d399;
  --green-glow:  #34d39920;
  --blue:        #60a5fa;
  --blue-glow:   #60a5fa20;
  --amber:       #fbbf24;
  --amber-glow:  #fbbf2420;
  --rose:        #fb7185;
  --rose-glow:   #fb718520;
  --cyan:        #22d3ee;
  --cyan-glow:   #22d3ee20;
  --radius:      12px;
  --radius-lg:   20px;
  --radius-sm:   8px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --transition:  .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #c4b5fd; }

img { max-width: 100%; display: block; }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5 { line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--cyan) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 24px; }

.section { padding: 100px 0; }
.section-sm { padding: 60px 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 0;
  background: rgba(10, 10, 15, .8);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800; color: var(--text);
  letter-spacing: -.03em;
}

.nav-logo .logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
}

.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 8px 20px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff !important; font-weight: 600; font-size: .88rem;
  transition: all var(--transition);
}
.nav-cta:hover { background: #6d28d9; transform: translateY(-1px); box-shadow: var(--shadow-glow); }

.mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 80px; position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-glow) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 20%, var(--cyan-glow) 0%, transparent 60%),
    radial-gradient(ellipse 30% 25% at 30% 30%, var(--green-glow) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 820px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  background: var(--accent-glow); border: 1px solid var(--accent)40;
  font-size: .82rem; font-weight: 600; color: var(--accent-light);
  margin-bottom: 28px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.hero h1 { margin-bottom: 24px; }

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted);
  max-width: 640px; margin: 0 auto 44px; line-height: 1.7;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius); font-weight: 600; font-size: .95rem;
  transition: all var(--transition); cursor: pointer; border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff; box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); color: #fff; }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent-light); color: var(--accent-light); transform: translateY(-2px); }

.btn-sm { padding: 10px 20px; font-size: .88rem; border-radius: var(--radius-sm); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}

.card:hover {
  border-color: var(--accent)60;
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow), 0 0 60px var(--accent-glow);
}

.card-icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 20px;
}

a.card { display: block; text-decoration: none; color: var(--text); cursor: pointer; }
a.card:hover { color: var(--text); }

.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-muted); font-size: .95rem; margin-bottom: 20px; }

.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: .9rem; color: var(--accent-light);
}
.card-link:hover { gap: 10px; }
.card-link::after { content: '\2192'; transition: transform var(--transition); }

/* Service card color variations */
.card--purple .card-icon { background: var(--accent-glow); color: var(--accent-light); }
.card--green  .card-icon { background: var(--green-glow);  color: var(--green); }
.card--blue   .card-icon { background: var(--blue-glow);   color: var(--blue); }
.card--amber  .card-icon { background: var(--amber-glow);  color: var(--amber); }
.card--cyan   .card-icon { background: var(--cyan-glow);   color: var(--cyan); }

.card--purple:hover { border-color: var(--accent)50; box-shadow: var(--shadow), 0 0 60px var(--accent-glow); }
.card--green:hover  { border-color: var(--green)50;  box-shadow: var(--shadow), 0 0 60px var(--green-glow); }
.card--blue:hover   { border-color: var(--blue)50;   box-shadow: var(--shadow), 0 0 60px var(--blue-glow); }
.card--amber:hover  { border-color: var(--amber)50;  box-shadow: var(--shadow), 0 0 60px var(--amber-glow); }
.card--cyan:hover   { border-color: var(--cyan)50;   box-shadow: var(--shadow), 0 0 60px var(--cyan-glow); }

/* ── Stats Row ───────────────────────────────────────────── */
.stats-row {
  display: flex; justify-content: center; gap: 60px; flex-wrap: wrap;
  padding: 48px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}

.stat { text-align: center; }
.stat-value { font-size: 2.2rem; font-weight: 800; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

/* ── Code Blocks ─────────────────────────────────────────── */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  font-size: .8rem; color: var(--text-dim); font-weight: 600;
}

.code-header .method { padding: 2px 8px; border-radius: 4px; font-size: .75rem; font-weight: 700; }
.method-post { background: var(--green-glow); color: var(--green); }
.method-get  { background: var(--blue-glow); color: var(--blue); }

.code-body {
  padding: 20px; font-family: var(--font-mono); font-size: .85rem;
  line-height: 1.65; overflow-x: auto; color: var(--text-muted);
}

.code-body .key   { color: var(--cyan); }
.code-body .str   { color: var(--green); }
.code-body .num   { color: var(--amber); }
.code-body .bool  { color: var(--rose); }
.code-body .cmt   { color: var(--text-dim); font-style: italic; }

/* ── Feature List ────────────────────────────────────────── */
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }

.feature-list li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02); border: 1px solid transparent;
  transition: all var(--transition);
}
.feature-list li:hover { border-color: var(--border); background: rgba(255,255,255,.04); }

.feature-list .icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; margin-top: 2px;
}

.feature-list .content h4 { font-size: .95rem; margin-bottom: 4px; font-weight: 600; }
.feature-list .content p  { font-size: .88rem; color: var(--text-muted); line-height: 1.55; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: rgba(255,255,255,.03); }
th { text-align: left; padding: 14px 20px; font-weight: 600; color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
td { padding: 14px 20px; border-bottom: 1px solid var(--border)80; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
td code { font-family: var(--font-mono); font-size: .82rem; padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,.05); color: var(--accent-light); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
}
.badge-green  { background: var(--green-glow); color: var(--green); }
.badge-amber  { background: var(--amber-glow); color: var(--amber); }
.badge-rose   { background: var(--rose-glow); color: var(--rose); }
.badge-blue   { background: var(--blue-glow); color: var(--blue); }
.badge-purple { background: var(--accent-glow); color: var(--accent-light); }

/* ── Detail Page Header ──────────────────────────────────── */
.page-header {
  padding: 140px 0 80px; text-align: center; position: relative; overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
}
.page-header .breadcrumb {
  font-size: .85rem; color: var(--text-dim); margin-bottom: 20px;
}
.page-header .breadcrumb a { color: var(--text-muted); }
.page-header h1 { margin-bottom: 16px; }
.page-header .subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 640px; margin: 0 auto; }

.page-header .endpoint-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  background: var(--bg-code); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: .9rem; margin-top: 24px;
}

/* ── Section Headers ─────────────────────────────────────── */
.section-header { margin-bottom: 48px; }
.section-header.center { text-align: center; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--text-muted); font-size: 1.05rem; max-width: 580px; }
.section-header.center p { margin: 0 auto; }

/* ── Pipeline / Flow ─────────────────────────────────────── */
.pipeline {
  display: flex; flex-direction: column; gap: 0; position: relative;
}
.pipeline::before {
  content: ''; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 2px;
  background: linear-gradient(to bottom, var(--accent)60, var(--cyan)60, var(--green)60);
}
.pipeline-step {
  display: flex; align-items: flex-start; gap: 20px; padding: 20px 0; position: relative;
}
.pipeline-step .step-marker {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  background: var(--bg-card); border: 2px solid var(--border);
  z-index: 1;
}
.pipeline-step .step-content { padding-top: 12px; }
.pipeline-step .step-content h4 { margin-bottom: 6px; font-size: 1.05rem; }
.pipeline-step .step-content p { color: var(--text-muted); font-size: .9rem; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.footer-links { display: flex; gap: 32px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: .9rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-dim); font-size: .82rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .stats-row { gap: 32px; }
  .section { padding: 64px 0; }
  .hero { padding: 100px 16px 60px; }
  .card { padding: 28px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pipeline::before { left: 23px; }
  .pipeline-step .step-marker { width: 48px; height: 48px; font-size: .95rem; }
}

/* ── Animations ──────────────────────────────────────────── */
.fade-in {
  opacity: 0; transform: translateY(24px);
  animation: fadeIn .6s ease forwards;
}
.fade-in:nth-child(2) { animation-delay: .1s; }
.fade-in:nth-child(3) { animation-delay: .2s; }
.fade-in:nth-child(4) { animation-delay: .3s; }
.fade-in:nth-child(5) { animation-delay: .4s; }

@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

/* ── Glow Orb (decorative) ───────────────────────────────── */
.glow-orb {
  position: absolute; border-radius: 50%; filter: blur(100px); pointer-events: none; opacity: .25;
}
