:root {
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --bg: #ffffff;
    --border: #e5e7eb;
    --accent: #0f172a;
    --tag-bg: #f3f4f6;
    --max-width: 700px;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-serif);
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.8;
    font-size: 18px;
}

/* ── Navigation ── */
nav {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-sans);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.rss-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.rss-link:hover { color: var(--accent); }

/* ── Homepage ── */
.posts-list {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.hero {
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
}

.post-card {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}

.post-card:last-child { border-bottom: none; }

.post-card h2 a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.post-card h2 a:hover { color: var(--accent); }

.post-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.6rem;
    font-family: var(--font-sans);
}

.post-description {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: var(--font-sans);
    line-height: 1.65;
}

.post-tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--tag-bg);
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    text-decoration: none;
    font-weight: 500;
}

/* ── Single Post ── */
.post-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

/* ── Post Content Typography ── */
.post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    line-height: 1.3;
}

.post-content p {
    margin: 1.4rem 0;
}

.post-content ul,
.post-content ol {
    margin: 1.25rem 0 1.25rem 1.75rem;
}

.post-content li { margin: 0.4rem 0; }

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 2rem 0;
    display: block;
}

.post-content pre {
    background: #f8f9fa;
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    margin: 1.5rem 0;
    line-height: 1.6;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.post-content code {
    background: #f3f4f6;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border);
    padding: 0.6rem 0.9rem;
    text-align: left;
}

.post-content th {
    background: var(--tag-bg);
    font-weight: 600;
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
}

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

footer a:hover { color: var(--accent); }

/* ── Empty state ── */
.empty-state {
    padding: 3rem 0;
    color: var(--text-secondary);
    font-family: var(--font-sans);
}

.empty-state a { color: var(--accent); }

@media (max-width: 640px) {
    body { font-size: 17px; }
    .post-header h1 { font-size: 1.9rem; }
    nav { padding: 1rem; }
}
