*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #fafaf8;
    --fg: #59C3D7;
    --muted: #666;
    --accent: #D75B70;
    --border: #e0e0d8;
    --max-width: 680px;
    --sidebar-width: 280px;
    --font-body: Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Inconsolata', monospace;
}

html { font-size: 18px; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    line-height: 1.7;
    margin: 0;
}

/* Nav */
header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

nav {
    max-width: calc(var(--max-width) + var(--sidebar-width) + 3rem);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-title {
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--accent);
    letter-spacing: -0.02em;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

nav a:hover { color: var(--fg); }

/* Layout */
.layout {
    max-width: calc(var(--max-width) + var(--sidebar-width) + 3rem);
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

main {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

@media (max-width: 800px) {
    body { padding-bottom: 108px; }
    .layout { flex-direction: column; }
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--bg);
        border-top: 1px solid var(--border);
        padding: 8px;
        z-index: 100;
    }
}

/* Post list */
.post-list h1 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 2rem;
}

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

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

.post-summary h2 {
    font-size: 1.3rem;
    margin: 0 0 0.3rem;
}

.post-summary-link {
    display: block;
    color: var(--fg);
    text-decoration: none;
}

.post-summary-link:hover h2 { color: var(--accent); }

.post-summary time {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-bottom: 0.5rem;
}

.post-summary p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Post / Page */
.post-header, .page-header { margin-bottom: 2rem; }

.post-header h1, .page-header h1 {
    font-size: 2rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
}

.post-header time {
    font-size: 0.85rem;
    color: var(--muted);
}

.post-content, .page-content { }

.post-content h2, .page-content h2 { font-size: 1.4rem; margin-top: 2rem; }
.post-content h3, .page-content h3 { font-size: 1.15rem; margin-top: 1.5rem; }

.post-content a, .page-content a { color: var(--accent); }

.post-content img, .page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: #f0f0ea;
    padding: 0.1em 0.35em;
    border-radius: 3px;
}

pre {
    background: #f0f0ea;
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
}

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

blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.5rem 0;
    padding: 0.5rem 1.25rem;
    color: var(--muted);
    font-style: italic;
}

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

.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-footer a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.post-footer a:hover { color: var(--fg); }

.error { color: #c0392b; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4rem;
}
