/* rg-cc documentation pages (architecture.html, benchmarks.html, readme.html, release-notes.html) */
:root {
    --emerald: #34d399;
    --emerald-bright: #4ade80;
    --emerald-dim: #059669;
    --emerald-dark: #064e3b;
    --emerald-glow: rgba(52, 211, 153, 0.16);
    --emerald-bg: rgba(5, 150, 105, 0.12);
    --emerald-ink: #022c16;
}

body {
    background:
      radial-gradient(900px 420px at 12% -10%, var(--emerald-glow), transparent 60%),
      radial-gradient(700px 380px at 95% 8%, rgba(94, 200, 224, 0.08), transparent 55%),
      linear-gradient(180deg, var(--bg2), var(--bg) 36%);
}

.banner strong { color: var(--emerald-bright); font-weight: 700; }
.banner a:hover { color: var(--emerald); }
.banner a[aria-current="page"] { color: var(--emerald-bright); font-weight: 700; }
.kicker { color: var(--emerald); }

.note {
    border-left: 3px solid var(--emerald);
    padding: .65rem 1rem;
    margin: 1.25rem 0;
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.note strong { color: var(--emerald-bright); }

.perf-metric {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .4rem .85rem;
    font: .82rem/1.4 var(--mono);
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--emerald);
    padding: .5rem .85rem;
    margin: .85rem 0 1.75rem;
    color: var(--dim);
}
.perf-metric strong { color: var(--ink); }
.perf-metric .saved { color: var(--emerald-bright); font-weight: 700; }

.subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: 1.5rem 0 2rem;
    padding: .65rem .95rem;
    background: var(--panel);
    border: 1px solid var(--line);
    font: .82rem/1.4 var(--mono);
}
.subnav__label {
    color: var(--dim);
    font-weight: 600;
}
.subnav__link {
    color: var(--dim);
    padding: .25rem .65rem;
    border: 1px solid transparent;
    text-decoration: none;
    border-radius: 2px;
}
.subnav__link:hover {
    color: var(--emerald-bright);
    border-color: var(--emerald-dim);
}
.subnav__link.is-active {
    color: var(--emerald-bright);
    background: var(--emerald-bg);
    border-color: var(--emerald-dim);
    font-weight: 700;
}

.page {
    max-width: calc(var(--w) + 3rem);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
}
.page--wide {
    max-width: min(96vw, 88rem);
}
.page--wide #content {
    max-width: 100%;
}
.page--wide header,
.page--wide .subnav,
.page--wide #content > p,
.page--wide #content > ul,
.page--wide #content > pre,
.page--wide footer {
    max-width: var(--w);
}
.top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    font: .82rem/1.4 var(--mono);
}
.top a { color: var(--emerald); text-decoration: none; }
.top a:hover { border-bottom: 1px solid var(--emerald); }
.top__muted { color: var(--dim); }
#content {
    max-width: var(--w);
}
#content > :first-child { margin-top: 0; }
#content h1 {
    font: 700 2rem/1.15 var(--mono);
    color: var(--emerald-bright);
    letter-spacing: -0.03em;
    margin: 0 0 .75rem;
}
#content h2 {
    font: 700 1.15rem/1.25 var(--mono);
    color: var(--emerald);
    margin: 2.25rem 0 .75rem;
    padding-top: .35rem;
    border-top: 1px solid var(--line);
}
#content h3 {
    font: 700 1rem/1.3 var(--mono);
    color: var(--ink);
    margin: 1.5rem 0 .5rem;
}
#content h4 {
    font: 700 .9rem/1.3 var(--mono);
    color: var(--dim);
    margin: 1.25rem 0 .4rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
#content p, #content li { color: var(--ink); }
#content a { color: var(--emerald); }
#content a:hover { color: var(--emerald-bright); }
#content hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2rem 0;
}
#content code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--panel);
    padding: .1em .35em;
    border: 1px solid var(--line);
    color: var(--emerald-bright);
}
#content pre {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: .85rem 1rem;
    overflow-x: auto;
    font: .85rem/1.45 var(--mono);
    color: var(--ink);
}
#content pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
}
#content table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font: .82rem/1.35 var(--mono);
}
#content th, #content td {
    padding: .35rem .6rem;
    border: 1px solid var(--line);
    text-align: left;
}
#content th {
    background: var(--panel);
    color: var(--emerald-bright);
}
#content table td strong,
#content table td.is-best {
    color: var(--emerald-bright);
    font-weight: 700;
}
#content table td.is-best {
    background: rgba(52, 211, 153, 0.14);
}

