:root {
    /* Soft contrast: avoid pure black-on-white at full brightness */
    --bg-0: #f4f1e8;
    --bg-1: #e8e5dc;
    --ink: #2a2a2a;
    --ink-muted: #555;
    --ink-faint: #666;
    --surface-ink: #fefdfb;
    --profile-width: 220px;
    --profile-width-sm: 150px;

    /*
     * Reading levers (in order of impact):
     * 1. size  2. measure  3. leading  4. contrast  5. x-height/spacing
     * Typeface is last — system UI faces are large-x-height screen defaults.
     */
    --font-body: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
    --font-size: 1.125rem; /* ~18px: biggest lever; browser 16px default is undersized */
    --line-height: 1.55; /* ~1.4–1.6× on screen */
    --measure: 65ch; /* ~55–75 characters */
}

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

body {
    font-family: var(--font-body);
    font-size: var(--font-size);
    background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 100%);
    color: var(--ink);
    line-height: var(--line-height);
    padding: 2rem;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    /* Wider than the prose measure so the home columns can breathe */
    max-width: 48rem;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.home-columns {
    display: grid;
    /* Right column matches profile width so both share one right edge */
    grid-template-columns: 1fr var(--profile-width);
    gap: 2rem 2.5rem;
    margin: 1.5rem 0 2rem;
    align-items: start;
}

.home-col h3 {
    margin-bottom: 0.85rem;
}

a.heading-link {
    text-decoration: none;
}

a.heading-link:hover {
    padding: 0;
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.home-col-blog {
    font-size: 0.95rem;
    line-height: 1.4;
}

.home-col-blog .post-list {
    margin-bottom: 0;
}

.home-col-blog .post-list li {
    margin-bottom: 0.85rem;
}

.home-col-blog .post-list .date {
    margin-bottom: 0.1rem;
    font-size: 0.8rem;
}

.title-block {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    min-height: 250px;
    display: flex;
    align-items: flex-end;
}

.title-block.compact {
    min-height: 0;
}

.title-block::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--ink);
    z-index: 3;
}

.title-block h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    padding-right: 1rem;
    position: relative;
    z-index: 1;
    text-wrap: balance;
}

.title-block .profile {
    position: absolute;
    right: 0;
    bottom: 0;
    width: var(--profile-width);
    height: 250px;
    z-index: 2;
}

.title-block .profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    letter-spacing: -0.015em;
    line-height: 1.25;
    text-wrap: balance;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

p {
    margin-bottom: 1rem;
    text-wrap: pretty;
}

a {
    color: var(--ink);
    text-decoration: underline;
    transition: all 0.2s ease;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    background: var(--ink);
    color: var(--surface-ink);
    padding: 2px 6px;
    text-decoration: none;
}

.date {
    font-size: 0.9rem;
    color: var(--ink-faint);
    margin-bottom: 2rem;
}

ul, ol {
    margin: 0 0 1rem 1.5rem;
}

li {
    margin-bottom: 0.4rem;
}

.nav {
    margin-bottom: 2rem;
}

.post-list {
    list-style: none;
    margin-left: 0;
}

.post-list li {
    margin-bottom: 1.25rem;
}

.post-list .date {
    margin-bottom: 0.25rem;
}

/* Long-form: where size/measure/leading actually matter */
.prose {
    max-width: var(--measure);
    font-size: 1.1875rem; /* ~19px rendered */
    line-height: 1.6;
}

.prose p,
.prose li {
    max-width: var(--measure);
}

.prose h2 {
    margin-top: 2.25rem;
}

.prose h3 {
    margin-top: 1.75rem;
}

.prose pre {
    background: var(--ink);
    color: var(--surface-ink);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.45;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.prose :not(pre) > code {
    background: rgba(42, 42, 42, 0.08);
    padding: 0.1em 0.35em;
}

.prose blockquote {
    border-left: 2px solid var(--ink);
    padding-left: 1rem;
    margin: 0 0 1.25rem;
    color: var(--ink-muted);
}

.prose img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.25rem 0;
}

.prose .embed {
    margin: 1.75rem 0;
    max-width: none;
    width: 100%;
}

.prose .embed-frame {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.prose .embed-image img {
    margin: 0;
    width: 100%;
    height: auto;
}

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

@media (max-width: 700px) {
    .home-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .home-col-blog {
        max-width: var(--profile-width);
    }
}

@media (max-width: 520px) {
    body {
        padding: 1rem;
        /* Keep visual angle up on small screens */
        font-size: 1.0625rem;
    }

    .container {
        padding: 2rem 1rem;
    }

    .prose {
        font-size: 1.125rem;
    }

    .title-block {
        min-height: 180px;
    }

    .title-block.compact {
        min-height: 0;
    }

    .title-block .profile {
        width: var(--profile-width-sm);
        height: 180px;
    }

    .home-col-blog {
        max-width: none;
    }

    .title-block h1 {
        font-size: 1.5rem;
    }
}
