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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1525;
    --bg-card: #161d33;
    --bg-card-hover: #1b2340;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --border-color: #1e293b;
    --border-bright: #334155;
    --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { color: var(--text-primary); }

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.docs-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(10, 14, 26, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.docs-nav .container {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
}

.brand img { width: 32px; height: 32px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

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

.nav-links .cta {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    padding: 8px 14px;
    border-radius: var(--radius);
}

.hero {
    padding: 72px 0 48px;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(6, 182, 212, 0.14), transparent 52%),
        radial-gradient(ellipse at 80% 10%, rgba(34, 197, 94, 0.08), transparent 48%);
    border-bottom: 1px solid var(--border-color);
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.01em; }

h1 {
    max-width: 820px;
    margin: 0 0 18px;
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.hero p {
    max-width: 760px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border-bright);
    color: var(--text-primary);
    font-weight: 700;
}

.button.primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
}

.button:hover {
    transform: translateY(-1px);
    border-color: var(--accent-cyan);
}

.layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
    padding: 44px 0 72px;
}

.toc {
    position: sticky;
    top: 90px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: rgba(22, 29, 51, 0.72);
    padding: 16px;
}

.toc-title {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.toc a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 6px 0;
}

.toc a:hover { color: var(--text-primary); }

.doc-section {
    padding: 0 0 42px;
    margin-bottom: 42px;
    border-bottom: 1px solid var(--border-color);
}

.doc-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.doc-section h2 {
    margin: 0 0 14px;
    font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.doc-section h3 {
    margin: 26px 0 10px;
    font-size: 1.15rem;
}

.doc-section p,
.doc-section li {
    color: var(--text-secondary);
}

.doc-section strong { color: var(--text-primary); }

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

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

.card h3,
.card h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.card p:last-child,
.card ul:last-child { margin-bottom: 0; }

.callout {
    border: 1px solid rgba(6, 182, 212, 0.28);
    background: rgba(6, 182, 212, 0.08);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 20px 0;
}

.warning {
    border-color: rgba(234, 179, 8, 0.35);
    background: rgba(234, 179, 8, 0.08);
}

code {
    color: var(--accent-cyan);
    background: rgba(15, 21, 37, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 6px;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.88em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

th, td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

th {
    color: var(--text-primary);
    background: var(--bg-secondary);
    font-size: 0.82rem;
}

td { color: var(--text-secondary); }
tr:last-child td { border-bottom: 0; }

.footer {
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .docs-nav .container { align-items: flex-start; padding: 14px 0; }
    .nav-links { gap: 12px; }
    .layout { grid-template-columns: 1fr; gap: 24px; }
    .toc { position: static; }
    .grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .container { width: min(100% - 28px, 1120px); }
    .docs-nav .container { flex-direction: column; }
    .nav-links { justify-content: flex-start; }
    .hero { padding-top: 46px; }
}
