:root {
    color-scheme: dark;
    --bg: #070a10;
    --panel: rgba(18, 22, 31, 0.92);
    --panel-strong: #10141d;
    --ink: #f7f9fc;
    --muted: #aeb8c8;
    --line: rgba(255, 255, 255, 0.16);
    --green: #76ee87;
    --yellow: #f3cf72;
    --blue: #0a66c2;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
}

a {
    color: inherit;
}

.article-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    display: grid;
    grid-template-columns: repeat(5, minmax(220px, 1fr));
    gap: 12px;
    padding: 12px;
    transform: rotate(-1deg) scale(1.04);
    opacity: 0.28;
    pointer-events: none;
}

.article-bg div {
    min-height: 180px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #d8f66c;
}

.article-bg div:nth-child(2n) {
    background: #97d9ff;
}

.article-bg div:nth-child(3n) {
    background: #f7a188;
}

.article-bg div:nth-child(4n) {
    background: #cdbdff;
}

.shade {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(5, 8, 13, 0.83);
    pointer-events: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 62px;
    padding: 12px 34px;
    background: rgba(5, 7, 11, 0.86);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--mono);
    font-weight: 850;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.top-links {
    display: flex;
    gap: 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
}

.top-links a {
    text-decoration: none;
}

.article-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 56px;
}

.hero {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 32px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: var(--green);
    font: 850 0.76rem/1 var(--mono);
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 12em;
    margin-bottom: 16px;
    font-size: 3.1rem;
    line-height: 1;
    letter-spacing: 0;
}

.dek {
    max-width: 720px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.1rem;
    line-height: 1.6;
}

.article-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    background: rgba(18, 22, 31, 0.9);
}

article h2 {
    margin: 34px 0 12px;
    font-size: 1.65rem;
    line-height: 1.2;
}

article h2:first-child {
    margin-top: 0;
}

article h3 {
    margin: 24px 0 10px;
    font-size: 1.15rem;
}

article p,
article li {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.72;
}

article strong {
    color: #fff;
}

article a {
    color: var(--green);
    font-weight: 800;
}

ul,
ol {
    padding-left: 22px;
}

li + li {
    margin-top: 8px;
}

.callout {
    margin: 24px 0;
    border: 1px solid rgba(243, 207, 114, 0.42);
    border-radius: 8px;
    padding: 16px;
    color: #fff3cb;
    background: rgba(243, 207, 114, 0.08);
}

.callout p {
    margin-bottom: 0;
    color: #fff3cb;
}

code {
    border-radius: 6px;
    padding: 2px 5px;
    color: #08111e;
    background: var(--yellow);
    font-family: var(--mono);
    font-size: 0.86em;
    font-weight: 850;
}

.sidebar {
    position: sticky;
    top: 86px;
    display: grid;
    gap: 12px;
}

.side-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--panel);
}

.side-card h2 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.side-card p {
    color: var(--muted);
    line-height: 1.55;
}

.button {
    min-height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: #08111e;
    background: var(--green);
    font-weight: 850;
    text-decoration: none;
}

.button.secondary {
    color: #fff;
    border: 1px solid var(--line);
    background: transparent;
}

.related {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto 56px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.related a {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--panel);
    text-decoration: none;
}

.related strong {
    display: block;
    margin-bottom: 8px;
}

.related span {
    color: var(--muted);
    line-height: 1.5;
}

.site-footer {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto 28px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}

.site-footer nav {
    display: flex;
    gap: 16px;
}

@media (max-width: 840px) {
    .topbar {
        padding: 11px 18px;
    }

    .top-links {
        display: none;
    }

    h1 {
        font-size: 2.35rem;
    }

    .hero {
        padding: 22px;
    }

    .article-body,
    .related-grid {
        grid-template-columns: 1fr;
    }

    article {
        padding: 22px;
    }

    .sidebar {
        position: static;
    }
}
