:root {
  --bg: #070b10;
  --bg2: #0c1219;
  --surface: rgba(17, 24, 39, 0.72);
  --surface2: rgba(30, 41, 59, 0.55);
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --teal: #2dd4bf;
  --teal-d: #0d9488;
  --amber: #fbbf24;
  --rose: #fb7185;
  --violet: #a78bfa;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(13, 148, 136, 0.28), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(251, 191, 36, 0.08), transparent 40%),
    linear-gradient(var(--bg), var(--bg2));
  z-index: -2;
}

.bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.35;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 16, 0.75);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

.brand-text strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  color: #042f2e;
  box-shadow: 0 8px 28px rgba(45, 212, 191, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 12px 36px rgba(45, 212, 191, 0.38);
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot.ok {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.status-dot.warn {
  background: var(--amber);
}

/* hero */
.hero {
  padding: 56px 0 40px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--teal), #6ee7b7 40%, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card h3 {
  margin: 0 0 16px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipe-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
}

.pipe-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(45, 212, 191, 0.15);
  color: var(--teal);
}

.pipe-step strong {
  font-size: 0.88rem;
}

.pipe-step small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.pipe-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

/* sections */
section {
  padding: 48px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.demo-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  margin-bottom: 12px;
}

.demo-input:focus {
  outline: 2px solid rgba(45, 212, 191, 0.45);
  border-color: var(--teal-d);
}

.demo-result {
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px dashed var(--border);
  font-size: 1.05rem;
}

.demo-meta {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.endpoint {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.method {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.method-get {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}

.method-post {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.endpoint-path {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.endpoint-desc {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}

.endpoint-body {
  display: none;
  padding: 0 14px 14px;
}

.endpoint.open .endpoint-body {
  display: block;
}

.code-block {
  position: relative;
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  background: #020617;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #cbd5e1;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.feature {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.feature p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.tone-teal .feature-icon {
  background: rgba(45, 212, 191, 0.12);
}
.tone-amber .feature-icon {
  background: rgba(251, 191, 36, 0.12);
}
.tone-violet .feature-icon {
  background: rgba(167, 139, 250, 0.12);
}
.tone-rose .feature-icon {
  background: rgba(251, 113, 133, 0.12);
}

.footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.footer a {
  color: var(--teal);
  text-decoration: none;
}

@media (max-width: 900px) {
  .hero,
  .two-col {
    grid-template-columns: 1fr;
  }

  .nav a:not(.btn) {
    display: none;
  }
}
