:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-hover: #1a1a1a;
    --border: #262626;
    --text: #fafafa;
    --text-muted: #a1a1a1;
    --text-dim: #525252;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Nav — matches main site */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* Blog listing */
.blog-header {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 2rem 2rem;
}

.blog-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.blog-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.posts {
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    display: block;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s;
}

.post-card:hover {
    border-color: var(--text-dim);
    background: var(--surface-hover);
}

.post-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.post-card .post-date {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.post-card .post-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Article layout */
.article {
    max-width: 680px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
}

.article-header {
    margin-bottom: 3rem;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.article-meta {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.article-body h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.article-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.article-body p {
    margin: 1rem 0;
    line-height: 1.8;
    color: #d4d4d4;
}

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

.article-body a:hover {
    text-decoration: underline;
}

.article-body strong {
    color: var(--text);
    font-weight: 600;
}

.article-body em {
    color: var(--text-muted);
}

.article-body ul, .article-body ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.article-body li {
    margin: 0.4rem 0;
    line-height: 1.7;
    color: #d4d4d4;
}

.article-body code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
}

.article-body pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
}

.article-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

.article-body .diagram {
    margin: 1.5rem 0;
    background: #fafafa;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    cursor: zoom-in;
}

.article-body .diagram img {
    display: block;
    width: 100%;
    height: auto;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    cursor: zoom-out;
    padding: 2rem;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 95%;
    max-height: 95vh;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}

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

.article-footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 600px) {
    .blog-header { padding: 100px 1.25rem 1.5rem; }
    .blog-header h1 { font-size: 1.5rem; }
    .posts { padding: 0 1.25rem; }
    .article { padding: 100px 1.25rem 3rem; }
    .article-header h1 { font-size: 1.5rem; }
    .nav-inner { padding: 0.75rem 1.25rem; }
}
