/* ---------------------------------------------------------------- tokens */
:root {
    --bg: #faf9f7;
    --bg-raised: #ffffff;
    --text: #26221c;
    --text-muted: #6f6a61;
    --accent: #7a4bd6;
    --accent-hover: #5c33ab;
    --accent-soft: #f0eafc;
    --daily-accent: #0f766e;
    --daily-soft: #e6f4f2;
    --border: #e6e2da;
    --code-bg: #f1efeb;
    --code-text: #3d3830;
    --shadow: 0 1px 3px rgba(30, 25, 15, 0.06);
    color-scheme: light;
}
html[data-theme="dark"] {
    --bg: #16151a;
    --bg-raised: #1e1d24;
    --text: #e8e5df;
    --text-muted: #9b968c;
    --accent: #b49af0;
    --accent-hover: #d0bffa;
    --accent-soft: #2a2438;
    --daily-accent: #4fd1c5;
    --daily-soft: #14302d;
    --border: #322f3a;
    --code-bg: #24222b;
    --code-text: #ddd8ce;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
}
.wrap {
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; border-radius: 8px; }
h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- header */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 0.9rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.site-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
}
.site-name:hover { color: var(--accent); text-decoration: none; }
.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}
.site-nav a {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
}
.site-nav a:hover {
    color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
}
.nav-rss { font-variant: small-caps; letter-spacing: 0.05em; }
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    width: 2rem;
    height: 2rem;
    margin-left: 0.35rem;
    cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ---------------------------------------------------------------- hero */
.hero { margin: 2.5rem 0 1rem; }
.hero h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
.hero p { color: var(--text-muted); margin: 0; max-width: 38rem; }

/* ---------------------------------------------------------------- stream */
main { padding-bottom: 3rem; }
.stream { margin-top: 1.5rem; }
.entry {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.35rem 1.5rem;
    margin: 1.15rem 0;
}
.entry-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.entry-kind {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.12rem 0.5rem;
    border-radius: 99px;
}
.kind-article { color: var(--accent); background: var(--accent-soft); }
.kind-daily { color: var(--daily-accent); background: var(--daily-soft); }
.entry-permalink { color: var(--text-muted); }
.entry-title {
    font-size: 1.3rem;
    margin: 0.1rem 0 0.4rem;
}
.entry-title a { color: var(--text); }
.entry-title a:hover { color: var(--accent); text-decoration: none; }
.entry-summary { color: var(--text-muted); margin: 0 0 0.5rem; }
.entry-more { margin: 0; font-size: 0.92rem; font-weight: 500; }
.entry-daily .entry-title { font-size: 1.15rem; }
.entry-body > :first-child { margin-top: 0; }
.entry-body > :last-child { margin-bottom: 0; }
.tags { display: inline-flex; gap: 0.35rem; }
.tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.05rem 0.5rem;
}

/* ---------------------------------------------------------------- prose */
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.prose h3 { font-size: 1.15rem; margin-top: 1.8rem; }
.prose blockquote {
    margin: 1.25rem 0;
    padding: 0.6rem 1.1rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 8px 8px 0;
    color: var(--text);
}
.prose blockquote p { margin: 0.35rem 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.45rem 0.7rem; text-align: left; }
.prose iframe { max-width: 100%; border-radius: 8px; }

pre, code {
    font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: 6px;
}
code { padding: 0.15em 0.35em; }
pre {
    padding: 1rem 1.15rem;
    overflow-x: auto;
    line-height: 1.5;
    border: 1px solid var(--border);
}
pre code { padding: 0; background: none; border: none; }

/* ---------------------------------------------------------------- post */
.post { margin-top: 2.5rem; }
.post-header { margin-bottom: 1.75rem; }
.post-header h1 { margin: 0.4rem 0 0; font-size: 2.1rem; }
.post-footer {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}
.page-prose { margin-top: 2.5rem; }

/* ---------------------------------------------------------------- archive */
.page-title { margin: 2.5rem 0 0.4rem; font-size: 1.9rem; }
.page-intro { color: var(--text-muted); margin-top: 0; }
.archive-month h2 {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 2rem 0 0.5rem;
}
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li {
    display: flex;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--border);
}
.archive-list time {
    flex: 0 0 8.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    padding-top: 0.1rem;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.site-footer a { color: var(--text-muted); text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 600px) {
    body { font-size: 1rem; }
    .entry { padding: 1.1rem 1.15rem; }
    .hero h1 { font-size: 1.6rem; }
    .post-header h1 { font-size: 1.7rem; }
    .archive-list li { flex-direction: column; gap: 0; }
    .archive-list time { flex: none; }
}
