/* ---------- Article / long-form writing pages ---------- */
.article-topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.article-topbar .inner {
    max-width: 1180px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9rem 1.5rem;
}
.article-back {
    font-family: var(--font-mono); font-size: 0.9rem;
    color: var(--text-secondary); text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.article-back:hover { color: var(--accent); }
.article-back .prompt { color: var(--accent); }
.theme-toggle-btn {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 0.95rem;
}
.theme-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle-btn .fa-moon { display: none; }
[data-theme="light"] .theme-toggle-btn .fa-sun { display: none; }
[data-theme="light"] .theme-toggle-btn .fa-moon { display: inline; }

.article-wrap { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem 6rem; }
.article-head { margin-bottom: 2.5rem; }
.article-kicker {
    font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--accent);
}
.article-meta { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.82rem; margin-top: 0.6rem; }
.article-meta a { color: var(--text-secondary); }

/* table of contents */
.article-toc {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.3rem 1.6rem; margin: 0 0 3rem;
}
.article-toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 0.8rem; border: 0; padding: 0; }
.article-toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; }
.article-toc > ol > li { counter-increment: toc; margin: 0.35rem 0; }
.article-toc > ol > li > a::before {
    content: counter(toc) ". "; color: var(--accent); font-family: var(--font-mono); }
.article-toc a { color: var(--text-secondary); text-decoration: none; }
.article-toc a:hover { color: var(--accent); }

/* prose */
.prose { color: var(--text-secondary); font-size: 1.02rem; line-height: 1.8; }
.prose h1 { font-size: 2rem; line-height: 1.2; color: var(--text); margin: 0 0 1.2rem; }
.prose h1:not(:first-child) {
    margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border-strong); }
.prose h2 { font-size: 1.5rem; color: var(--text); margin: 2.6rem 0 1rem; }
.prose h3 { font-size: 1.2rem; color: var(--text); margin: 2rem 0 0.8rem; }
.prose h4 { font-size: 1.02rem; color: var(--text); margin: 1.6rem 0 0.6rem; }
.prose p { margin: 0 0 1.2rem; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.3rem 1.4rem; }
.prose li { margin: 0.4rem 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose code {
    font-family: var(--font-mono); font-size: 0.86em;
    background: var(--surface-3); border: 1px solid var(--border);
    padding: 0.12em 0.4em; border-radius: 6px; color: var(--text); }
.prose pre {
    background: var(--surface); border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; overflow-x: auto; margin: 0 0 1.5rem;
    font-size: 0.86rem; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: var(--text-secondary); }
.prose blockquote {
    margin: 0 0 1.5rem; padding: 0.9rem 1.3rem;
    background: var(--accent-soft); border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-secondary); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table {
    width: 100%; border-collapse: collapse; margin: 0 0 1.6rem; font-size: 0.92rem; }
.prose th, .prose td {
    border: 1px solid var(--border); padding: 0.55rem 0.8rem; text-align: left; }
.prose th { background: var(--surface-3); color: var(--text); font-family: var(--font-mono); font-size: 0.82rem; }
.prose :target { scroll-margin-top: 80px; }
