/* The site's only stylesheet (see ADR 0001). Design tokens first, then base
   typography, page chrome and the generic Markdown page. Colours were sampled
   from the design PDF (docs/design); bin/contrast.mjs records their contrast.
   Fonts: IBM Plex, subsetted by bin/subset-fonts.mjs. Every face declared here
   counts towards every page's Page weight, so add faces sparingly. */

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-serif-regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/plex-serif-medium.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-sans-regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-sans-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/plex-sans-semibold.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/plex-mono-regular.woff2") format("woff2");
}

/* ---------------------------------------------------------------------------
   Tokens. Colours are plain #rrggbb so the contrast check can read them.
   --------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Colours */
  --bg: #ffffff;
  --surface: #f4f5f7; /* boxes: plain-words summary, thesis topics, author box */
  --chip: #eff0f4; /* tags, type badges, placeholders */
  --border: #e5e6ea; /* dividers, header and footer rules */
  --border-strong: #d2d3d8; /* outlined buttons and pills */
  --text: #17181d;
  --text-2: #4b4f59; /* lead paragraphs, author lists */
  --muted: #5c606a; /* dates, labels, footer */
  --accent: #1e40af;
  --on-accent: #ffffff;
  --ink: #17181d; /* dark buttons */
  --on-ink: #ffffff;
  --code-bg: #17181d;
  --code-text: #f4f5f7;
  --ok: #2f8e5a; /* the Footprint dot */
  --bar: #9da0a8; /* the median page's bar on the Colophon */

  /* Type */
  --font-serif: "IBM Plex Serif", Georgia, serif;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --fs-xs: 0.75rem; /* 12px: mono labels, badges */
  --fs-sm: 0.875rem; /* 14px: footer, meta */
  --fs-nav: 0.9375rem; /* 15px */
  --fs-base: 1rem; /* 16px */
  --fs-lead: 1.0625rem; /* 17px */
  --fs-h3: 1.25rem; /* 20px */
  --fs-box-title: 1.375rem; /* 22px: the thesis box title */
  --fs-h2: 2rem; /* 32px: section titles */
  --fs-h1: 3rem; /* 48px: page titles */
  --fs-display: 3.5rem; /* 56px: home page name */
  --fs-name: 1.3125rem; /* 21px: the name in the header */
  --fs-prose-h2: 1.75rem; /* 28px: headings inside Markdown content */
  --fs-post: 1.1875rem; /* 19px: Post body */
  --fs-post-lead: 1.375rem; /* 22px: a Post's first paragraph */
  --fs-post-h2: 1.5rem; /* 24px: headings inside a Post */
  --fs-post-title: 2.75rem; /* 44px */
  --lh-tight: 1.15;
  --lh-heading: 1.3;
  --lh-body: 1.6;

  /* Layout */
  --container: 1080px;
  --gutter: 32px;
  --section: 72px;
  --measure: 42rem; /* reading column */
  --column: 720px; /* a Post */
  --header-height: 70px;

  /* Shape */
  --radius-sm: 6px; /* buttons, badges */
  --radius: 8px; /* boxes, cards */
  --radius-pill: 999px;
  --target: 44px; /* minimum touch target */
}

/* Dark mode follows the system setting only. Same hues as the light palette
   with lightness inverted; the accent is lightened, so text on it turns dark. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131418;
    --surface: #1c1e23;
    --chip: #24262d;
    --border: #2c2e35;
    --border-strong: #42454e;
    --text: #e9eaee;
    --text-2: #bfc2ca;
    --muted: #a3a7b0;
    --accent: #93acf5;
    --on-accent: #131418;
    --ink: #e9eaee;
    --on-ink: #131418;
    --code-bg: #0b0c0f;
    --code-text: #e9eaee;
    --ok: #4cb27a;
    --bar: #6b6f78;
  }
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-h1);
  margin: 0;
}

h2 {
  font-size: var(--fs-h2);
}

h3,
h4 {
  font-weight: 600;
  line-height: var(--lh-heading);
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-base);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

strong,
b {
  font-weight: 600;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* A section of a page, separated from the next by a rule. */
.section {
  padding-block: var(--section);
}

.section + .section {
  border-top: 1px solid var(--border);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-2);
  max-width: var(--measure);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 1;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 0.5rem;
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  min-height: var(--header-height);
}

