:root {
    --c-bg: #fff;
    --c-text: #1a1a1a;
    --c-text-muted: #6b7280;
    --c-link: #2563eb;
    --c-link-hover: #1d4ed8;
    --c-border: #e5e7eb;
    --c-code-bg: #f3f4f6;
    --c-header-bg: #fafafa;
    --c-tag-bg: #f0f0f0;
    --c-tag-text: #374151;
    --c-blockquote: #6b7280;
    --c-blockquote-border: #d1d5db;
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, monospace;
    --max-width: 42rem;
}
[data-theme="dark"] {
    --c-bg: #111827;
    --c-text: #e5e7eb;
    --c-text-muted: #9ca3af;
    --c-link: #60a5fa;
    --c-link-hover: #93bbfd;
    --c-border: #374151;
    --c-code-bg: #1f2937;
    --c-header-bg: #0f172a;
    --c-tag-bg: #1f2937;
    --c-tag-text: #d1d5db;
    --c-blockquote: #9ca3af;
    --c-blockquote-border: #4b5563;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-bg);
    transition: color .2s, background .2s;
}
a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

/* Header */
.site-header {
    border-bottom: 1px solid var(--c-border);
    background: var(--c-header-bg);
    transition: background .2s, border-color .2s;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}
.site-header .site-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--c-text);
    text-decoration: none;
}
.site-header .site-name:hover { color: var(--c-link); text-decoration: none; }
.site-header nav ul { list-style: none; display: flex; gap: 1.25rem; }
.site-header nav a { font-size: .9375rem; }
.theme-toggle {
    background: none;
    border: 1px solid var(--c-border);
    border-radius: .375rem;
    padding: .25rem .5rem;
    cursor: pointer;
    font-size: .875rem;
    color: var(--c-text-muted);
    transition: border-color .2s, color .2s;
    line-height: 1;
}
.theme-toggle:hover { border-color: var(--c-text-muted); color: var(--c-text); }

/* Main content */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
main { padding: 2.5rem 0 4rem; }
main .container > h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; line-height: 1.3; }

/* Article / entry */
article h1 { font-size: 2rem; font-weight: 700; line-height: 1.25; margin-bottom: .5rem; }
.entry-meta { color: var(--c-text-muted); font-size: .9375rem; margin-bottom: 2rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.entry-meta time, .entry-meta .author { display: inline; }
.content { font-size: 1.0625rem; line-height: 1.8; }
.content h2 { font-size: 1.5rem; font-weight: 600; margin: 2rem 0 .75rem; }
.content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.75rem 0 .5rem; }
.content h4 { font-size: 1.0625rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.content p { margin-bottom: 1.25rem; }
.content ul, .content ol { margin: 0 0 1.25rem 1.5rem; }
.content li { margin-bottom: .25rem; }
.content blockquote {
    border-left: 3px solid var(--c-blockquote-border);
    padding: .5rem 0 .5rem 1.25rem;
    margin: 1.25rem 0;
    color: var(--c-blockquote);
    font-style: italic;
}
.content pre {
    background: var(--c-code-bg);
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    font-size: .875rem;
    line-height: 1.6;
    transition: background .2s;
}
.content pre[style] { background-color: var(--c-code-bg) !important; }
[data-theme="dark"] .content pre[style] span[style] { filter: invert(.85) hue-rotate(180deg); }
.content code { font-family: var(--font-mono); font-size: .9em; }
.content :not(pre) > code {
    background: var(--c-code-bg);
    padding: .15em .35em;
    border-radius: .25rem;
    transition: background .2s;
}
.content img { max-width: 100%; height: auto; border-radius: .5rem; margin: 1.25rem 0; }
.content table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .9375rem; }
.content th, .content td { padding: .5rem .75rem; border: 1px solid var(--c-border); text-align: left; }
.content th { background: var(--c-code-bg); font-weight: 600; }
.content hr { border: none; border-top: 1px solid var(--c-border); margin: 2rem 0; }

/* Entry list */
.entry-list { list-style: none; }
.entry-list li { padding: 1rem 0; border-bottom: 1px solid var(--c-border); }
.entry-list li:last-child { border-bottom: none; }
.entry-list a { font-weight: 600; font-size: 1.125rem; }
.entry-list time { display: block; color: var(--c-text-muted); font-size: .875rem; margin-top: .125rem; }
.entry-list p { color: var(--c-text-muted); font-size: .9375rem; margin-top: .375rem; }

/* Tag / term list */
.term-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.term-list a {
    display: inline-block;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
    padding: .25rem .75rem;
    border-radius: 2rem;
    font-size: .875rem;
    transition: background .2s, color .2s;
}
.term-list a:hover { background: var(--c-link); color: #fff; text-decoration: none; }

/* Author */
.author-profile { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 2rem; }
.author-profile img { width: 5rem; height: 5rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-profile .author-info { flex: 1; }
.author-profile h1 { font-size: 1.75rem; margin-bottom: .25rem; }
.author-profile .author-links { color: var(--c-text-muted); font-size: .9375rem; }
.author-profile .author-links a { margin-right: 1rem; }
.author-profile .bio { margin-top: .75rem; }

/* Author index */
.author-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.author-grid li { display: flex; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid var(--c-border); border-radius: .5rem; transition: border-color .2s; }
.author-grid li:hover { border-color: var(--c-link); }
.author-grid img { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-grid a { font-weight: 600; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-border);
    font-size: .9375rem;
}
.pagination span { color: var(--c-text-muted); }

/* Archive months */
.archive-months ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.archive-months a {
    display: inline-block;
    background: var(--c-tag-bg);
    color: var(--c-tag-text);
    padding: .25rem .75rem;
    border-radius: 2rem;
    font-size: .875rem;
    transition: background .2s, color .2s;
}
.archive-months a:hover { background: var(--c-link); color: #fff; text-decoration: none; }
.back-link { margin-bottom: 1.5rem; font-size: .9375rem; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--c-border);
    padding: 1.5rem 0;
    color: var(--c-text-muted);
    font-size: .875rem;
    transition: border-color .2s;
}
.site-footer .container { text-align: center; }
.site-footer nav ul { list-style: none; display: flex; justify-content: center; gap: 1.25rem; }

/* 404 */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 4rem; font-weight: 700; margin-bottom: .5rem; }
.error-page p { color: var(--c-text-muted); font-size: 1.125rem; margin-bottom: 1.5rem; }
