:root {
    color-scheme: dark; /* render native UI (scrollbars, form controls) dark */

    --bg: #0b0f0c; /* near-black with green tint */
    --panel: #0f1612;
    --border: #1f2a23;

    --fg: #cfe8d8; /* main text */
    --muted: #8fb3a0; /* secondary text */
    --accent: #6fd19c; /* selection / highlights */
    --accent-rgb: 111, 209, 156; /* --accent as r,g,b for rgba() */
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.125rem; /* ≈ 18px */
    overflow: hidden;
}

body {
    display: flex;
    align-items: center; /* vertical */
    justify-content: center; /* horizontal */
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Tint text selection with the CRT accent instead of the browser default. */
::selection {
    background: rgba(var(--accent-rgb), 0.3);
    color: var(--fg);
}

/* Visible focus ring for keyboard users (mouse clicks stay clean). */
a:focus-visible,
.tui-menu li:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

.tags {
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.8;
}

.view-title {
    text-decoration: underline;
}

.post-meta {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

.tag-filter {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.7;
}

.tag-filter-summary {
    cursor: pointer;
    list-style: none; /* hide the default disclosure triangle */
    color: var(--muted);
    user-select: none;
    width: fit-content;
}

.tag-filter-summary::-webkit-details-marker {
    display: none;
}

.tag-filter-caret::before {
    content: "\25B8"; /* ▸ */
}

.tag-filter[open] .tag-filter-caret::before {
    content: "\25BE"; /* ▾ */
}

.tag-filter-active {
    color: var(--accent);
}

.tag-filter-list {
    margin-top: 0.4rem;
    padding-left: 0.2rem;
}

.tag-filter-item {
    color: var(--muted);
}

.tag-filter-item.active {
    color: var(--accent);
    text-decoration: underline;
}

/* series: badge in the blog list + a "part of the series" nav on a post */
.post-series {
    color: var(--accent);
    font-size: 0.85rem;
    opacity: 0.85;
}

.article-series {
    margin: 2rem 0 0;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.article-series-title {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.article-series ol {
    margin: 0;
    padding-left: 1.4rem;
}

.article-series li {
    margin: 0.2rem 0;
}

.article-series li[aria-current="true"] strong {
    color: var(--accent);
}

.series-here {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* blog post (article) view */
.article {
    max-width: 72ch;
    line-height: 1.55;
}

.article h1 {
    font-size: 1.4rem;
    margin: 0.6rem 0 0.2rem;
    color: var(--accent);
}

.article h2 {
    font-size: 1.15rem;
    margin: 1.4rem 0 0.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.2rem;
}

.article h3 {
    font-size: 1rem;
    margin: 1.1rem 0 0.3rem;
    color: var(--muted);
}

.article h4,
.article h5,
.article h6 {
    font-size: 0.95rem;
    margin: 1rem 0 0.3rem;
    color: var(--muted);
}

.article p {
    margin: 0.6rem 0;
}

.article ul,
.article ol {
    margin: 0.5rem 0;
    padding-left: 1.4rem;
}

.article li {
    margin: 0.2rem 0;
}

.article li > ul,
.article li > ol {
    margin: 0.2rem 0;
}

.article code {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 0.3em;
    font-size: 0.9em;
}

.article pre.code {
    margin: 0.8rem 0;
    padding: 0.75rem 1rem;
    background: #0b120e;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre;
}

.article pre.code code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9em;
}

.article blockquote {
    margin: 0.8rem 0;
    padding: 0.2rem 0 0.2rem 1rem;
    border-left: 3px solid var(--border);
    color: var(--muted);
}

.article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.2rem 0;
}

.article img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.article-meta {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.article-source {
    margin-top: 1.4rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
}

.article > .back-link:last-child {
    margin-top: 1.4rem;
}
