:root {
    --bg: #0B0F17;
    --bg-raised: #111722;
    --bg-sunken: #080B11;
    --line: #1E2635;
    --line-strong: #2A3447;
    --text: #E8ECF3;
    --text-muted: #9AA4B5;
    --text-faint: #6B7587;
    --accent: #3E6BFF;
    --accent-hover: #5A80FF;
    --accent-soft: rgba(62, 107, 255, 0.12);
    --get: #34C28A;
    --post: #E8A33D;
    --radius: 10px;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

a {
    color: inherit;
}

code {
    font-family: var(--mono);
    font-size: 0.875em;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 15, 23, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-faint);
    border-left: 1px solid var(--line-strong);
    padding-left: 10px;
    margin-left: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    border-color: var(--text-faint);
}

nav .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #fff;
}

/* Hero */
.hero {
    padding: 96px 0 88px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(900px 400px at 85% -10%, rgba(62, 107, 255, 0.14), transparent 60%),
        var(--bg);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 56px;
    align-items: center;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-hover);
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(2.2rem, 4.4vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-weight: 700;
    margin-bottom: 22px;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 34px;
}

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

.hero-note {
    margin-top: 22px;
    font-size: 0.875rem;
    color: var(--text-faint);
}

/* Code panel */
.panel {
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}

.panel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--text-faint);
    font-family: var(--mono);
}

.panel pre {
    margin: 0;
    padding: 18px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.7;
    color: #C9D1DE;
}

.panel pre + .panel-bar {
    border-top: 1px solid var(--line);
}

.tok-k { color: #7AA2FF; }
.tok-s { color: #9ED8A8; }
.tok-n { color: #F0B86E; }
.tok-c { color: var(--text-faint); }

.copy-btn {
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
}

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

/* Coverage */
.coverage {
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg-sunken);
}

.coverage-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.coverage-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
}

.coverage-list {
    display: flex;
    gap: 12px 28px;
    flex-wrap: wrap;
    list-style: none;
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sections */
.section {
    padding: 96px 0;
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 680px;
    margin-bottom: 52px;
}

h2 {
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 700;
    margin-bottom: 14px;
}

.section-head p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.cell {
    background: var(--bg);
    padding: 32px 28px;
}

.cell-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.cell-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-hover);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cell h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.cell p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Data products */
.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 26px 22px;
    background: var(--bg-raised);
}

.product h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.product p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.product ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product li {
    font-size: 0.78rem;
    color: var(--text-muted);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 2px 10px;
}

/* Process */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    counter-reset: step;
}

.step {
    border-top: 2px solid var(--line-strong);
    padding-top: 22px;
}

.step:first-child {
    border-top-color: var(--accent);
}

.step-num {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent-hover);
    margin-bottom: 10px;
}

.step h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* API reference */
.api-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    align-items: start;
}

.api-nav {
    position: sticky;
    top: 96px;
    list-style: none;
    border-left: 1px solid var(--line);
}

.api-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    margin-left: -1px;
    border-left: 1px solid transparent;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
}

.api-nav a:hover {
    color: var(--text);
    border-left-color: var(--text-faint);
}

.api-nav .group {
    padding: 16px 14px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
}

.api-nav .group:first-child {
    padding-top: 0;
}

.method {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

.m-get {
    color: var(--get);
    background: rgba(52, 194, 138, 0.1);
}

.m-post {
    color: var(--post);
    background: rgba(232, 163, 61, 0.1);
}

.api-intro {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
    padding: 22px 24px;
    margin-bottom: 40px;
}

.api-intro dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px 16px;
    font-size: 0.925rem;
}

.api-intro dt {
    color: var(--text-faint);
}

.api-intro dd {
    color: var(--text-muted);
    min-width: 0;
    overflow-wrap: anywhere;
}

.endpoint {
    padding: 40px 0;
    border-top: 1px solid var(--line);
    min-width: 0;
}

.endpoint:first-of-type {
    border-top: none;
    padding-top: 0;
}

.endpoint-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.endpoint-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.endpoint-path {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.endpoint > p {
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 720px;
}

.params {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.params th:first-child {
    width: 170px;
}

.params th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid var(--line);
}

.params td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text-muted);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.params td:first-child {
    white-space: nowrap;
    color: var(--text);
}

