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

:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --bg-card: #16161a;
  --border: #222228;
  --text: #ededef;
  --text-secondary: #8b8b8d;
  --text-tertiary: #5a5a5c;
  --accent: #6d5cff;
  --accent-glow: rgba(109, 92, 255, .25);
  --green: #2dd4a8;
  --green-dim: rgba(45, 212, 168, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: #8a7dff; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Layout ── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 11, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; }
.nav-brand .icon { margin-right: 8px; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: .875rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }

/* ── Hero ── */
.hero {
  padding: 120px 0 96px;
  text-align: center;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 24px;
  position: relative;
}
.hero .subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.hero .cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover { background: #7e6fff; box-shadow: 0 0 32px rgba(109,92,255,.4); color: #fff; }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card); border-color: #333; color: var(--text); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 24px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(45, 212, 168, .2);
}

/* ── Section Headings ── */
section { padding: 96px 0; }
.section-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 56px;
}
section.centered { text-align: center; }

/* ── Code Block ── */
.code-section { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.code-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.code-tab {
  padding: 10px 20px;
  font-size: .8rem; font-weight: 600;
  color: var(--text-tertiary);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  font-family: var(--font);
}
.code-tab:hover { color: var(--text-secondary); }
.code-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.code-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.code-panel { display: none; }
.code-panel.active { display: block; }
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  position: relative;
}
.code-block pre {
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre;
  margin: 0;
}
.code-block .copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-tertiary); padding: 6px 12px;
  border-radius: 6px; font-size: .75rem; font-family: var(--font);
  cursor: pointer; transition: color .15s, border-color .15s;
}
.code-block .copy-btn:hover { color: var(--text); border-color: #444; }
.code-block .copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Syntax highlighting */
.token-keyword { color: #c792ea; }
.token-string { color: #c3e88d; }
.token-comment { color: #546e7a; font-style: italic; }
.token-function { color: #82aaff; }
.token-property { color: #f78c6c; }
.token-punctuation { color: #89ddff; }
.token-url { color: #ffcb6b; }

/* ── Features Grid ── */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color .2s, box-shadow .2s;
}
.feature:hover { border-color: #333; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 16px;
  display: block;
}
.feature h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature p { color: var(--text-secondary); font-size: .9rem; line-height: 1.6; }

/* ── Steps Grid ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color .2s, box-shadow .2s;
}
.step:hover { border-color: #333; box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(109, 92, 255, .12);
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
}
.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: .9rem; line-height: 1.6; }
.step code {
  font-family: var(--mono);
  font-size: .82rem;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── API Reference ── */
.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.api-table th {
  text-align: left;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.api-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.api-table tr:last-child td { border-bottom: none; }
.api-table code {
  font-family: var(--mono);
  font-size: .82rem;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.api-table .method {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.method-post { background: rgba(109, 92, 255, .15); color: var(--accent); }
.method-get { background: var(--green-dim); color: var(--green); }
.api-table .desc { color: var(--text-secondary); }
.api-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── CTA Section ── */
.cta-section {
  text-align: center;
  padding: 96px 0;
  position: relative;
}
.cta-section::before {
  content: '';
  position: absolute;
  bottom: -20%; left: 50%; transform: translateX(-50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 { position: relative; }
.cta-section p { position: relative; }
.cta-section .cta-row { position: relative; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: .85rem;
}
footer p { margin-bottom: 8px; }
footer a { color: var(--text-secondary); }
footer a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .hero { padding: 80px 0 64px; }
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .api-wrapper { overflow-x: auto; }
  .api-table { min-width: 540px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .cta-row { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── Fade-in animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

