:root {
    --bg: #0b0f14;
    --panel: #11161d;
    --panel-soft: rgba(255, 255, 255, 0.03);
    --line: #202833;
    --line-soft: rgba(220, 229, 239, 0.08);
    --line-faint: rgba(220, 229, 239, 0.05);
    --text: #dce5ef;
    --muted: #8b98a5;
    --link: #8cc2ff;
    --accent: #58a6ff;
    --badge-ast-bg: rgba(218, 77, 77, 0.15);
    --badge-ast-fg: #ff8a8a;
    --badge-cst-bg: rgba(88, 178, 108, 0.16);
    --badge-cst-fg: #8de1a1;
    --badge-core-bg: rgba(79, 132, 223, 0.16);
    --badge-core-fg: #8db7ff;
    --max-width: 1320px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 13px/1.55 "IBM Plex Sans", sans-serif;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

code,
pre {
    font-family: "IBM Plex Mono", monospace;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(14, 19, 25, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.header-row {
    display: grid;
    align-items: center;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.header-main {
    grid-template-columns: 220px minmax(0, 1fr) 340px;
    min-height: 48px;
    gap: 12px;
}

.header-nav {
    display: flex;
    min-height: 38px;
    border-top: 1px solid var(--line);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.brand-icon {
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.search-area {
    position: relative;
}

.search-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #2b3542;
    border-radius: 6px;
    background: #0a0f14;
    color: var(--text);
    outline: none;
}

.search-input::placeholder {
    color: var(--muted);
}

.search-input:focus {
    border-color: var(--accent);
}

.github-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.github-label,
.github-meta {
    color: var(--muted);
    font-size: 12px;
}

.github-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-tab {
    position: relative;
    height: 38px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.nav-tab + .nav-tab::before {
    content: "|";
    position: absolute;
    left: -2px;
    color: #2b3542;
}

.nav-tab.is-active,
.nav-tab:hover {
    color: var(--text);
}

.search-results {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 32px));
    background: rgba(17, 22, 29, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.search-result,
.search-empty {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.search-result:last-child,
.search-empty:last-child {
    border-bottom: 0;
}

.search-result:hover {
    background: #161d26;
}

.search-result-name {
    font-size: 13px;
    font-weight: 600;
}

.search-result-meta,
.search-empty {
    color: var(--muted);
    font-size: 12px;
}

.page-shell {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 18px 18px 28px;
}

.hero-panel,
.empty-state {
    background: var(--panel);
    border: 1px solid var(--line);
}

.hero-panel {
    padding: 22px 24px;
}

.hero-block h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.08;
}

.hero-block p,
.resource-description,
.member-description,
.field-description {
    color: var(--muted);
}

.home-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 220px;
}

.home-logo {
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.hero-home-copy {
    display: grid;
    gap: 10px;
}

.home-doc {
    display: grid;
    gap: 20px;
}

.home-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 28px;
    align-items: start;
}

.hero-kicker {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-home-copy p {
    margin: 0;
    max-width: 720px;
}

.home-lead {
    font-size: 16px;
    line-height: 1.65;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.home-action {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.home-action strong,
.home-action span,
.home-action label {
    display: block;
}

.home-action strong {
    font-size: 16px;
    font-weight: 600;
}

.home-action span,
.home-action label {
    color: var(--muted);
}

.home-action label {
    font-size: 12px;
}

.home-section {
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.home-section h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.home-section p {
    margin: 10px 0 0;
    color: var(--muted);
}

.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-note {
    padding-left: 12px;
    border-left: 2px solid rgba(88, 166, 255, 0.4);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.hero-link {
    padding: 5px 10px;
    border: 1px solid #2b3542;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 184px;
    gap: 22px;
    margin-top: 18px;
    align-items: start;
}

.content-layout.is-home {
    grid-template-columns: minmax(0, 1fr);
}

.content-layout.is-guide {
    grid-template-columns: minmax(0, 1fr) 184px;
}

.resource-card {
    padding: 18px 18px 20px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.015);
    scroll-margin-top: 92px;
}

.guide-hero p {
    max-width: 820px;
}

.guide-page {
    display: grid;
    gap: 22px;
}

.guide-section {
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
    scroll-margin-top: 96px;
}

.guide-page > :first-child {
    padding-top: 0;
    border-top: 0;
}

.guide-section h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.guide-section p {
    margin: 10px 0 0;
    color: var(--muted);
}

.resource-card:first-child {
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.resource-card + .resource-card {
    margin-top: 12px;
}

.resource-header {
    display: grid;
    gap: 8px;
}

.resource-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.resource-header h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
}

.resource-header h3 a {
    text-decoration: none;
}

.node-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.node-badge-ast {
    background: var(--badge-ast-bg);
    color: var(--badge-ast-fg);
}

.node-badge-cst {
    background: var(--badge-cst-bg);
    color: var(--badge-cst-fg);
}

.node-badge-core {
    background: var(--badge-core-bg);
    color: var(--badge-core-fg);
}

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

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 11px;
}

.resource-description {
    margin: 10px 0 0;
}

.resource-description a,
.member-description a,
.field-description a {
    color: var(--link);
    text-decoration: underline;
}

.field-type a {
    text-decoration: underline;
}

.resource-description code,
.member-description code,
.field-description code,
.field-type code,
.hero-block code,
.field-name code {
    padding: 1px 4px;
    background: var(--panel-soft);
    border: 0;
}

.hero-panel a {
    color: var(--link);
    text-decoration: none;
}

.example-shell,
.table-shell {
    margin-top: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    overflow: hidden;
}

.example-shell {
    background: rgba(255, 255, 255, 0.035);
}

.table-shell {
    background: var(--bg);
}

.code-frame {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
}

.code-gutter,
.code-frame pre {
    margin: 0;
    white-space: pre;
    line-height: 1.65;
    tab-size: 4;
}

.code-gutter {
    padding: 10px 8px 10px 0;
    color: var(--muted);
    text-align: right;
    border-right: 1px solid var(--line-soft);
    user-select: none;
}

.code-frame > pre:last-child {
    min-width: 0;
    padding: 10px 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.code-frame > pre:last-child::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.jump-panel::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.jump-panel::-webkit-scrollbar-thumb {
    background: rgba(220, 229, 239, 0.24);
}

.jump-panel::-webkit-scrollbar-track {
    background: transparent;
}

.example-shell code,
.example-shell .hljs {
    display: block;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    line-height: 1.65;
}

.member-list,
.field-list {
    display: grid;
}

.member-item,
.field-row {
    padding: 10px;
    border-top: 1px solid var(--line-soft);
}

.member-item:first-child,
.field-row:first-child {
    border-top: 0;
}

.member-name,
.field-name {
    font-weight: 600;
}

.member-description {
    margin-top: 4px;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.95fr) minmax(150px, 0.95fr) minmax(0, 1.8fr);
    gap: 10px;
}

.field-type,
.field-description {
    min-width: 0;
}

.field-link {
    text-decoration: underline;
}

.field-token-ast {
    color: #ff8a8a;
}

.field-token-ref {
    color: #8db7ff;
}

.field-token-primitive {
    color: #f3c56a;
}

.field-token-string {
    color: #8de1a1;
}

.jump-panel {
    position: sticky;
    top: 96px;
    align-self: start;
    width: 100%;
    max-width: 184px;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 6px 0 0 16px;
    border-left: 1px solid var(--line-soft);
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 229, 239, 0.24) transparent;
}

.jump-title {
    margin: 0;
    padding-left: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.jump-links {
    display: grid;
    gap: 0;
    margin-top: 6px;
}

.jump-link {
    display: block;
    padding: 7px 0 7px 8px;
    border: 0;
    border-top: 1px solid var(--line-faint);
    background: transparent;
    color: var(--muted);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.jump-links > :first-child {
    border-top: 0;
}

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

.empty-state {
    padding: 16px;
}

.empty-state h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 1040px) {
    .header-main {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .github-link {
        justify-content: flex-start;
    }

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

    .jump-panel {
        position: static;
        max-width: none;
        max-height: none;
        overflow: visible;
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--line-soft);
        padding-top: 12px;
    }

    .home-top {
        grid-template-columns: 1fr;
    }

    .home-logo-wrap {
        justify-content: flex-start;
        min-height: 140px;
    }

    .home-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .header-row,
    .page-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-nav {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .header-nav::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .search-results {
        width: calc(100% - 24px);
    }

    .resource-header h3 {
        font-size: 22px;
    }

    .home-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

}
