:root {
    --side-bg: #0d0d0f;
    --content-bg: #121215;
    --panel: #18181d;
    --panel-2: #1f1f25;
    --gold: #c5a059;
    --gold-soft: rgba(197, 160, 89, 0.12);
    --gold-strong: rgba(197, 160, 89, 0.22);
    --border: rgba(197, 160, 89, 0.2);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text-main: #e2e2e7;
    --text-muted: #9b9ba4;
    --text-soft: #b9b9c2;
    --success: #88c37e;
    --danger: #d98a8a;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    --radius: 18px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at top right, rgba(197, 160, 89, 0.08), transparent 32%),
        linear-gradient(180deg, #111114 0%, #121215 100%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

code {
    font-family: 'Consolas', 'SFMono-Regular', Menlo, monospace;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #f2ead9;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.9em;
}

strong {
    color: #fff;
}

.wiki-wrapper {
    display: flex;
    min-height: 100vh;
}

.mobile-topbar {
    display: none;
}

.mobile-menu-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.wiki-sidebar {
    width: 320px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
        var(--side-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    padding: 30px 26px 40px;
    overflow-y: auto;
    z-index: 30;
}

.wiki-sidebar::-webkit-scrollbar {
    width: 8px;
}

.wiki-sidebar::-webkit-scrollbar-thumb {
    background: rgba(197, 160, 89, 0.22);
    border-radius: 999px;
}

.sidebar-header {
    margin-bottom: 26px;
}

.sidebar-header .logo {
    font-family: 'Archivo Black', sans-serif;
    font-size: 2.2rem;
    color: #fff;
    line-height: 1;
}

.sidebar-header span,
.sidebar-header p,
.gold-text {
    color: var(--gold);
}

.sidebar-header p {
    font-size: 0.65rem;
    letter-spacing: 2px;
    margin-top: 10px;
}

.external-nav {
    margin-bottom: 24px;
}

.btn-back {
    display: block;
    padding: 12px 14px;
    background: rgba(197, 160, 89, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    text-decoration: none;
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
    transition: 0.25s ease;
    clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
}

.btn-back:hover {
    background: var(--gold);
    color: #050505;
}

.sidebar-intro {
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(197, 160, 89, 0.08), rgba(197, 160, 89, 0.02));
    border-radius: 16px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.section-title {
    color: #4f4f57;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 24px 0 12px;
    list-style: none;
    font-weight: 700;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 7px;
}

.sidebar-links a {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.1;
    padding: 4px 0;
    transition: 0.2s ease;
}

.sidebar-links a:hover,
.sidebar-links a.active {
    color: var(--gold);
    padding-left: 6px;
}

.wiki-content {
    margin-left: 320px;
    padding: 54px min(8vw, 110px) 90px;
    width: 100%;
}

.wiki-shell {
    max-width: 1120px;
}

.hero {
    margin-bottom: 50px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
        linear-gradient(135deg, rgba(197, 160, 89, 0.12), rgba(197, 160, 89, 0.03));
    box-shadow: var(--shadow);
}

.hero-kicker {
    font-size: 0.78rem;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 800;
    margin-bottom: 16px;
}

.hero h1,
.wiki-section h2,
.wiki-section h3,
.wiki-section h4 {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.2rem);
    line-height: 0.95;
    color: #fff;
    margin-bottom: 18px;
}

.hero p {
    max-width: 850px;
    color: var(--text-soft);
    font-size: 1.03rem;
}

.hero-grid,
.info-grid,
.card-grid,
.triple-grid,
.stats-grid {
    display: grid;
    gap: 18px;
}

.hero-grid,
.info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 26px;
}

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

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

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 26px;
}

.info-card,
.panel-card,
.mini-card,
.stat-card,
.bento-mini,
.table-wrap,
.note-box,
.warning-box,
.list-panel,
.callout,
.subsection,
.toc-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.info-card,
.panel-card,
.subsection,
.table-wrap,
.note-box,
.warning-box,
.list-panel,
.callout,
.toc-card {
    padding: 22px;
}

.stat-card,
.mini-card,
.bento-mini {
    padding: 18px;
}

.info-card {
    border-left: 4px solid var(--gold);
    background: linear-gradient(180deg, rgba(197,160,89,0.08), rgba(255,255,255,0));
}

.gold-label,
.mini-label,
.subsection-label {
    display: block;
    color: var(--gold);
    font-weight: 800;
    font-size: 0.75rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
}

.stat-card {
    background: var(--panel);
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 8px;
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
}

.kpi {
    color: var(--gold);
}

.hero-tags,
.tag-list,
.code-pill-list,
.inline-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-tags {
    margin-top: 24px;
}

.tag,
.code-pill,
.inline-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-main);
    font-size: 0.9rem;
}

