/* Engineering notebook: the design in docs/DESIGN.md and design/mockups/, rebuilt as one stylesheet.
   Light theme only. Content is 1120px wide with 32px side padding; grids collapse with auto-fit. */

/* fonts: written by tools/fonts.py */
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/caveat-latin-ext.woff2?v=891fdfff) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/caveat-latin.woff2?v=a7c22cb1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/caveat-latin-ext.woff2?v=891fdfff) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/caveat-latin.woff2?v=a7c22cb1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext.woff2?v=a675c31e) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin.woff2?v=8bd71fb1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext.woff2?v=a675c31e) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin.woff2?v=8bd71fb1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/newsreader-italic-latin-ext.woff2?v=89e1d530) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/newsreader-italic-latin.woff2?v=e384e318) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/newsreader-latin-ext.woff2?v=85de14b1) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/newsreader-latin.woff2?v=796686f1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/newsreader-latin-ext.woff2?v=85de14b1) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/newsreader-latin.woff2?v=796686f1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/newsreader-latin-ext.woff2?v=85de14b1) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/newsreader-latin.woff2?v=796686f1) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader fallback'; src: local('Georgia'); size-adjust: 91.79%; ascent-override: 80.08%; descent-override: 28.87%; line-gap-override: 0.00%; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* end fonts */

:root {
  --paper: #F5F1E8;
  --dot: #D6CFBE;
  --ink: #1C2024;
  --ink-2: #33373C;
  --muted: #5B5E63;
  --faint: #8A8D91;
  --rule: #D8D1C0;
  --rule-dash: #BDB5A3;
  --rule-dot: #CFC7B4;
  --card: #FFFDF8;
  --card-soft: #FBF9F4;
  --accent: #2747A0;
  --accent-hover: #16306F;
  --highlight: #F3DD6A;
  --code-bg: #EAE4D6;
  --serif: 'Newsreader', 'Newsreader fallback', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background-color: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-variant-emoji: text;
  line-height: 1.6;
}
body.page-cv { font-size: 18px; }
body.page-post { font-size: 20px; line-height: 1.65; }

/* Zero-specificity defaults, so component colours also hold on hover. */
:where(a) { color: var(--accent); text-underline-offset: 3px; }
:where(a):hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 8px 14px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 14px; }
.skip:focus { left: 8px; color: var(--paper); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px 80px; }

/* ---------------------------------------------------------------- header and footer */

.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--rule); }
.site-name, .site-name:hover { font-size: 23px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 28px; font-family: var(--mono); font-size: 14px; }
.site-nav a, .site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--rule-dash); text-decoration-thickness: 2px; }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 13px; color: var(--muted); }
.page-home .site-footer { margin-top: 0; padding-top: 32px; border-top: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------------------------------------------------------------- shared components */

.label { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hand { font-family: var(--hand); color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; font-family: var(--mono); font-size: 14px; text-decoration: none; }
.btn-dark, .btn-dark:hover { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--accent); }
.btn-dark:hover { box-shadow: 2px 2px 0 var(--accent); transform: translate(2px, 2px); }
.btn-outline, .btn-outline:hover { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--card); }

.empty { margin: 0; color: var(--ink-2); }

/* Diagrams: natural width at most; below 760px they keep 80% of it and their wrapper scrolls. */
.dg-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dg { display: block; width: 100%; height: auto; margin: 0 auto; min-width: var(--mw, 0); }
@media (min-width: 760px) { .dg { min-width: 0; } }
/* A WebP with its PNG fallback lays out as its <img> alone. */
picture { display: contents; }
picture source { display: none; }

/* ---------------------------------------------------------------- home */

.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 56px; align-items: center; padding: 88px 0 72px; }
.hero-text { display: flex; flex-direction: column; gap: 24px; }
.hero h1 { margin: 0; font-size: 64px; line-height: 1.04; font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; }
.hl { background: linear-gradient(transparent 58%, var(--highlight) 58%, var(--highlight) 92%, transparent 92%); }
.hero .lead { margin: 0; font-size: 21px; color: var(--ink-2); max-width: 34em; }
.hero-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-note { margin: 0; align-self: flex-start; font-size: 27px; line-height: 1.1; transform: rotate(-3deg); }
.hero-figure img { width: 100%; max-width: 470px; height: auto; }

