/* Free API — website stylesheet */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --accent: #2f81f7;
  --accent-dark: #1f6feb;
  --accent-glow: rgba(47,129,247,0.15);
  --green: #3fb950;
  --yellow: #d29922;
  --red: #f85149;
  --purple: #bc8cff;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --code-bg: #161b22;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html { scroll-behavior: smooth; }

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

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

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

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--accent); }

nav { display: flex; gap: 4px; }
nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: color .15s, background .15s;
}
nav a:hover, nav a.active {
  color: var(--text);
  background: var(--surface2);
}

.main { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(47,129,247,.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #e6edf3 40%, #8b949e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 em {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  font-style: normal;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  cursor: pointer;
  border: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { opacity: .9; box-shadow: 0 0 20px rgba(47,129,247,.35); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Architecture diagram ── */
.arch-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin: 40px 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  overflow-x: auto;
}
.arch-diagram pre { color: var(--text-muted); line-height: 1.8; }
.arch-diagram .hl { color: var(--accent); font-weight: 700; }
.arch-diagram .hl2 { color: var(--green); font-weight: 600; }
.arch-diagram .hl3 { color: var(--purple); font-weight: 600; }

/* ── Sections ── */
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--border); }

.section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.section-sub {
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
}

/* ── Feature cards ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s, box-shadow .2s;
}
.feature-card:hover {
  border-color: var(--accent-dark);
  box-shadow: 0 0 20px var(--accent-glow);
}
.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── API tables ── */
.api-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead tr { background: var(--surface2); }
th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .04em;
}
.badge-implemented { background: rgba(63,185,80,.18); color: var(--green); border: 1px solid rgba(63,185,80,.35); }
.badge-partial     { background: rgba(210,153,34,.18); color: var(--yellow); border: 1px solid rgba(210,153,34,.35); }
.badge-stub        { background: rgba(248,81,73,.15); color: var(--red); border: 1px solid rgba(248,81,73,.3); }
.badge-header      { background: rgba(188,140,255,.15); color: var(--purple); border: 1px solid rgba(188,140,255,.3); }

/* ── Code blocks ── */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}
.code-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-size: .75rem;
  color: var(--text-muted);
  font-family: monospace;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .82rem;
  line-height: 1.7;
  color: var(--text);
}

/* syntax highlight helpers */
.kw { color: #ff7b72; }
.ty { color: #ffa657; }
.fn { color: #d2a8ff; }
.st { color: #a5d6ff; }
.cm { color: var(--text-dim); font-style: italic; }
.num { color: #79c0ff; }
.pp { color: #ff7b72; }

/* ── Callouts ── */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0;
  font-size: .9rem;
}
.callout.warn { border-color: var(--yellow); background: rgba(210,153,34,.1); }
.callout.info { border-color: var(--green); background: rgba(63,185,80,.08); }

.callout strong { display: block; margin-bottom: 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Two-col layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

/* ── Platform grid ── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.platform-card .icon { font-size: 2rem; margin-bottom: 8px; }
.platform-card h4 { font-size: .9rem; margin-bottom: 6px; }
.platform-card .status { font-size: .75rem; }

/* ── Steps ── */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 28px; }
.step { display: flex; gap: 18px; }
.step-num {
  counter-increment: step;
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.step-body h3 { font-size: 1rem; margin-bottom: 6px; }
.step-body p { font-size: .875rem; color: var(--text-muted); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: .8rem;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ── API sub-nav ── */
.api-subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}
.api-subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
  height: 42px;
  align-items: center;
}
.api-subnav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 11px;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 500;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.api-subnav a:hover { color: var(--text); background: var(--surface2); }
.api-subnav a.active { color: var(--accent); background: var(--accent-glow); }

/* ── Scroll anchor offset ── */
[id] { scroll-margin-top: 72px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  nav { display: none; }
  .hero { padding: 48px 16px 40px; }
}