.code-pill {
    font-family: 'Consolas', 'SFMono-Regular', Menlo, monospace;
    font-size: 0.82rem;
    background: rgba(197, 160, 89, 0.08);
    border-color: rgba(197, 160, 89, 0.15);
}

.inline-pill {
    font-size: 0.82rem;
    padding: 7px 10px;
}

.wiki-section {
    margin-bottom: 54px;
    max-width: 1120px;
    scroll-margin-top: 28px;
}

.section-head {
    margin-bottom: 18px;
}

.section-index {
    display: inline-block;
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.wiki-section h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #fff;
    line-height: 1;
    margin-bottom: 12px;
}

.wiki-section h3 {
    font-size: 1.55rem;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 0.4px;
}

.wiki-section h4 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.section-desc {
    color: var(--text-soft);
    max-width: 950px;
}

.subsection {
    margin-top: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}

.subsection + .subsection {
    margin-top: 16px;
}

.subsection p,
.panel-card p,
.info-card p,
.mini-card p,
.note-box p,
.warning-box p,
.callout p,
.list-panel p,
.hero p,
.wiki-section > p {
    color: var(--text-soft);
}

.wiki-section > p {
    margin-bottom: 14px;
}

.wiki-section ul,
.wiki-section ol {
    margin: 12px 0 0 18px;
}

.wiki-section li {
    margin-bottom: 10px;
    color: var(--text-soft);
}

.compact-list li {
    margin-bottom: 8px;
}

.clean-list {
    list-style: none;
    margin: 0;
}

.clean-list li {
    padding-left: 18px;
    position: relative;
    margin-bottom: 10px;
}

.clean-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(197,160,89,0.12);
}

.table-wrap {
    overflow-x: auto;
    margin-top: 20px;
    background: rgba(255,255,255,0.02);
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.wiki-table th,
.wiki-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: top;
}

.wiki-table th {
    color: var(--gold);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(197,160,89,0.05);
}

.wiki-table td {
    color: var(--text-soft);
}

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

.bento-mini,
.mini-card {
    background: var(--panel);
}

.note-box,
.warning-box,
.callout {
    margin-top: 18px;
}

.note-box {
    background: rgba(255,255,255,0.02);
}

.warning-box {
    background: rgba(197, 160, 89, 0.06);
    border-color: var(--gold);
}

.callout {
    border-left: 4px solid var(--gold);
    background: linear-gradient(180deg, rgba(197,160,89,0.1), rgba(197,160,89,0.03));
}

.list-panel {
    margin-top: 18px;
    background: var(--panel);
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    align-items: start;
}

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

.toc-card h3 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.toc-card ul {
    list-style: none;
    margin: 0;
}

.toc-card li {
    margin-bottom: 8px;
}

.toc-card a {
    text-decoration: none;
    color: var(--text-soft);
}

.toc-card a:hover {
    color: var(--gold);
}

.footer-note {
    padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    margin-top: 60px;
}

.small {
    font-size: 0.92rem;
}

.muted {
    color: var(--text-muted);
}

@media (max-width: 1240px) {
    .wiki-sidebar {
        width: 285px;
    }

    .wiki-content {
        margin-left: 285px;
        padding-inline: 6vw;
    }
}

@media (max-width: 1040px) {
    .mobile-topbar {
        position: sticky;
        top: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 18px;
        background: rgba(13, 13, 15, 0.95);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(12px);
        z-index: 50;
    }

    .mobile-topbar .logo {
        font-family: 'Archivo Black', sans-serif;
        color: #fff;
        font-size: 1.2rem;
        line-height: 1;
    }

    .mobile-topbar .logo span {
        color: var(--gold);
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: rgba(197,160,89,0.08);
        color: var(--gold);
        cursor: pointer;
    }

    .wiki-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: min(86vw, 340px);
        z-index: 60;
    }

    .wiki-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        backdrop-filter: blur(2px);
        z-index: 40;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .wiki-content {
        margin-left: 0;
        padding: 22px 18px 70px;
    }

    .hero,
    .info-card,
    .panel-card,
    .subsection,
    .table-wrap,
    .note-box,
    .warning-box,
    .list-panel,
    .callout,
    .toc-card {
        border-radius: 20px;
    }

    .hero-grid,
    .info-grid,
    .card-grid,
    .triple-grid,
    .stats-grid,
    .two-col,
    .split,
    .toc-grid,
    .bento-wiki {
        grid-template-columns: 1fr;
    }

    .wiki-table {
        min-width: 620px;
    }
}

@media (max-width: 680px) {
    .hero {
        padding: 24px 18px;
    }

    .hero h1 {
        font-size: 2.45rem;
    }

    .wiki-section h2 {
        font-size: 2rem;
    }

    .wiki-section h3 {
        font-size: 1.35rem;
    }

    .stat-card strong {
        font-size: 1.6rem;
    }

    .tag,
    .code-pill,
    .inline-pill {
        width: 100%;
        justify-content: center;
    }
}