.section { padding: 56px 0; border-top: 1px solid var(--rule); }
.section .label { margin-bottom: 10px; }
.section h2 { margin: 0 0 36px; font-size: 38px; line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.more { font-family: var(--mono); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 28px; }
.card { padding: 28px; background: var(--card-soft); border: 1.5px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; gap: 10px; }
.card-num { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.card h3 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; }
.card p:last-child { margin: 0; font-size: 18px; color: var(--ink-2); }

.rows { display: flex; flex-direction: column; }
.row, .row:hover { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px 32px; padding: 22px 0; border-top: 1px dashed var(--rule-dash); color: var(--ink); text-decoration: none; }
.row:last-child { border-bottom: 1px dashed var(--rule-dash); }
.row-when { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.row-title { font-size: 22px; font-weight: 600; }
.row-text { font-size: 18px; color: var(--ink-2); }
.row:hover .row-title { color: var(--accent); }

/* auto-fill keeps three columns when there are fewer than three posts */
.post-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 28px; }
.post-card, .post-card:hover { display: flex; flex-direction: column; gap: 10px; padding: 24px 0 0; border-top: 3px solid var(--ink); color: var(--ink); text-decoration: none; }
.post-card .meta { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.post-card .title { font-size: 25px; line-height: 1.25; font-weight: 600; }
.post-card .summary { font-size: 18px; color: var(--ink-2); }
a.post-card:hover .title { color: var(--accent); }

.contact-block { margin-top: 32px; padding: 48px; background: var(--ink); color: var(--paper); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 32px; align-items: center; }
.contact-block-text { display: flex; flex-direction: column; gap: 12px; }
.contact-block .label { color: #C9C2B2; }
.contact-block h2 { margin: 0; font-size: 38px; line-height: 1.15; font-weight: 500; }
.contact-block-note { margin: 0; font-size: 26px; color: var(--highlight); }
.contact-block-links { display: flex; flex-direction: column; gap: 14px; font-family: var(--mono); font-size: 16px; }
.contact-block-links a, .contact-block-links a:hover { display: flex; align-items: center; min-height: 48px; padding: 0 20px; border: 1.5px solid var(--paper); color: var(--paper); text-decoration: none; }
.contact-block-links a:hover { background: #2A2F35; }
.contact-block-links a.email { overflow-wrap: anywhere; }
.contact-block-links a.pdf, .contact-block-links a.pdf:hover { border: 0; background: var(--highlight); color: var(--ink); }

/* ---------------------------------------------------------------- résumé */

.cv-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 72px 0 40px; }
.cv-hero-text { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.cv-hero h1 { margin: 0; font-size: 56px; line-height: 1.05; font-weight: 500; letter-spacing: -0.02em; }
.cv-hero .profile { margin: 0; font-size: 20px; color: var(--ink-2); }

.cv-section { border-top: 1px solid var(--rule); padding: 32px 0; }
.cv-section h2.label, .cv-bottom h2.label { margin: 0 0 8px; font-weight: 500; }
.cv-work { padding: 40px 0 0; }

.kv { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 14px 0; border-top: 1px dashed var(--rule-dash); }
.kv h3 { margin: 0; flex: 0 0 230px; font-size: 17px; font-weight: 600; }
.kv p { margin: 0; flex: 1 1 480px; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.kv-chips { gap: 8px 24px; padding: 12px 0; }
.kv-chips h3 { line-height: 1.9; }
.chips { flex: 1 1 480px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 3px 10px; border: 1px solid var(--rule-dot); background: var(--card); font-family: var(--mono); font-size: 13px; line-height: 1.5; }

.legend { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.legend-title { color: var(--ink); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; border: 2px solid; }

.role { display: flex; flex-direction: column; gap: 14px; padding: 48px 0; border-bottom: 2px solid var(--ink); scroll-margin-top: 16px; }
.role:last-of-type { border-bottom: 0; }
.role-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.role-meta .dates { color: var(--accent); }
.role h3 { margin: 0; font-size: 32px; line-height: 1.2; font-weight: 600; }
.role-context { margin: 0; max-width: 62em; font-style: italic; color: var(--ink-2); }
.role-strip { margin: 8px 0 4px; }
.role-strip .dg { margin: 0; }

.block { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 28px 48px; padding: 28px 0; border-top: 1px dotted var(--rule-dot); }
.block-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; align-self: center; }
.block h4 { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.block ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.block li { padding-left: 4px; }
.block-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.block-figure figcaption { font-family: var(--hand); font-size: 21px; line-height: 1.2; color: var(--accent); text-align: center; }

.tools { display: flex; flex-direction: column; gap: 4px; padding-top: 24px; border-top: 1px dotted var(--rule-dot); font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--muted); }
.tools p { margin: 0; }
.tools .k { color: var(--ink); }

.dated { display: flex; flex-wrap: wrap; gap: 6px 48px; padding: 18px 0; border-top: 1px dashed var(--rule-dash); }
.dated .when { margin: 0; flex: 0 0 200px; font-family: var(--mono); font-size: 14px; color: var(--accent); }
.dated .what { flex: 1 1 420px; min-width: 0; margin: 0; color: var(--ink-2); }
.dated strong { color: var(--ink); font-weight: 600; }

.cv-bottom { border-top: 1px solid var(--rule); padding: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 32px; }
.cv-bottom > div { display: flex; flex-direction: column; gap: 8px; }
.cv-bottom p { margin: 0; color: var(--ink-2); }
.cv-bottom .degree { font-size: 20px; font-weight: 600; color: var(--ink); }

/* ---------------------------------------------------------------- blog list */

.blog-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 40px 56px; align-items: center; padding: 64px 0 40px; }
.blog-hero-text { display: flex; flex-direction: column; gap: 14px; }
.blog-hero h1 { margin: 0; font-size: 60px; line-height: 1.05; font-weight: 500; letter-spacing: -0.02em; }
.blog-hero .intro { margin: 0; font-size: 20px; color: var(--ink-2); }
.disclosure { margin: 0; padding-left: 16px; border-left: 3px solid var(--accent); font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.blog-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.blog-figure img { width: 100%; max-width: 470px; height: auto; display: block; }

.topics { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 28px; font-family: var(--mono); font-size: 14px; }
.chip-link, .chip-link:hover { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; }
.chip-link:hover { background: var(--card); }
.chip-link[aria-current], .chip-link[aria-current]:hover { border: 0; background: var(--ink); color: var(--paper); }

.post-list { display: flex; flex-direction: column; }
.post-row, .post-row:hover { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px 40px; padding: 32px 0; border-top: 1px dashed var(--rule-dash); color: var(--ink); text-decoration: none; }
.post-row:first-child { border-top: 3px solid var(--ink); }
.post-row:last-child { border-bottom: 1px dashed var(--rule-dash); }
.post-row .meta { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.post-row-body { grid-column: span 2; display: flex; flex-direction: column; gap: 8px; }
.post-row .title { font-size: 30px; line-height: 1.2; font-weight: 600; }
.post-row .summary { font-size: 19px; color: var(--ink-2); }
a.post-row:hover .title { color: var(--accent); }
/* Planned posts (content/posts/planned.yaml): listed like posts, "In progress" in place of the date, no link. */
.planned-note { margin: 0 0 18px; font-size: 25px; line-height: 1.2; transform: rotate(-1.5deg); transform-origin: left; }

/* ---------------------------------------------------------------- post */

.post-head { max-width: 760px; padding: 64px 0 36px; display: flex; flex-direction: column; gap: 16px; }
.back, .back:hover { font-family: var(--mono); font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.post-tag { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.post-head h1 { margin: 0; font-size: 56px; line-height: 1.08; font-weight: 500; letter-spacing: -0.02em; }
.post-lead { margin: 0; font-size: 22px; line-height: 1.5; color: var(--ink-2); font-style: italic; }
.post-date { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.draft { color: #C92A2A; }

.figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.figure .dg { margin: 0; }
.figure figcaption { font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--muted); }
.lead-figure { margin: 0 0 48px; }

.post-layout { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.prose { flex: 1 1 600px; max-width: 720px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.prose > * { margin: 0; }
.prose h2 { margin-top: 18px; font-size: 32px; line-height: 1.2; font-weight: 600; scroll-margin-top: 24px; }
.prose h3 { margin-top: 8px; font-size: 24px; line-height: 1.25; font-weight: 600; scroll-margin-top: 24px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose code { font-family: var(--mono); font-size: 0.82em; background: var(--code-bg); padding: 1px 5px; }
.prose :not(pre) > code { overflow-wrap: anywhere; }
.prose blockquote { padding: 18px 22px; border-left: 4px solid var(--accent); background: var(--card); font-size: 19px; }
.prose blockquote > * { margin: 0; }
.prose blockquote > * + * { margin-top: 12px; }
.prose hr { width: 100%; border: 0; border-top: 1px solid var(--rule); }

.codehilite pre, .prose > pre { margin: 0; padding: 20px 22px; background: var(--ink); color: #E8E3D6; font-family: var(--mono); font-size: 15px; line-height: 1.6; overflow-x: auto; }
.codehilite pre code, .prose > pre code { background: none; padding: 0; font-size: inherit; }

.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.45; }
.prose thead tr { border-bottom: 2px solid var(--ink); text-align: left; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.prose th { padding: 10px 14px; font-weight: 500; }
.prose tbody tr { border-bottom: 1px dashed var(--rule-dash); vertical-align: top; }
.prose td { padding: 12px 14px; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose td:first-child { font-family: var(--mono); font-size: 14px; }

.post-aside { flex: 1 1 220px; display: flex; flex-direction: column; gap: 36px; padding-top: 4px; }
.toc { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.toc p { margin: 0; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.toc a, .toc a:hover { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.aside-note { margin: 0; font-size: 25px; line-height: 1.25; transform: rotate(-2deg); }
.aside-note:nth-of-type(even) { transform: rotate(1.5deg); }

.author { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; padding: 28px; border: 1.5px solid var(--ink); background: var(--card); }
.author-who { display: flex; flex-direction: column; gap: 8px; }
.author-name { margin: 0; font-size: 22px; font-weight: 600; }
.author-bio { margin: 0; font-size: 18px; color: var(--ink-2); }
.author-links { display: flex; flex-wrap: wrap; align-content: center; gap: 12px 24px; font-family: var(--mono); font-size: 14px; }

/* Pygments (codehilite), tuned to the dark code block */
.codehilite .hll { color: #F2C14E; background: none; }
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cs, .codehilite .ch, .codehilite .cp, .codehilite .cpf { color: #8F9398; font-style: italic; }
.codehilite .k, .codehilite .kd, .codehilite .kn, .codehilite .kp, .codehilite .kr, .codehilite .kc, .codehilite .ow { color: #A9BCEB; }
.codehilite .kt, .codehilite .nc, .codehilite .nn { color: #9DD3CF; }
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sb, .codehilite .sc, .codehilite .sd, .codehilite .se, .codehilite .sh, .codehilite .si, .codehilite .sx, .codehilite .sr, .codehilite .ss, .codehilite .sa, .codehilite .dl { color: #C9D7A3; }
.codehilite .m, .codehilite .mi, .codehilite .mf, .codehilite .mh, .codehilite .mo, .codehilite .mb, .codehilite .il { color: #E6B98A; }
.codehilite .nf, .codehilite .fm, .codehilite .nd { color: #F0E6C8; }
.codehilite .nb, .codehilite .bp { color: #D7B8E8; }
.codehilite .gd { color: #F2A3A3; }
.codehilite .gi { color: #C9D7A3; }
.codehilite .err { color: inherit; background: none; }

/* ---------------------------------------------------------------- contact and 404 */

.contact-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 48px 64px; align-items: center; padding: 72px 0 24px; }
.contact-text { display: flex; flex-direction: column; gap: 16px; }
.contact-hero h1, .notfound h1 { margin: 0; font-size: 64px; line-height: 1.04; font-weight: 500; letter-spacing: -0.02em; }
.contact-note { margin: 0; font-size: 30px; line-height: 1.2; transform: rotate(-1.5deg); transform-origin: left; }
.contact-hero .intro, .notfound .intro { margin: 0; font-size: 20px; color: var(--ink-2); max-width: 32em; }
.contact-list { display: flex; flex-direction: column; gap: 14px; font-family: var(--mono); font-size: 16px; }
.contact-list a, .contact-list a:hover { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 0 22px; text-decoration: none; border: 1.5px solid var(--ink); color: var(--ink); }
.contact-list a:hover { background: var(--card); }
.contact-list a.primary, .contact-list a.primary:hover { border: 0; background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--accent); }

.notfound { display: flex; flex-direction: column; gap: 16px; padding: 72px 0 24px; }