.table-scroll {
    overflow-x: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--line);
    background: var(--bg2);
    width: fit-content;
    max-width: 100%;
}
.matrix-table {
    width: auto;
    border-collapse: collapse;
    margin: 0 !important;
    font: .8rem/1.35 var(--mono);
}
.matrix-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
    color: var(--emerald-bright);
    padding: .4rem .55rem;
    border: 1px solid var(--line);
    white-space: nowrap;
}
.matrix-table td {
    padding: .28rem .55rem;
    border: 1px solid var(--line);
    white-space: nowrap;
}
.matrix-table td.is-best {
    color: var(--emerald-bright);
    font-weight: 700;
    background: rgba(52, 211, 153, 0.14);
}
.matrix-table td.is-best strong {
    color: var(--emerald-bright);
    font-weight: 700;
}

.game-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--emerald);
    padding: 1.15rem;
    margin: 1.5rem 0 1.25rem;
}
.game-card__hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.game-card__thumb {
    flex: 0 0 240px;
    max-width: 240px;
}
.game-card__thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.game-card__intro {
    flex: 1 1 20rem;
    min-width: 0;
}
.game-card__header {
    margin-bottom: .6rem;
}
.game-card__title {
    font: 700 1.2rem/1.2 var(--mono);
    color: var(--emerald-bright);
    margin: 0 0 .25rem;
}
.game-card__meta {
    font: .82rem/1.4 var(--mono);
    color: var(--dim);
}
.game-card__badge {
    display: inline-block;
    padding: .1rem .45rem;
    font-size: .75rem;
    border: 1px solid var(--line);
    background: rgba(52, 211, 153, 0.08);
    color: var(--emerald);
    border-radius: 2px;
    margin-right: .35rem;
}
.game-card__blurb {
    font-size: .88rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg2);
    border: 1px solid var(--line);
    border-left: 2px solid var(--emerald-dim);
    padding: .65rem .85rem;
    margin-top: .6rem;
}
.game-card__blurb strong {
    color: var(--emerald-bright);
}
.game-card__compare {
    margin-top: .75rem;
    overflow-x: auto;
}
.game-card__table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
    font: .82rem/1.4 var(--mono);
    background: var(--bg2);
}
.game-card__table th, .game-card__table td {
    padding: .45rem .75rem;
    border: 1px solid var(--line);
}
.game-card__table th {
    background: rgba(5, 150, 105, 0.08);
    color: var(--emerald);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

footer {
    max-width: var(--w);
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: .82rem;
    color: var(--dim);
    text-align: center;
}
footer a { color: var(--emerald); border: 0; }
footer a:hover { color: var(--emerald-bright); text-decoration: underline; }
.heart { color: var(--emerald); }

.rbs-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--emerald);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted var(--emerald-dim);
}
.rbs-link:hover {
    color: var(--emerald-bright);
    border-bottom-color: var(--emerald-bright);
}
.rbs-modal {
    max-width: min(56rem, 94vw);
    width: 100%;
    max-height: 85vh;
    padding: 0;
    border: 1px solid var(--emerald-dim);
    border-radius: 3px;
    background: var(--bg);
    color: var(--ink);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.75);
}
.rbs-modal::backdrop {
    background: rgba(0, 0, 0, 0.72);
}
.rbs-modal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
}
.rbs-modal__title {
    font: 700 .95rem/1.3 var(--mono);
    color: var(--emerald-bright);
    margin: 0;
}
.rbs-modal__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.rbs-modal__btn {
    font: 600 .78rem/1 var(--mono);
    padding: .4rem .7rem;
    border: 1px solid var(--emerald-dim);
    border-radius: 2px;
    background: rgba(52, 211, 153, 0.1);
    color: var(--emerald-bright);
    cursor: pointer;
}
.rbs-modal__btn:hover {
    background: rgba(52, 211, 153, 0.22);
}
.rbs-modal__btn--close {
    border-color: var(--line);
    background: transparent;
    color: var(--dim);
}
.rbs-modal__btn--close:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
}
.rbs-modal__code {
    margin: 0 !important;
    padding: 1rem !important;
    max-height: calc(85vh - 3.25rem);
    overflow: auto;
    border: 0 !important;
    background: var(--bg) !important;
    font: .8rem/1.5 var(--mono);
    white-space: pre;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .9rem;
    margin: 1.5rem 0;
}
.kpi-card {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 1rem 1.1rem;
}
.kpi-card__value {
    font: 700 1.65rem/1.15 var(--mono);
    color: var(--emerald-bright);
    margin-bottom: .35rem;
}
.kpi-card__label {
    font-size: .88rem;
    color: var(--text);
    font-weight: 600;
}
.kpi-card__sub {
    font-size: .78rem;
    color: var(--muted, #9ca3af);
    margin-top: .2rem;
}
.chart-box {
    background: var(--bg2);
    border: 1px solid var(--line);
    padding: 1.1rem 1.25rem;
    margin: 1.25rem 0;
    max-width: 52rem;
}
.chart-box__title {
    font: 600 .85rem/1.3 var(--mono);
    color: var(--emerald-bright);
    margin-bottom: 1.1rem;
}
.vchart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
    gap: .9rem;
    align-items: end;
    font: .8rem/1.3 var(--mono);
}
.vbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}
.vbar__plot {
    width: 100%;
    height: 12.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
}
.vbar__val {
    font-weight: 700;
    color: var(--text);
    margin-bottom: .35rem;
    white-space: nowrap;
}
.vbar__val--rg {
    color: var(--emerald-bright);
}
.vbar__col {
    width: 3rem;
    max-width: 72%;
    background: rgba(148, 163, 184, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-bottom: none;
    border-radius: 3px 3px 0 0;
}
.vbar__col--rg {
    background: var(--emerald-bright);
    border-color: var(--emerald-bright);
}
.vbar__label {
    margin-top: .55rem;
    font-weight: 600;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
}
.vbar__sub {
    margin-top: .15rem;
    font-size: .72rem;
    color: var(--muted, #9ca3af);
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 640px) {
    .vchart {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .65rem .45rem;
    }
    .vbar__plot {
        height: 9.5rem;
    }
    .vbar__col {
        width: 2.1rem;
    }
}
#content table {
    width: auto;
    max-width: 100%;
    margin: 1.25rem 0;
    font: .82rem/1.35 var(--mono);
}
#content th, #content td {
    padding: .38rem .65rem;
}
#content table td.is-best {
    color: var(--emerald-bright);
    font-weight: 700;
}
#content table td strong {
    color: var(--emerald-bright);
    font-weight: 700;
}
.arch-pipeline {
    max-width: 44rem;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.arch-node {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--emerald);
    border-radius: 6px;
    padding: .75rem 1rem;
}
.arch-node--accent {
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-dim);
    border-left: 3px solid var(--emerald-bright);
    text-align: center;
}
.arch-node__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin-bottom: .35rem;
}
.arch-badge {
    font: 600 .74rem/1 var(--mono);
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--emerald-bright);
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-dark);
    border-radius: 4px;
    padding: .22rem .45rem;
}
.arch-node__title {
    color: var(--ink);
    font-weight: 600;
    font-size: .96rem;
}
.arch-node__desc {
    margin: 0;
    color: var(--dim);
    font-size: .86rem;
    line-height: 1.5;
}
.arch-node__list {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--dim);
    font-size: .86rem;
    line-height: 1.5;
}
.arch-node__list li { margin: .12rem 0; }
.arch-arrow {
    display: flex;
    justify-content: center;
    height: 22px;
    color: var(--emerald);
}
.arch-arrow svg { width: 20px; height: 22px; display: block; }
.arch-tree {
    margin: 1.5rem 0;
}
.arch-tree__root {
    max-width: 22rem;
    margin: 0 auto;
}
.arch-tree__fork {
    height: 36px;
    color: var(--emerald);
}
.arch-tree__fork svg {
    width: 100%;
    height: 36px;
    display: block;
}
.arch-tree__cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}
@media (max-width: 680px) {
    .arch-tree__fork { display: none; }
    .arch-tree__cols {
        grid-template-columns: 1fr;
        margin-top: .75rem;
    }
}
