@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root, [data-theme="dark"] {
    --bg: #0a0a0a;
    --bg2: #141414;
    --bg3: #1a1a1a;
    --border: #222;
    --text: #e0e0e0;
    --text2: #888;
    --text3: #444;
    --accent: #22c55e;
    --accent-hover: #1fad53;
    --code-bg: #111;
    --c-bg: #0a0a0a;
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg2: #fff;
    --bg3: #f0f0f0;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --text2: #666;
    --text3: #bbb;
    --accent: #16a34a;
    --accent-hover: #15803d;
    --code-bg: #f4f4f5;
    --c-bg: #fafafa;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, sans-serif;
    line-height: 1.6;
}

.hidden { display: none !important; }

/* ── nav (same as landing) ── */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.nav__inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav__link {
    font-size: 0.82em;
    font-weight: 500;
    color: var(--text2);
    text-decoration: none;
    transition: color 0.15s;
}

.nav__link:hover { color: var(--text); }

.nav__theme {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg2);
    color: var(--text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.nav__theme:hover { color: var(--text); }
.nav__theme svg { width: 16px; height: 16px; }

/* ── docs layout ── */

.docs {
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}

.docs__title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 6px;
}

.docs__subtitle {
    font-size: 0.88em;
    color: var(--text2);
    margin-bottom: 40px;
}

/* ── sections ── */

.docs-section {
    margin-bottom: 48px;
}

.docs-section__title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.docs-section p {
    font-size: 0.88em;
    color: var(--text2);
    margin-bottom: 12px;
    line-height: 1.7;
}

.docs-section ul {
    list-style: none;
    padding: 0;
    margin-bottom: 12px;
}

.docs-section ul li {
    font-size: 0.85em;
    color: var(--text2);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.docs-section ul li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--text3);
}

/* ── endpoint blocks ── */

.endpoint {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

.endpoint__header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.endpoint__method {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent);
    color: #000;
    letter-spacing: 0.5px;
}

.endpoint__method--get {
    background: #3b82f6;
    color: #fff;
}

.endpoint__path {
    font-size: 0.82em;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text);
}

.endpoint__body {
    padding: 14px 16px;
}

.endpoint__body p {
    font-size: 0.82em;
    color: var(--text2);
    margin-bottom: 10px;
}

.endpoint__label {
    font-size: 0.72em;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    margin-top: 10px;
}

/* ── code blocks ── */

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.code-block__header {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.72em;
    font-weight: 600;
    color: var(--text3);
}

.code-block__body {
    padding: 14px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78em;
    line-height: 1.7;
    color: var(--text2);
    overflow-x: auto;
    margin: 0;
}

/* ── inline code ── */

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

/* ── step list ── */

.steps {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin-bottom: 16px;
}

.steps li {
    counter-increment: step;
    font-size: 0.85em;
    color: var(--text2);
    padding: 6px 0 6px 32px;
    position: relative;
    line-height: 1.6;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg3);
    border: 1px solid var(--border);
    font-size: 0.72em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    top: 7px;
}

/* ── risk table ── */

.risk-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 0.82em;
}

.risk-table th,
.risk-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.risk-table th {
    color: var(--text3);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.risk-table td {
    color: var(--text2);
}

/* ── footer ── */

.footer {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.75em;
    color: var(--text3);
}

/* ── responsive ── */

@media (max-width: 500px) {
    .docs__title { font-size: 1.4em; }
    .endpoint__header { flex-wrap: wrap; }
}
