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

:root {
    --bg:         #0d1117;
    --bg-2:       #161b22;
    --bg-3:       #1c2330;
    --border:     #30363d;
    --text:       #e6edf3;
    --text-muted: #8b949e;
    --orange:     #3b9eff;
    --orange-dim: #163d6b;
    --orange-glow:rgba(59,158,255,.25);
    --green:      #3fb950;
    --green-dim:  #1a4a24;
    --blue:       #58a6ff;
    --blue-dim:   #0d2a4e;
    --red:        #f85149;
    --yellow:     #e3b341;
    --radius:     10px;
    --sidebar-w:  260px;
    --header-h:   64px;
}

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── Animated background aurora ────────────────────── */
.aurora {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.aurora::before, .aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .12;
    animation: drift 18s ease-in-out infinite alternate;
}
.aurora::before {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #3b9eff 0%, transparent 70%);
    top: -200px; left: -200px;
}
.aurora::after {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    bottom: -200px; right: -200px;
    animation-delay: -9s;
}
@keyframes drift {
    0%   { transform: translate(0, 0)   scale(1); }
    50%  { transform: translate(80px, 60px) scale(1.1); }
    100% { transform: translate(-40px, 30px) scale(.95); }
}

/* ── Header ─────────────────────────────────────────── */
header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(13,17,23,.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}
.logo {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.25rem; font-weight: 700; letter-spacing: -.5px;
    text-decoration: none; color: var(--text);
}
.logo-icon {
    width: 36px; height: 36px;
    background: transparent;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: none;
    animation: none;
}
@keyframes pulse-logo {
    0%, 100% { box-shadow: 0 0 20px var(--orange-glow); }
    50%       { box-shadow: 0 0 35px rgba(59,158,255,.45); }
}
.header-badge {
    font-size: .7rem; font-weight: 500;
    background: var(--bg-3); color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 3px 10px; border-radius: 99px;
}
.header-right {
    display: flex; align-items: center; gap: 16px;
}
.version-chip {
    font-size: .7rem; font-weight: 600;
    background: linear-gradient(135deg,#3b9eff,#2563eb);
    color: #fff; padding: 4px 12px; border-radius: 99px;
}

/* ── Layout ──────────────────────────────────────────── */
.layout {
    display: flex;
    padding-top: var(--header-h);
    position: relative; z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────── */
aside {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: 24px 0;
    background: rgba(13,17,23,.6);
}
.nav-section { margin-bottom: 24px; }
.nav-section-label {
    font-size: .68rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
    padding: 0 20px; margin-bottom: 6px;
}
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 20px;
    color: var(--text-muted); text-decoration: none;
    font-size: .875rem; font-weight: 400;
    border-left: 2px solid transparent;
    transition: all .2s;
}
.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,.04);
}
.nav-link.active {
    color: var(--orange);
    border-left-color: var(--orange);
    background: rgba(59,158,255,.08);
    font-weight: 500;
}
.method-pill {
    font-size: .6rem; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
}
.pill-post { background: var(--orange-dim); color: var(--orange); }
.pill-get  { background: var(--green-dim);  color: var(--green); }

/* ── Main content ────────────────────────────────────── */
main {
    flex: 1; min-width: 0;
    padding: 48px 64px 120px;
    max-width: 900px;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
    margin-bottom: 64px;
    animation: fade-up .6s ease both;
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .75rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--orange);
    background: rgba(59,158,255,.1); border: 1px solid rgba(59,158,255,.3);
    padding: 5px 14px; border-radius: 99px;
    margin-bottom: 20px;
}
.hero-eyebrow svg { width: 12px; height: 12px; }
.hero h1 {
    font-size: 3rem; font-weight: 700; letter-spacing: -1.5px;
    line-height: 1.15;
    background: linear-gradient(135deg, #e6edf3 0%, #8b949e 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}
.hero-sub {
    font-size: 1.1rem; color: var(--text-muted);
    max-width: 580px; line-height: 1.7;
    margin-bottom: 32px;
}
.hero-stats {
    display: flex; gap: 32px; flex-wrap: wrap;
}
.stat {
    display: flex; flex-direction: column; gap: 2px;
}
.stat-value {
    font-size: 1.5rem; font-weight: 700;
    color: var(--orange);
}
.stat-label {
    font-size: .75rem; color: var(--text-muted); font-weight: 500;
}

/* ── Section headings ────────────────────────────────── */
.section {
    margin-bottom: 72px;
    animation: fade-up .5s ease both;
}
.section:nth-child(2) { animation-delay: .05s; }
.section:nth-child(3) { animation-delay: .1s; }
.section:nth-child(4) { animation-delay: .15s; }
.section:nth-child(5) { animation-delay: .2s; }

.section-title {
    font-size: .75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.section-title::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Endpoint cards ──────────────────────────────────── */
.endpoint-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    transition: border-color .3s, box-shadow .3s;
}
.endpoint-card:hover {
    border-color: rgba(59,158,255,.4);
    box-shadow: 0 0 0 1px rgba(59,158,255,.1), 0 8px 32px rgba(0,0,0,.3);
}
.endpoint-header {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}
.method-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: .8rem; font-weight: 700;
    padding: 5px 12px; border-radius: 6px;
    min-width: 66px; text-align: center;
}
.badge-post { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(59,158,255,.35); }
.endpoint-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: .95rem; color: var(--text);
    flex: 1;
}
.endpoint-summary {
    font-size: .85rem; color: var(--text-muted);
}
.auth-tag {
    display: flex; align-items: center; gap: 5px;
    font-size: .72rem; font-weight: 500; padding: 3px 10px; border-radius: 99px;
}
.auth-public { background: var(--green-dim); color: var(--green); }
.auth-private { background: var(--blue-dim); color: var(--blue); }
.toggle-chevron {
    color: var(--text-muted); transition: transform .3s;
    width: 16px; height: 16px;
}
.endpoint-card.open .toggle-chevron { transform: rotate(180deg); }

