html {
    scroll-behavior: smooth;
}

.article-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    left: 40px;
    top: 72px;
    width: 160px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 2;
}

.back-link {
    color: var(--text-muted) !important;
    font-size: 13px;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    transition: color 0.2s ease;
    display: inline-block;
}

.back-link:hover {
    color: var(--text-main) !important;
    border-bottom: none !important;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toc-nav a {
    color: var(--text-muted);
    font-size: 12px;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    transition: color 0.2s ease;
    line-height: 1.5;
}

.toc-nav a:hover {
    color: var(--text-main);
    border-bottom: none !important;
}

/* ── Main content ── */
.article-main {
    max-width: 520px;
    margin: 0 auto;
    padding: 72px 24px 120px;
    opacity: 0;
    animation: fadeInSlideUp 0.7s ease 0.1s forwards;
}

.article-header {
    margin-bottom: 32px;
}

.article-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}

.article-date {
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Hero banner ── */
.article-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto 36px;
}

/* ── Sections ── */
.article-section {
    margin-bottom: 36px;
}

.article-section:not(:first-child) {
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.article-section h2 {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.article-section p {
    color: var(--text-main);
    line-height: 1.75;
    margin-bottom: 14px;
    font-size: 14px;
}

.article-section p:last-child {
    margin-bottom: 0;
}

/* ── Feature list ── */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-list li {
    font-size: 14px;
    color: var(--text-main);
    position: relative;
    line-height: 1.65;
}



/* ── Format grid ── */
.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.format-item {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
}

.format-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.format-exts {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

/* ── Stack pills ── */
.stack-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.stack-pill {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-main);
}

/* ── Inline link inside article ── */
.article-a {
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 1px !important;
    transition: border-color 0.2s ease;
}

.article-a:hover {
    border-bottom-color: var(--text-main) !important;
}

/* ── Responsive ── */
@media (max-width: 720px) {
    .sidebar {
        position: static;
        width: auto;
        padding: 40px 24px 0;
    }

    .article-layout {
        display: flex;
        flex-direction: column;
    }

    .article-main {
        margin: 0;
        padding: 24px 24px 80px;
    }

    .toc-nav {
        display: none;
    }
}
/* ── Code block ── */
.code-block {
    background-color: #0d0d0d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
}

.code-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid #1e1e1e;
    background-color: #111111;
}

.code-block-filename {
    font-size: 11px;
    color: #666;
    letter-spacing: 0.03em;
}

.code-block pre {
    margin: 0;
    padding: 16px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.code-line {
    display: flex;
    padding: 0 16px;
    min-width: max-content;
}

.code-line:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.line-number {
    display: inline-block;
    width: 28px;
    min-width: 28px;
    color: #3a3a3a;
    user-select: none;
    text-align: right;
    margin-right: 20px;
    font-size: 11.5px;
}

.line-content {
    color: #c9c9c9;
    white-space: pre;
}

/* Syntax colors */
.tok-keyword  { color: #c084fc; }
.tok-fn       { color: #60a5fa; }
.tok-string   { color: #86efac; }
.tok-comment  { color: #4b5563; font-style: italic; }
.tok-type     { color: #f9a8d4; }
.tok-number   { color: #fdba74; }
.tok-param    { color: #fcd34d; }
.tok-punct    { color: #888888; }