.site-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-name);
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
}

.site-name:hover {
  text-decoration: none;
}

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

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-size: var(--fs-nav);
  color: var(--text);
}

.site-header nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

.site-header nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* Phones: the name above, the items wrapping below it. */
@media (max-width: 720px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-block: 0.5rem;
  }

  .site-header nav ul {
    gap: 0 1.25rem;
  }
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-block: 1.25rem;
}

.site-footer p {
  margin: 0;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* Inline-block rather than flex, so the text wraps on phones. */
.site-footer a.footprint {
  display: inline-block;
  padding-block: 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.footprint::before {
  content: "";
  display: inline-block;
  margin-right: 0.5em;
  vertical-align: 0.05em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ok);
}

/* Fixed width (sized for "123 kB · transfer ≈ 0.012 g CO₂e · creation share
   ≈ 0.28 g CO₂e"), so the measured figures do not shift the footer; on
   narrow screens it wraps instead (see below). */
[data-footprint] {
  display: inline-block;
  inline-size: 59ch;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Generic Markdown page
   --------------------------------------------------------------------------- */

.page {
  padding-block: var(--section);
}

.page-header {
  margin-bottom: 2.5rem;
}

.page-header .lead {
  margin: 1rem 0 0;
}

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

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: var(--fs-prose-h2);
  margin: 3rem 0 1rem;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose figure {
  margin: 0 0 1.25rem;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li + li {
  margin-top: 0.25rem;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose blockquote {
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--text-2);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose :not(pre) > code {
  padding: 0.1em 0.35em;
  background: var(--chip);
  border-radius: var(--radius-sm);
}

.prose pre {
  padding: 1rem 1.25rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}

.prose pre code {
  font-size: var(--fs-sm);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 0.6rem 1rem 0.6rem 0;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* First columns hold short keys such as year ranges, which should not wrap. */
.prose td:first-child {
  white-space: nowrap;
}

.prose th {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose figcaption {
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Controls shared across pages: script-only controls and panels, filter
   pills, small mono buttons
   --------------------------------------------------------------------------- */

/* Controls that only work with JavaScript are hidden without it; the page
   script sets the `js` class (assets/js/publications.js). Panels they toggle
   stay visible without it and are hidden by CSS until opened. */
html:not(.js) .js-only,
.js .toggle-panel:not(.is-open) {
  display: none;
}

[hidden] {
  display: none !important;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 1.05rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-nav);
  cursor: pointer;
}

.pill:hover {
  border-color: var(--text);
  text-decoration: none;
}

/* A pressed filter button, or the link to the page being shown. */
.pill[aria-pressed="true"],
.pill[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-mono {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--target);
  padding: 0 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1;
  cursor: pointer;
}

.btn-mono:hover {
  border-color: var(--text);
  text-decoration: none;
}

/* A disclosure arrow, drawn so that no font needs the glyph. */
.btn-plain::after {
  content: "";
  border-inline: 0.25rem solid transparent;
  border-top: 0.3rem solid currentColor;
}

.btn-plain {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-plain[aria-expanded="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-plain[aria-expanded="true"]::after {
  border-top: 0;
  border-bottom: 0.3rem solid currentColor;
}

/* ---------------------------------------------------------------------------
   Publications
   --------------------------------------------------------------------------- */

.page-header .lead > p {
  margin: 0;
}

.pub-filter {
  margin-bottom: 3rem;
}

/* jekyll-scholar renders each year as an h2 followed by its ol; the grid puts
   the year beside its list, with a rule above every year. */
.pub-list {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
}

.pub-list > h2,
.pub-list > ol {
  margin: 0;
  padding: 2.25rem 0 2rem;
  border-top: 1px solid var(--border);
}

.pub-list > h2 {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--lh-heading);
  color: var(--accent);
}

.pub-list > ol {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* long BibTeX lines scroll instead of widening the page */
  gap: 1.75rem;
}

.pub {
  max-width: 47.5rem;
}

.pub-empty {
  margin: 0;
  color: var(--muted);
}

.pub-empty:not(:empty) {
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
}

.pub-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.pub-type {
  flex: none;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--chip);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  top: -0.1rem;
}

.pub-title {
  margin: 0;
  font-size: 1.0625rem;
}

.pub-title a {
  color: inherit;
  text-decoration: none;
}

.pub-title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.pub-meta {
  margin: 0.4rem 0 0.6rem;
  color: var(--text-2);
}

.pub-meta strong {
  color: var(--text);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-plain {
  margin: 0.9rem 0 0;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.pub-plain-label {
  margin-right: 0.35rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* BibTeX: a native <details>, so it opens without JavaScript. Where the
   browser lets its content box be styled, the box is dissolved into the
   button row: the summary stays among the buttons and the snippet wraps onto
   a full-width line below them. Elsewhere the disclosure comes last in the
   row and takes a line of its own when open. */
.pub-bibtex {
  order: 1;
}

.pub-bibtex[open] {
  flex-basis: 100%;
}

@supports selector(::details-content) {
  .pub-bibtex,
  .pub-bibtex::details-content {
    display: contents;
  }

  /* Dissolving the content box also drops its closed-state hiding. */
  .pub-bibtex:not([open]) > pre {
    display: none;
  }
}

.pub-bibtex > summary {
  list-style: none;
}

.pub-bibtex > summary::-webkit-details-marker {
  display: none;
}

.pub-bibtex[open] > summary {
  border-color: var(--text);
}

.pub-bibtex pre {
  order: 1;
  flex-basis: 100%;
  min-width: 0;
  margin: 0.4rem 0 0;
}

.pub-bibtex pre,
.pub-bibtex-full pre {
  padding: 1rem 1.25rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.pub-bibtex code,
.pub-bibtex-full code {
  font-size: inherit;
}

/* A Publication's detail page: the list's parts in a single reading column,
   with the summary always open and the BibTeX shown in full. */
.publication > * {
  max-width: var(--measure);
}

.publication .page-header {
  margin-bottom: 1.5rem;
}

.publication .pub-type {
  display: inline-block;
  margin: 0 0 0.75rem;
  top: 0;
}

.publication .pub-meta {
  margin: 1rem 0 0;
}

.publication .pub-plain {
  margin: 0 0 2rem;
}

.publication h2 {
  font-size: var(--fs-prose-h2);
  margin: 2.5rem 0 0.75rem;
}

.pub-abstract p {
  margin: 0;
}

.pub-abstract + .pub-links {
  margin-top: 2rem;
}

.pub-bibtex-full pre {
  margin: 0;
}

.pub-back {
  margin: 2.5rem 0 0;
}

/* ---------------------------------------------------------------------------
   Blog index and Tag pages
   --------------------------------------------------------------------------- */

.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.blog-header .lead {
  max-width: var(--measure);
}

/* A button: outlined (the RSS button, a Project's website, the CV download)
   or filled (the E-Mail button in the accent, Open topics in ink). */
.btn-feed,
.btn-outline,
.btn-accent,
.btn-ink {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--target);
  padding: 0 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-nav);
}

.btn-feed:hover,
.btn-outline:hover {
  border-color: var(--text);
  text-decoration: none;
}

.btn-accent,
.btn-ink {
  font-weight: 600;
}

.btn-accent {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-ink {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.btn-accent:hover,
.btn-ink:hover {
  text-decoration: none;
  opacity: 0.9;
}

.blog-tags {
  margin-bottom: 2.5rem;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.post-item {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  padding: 2.25rem 0 2rem;
  border-top: 1px solid var(--border);
}

.post-item time {
  padding-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.post-title {
  margin: 0;
  font-size: var(--fs-h2);
}

.post-title a {
  color: var(--text);
}

.post-teaser {
  margin: 0.6rem 0 0;
  font-size: var(--fs-lead);
  color: var(--text-2);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

.reading-time {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.tag {
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--chip);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pager > * {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
}

.pager span {
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Post: one 720px column. The body is serif and builds on .prose; its first
   paragraph is the lead. Headings inside stay sans, as in the design.
   --------------------------------------------------------------------------- */

.post {
  max-width: calc(var(--column) + 2 * var(--gutter));
  padding-block: var(--section);
}

.post-back,
.page-back {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-size: var(--fs-sm);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0.75rem;
}

.post-header h1 {
  font-size: var(--fs-post-title);
}

.post-date {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.post-body {
  max-width: none;
  margin-top: 2.5rem;
  counter-reset: figure;
  font-family: var(--font-serif);
  font-size: var(--fs-post);
  line-height: 1.75;
}

.post-body > p:first-child {
  font-size: var(--fs-post-lead);
  line-height: 1.6;
}

.post-body h2,
.post-body h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: 0;
}

.post-body h2 {
  font-size: var(--fs-post-h2);
  margin: 2.5rem 0 0.75rem;
}

.post-body h3 {
  font-size: var(--fs-h3);
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre,
.post-body table,
.post-body figure {
  margin-bottom: 1.5rem;
}

.post-body blockquote {
  margin-left: 0;
  margin-right: 0;
  border-left-width: 3px;
}

.post-body figure {
  margin-inline: 0;
  margin-block: 2rem;
}

.post-body figure img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  background: var(--chip);
}

.post-body figcaption {
  font-family: var(--font-sans);
  line-height: var(--lh-body);
}

.post-body figcaption::before {
  counter-increment: figure;
  content: "Figure " counter(figure) ": ";
}

.post-body:lang(de) figcaption::before {
  content: "Abbildung " counter(figure) ": ";
}

.post-body pre,
.post-body table {
  line-height: 1.5;
}

.post-body .citation {
  text-decoration: none;
}

.post-references {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.post-references h2 {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.post-references ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The label ([1]) hangs beside the entry, so the numbers line up. */
.post-references li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  overflow-wrap: anywhere;
}

.post-references li + li {
  margin-top: 0.5rem;
}

.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.author-portrait {
  flex: none;
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--border-strong);
  object-fit: cover;
}

.author-name {
  margin: 0;
  font-weight: 600;
}

.author-bio {
  margin: 0.25rem 0 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: var(--target);
  color: var(--text);
}

.post-nav a:hover {
  text-decoration: none;
}

.post-nav a:hover .post-nav-title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.post-nav-older {
  grid-column: 2;
  text-align: right;
}

.post-nav-label {
  font-size: var(--fs-sm);
  color: var(--accent);
}

.post-nav-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
}

/* ---------------------------------------------------------------------------
   News, Projects and Teaching. The lists and cards are shared with the home
   page (_includes/news.liquid, projects.liquid, courses.liquid).
   --------------------------------------------------------------------------- */

.page-actions {
  margin: 2.5rem 0 0;
}

/* A button inside Markdown content ({: .btn-outline}), such as the CV download. */
.prose a.btn-outline {
  color: var(--text);
  text-decoration: none;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.news-item {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.news-date {
  padding-top: 0.1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.news-text {
  margin: 0;
  max-width: 47.5rem;
}

.news-post {
  white-space: nowrap;
}

.projects-group + .projects-group {
  margin-top: 3.5rem;
}

.projects-group > h2 {
  margin: 0 0 1.25rem;
  font-size: var(--fs-prose-h2);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* A Project whose details are still placeholders. */
.project-card.is-placeholder {
  border-style: dashed;
  border-color: var(--border-strong);
}

.project-meta,
.course-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.page-header .project-meta,
.page-header .course-meta {
  margin-bottom: 1rem;
  font-size: var(--fs-sm);
}

.project-title {
  margin: 0.9rem 0 0;
}

.project-description {
  margin: 0.75rem 0 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* An arrow link ('Project details →', 'All news →', 'Read post →'): small
   text on a 44px target. */
.project-details,
.section-more,
.home-post-more {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-size: var(--fs-sm);
}

.project-details {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.5rem;
}

/* Each term beside its Courses, with a rule above every term, like the years
   of the Publications list. */
.term-list {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.term-list > h2,
.term-list > ol {
  margin: 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.term-list > h2 {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--lh-body);
  color: var(--accent);
}

.course-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-title {
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   Home page
   --------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 3rem 4rem;
  padding-top: 4.5rem;
}

.hero-kicker {
  margin: 0.5rem 0 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: var(--fs-display);
}

.hero-bio {
  max-width: 36rem;
}

.hero-bio p {
  margin: 1rem 0 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.hero-bio p:first-child {
  margin-top: 1.5rem;
  font-size: var(--fs-lead);
  color: var(--text);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.75rem 0 0;
}

.hero-portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--chip);
}

.hero-address {
  margin: 0.9rem 0 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-2);
}

.home .research-topics {
  padding-top: 2.5rem;
}

.research-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-topic {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--chip);
  font-size: var(--fs-xs);
}

/* A section title with a link to the full list on the right. */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0;
}

.section-more {
  white-space: nowrap;
}

.home-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-post-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.home-post-title {
  margin: 0.6rem 0 0;
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 500;
}

.home-post-title a {
  color: var(--text);
}

.home-post .post-teaser {
  margin: 0.5rem 0 0;
}

.home-pubs ol {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The design lists Selected publications without their type. */
.home-pubs .pub-type {
  display: none;
}

.home-teaching {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
  align-items: start;
}

.home-teaching h2 {
  margin: 0 0 1.5rem;
}

.thesis-box {
  padding: 1.75rem 1.75rem 2rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.thesis-box h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-box-title);
  font-weight: 500;
}

.thesis-box p {
  margin: 1rem 0 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.thesis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------------------------------------------------------------------------
   Colophon
   --------------------------------------------------------------------------- */

.kicker {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.colophon h1 {
  max-width: 18em;
}

.colophon > section {
  margin-top: var(--section);
}

.colophon h2 {
  margin: 0 0 1.25rem;
  font-size: var(--fs-h2);
}

.colophon h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: var(--fs-h3);
}

.colophon .note {
  margin: 1rem 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.colophon .prose {
  max-width: var(--measure);
}

.key-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.key-figures > li {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.key-figure {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
}

.key-label {
  display: block;
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.bars {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 6rem;
  align-items: center;
  gap: 1rem;
  font-size: var(--fs-sm);
}

.bar {
  display: block;
  width: 100%;
  height: 0.5rem;
}

.bar-site {
  fill: var(--accent);
}

.bar-median {
  fill: var(--bar);
}

.bar-value {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
}

table.figures {
  width: 100%;
  max-width: 44rem;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.figures th,
.figures td {
  padding: 0.6rem 0 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

.figures th:first-child,
.figures td:first-child {
  padding-left: 0;
  text-align: left;
}

.figures thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.figures tbody th {
  font-weight: 400;
}

.figures td {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

/* An estimated record's note, under its row. */
.figures .session-note td {
  padding-top: 0;
  font-family: var(--font-sans);
  white-space: normal;
  text-align: left;
  color: var(--muted);
}

.figures tr:has(+ .session-note) > * {
  border-bottom: 0;
}

.colophon-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 4rem;
  margin-top: var(--section);
}

.principles {
  margin: 0;
  padding-left: 1.25rem;
}

.principles li + li {
  margin-top: 0.5rem;
}

.built-with {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  margin: 0;
  font-size: var(--fs-sm);
}

.built-with dt {
  color: var(--muted);
}

.built-with dd {
  margin: 0;
}

.why-box {
  max-width: var(--measure);
  margin-top: var(--section);
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.why-box h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 600;
}

.why-box p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.why-box a {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Small screens and preferences
   --------------------------------------------------------------------------- */

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --section: 48px;
    --fs-h1: 2.25rem;
    --fs-h2: 1.625rem;
    --fs-display: 2.5rem;
  }

  .pub-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .pub-list > h2 {
    padding-bottom: 0;
  }

  .pub-list > ol {
    border-top: 0;
    padding-top: 1rem;
  }

  .blog-header {
    flex-direction: column;
  }

  .post-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 1.75rem 0;
  }

  .post-item time {
    padding-top: 0;
  }

  .news-item,
  .term-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-item {
    gap: 0.25rem;
  }

  .term-list > h2 {
    padding-bottom: 0;
  }

  .term-list > ol {
    border-top: 0;
    padding-top: 0.75rem;
  }

  .project-grid,
  .hero,
  .home-posts,
  .home-teaching {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: 2.5rem;
  }

  .hero-aside {
    max-width: 15rem;
  }

  [data-footprint] {
    display: inline;
    white-space: normal;
  }

  .key-figures,
  .colophon-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bar-row .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  :root {
    --fs-post: 1.125rem;
    --fs-post-lead: 1.25rem;
    --fs-post-title: 2rem;
  }

  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-nav-older {
    grid-column: 1;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
