:root {
  --bg: #0A1826;
  --bg-grid: #0F2032;
  --surface: #0F2337;
  --surface-2: #13293f;
  --line: #23415c;
  --line-soft: #1a3049;
  --text: #EAF0F6;
  --text-dim: #7E97AE;
  --accent: #FF8A34;
  --accent-soft: rgba(255, 138, 52, 0.12);
  --accent-2: #52D9C4;
  --success: #4ADE80;
  --danger: #FF6B6B;
  --get: #52D9C4;
  --post: #FF8A34;
  --put: #E9C46A;
  --delete: #FF6B6B;
  --radius: 8px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a { color: inherit; }

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.grid-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

code {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent-2);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 24, 38, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.brand em { color: var(--accent); font-style: normal; }

.topnav { display: flex; gap: 24px; margin-left: 8px; flex: 1; }
.topnav a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.15s ease;
}
.topnav a:hover { color: var(--text); }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.dot.on {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.08); }
}

/* ---------- hero ---------- */
.hero { padding: 88px 0 64px; }
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.lead {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn--primary {
  background: var(--accent);
  color: #0A1826;
}
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); }

.hero__meta {
  display: flex;
  gap: 32px;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.hero__meta dt {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.hero__meta dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text);
}

.hero__diagram { width: 100%; }
.svg-label { font-family: var(--mono); font-size: 13px; fill: var(--text); font-weight: 500; }
.svg-label--accent { fill: var(--accent); }
.svg-sub { font-family: var(--mono); font-size: 10px; fill: var(--text-dim); }
.svg-dim { font-family: var(--mono); font-size: 10px; fill: var(--text-dim); }
.flow-line {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  fill: none;
  animation: dash 1.2s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -16; } }
.pulse-dot { fill: var(--success); animation: pulse 2s ease-in-out infinite; }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015), transparent); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section__head { max-width: 60ch; margin-bottom: 40px; }
.section__head h2 { font-size: 28px; margin: 0 0 10px; font-weight: 600; }
.section__head p { color: var(--text-dim); margin: 0; font-size: 15px; }

/* ---------- endpoint list ---------- */
.endpoint-list {
  border-top: 1px solid var(--line-soft);
}
.endpoint-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font: inherit;
  text-align: left;
  width: 100%;
  color: inherit;
}
.endpoint-row:hover { border-left-color: var(--accent); background: rgba(255,255,255,0.015); }

.method {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: center;
  width: fit-content;
}
.method--get { color: var(--get); border: 1px solid var(--get); }
.method--post { color: var(--post); border: 1px solid var(--post); }
.method--put { color: var(--put); border: 1px solid var(--put); }
.method--delete { color: var(--delete); border: 1px solid var(--delete); }

.endpoint-info .path { font-family: var(--mono); font-size: 14.5px; color: var(--text); }
.endpoint-info .desc { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.endpoint-row .try { font-size: 13px; color: var(--text-dim); }
.endpoint-row:hover .try { color: var(--accent); }

/* ---------- console / playground ---------- */
.console {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
}
.console__controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--grow { flex: 1; min-width: 200px; }
.field label { font-size: 12.5px; color: var(--text-dim); font-family: var(--mono); }

select, input, textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

.console__result { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.console__result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.req-line { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.status-chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.status-chip.ok { color: var(--success); border-color: var(--success); }
.status-chip.err { color: var(--danger); border-color: var(--danger); }
.latency { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-left: auto; }

.console__output {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-2);
  overflow-x: auto;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- features ---------- */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
}
.feature-list li {
  display: flex;
  gap: 16px;
  padding: 26px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.feature-list svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.feature-list h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; }
.feature-list p { margin: 0; color: var(--text-dim); font-size: 13.8px; }

/* ---------- steps ---------- */
.steps {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  counter-reset: step;
}
.steps li {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.steps li:first-child { border-top: 1px solid var(--line-soft); }
.steps__num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--line);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.steps h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.steps p { margin: 0; color: var(--text-dim); font-size: 14px; }

.terminal {
  background: #06111c;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.terminal__bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.terminal__bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line);
}
.terminal pre {
  margin: 0;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-2);
  overflow-x: auto;
  line-height: 1.7;
}

/* ---------- footer ---------- */
.footer { padding: 40px 0 60px; }
.footer__inner p { margin: 0 0 6px; color: var(--text-dim); font-size: 13.5px; }
.footer__sub { font-family: var(--mono); font-size: 12px !important; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__diagram { order: -1; max-width: 420px; margin: 0 auto; }
  .feature-list { grid-template-columns: 1fr; }
  .endpoint-row { grid-template-columns: 70px 1fr; }
  .endpoint-row .try { display: none; }
  .topnav { display: none; }
  .hero__meta { gap: 20px; flex-wrap: wrap; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
