:root {
    color-scheme: dark;
    --bg: #0b1020;
    --bg-alt: #121a2f;
    --panel: #161f39;
    --panel-strong: #1c2747;
    --panel-soft: #10172b;
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(148, 163, 184, 0.34);
    --text: #e7edf8;
    --muted: #97a5c0;
    --accent: #3dd9b1;
    --accent-strong: #67e8f9;
    --warning: #ffb347;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    --radius: 6px;
    --body: "Segoe UI", "Inter", "Helvetica Neue", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(61, 217, 177, 0.1), transparent 30%),
        linear-gradient(180deg, #0d1325 0%, #0b1020 100%);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.55;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

code,
pre,
.mono {
    font-family: var(--mono);
}

.site-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(11, 16, 32, 0.84);
    border-bottom: 1px solid var(--line);
}

.site-header .site-shell,
.site-footer .site-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 34px;
    text-decoration: none;
    min-width: 0;
}

.brand-chip {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 18px 0 0 rgba(61, 217, 177, 0.28);
}

.brand-copy {
    display: grid;
    gap: 1px;
}

.brand-copy strong {
    font-size: 0.96rem;
    font-weight: 700;
}

.brand-copy span {
    color: var(--muted);
    font-size: 0.78rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--muted);
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--text);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
}

main {
    padding: 26px 0 56px;
}

.hero-grid,
.two-column,
.feature-grid,
.workflow-grid,
.code-grid,
.gallery-grid,
.footer-grid,
.matrix-grid,
.manifest-grid,
.detail-grid {
    display: grid;
    gap: 18px;
}

.hero-grid,
.two-column {
    grid-template-columns: 1.4fr 1fr;
}

.feature-grid,
.workflow-grid,
.code-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid,
.matrix-grid,
.manifest-grid,
.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-panel,
.page-banner,
.feature-block,
.workflow-card,
.code-card,
.info-panel,
.matrix-card,
.manifest-item,
.repo-slab,
.gallery-note,
.gallery-grid figure,
.detail-card {
    background: linear-gradient(180deg, rgba(28, 39, 71, 0.96), rgba(17, 24, 45, 0.96));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-copy,
.page-banner,
.feature-block,
.workflow-card,
.code-card,
.info-panel,
.matrix-card,
.manifest-item,
.repo-slab,
.gallery-note,
.detail-card {
    padding: 20px;
}

.eyebrow,
.section-label {
    margin: 0 0 10px;
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-title,
.page-title,
.section-heading {
    margin: 0 0 10px;
    font-size: clamp(1.55rem, 2.6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.16;
}

.hero-title {
    max-width: 16ch;
}

.page-title {
    max-width: 22ch;
}

.section-heading {
    max-width: 24ch;
}

.lead,
.page-intro,
.hero-copy p,
.info-panel p,
.feature-block p,
.workflow-card p,
.code-card p,
.matrix-card p,
.manifest-item p,
.repo-slab p,
.gallery-note p,
.detail-card p,
.site-footer p,
.gallery-grid figcaption,
li,
small {
    color: var(--muted);
}

.hero-copy .lead {
    margin: 0;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.hero-stat {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
}

.hero-stat strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

.button-row,
.hero-actions,
.token-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions {
    margin-top: 18px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.button.primary {
    background: var(--accent);
    color: #06211c;
    border-color: transparent;
    font-weight: 600;
}

.button.ghost {
    background: rgba(255, 255, 255, 0.04);
}

.token {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 0.8rem;
}

.token.alt {
    color: var(--accent);
    border-color: rgba(61, 217, 177, 0.32);
    background: rgba(61, 217, 177, 0.08);
}

.token.outline {
    color: var(--muted);
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.mini-cell {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
}

.mini-cell strong,
.detail-card strong,
.manifest-item strong,
.matrix-card strong,
.feature-block h3,
.workflow-card h3,
.code-card h3,
.repo-slab h3 {
    display: block;
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
}

.section-block {
    padding-top: 12px;
}

.list {
    margin: 0;
    padding-left: 18px;
}

.workflow-card header,
.code-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.step-index {
    color: var(--accent-strong);
    font-size: 0.8rem;
}

pre {
    margin: 14px 0 0;
    padding: 14px;
    overflow-x: auto;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: var(--radius);
    background: #0b1224;
    color: #d5e2ff;
    font-size: 0.84rem;
    line-height: 1.5;
}

.gallery-grid figure {
    overflow: hidden;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.gallery-grid figcaption {
    padding: 12px 14px 14px;
    font-size: 0.9rem;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.api-table th,
.api-table td {
    padding: 11px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.api-table th {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
}

.site-footer {
    border-top: 1px solid var(--line);
}

.footer-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
}

.inline-code {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
    .hero-grid,
    .two-column,
    .feature-grid,
    .workflow-grid,
    .code-grid,
    .gallery-grid,
    .footer-grid,
    .matrix-grid,
    .manifest-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats,
    .mini-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header .site-shell,
    .site-footer .site-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-shell {
        width: min(100% - 20px, 1180px);
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 4px 8px;
        white-space: nowrap;
    }

    .hero-copy,
    .page-banner,
    .feature-block,
    .workflow-card,
    .code-card,
    .info-panel,
    .matrix-card,
    .manifest-item,
    .repo-slab,
    .gallery-note,
    .detail-card {
        padding: 16px;
    }

    .hero-title,
    .page-title,
    .section-heading {
        font-size: 1.28rem;
    }

    .site-nav {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .brand-copy strong {
        font-size: 0.88rem;
    }

    .brand-copy span {
        font-size: 0.72rem;
    }
}
