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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --border: #21262d;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --accent: #4493f8;
  --accent-dim: #1f3a5f;
  --green: #3fb950;
  --purple: #bc8cff;
  --code-bg: #161b22;
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

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

/* ── Hero ── */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 72px 24px 56px;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e6edf3 0%, #7d8590 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 28px;
}

.hero-sub a {
  color: var(--accent);
  text-decoration: none;
}

.hero-sub a:hover {
  text-decoration: underline;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 16px;
  margin-bottom: 32px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge-green {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.base-url {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.feature {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
}

/* ── Sections ── */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.section h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Endpoint Cards ── */
.endpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.method {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(68, 147, 248, 0.15);
  color: var(--accent);
  border: 1px solid rgba(68, 147, 248, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.path {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.9rem;
  color: var(--text);
  background: none;
  padding: 0;
}

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

.endpoint-body {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.endpoint-body > p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Params Table ── */
.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.params-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.params-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.params-table tr:last-child td {
  border-bottom: none;
}

.required {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.optional {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}

/* ── Code Blocks ── */
.example-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.example-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
}

pre code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.825rem;
  color: var(--text);
  background: none;
  padding: 0;
  line-height: 1.7;
}

code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  color: var(--purple);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Notes Grid ── */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

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

.note-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.note-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.note-card code {
  font-size: 0.8em;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.site-footer a:hover {
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }

  .desc {
    display: none;
  }

  .endpoint-header {
    flex-wrap: wrap;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }
}
