/* The lab book shares the research board's paper, type, and restrained colours. */
:root {
    color-scheme: light dark;
    --ground: #f3f4ef;
    --surface: #fbfbf8;
    --surface-2: #e9ebe4;
    --ink: #1a1d1b;
    --muted: #5c635f;
    --rule: #d5d9d1;
    --rule-strong: #aeb5ad;
    --accent: #157a6e;
    --accent-soft: #d7ece7;
    --draft: #8a4d13;
    --draft-soft: #f5e4cf;
    --focus: #3c5aa6;
    --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --sans: 'Atkinson Hyperlegible', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #141715;
        --surface: #1c201e;
        --surface-2: #262b28;
        --ink: #e6e8e2;
        --muted: #9aa39c;
        --rule: #2c332e;
        --rule-strong: #465049;
        --accent: #4fb3a5;
        --accent-soft: #1b3a35;
        --draft: #e0a05a;
        --draft-soft: #3e2b15;
        --focus: #8fa8e8;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    z-index: 1;
    padding: 12px;
    background: var(--surface);
}
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 28px; }
main { flex: 1; padding-bottom: 64px; }
.reading { max-width: 816px; }

/* The research board's small monospaced labels form a quiet masthead. */
.lab-nav .container {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    padding-top: 36px;
    padding-bottom: 14px;
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.brand, .crumb, .crumb a { color: var(--muted); text-decoration: none; }
.brand:hover, .crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb { display: flex; gap: 10px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; }
h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4.4vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variation-settings: 'opsz' 144;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.lab-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px 40px;
    padding-bottom: 22px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--ink);
}
.lede { max-width: 62ch; color: var(--muted); }
.entry-count, .post-meta, .post-author, .post-back, .footer-brand {
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--muted);
}
.entry-count { font-variant-numeric: tabular-nums; }

/* Entries sit on a lightly outlined paper surface. */
.post-list { list-style: none; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.post-item + .post-item { border-top: 1px solid var(--rule); }
.post-item article {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px 32px;
    padding: 28px;
    border-left: 3px solid transparent;
}
.post-item:focus-within article, .post-item:hover article { border-left-color: var(--accent); }
.post-item h2 {
    margin-bottom: 10px;
    font-size: 1.625rem;
    line-height: 1.25;
    font-variation-settings: 'opsz' 48;
    overflow-wrap: anywhere;
}
.post-link { color: var(--ink); text-decoration: none; }
.post-link:hover { color: var(--accent); text-decoration: underline; }
.post-summary { max-width: 70ch; color: var(--muted); overflow-wrap: anywhere; }
.post-author { margin-top: 14px; overflow-wrap: anywhere; }
.post-meta { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.post-item .post-meta { padding-top: 5px; }
.post-empty {
    padding: 28px 30px;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    background: var(--surface);
}
.post-empty h2 { margin-bottom: 8px; font-size: 1.5rem; line-height: 1.3; font-variation-settings: 'opsz' 48; }
.post-empty p { color: var(--muted); }

/* Article typography uses a narrower reading measure. */
.post-back { display: inline-block; margin: 18px 0 28px; color: var(--accent); font-size: 0.875rem; }
.post-header { padding-bottom: 26px; margin-bottom: 32px; border-bottom: 2px solid var(--ink); }
.post-header .post-meta { margin-bottom: 12px; }
.post-lede { color: var(--muted); font-size: 1.125rem; line-height: 1.6; overflow-wrap: anywhere; }
.post-body { font-size: 1.125rem; line-height: 1.7; overflow-wrap: anywhere; }
.post-body h2 { font-size: 1.75rem; line-height: 1.25; margin: 40px 0 16px; font-variation-settings: 'opsz' 48; }
.post-body h3, .post-body h4 { line-height: 1.35; margin: 32px 0 12px; }
.post-body h3 { font-size: 1.375rem; }
.post-body p, .post-body ul, .post-body ol { margin-bottom: 20px; }
.post-body ul, .post-body ol { padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body li::marker { color: var(--muted); }
.post-body blockquote {
    margin: 28px 0;
    padding: 18px 22px;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.55;
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body img, .post-body video { max-width: 100%; height: auto; border-radius: 4px; }
.post-body pre {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 18px;
    overflow-x: auto;
    margin-bottom: 20px;
    line-height: 1.6;
}
.post-body code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 2px 5px; border-radius: 3px; }
.post-body pre code { background: none; padding: 0; }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 20px; font-size: 1rem; }
.post-body th, .post-body td { border: 1px solid var(--rule); padding: 10px 14px; text-align: left; }
.post-body th { background: var(--surface-2); }
.post-body hr { border: 0; border-top: 1px solid var(--rule-strong); margin: 32px 0; }
.preview-notice { padding: 12px 16px; margin: 8px 0 24px; border: 1px solid var(--rule); border-left: 3px solid var(--draft); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 0.875rem; }
.draft-label { display: table; padding: 2px 8px; margin-bottom: 12px; border: 1px solid var(--draft); border-radius: 3px; color: var(--draft); background: var(--draft-soft); font-family: var(--mono); font-size: 0.75rem; }
.post-meta .draft-label { margin: 10px 0 0; }

footer .container { padding-top: 24px; padding-bottom: 32px; }
.footer-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; padding-top: 20px; border-top: 1px solid var(--rule-strong); }
.footer-brand { text-transform: uppercase; letter-spacing: 0.06em; }
.footer-top a { font-size: 0.875rem; }
.fineprint { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: 0.8125rem; color: var(--muted); }

@media (max-width: 760px) {
    .container { padding-inline: 20px; }
    .lab-nav .container { padding-top: 24px; }
    .lab-intro { grid-template-columns: 1fr; gap: 14px; }
    .post-item article { grid-template-columns: 1fr; gap: 12px; padding: 22px 20px; }
    .post-item .post-meta { padding-top: 0; }
    .post-meta .draft-label { display: inline-block; margin: 0 0 0 10px; }
    .post-empty { padding: 24px 20px; }
    .post-back { margin-top: 12px; }
    .post-body h2 { font-size: 1.5rem; }
    .fineprint { flex-direction: column; }
}

@media print {
    :root { color-scheme: light; --ground: white; --surface: white; --surface-2: #eee; --ink: black; --muted: #444; --rule: #ccc; --rule-strong: #aaa; --accent: #157a6e; }
    .lab-nav, .skip-link, .post-back, footer { display: none; }
    main { padding: 0; }
    .reading { max-width: none; }
}