.endpoint-body {
    display: none;
    padding: 24px;
}
.endpoint-card.open .endpoint-body { display: block; }

/* ── Description ─────────────────────────────────────── */
.endpoint-description {
    font-size: .9rem; color: var(--text-muted);
    line-height: 1.7; margin-bottom: 24px;
}

/* ── Parameters table ────────────────────────────────── */
.params-heading {
    font-size: .8rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.params-heading::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.params-table {
    width: 100%; border-collapse: collapse; margin-bottom: 28px;
    font-size: .85rem;
}
.params-table th {
    text-align: left; padding: 8px 14px;
    background: var(--bg-3);
    color: var(--text-muted);
    font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
}
.params-table th:first-child { border-radius: 6px 0 0 6px; }
.params-table th:last-child  { border-radius: 0 6px 6px 0; }
.params-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--bg-3);
    vertical-align: top;
}
.params-table tr:last-child td { border-bottom: none; }
.param-name {
    font-family: 'JetBrains Mono', monospace;
    color: var(--blue); font-size: .82rem;
}
.param-type {
    font-family: 'JetBrains Mono', monospace;
    color: var(--yellow); font-size: .78rem;
}
.req-badge {
    display: inline-block; font-size: .65rem; font-weight: 600;
    padding: 2px 7px; border-radius: 4px;
}
.req-yes { background: rgba(248,81,73,.15); color: var(--red); }
.req-no  { background: var(--bg-3); color: var(--text-muted); }
.req-cond { background: rgba(227,179,65,.15); color: var(--yellow); }
.param-desc { color: var(--text-muted); line-height: 1.5; }

/* ── Code blocks ─────────────────────────────────────── */
.code-block {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}
.code-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255,255,255,.03);
    border-bottom: 1px solid var(--border);
}
.code-lang {
    font-size: .72rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .08em;
}
.copy-btn {
    display: flex; align-items: center; gap: 6px;
    background: none; border: 1px solid var(--border);
    color: var(--text-muted); font-size: .72rem; font-weight: 500;
    padding: 4px 10px; border-radius: 5px; cursor: pointer;
    transition: all .2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-muted); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }
pre {
    padding: 18px 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: .8rem; line-height: 1.65;
    color: var(--text);
}
/* JSON syntax */
.key   { color: #79c0ff; }
.str   { color: #a5d6ff; }
.num   { color: #f2cc60; }
.bool  { color: #ff7b72; }
.null  { color: #8b949e; }
/* cURL syntax */
.cmd   { color: var(--green); }
.flag  { color: var(--yellow); }
.url   { color: var(--orange); }
.data  { color: #a5d6ff; }
.cmt   { color: #484f58; font-style: italic; }

/* ── Info alert ───────────────────────────────────────── */
.alert {
    display: flex; gap: 12px;
    padding: 14px 18px; border-radius: 8px;
    font-size: .85rem; line-height: 1.6;
    margin-bottom: 20px;
}
.alert-info  { background: var(--blue-dim); border: 1px solid rgba(88,166,255,.25); color: #79c0ff; }
.alert-warn  { background: rgba(227,179,65,.1); border: 1px solid rgba(227,179,65,.25); color: var(--yellow); }
.alert-ok    { background: var(--green-dim); border: 1px solid rgba(63,185,80,.25); color: #7ee787; }
.alert-icon  { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }

/* ── Response tab area ────────────────────────────────── */
.tabs {
    display: flex; gap: 2px; margin-bottom: 12px;
}
.tab-btn {
    background: none; border: 1px solid transparent;
    color: var(--text-muted); font-size: .8rem; font-weight: 500;
    padding: 6px 14px; border-radius: 6px;
    cursor: pointer; transition: all .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--text); border-color: var(--border);
    background: var(--bg-3);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Quick start grid ────────────────────────────────── */
.qs-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.qs-card {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    transition: border-color .2s, transform .2s;
}
.qs-card:hover { border-color: rgba(59,158,255,.4); transform: translateY(-2px); }
.qs-icon { font-size: 1.5rem; margin-bottom: 10px; }
.qs-title { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.qs-text  { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* ── Footer ───────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 24px 64px;
    display: flex; align-items: center; justify-content: space-between;
    color: var(--text-muted); font-size: .8rem;
    position: relative; z-index: 1;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    aside { display: none; }
    main  { padding: 32px 24px 80px; }
    .hero h1 { font-size: 2rem; }
    footer { padding: 20px 24px; flex-direction: column; gap: 8px; text-align: center; }
}