.req {
    font-size: 0.7rem;
    color: var(--post);
    margin-left: 6px;
}

.opt {
    font-size: 0.7rem;
    color: var(--text-faint);
    margin-left: 6px;
}

.endpoint .panel {
    margin-bottom: 14px;
}

.status-list {
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.status-list code {
    color: var(--text);
    margin-right: 8px;
}

.callout {
    border-left: 2px solid var(--accent);
    background: var(--accent-soft);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.callout strong {
    color: var(--text);
    font-weight: 600;
}

h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 22px 0 10px;
}

/* Engagement */
.engage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}

.check-list {
    list-style: none;
    display: grid;
    gap: 14px;
}

.check-list li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    color: var(--text-muted);
}

.check-list li strong {
    color: var(--text);
    font-weight: 600;
}

.check-list svg {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    stroke: var(--accent-hover);
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.engage-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
    padding: 32px;
}

.engage-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.engage-card > p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.engage-card ol {
    list-style: none;
    counter-reset: q;
    display: grid;
    gap: 10px;
    margin-bottom: 26px;
}

.engage-card ol li {
    counter-increment: q;
    display: grid;
    grid-template-columns: 26px 1fr;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.engage-card ol li::before {
    content: counter(q, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    padding-top: 2px;
}

.contact-reveal {
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 0.95rem;
    color: var(--text);
    display: none;
}

.contact-reveal a {
    color: var(--accent-hover);
}

/* Footer */
footer {
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-faint);
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

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

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

@media (max-width: 960px) {
    .hero-grid,
    .engage {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .grid-3,
    .steps {
        grid-template-columns: 1fr;
    }

    .api-layout {
        grid-template-columns: 1fr;
    }

    .api-nav {
        display: none;
    }
}

@media (max-width: 720px) {
    nav a:not(.btn) {
        display: none;
    }

    .brand-tag {
        display: none;
    }

    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 64px 0 56px;
    }

    .section {
        padding: 64px 0;
    }

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

    .api-intro dl {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .api-intro dd {
        margin-bottom: 10px;
    }

    .params th:first-child {
        width: 120px;
    }
}

/* Home */
.flow {
    padding: 22px;
    display: grid;
    gap: 10px;
}

.flow-node {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--bg-raised);
}

.flow-node.core {
    border-color: rgba(62, 107, 255, 0.45);
    background: linear-gradient(180deg, rgba(62, 107, 255, 0.1), rgba(62, 107, 255, 0.03));
}

.flow-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.flow-node.core .flow-label {
    color: var(--accent-hover);
}

.flow-body {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.flow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.flow-tags span {
    font-size: 0.76rem;
    color: var(--text);
    border: 1px solid var(--line-strong);
    background: var(--bg-sunken);
    border-radius: 6px;
    padding: 3px 9px;
}

.flow-arrow {
    display: flex;
    justify-content: center;
    color: var(--text-faint);
}

.flow-arrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.pillar {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
    padding: 30px 28px;
}

.pillar-num {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent-hover);
    margin-bottom: 18px;
}

.pillar h3 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 10px;
}

.pillar p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.pillar ul {
    list-style: none;
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.pillar li {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
}

.pillar li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 1px;
    background: var(--text-faint);
}

.featured {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
}

.featured-copy {
    padding: 40px;
}

.featured-copy h3 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.featured-copy p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.featured-side {
    border-left: 1px solid var(--line);
    background: var(--bg-sunken);
    padding: 40px;
    display: grid;
    gap: 18px;
    align-content: center;
}

.featured-side dt {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: 4px;
}

.featured-side dd {
    color: var(--text);
    font-size: 0.95rem;
}

.featured-side dd code {
    color: var(--text-muted);
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}

.plain-list {
    list-style: none;
    border-top: 1px solid var(--line);
}

.plain-list li {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
    color: var(--text-muted);
}

.plain-list li strong {
    color: var(--text);
    font-weight: 600;
}

@media (max-width: 960px) {
    .pillars,
    .featured,
    .two-col {
        grid-template-columns: 1fr;
    }

    .two-col {
        gap: 40px;
    }

    .featured-side {
        border-left: none;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    .featured-copy,
    .featured-side {
        padding: 28px 22px;
    }

    .plain-list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
