/* ------------------------------------------------------------------
   Fonts (self-hosted, SIL Open Font License; see static/fonts/)
   ------------------------------------------------------------------ */
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/newsreader-latin-standard-normal.woff2) 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: 200 800; font-display: swap;
  src: url(fonts/newsreader-latin-ext-standard-normal.woff2) 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: 200 800; font-display: swap;
  src: url(fonts/newsreader-latin-standard-italic.woff2) 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: 200 800; font-display: swap;
  src: url(fonts/newsreader-latin-ext-standard-italic.woff2) 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: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/hanken-grotesk-latin-wght-normal.woff2) 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: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/hanken-grotesk-latin-ext-wght-normal.woff2) 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: "Hanken Grotesk"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url(fonts/hanken-grotesk-latin-wght-italic.woff2) 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;
}
/* Stand-ins while the fonts load: Georgia and Arial with Newsreader's and Hanken Grotesk's widths and
   line metrics (Georgia scaled to match at title size; Arial already matches in width), so the text
   doesn't reflow when the real fonts arrive. */
@font-face {
  font-family: "Newsreader Fallback"; src: local("Georgia");
  size-adjust: 91.5%; ascent-override: 80.3%; descent-override: 29%; line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback"; font-style: italic; src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 82.2%; ascent-override: 89.4%; descent-override: 32.2%; line-gap-override: 0%;
}
@font-face {
  font-family: "Hanken Grotesk Fallback"; src: local("Arial"), local("ArialMT");
  size-adjust: 100%; ascent-override: 100%; descent-override: 30.3%; line-gap-override: 0%;
}


/* ------------------------------------------------------------------
   Colour tokens: a near-white page with pale-mint bands, and a deep petrol night.
   One accent, deep teal, kept to a few jobs: links (always underlined), the CV button,
   your name in author lists, award badges, the current section in the top bar, focus
   and selection. Everything else is ink or muted.
   To recolour the site, change the tokens in all three blocks (light, and the two dark
   ones, which must match) and the two theme-color tags in templates/base.html.j2.
   Keep links and muted text at 4.5:1 or more against bg, band and card in both themes.
   ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --bg: #fbfdfd;
  --band: #e6f5f5;
  --card: #ffffff;
  --ink: #101d21;
  --muted: #4f5e62;
  --faint: #d4dfdf;
  --accent: #006967;
  --accent-strong: #005553;
  --accent-soft: #d5f2f0;
  /* Outline of round buttons: derived from the theme, about 3:1 against the page in both. */
  --control: color-mix(in srgb, var(--muted) 70%, var(--bg));

  --serif: "Newsreader", "Newsreader Fallback", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Hanken Grotesk", "Hanken Grotesk Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale: every font size on the page is one of these (DESIGN.md, Typography, says which goes where).
     Serif for what names something, sans for what you read through. Weights: sans 400 / 500 / 600, serif 400 / 500. */
  --text-display: clamp(2.6rem, 2rem + 3.6vw, 4.1rem);  /* your name */
  --text-headline: 2.05rem;                             /* section titles */
  --text-lead: clamp(1.45rem, 1.15rem + 1vw, 1.9rem);   /* the research question */
  --text-subtitle: 1.3rem;    /* the position line, and the name in the top bar */
  --text-title: 1.2rem;       /* titles of papers, theses and research topics; Quick facts (1.125rem on phones) */
  --text-body: 1.0625rem;     /* running text */
  --text-small: 0.9375rem;    /* secondary text: authors, details, links, navigation */
  --text-label: 0.85rem;      /* dates, paper labels, years, captions, small print */

  --gutter: 8rem;      /* the left column with dates and paper labels */
  --gap: 2rem;
  --measure: 45rem;
  --page: calc(var(--gutter) + var(--gap) + var(--measure));
  --edge: max(1.25rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); /* keeps text clear of the notch in landscape */
  --bar: 3.75rem;      /* height of the top bar */
}

/* Dark: a deep petrol night rather than black. Kept in sync in the two blocks below. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09171c;
  --band: #0d1f24;
  --card: #12262c;
  --ink: #e4edef;
  --muted: #a3b9bd;
  --faint: #293e45;
  --accent: #77d4cc;
  --accent-strong: #a2e7e0;
  --accent-soft: #093b3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09171c;
    --band: #0d1f24;
    --card: #12262c;
    --ink: #e4edef;
    --muted: #a3b9bd;
    --faint: #293e45;
    --accent: #77d4cc;
    --accent-strong: #a2e7e0;
    --accent-soft: #093b3b;
  }
}

/* ------------------------------------------------------------------
   Base
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: color-mix(in srgb, var(--muted) 45%, var(--bg)) var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + env(safe-area-inset-top, 0px)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-weight: 400; font-size: var(--text-body); line-height: 1.6; font-family: var(--sans);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  transition: background-color .25s, color .25s;
}
p, ul, ol, h1, h2, h3, h4 { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
math { font-size: 1.02em; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent-soft); }
/* No lone word on the last line of a paragraph; headings split into even lines. */
p, li, dd, figcaption { text-wrap: pretty; }
.section-title, .interest-title, .question { text-wrap: balance; }
/* Read by screen readers, not shown. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--edge); top: -3rem; z-index: 20;
  background: var(--bg); padding: 0.5rem 0.75rem;
}
.skip:focus { top: 0.75rem; }
.nowrap { white-space: nowrap; }

/* Everything sits on one two-column grid: gutter | text. */
.masthead, .ticker, .section-inner, .divider, .contact-inner {
  width: min(100% - 2 * var(--edge), var(--page));
  margin-inline: auto;
}
.row, .masthead {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  column-gap: var(--gap);
}
.icon { width: 1.15rem; height: 1.15rem; flex: none; }

/* ------------------------------------------------------------------
   Top bar: name, sections, light/dark switch
   ------------------------------------------------------------------ */
/* On iPhones the bar also reaches up under the status bar (env() is 0 everywhere else),
   so the page never shows above it while scrolling. */
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--faint);
}
.topbar-inner {
  width: min(100% - 2 * var(--edge), 72rem);
  margin-inline: auto;
  min-height: var(--bar);
  display: flex; align-items: center; gap: 1.5rem;
}
.topbar-name {
  font-weight: 500; font-size: var(--text-subtitle); line-height: 1.2; font-family: var(--serif); letter-spacing: -0.005em; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.topbar-nav { margin-left: auto; min-width: 0; }
.topbar-nav ul {
  display: flex; gap: 1.35rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.35rem; margin: -0.35rem;   /* room inside the scroller for focus rings, which it would clip */
  font-size: var(--text-small); font-weight: 500;
}
/* While more links lie past the right edge (narrow screens), the row fades out there (set by site.js). */
.topbar-nav ul.is-clipped {
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
  mask-image: linear-gradient(to right, #000 88%, transparent);
}
.topbar-nav ul::-webkit-scrollbar { display: none; }
.topbar-nav a {
  display: block; padding-block: 0.35rem;
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.topbar-nav a:hover { color: var(--ink); }
.topbar-nav a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

.theme-toggle {
  flex: none; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; padding: 0;
  color: var(--ink); background: transparent;
  border: 1px solid var(--control); border-radius: 999px; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }

/* The CV, always one tap away; it sits next to the theme switch and shares its shape. */
.topbar-cv {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem;
  height: 2.25rem; padding: 0 0.95rem 0 0.8rem;
  font-weight: 500; font-size: var(--text-small); line-height: 1; font-family: var(--sans); color: var(--accent); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--bg)); border-radius: 999px;
  transition: border-color .2s, background-color .2s;
}
.topbar-cv .icon { width: 1rem; height: 1rem; }
.topbar-cv:hover { border-color: var(--accent); background: var(--accent-soft); }
.topbar-cv + .theme-toggle { margin-left: -0.9rem; }
.theme-toggle .icon { width: 1.05rem; height: 1.05rem; grid-area: 1 / 1; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ------------------------------------------------------------------
   Masthead and latest news
   ------------------------------------------------------------------ */
.hero { padding-bottom: 3rem; }
.masthead { padding-block: clamp(2.75rem, 7vw, 5rem) 2.5rem; align-items: start; }
/* The photo is wider than the date column and hangs into the left margin. */
.masthead-mark { padding-top: 0.4rem; width: calc(100% + 2.5rem); margin-left: -2.5rem; }
.portrait {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--faint);
}
.pareto { width: 100%; height: auto; overflow: visible; }
.pareto .axis { fill: none; stroke: var(--faint); stroke-width: 1.5; }
.pareto .dom circle { fill: var(--muted); opacity: 0.35; }
.pareto .front circle { fill: var(--accent); }
.pareto .stair {
  fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: draw 1.4s cubic-bezier(.6, 0, .3, 1) .2s backwards;
}
@keyframes draw { from { stroke-dashoffset: 1; } }

.name {
  font-weight: 400; font-size: var(--text-display); line-height: 1; font-family: var(--serif);
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}
.position {
  font-style: italic; font-weight: 400; font-size: var(--text-subtitle); line-height: 1.35; font-family: var(--serif);
  font-variation-settings: "opsz" 24;
  color: var(--muted);
  margin-bottom: 1.6rem;
}
.position a { color: inherit; }
/* The research question: the second thing a visitor reads, after the name. */
.question {
  font-weight: 400; font-size: var(--text-lead); line-height: 1.25; font-family: var(--serif);
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.012em;
  color: var(--ink);
  max-width: 24em;
  text-wrap: balance;
  margin: -0.35rem 0 1.75rem;
}
.bio { max-width: 38em; }

/* Bio and links, with the Quick facts panel beside them on wide screens */
.intro.has-facts { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; grid-template-rows: auto 1fr; column-gap: 2.5rem; align-items: start; }
/* The links follow the bio in the left column, so a tall facts card doesn't push them down. */
.intro.has-facts .facts { grid-column: 2; grid-row: 1 / span 2; }
.intro.has-facts .links { grid-column: 1; }
.facts { padding: 1.1rem 1.2rem 1.2rem; }
.facts-title { font-weight: 500; font-size: var(--text-title); line-height: 1.2; font-family: var(--serif); font-variation-settings: "opsz" 20; letter-spacing: -0.005em; color: var(--ink); margin-bottom: 0.85rem; }
.facts dl { display: grid; gap: 0.75rem; margin: 0; }
.facts dt { font-size: var(--text-label); font-weight: 600; color: var(--ink); }
.facts dd { margin: 0.05rem 0 0; font-size: var(--text-small); line-height: 1.45; color: var(--muted); }
.bio p + p { margin-top: 0.8em; }

.links {
  display: flex; flex-wrap: wrap; gap: 0.55rem 1.5rem;
  margin-top: 1.5rem;
  font-weight: 500; font-size: var(--text-small);
}
.links a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--ink); text-decoration: none;
}
.links a .icon { color: var(--muted); }
/* The labels are underlined like every link, in a faint Ink so the CV button stays the only accent. */
.links a span {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.links a:hover .icon { color: inherit; }
.links a:hover { color: var(--accent); }
.links a:hover span { text-decoration-color: currentColor; }
.links-center { justify-content: center; }

/* Latest news: one item at a time. On wide screens a vertical bar beside the text fills while
   an item is shown and items slide up; on phones (see the 760px block) the bar lies in the
   header and items slide sideways. --tick is how long each item stays. */
.ticker { position: relative; --tick: 7s; --head: 2rem; --head-gap: 0.6rem; --slide-x: 0px; --slide-y: 0.8rem; }
.ticker-head { height: var(--head); align-items: center; margin-bottom: var(--head-gap); }
/* A link to all news, styled like every other link. */
.ticker-label { justify-self: end; font-size: var(--text-label); font-weight: 600; }
.ticker-controls { grid-column: 2; display: none; align-items: center; gap: 0.4rem; padding-left: 1.1rem; }
.ticker.is-ready .ticker-controls { display: flex; }
.ticker-nav {
  display: grid; place-items: center; flex: none;
  width: 1.75rem; height: 1.75rem; padding: 0;
  color: var(--ink); background: transparent;
  border: 1px solid var(--control); border-radius: 999px; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.ticker-nav:hover { border-color: var(--accent); background: var(--accent-soft); }
.ticker-nav .icon { width: 0.95rem; height: 0.95rem; }
/* The middle button shows a pause symbol while the news rotates and a play symbol once paused. */
.ticker-pause .icon { grid-area: 1 / 1; }
.ticker-pause .icon-play, .ticker-pause.is-off .icon-pause { display: none; }
.ticker-pause.is-off .icon-play { display: block; }
.ticker-count {
  margin-left: 0.5rem; font-size: var(--text-label); color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums; letter-spacing: 0.04em;
}

.ticker-bar {
  display: none; position: absolute;
  left: calc(var(--gutter) + var(--gap)); top: calc(var(--head) + var(--head-gap)); bottom: 0.15rem;
  width: 3px; border-radius: 2px; overflow: hidden;
  background: var(--faint);
}
.ticker.is-ready .ticker-bar { display: block; }
.ticker-bar > span {
  display: block; width: 100%; height: 100%;
  background: var(--muted); transform-origin: top;
  animation: tick-down var(--tick) linear;
}
.ticker.is-paused .ticker-bar > span { animation-play-state: paused; }
@keyframes tick-down { from { transform: scaleY(0); } }
@keyframes tick-across { from { transform: scaleX(0); } }

.ticker-items { display: grid; }
.ticker-item {
  grid-area: 1 / 1;
  --side: 1;   /* 1: waits below (or right), -1: has left upwards (or left), 0: shown */
  transform: translate(calc(var(--side) * var(--slide-x)), calc(var(--side) * var(--slide-y)));
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, transform .4s ease, visibility 0s linear .4s;
}
.ticker-item[data-side="before"] { --side: -1; }
.ticker-item.is-active { --side: 0; opacity: 1; visibility: visible; transition: opacity .4s ease, transform .4s ease; }
.ticker-item.is-instant { transition: none; }
.ticker-item .what { max-width: 38em; }
.ticker.is-ready .ticker-item .what { padding-left: 1.1rem; }

/* ------------------------------------------------------------------
   Sections: tinted bands alternate with plain ones, split by a divider
   ------------------------------------------------------------------ */
.section { padding-block: 4.25rem; }
.section.band {
  background: var(--band);
  border-block: 1px solid var(--faint);
  --ring: var(--band);
}
.divider {
  position: relative; height: 1px;
  background: var(--faint);
}
.divider::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px var(--bg);
}

.section-title {
  margin-left: calc(var(--gutter) + var(--gap));
  margin-bottom: 1.6rem;
  font-weight: 400; font-size: var(--text-headline); line-height: 1.1; font-family: var(--serif);
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.01em;
}
.count {
  font-weight: 500; font-size: var(--text-small); line-height: 1; font-family: var(--sans); color: var(--muted);
  margin-left: 0.3rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.lede, .research, .group-title, .pub-year, .pub-foot, .more {
  margin-left: calc(var(--gutter) + var(--gap));
}

/* Dates in the gutter */
.entries { display: grid; gap: 1.15rem; }
.when {
  text-align: right;
  font-size: var(--text-label); line-height: 1.5; padding-top: 0.12rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
/* A range stacks its start over its end, so every range in the column has the same shape
   (on phones the date sits above the entry, on one line). */
.when .nowrap + .nowrap { display: block; }
/* Each row falls in weight: the role or degree, then where (Small, Ink), then the details (Small, muted). */
.headline { font-weight: 600; }
.where { font-size: var(--text-small); }
.details { color: var(--muted); font-size: var(--text-small); margin-top: 0.15rem; }
.more { margin-top: 0.4rem; font-weight: 500; font-size: var(--text-small); }

/* Cards: research interests and Quick facts */
.card {
  background: var(--card);
  border: 1px solid var(--faint);
  border-radius: 6px;
  padding: 1.15rem 1.3rem;
}
.lede { max-width: 38em; color: var(--muted); margin-top: -0.6rem; margin-bottom: 1.6rem; }
.interests { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.interest-icon { width: 1.6rem; height: 1.6rem; color: var(--muted); margin-bottom: 0.7rem; }
.interest-title { font-weight: 600; font-size: var(--text-body); line-height: 1.35; font-family: var(--sans); margin-bottom: 0.3rem; }
.interest-text { font-size: var(--text-small); color: var(--muted); }

/* With the figure: the Pareto front on the left, the topics as plain text beside it. */
.research.has-figure {
  display: grid; grid-template-columns: 16rem minmax(0, 1fr);
  gap: 2rem 3rem; align-items: start;
}
.has-figure .interests { grid-template-columns: 1fr; gap: 1.6rem; padding-top: 0.6rem; }
.has-figure .interest-title {
  font-weight: 500; font-size: var(--text-title); line-height: 1.25; font-family: var(--serif); font-variation-settings: "opsz" 20;
  letter-spacing: -0.005em; margin-bottom: 0.4rem;
}
.has-figure .interest-text { max-width: 34em; }
/* Links from a topic to its papers in Publications. */
.interest-papers { margin-top: 0.35rem; font-size: var(--text-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.research-figure { margin: 0; }
.figure-plot { width: 100%; height: auto; overflow: visible; }
/* Axes and grey points at 0.7 keep 3:1 or more against the band in both themes (graphics a reader needs). */
.figure-plot .axis, .figure-plot .axis-tip { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.figure-plot .axis-label { font: 500 12px var(--sans); fill: var(--muted); }
.figure-plot .dom circle { fill: var(--muted); opacity: 0.7; }
.figure-plot .front circle { fill: var(--accent); }
.figure-plot .stair { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.figure-plot .ring { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.figure-plot .link { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-dasharray: 3 3.5; opacity: 0.7; }
.figure-plot .mark { font: 600 14px var(--sans); fill: var(--ink); }
.figure-plot .query { font: italic 500 20px var(--serif); fill: var(--ink); }
.research-figure figcaption { margin-top: 0.9rem; font-size: var(--text-label); line-height: 1.5; color: var(--muted); }
/* The one moment of motion: the first time the figure scrolls into view, the staircase draws itself
   through the front. The points, A, B and the question are there from the start, so a view that never
   scrolls (a screenshot, a print preview) still shows what the caption describes. Without JavaScript,
   or with reduced motion, the staircase is simply there. */
.research-figure.will-draw .stair { stroke-dashoffset: 1; }
.research-figure.is-drawn .stair { stroke-dashoffset: 0; transition: stroke-dashoffset 1.3s cubic-bezier(.16, 1, .3, 1); }
/* Visitors who ask for more contrast get the chart at full strength. */
@media (prefers-contrast: more) {
  .figure-plot :is(.axis, .axis-tip, .dom circle, .link) { opacity: 1; }
}
/* High-contrast modes replace page colours but not SVG fills and strokes: draw the chart in system
   colours, with the front in the highlight colour so it still stands apart. */
@media (forced-colors: active) {
  .figure-plot :is(.axis, .axis-tip, .ring, .link) { stroke: CanvasText; opacity: 1; }
  .figure-plot :is(.axis-label, .mark, .query, .dom circle) { fill: CanvasText; }
  .figure-plot .dom circle { opacity: 1; }
  .figure-plot .front circle { fill: Highlight; }
  .figure-plot .stair { stroke: Highlight; }
}

/* Teaching: courses, then thesis supervision, both as rows on the date column */
.group-title + .entries { margin-top: 0.8rem; }
.entries + .supervision-title { margin-top: 2.4rem; }
.supervision-title { margin-bottom: 1.1rem; }
.thesis-title { font-weight: 500; font-size: var(--text-title); line-height: 1.3; font-family: var(--serif); font-variation-settings: "opsz" 20; letter-spacing: -0.005em; }
.thesis-title.in-progress { font-style: italic; color: var(--muted); }

/* News: a timeline on the axis between the dates and the text */
.timeline > li { position: relative; padding-bottom: 1.35rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute;
  left: calc(var(--gutter) + var(--gap) / 2 - 0.5px);
  top: 0.75rem; bottom: -0.75rem; width: 1px;
  background: var(--faint);
}
.timeline > li:last-child::before { display: none; }
.timeline > li::after {
  content: ""; position: absolute;
  left: calc(var(--gutter) + var(--gap) / 2 - 4.5px);
  top: 0.5rem; width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px var(--ring, var(--bg));
}
.timeline .what { max-width: 38em; }
.timeline .what p + p { margin-top: 0.55rem; }
.timeline + .more { margin-top: 1.6rem; }

/* ------------------------------------------------------------------
   Publications: labels C1, J1, ... in the gutter, grouped by year
   ------------------------------------------------------------------ */
.pub-group + .pub-group { margin-top: 2.8rem; }
.group-title { margin-bottom: 0.4rem; font-weight: 600; font-size: var(--text-body); line-height: 1.3; font-family: var(--sans); }
.pub-year {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 1rem; margin-bottom: 1rem;
  font-weight: 600; font-size: var(--text-label); line-height: 1; font-family: var(--sans); letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.pub-year::after { content: ""; flex: 1; height: 1px; background: var(--faint); }
.pubs { display: grid; gap: 1.45rem; }
.group-title + .pubs { margin-top: 0.8rem; }   /* no year heading between them (layout: category) */
.pubs + .pub-year { margin-top: 1.8rem; }
.pub { align-items: baseline; }
.pub-label {
  justify-self: end;
  font-weight: 600; font-size: var(--text-label); line-height: 1; font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  padding: 0.28rem 0.4rem;
  margin-right: -0.4rem;
  border-radius: 4px;
}
.pub-label:hover, .pub:target .pub-label { background: var(--accent-soft); }
.pub-title {
  font-weight: 500; font-size: var(--text-title); line-height: 1.3; font-family: var(--serif);
  font-variation-settings: "opsz" 20;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.pub-authors { margin-top: 0.3rem; font-size: var(--text-small); color: var(--muted); }
.pub-authors .me { color: var(--ink); font-weight: 600; }   /* bold Ink among muted co-authors; no underline, it isn't a link */
.eq { color: var(--ink); margin-left: 0.04em; }
.pub-meta {
  margin-top: 0.3rem; font-size: var(--text-small);
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.9rem; row-gap: 0.2rem;
}
.venue { font-weight: 600; }
/* The serif's lowercase is about 15% smaller than the sans's, so the italic is set a step larger to sit level with it. */
.award { color: var(--accent); font: italic 500 1.07em/1.3 var(--serif); }
.pub-links { display: inline-flex; flex-wrap: wrap; gap: 0.2rem 0.85rem; }
.pub-links a, .toggle {
  font-weight: 500; font-size: var(--text-small); line-height: 1.4; font-family: var(--sans);
  color: var(--accent);
}
/* The links keep their underline, so they never depend on colour alone; the toggle has its chevron. */
.toggle {
  text-decoration: none;
  background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 0.25rem;
}
.toggle::after {
  content: ""; width: 0.38em; height: 0.38em; translate: 0 -0.12em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  rotate: 45deg; transition: rotate .15s, translate .15s;
}
.toggle[aria-expanded="true"]::after { rotate: -135deg; translate: 0 0.1em; }
.panel { margin-top: 0.75rem; }
.abstract p {
  font-size: var(--text-small); color: var(--muted); max-width: 40em;
  padding-left: 0.9rem; border-left: 2px solid var(--faint);
}
.pub-foot {
  margin-top: 2rem;
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem;
  font-size: var(--text-small); color: var(--muted);
}
.pub-foot a { font-weight: 500; }

/* ------------------------------------------------------------------
   Get in touch, and the news archive page
   ------------------------------------------------------------------ */
.contact {
  padding: 4.5rem 0 calc(3rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.contact .section-title { margin-left: 0; margin-bottom: 0.8rem; }
.contact-text { color: var(--muted); max-width: 32em; margin: 0 auto 1.6rem; }
.contact .links { margin-top: 0; }
.updated { margin-top: 2.5rem; font-size: var(--text-label); color: var(--muted); }
.copyright { margin-top: 0.3rem; font-size: var(--text-label); color: var(--muted); }
.page-title { margin-top: 0.5rem; }

/* ------------------------------------------------------------------
   Small screens: the gutter folds away (paper labels keep a narrow one)
   ------------------------------------------------------------------ */
@media (max-width: 1000px) {
  .masthead-mark { width: 100%; margin-left: 0; }
  .intro.has-facts { display: block; }
  .facts { margin-top: 1.8rem; max-width: 30rem; }
  .facts dl { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); column-gap: 1.5rem; }
}

@media (max-width: 760px) {
  :root { --gutter: 2.6rem; --gap: 0.9rem; --text-title: 1.125rem; }
  .topbar-inner { flex-wrap: wrap; row-gap: 0; padding-top: 0.55rem; }
  .topbar-name { flex: 1; }
  .topbar-nav { order: 3; flex-basis: 100%; margin: 0; }
  .topbar-nav ul { gap: 1.25rem; padding-bottom: 0.55rem; }
  .topbar-nav ul.is-clipped {
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  html { scroll-padding-top: calc(6rem + env(safe-area-inset-top, 0px)); }
  .masthead { display: block; padding-top: 2.25rem; }
  .masthead-mark { width: 8.5rem; padding: 0; margin-bottom: 1.4rem; }
  .section { padding-block: 3.25rem; }
  .section-title, .lede, .research, .group-title, .pub-year, .pub-foot, .more { margin-left: 0; }
  .research.has-figure { grid-template-columns: 1fr; gap: 2rem; }
  .research-figure { max-width: 21rem; }
  .entries .row, .ticker-item.row { display: block; }
  .when { display: block; text-align: left; padding: 0; margin-bottom: 0.1rem; }
  .when .nowrap + .nowrap { display: inline; }
  /* The header's four links don't fit one phone row: a two-by-two grid instead of one left over. */
  .links:not(.links-center) { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 2rem; }
  .ticker { --slide-x: 1.25rem; --slide-y: 0px; }
  .ticker-head { display: flex; gap: 0.9rem; }
  .ticker-bar { position: static; flex: 1; height: 3px; width: auto; min-width: 2rem; }
  .ticker-bar > span { transform-origin: left; animation-name: tick-across; }
  .ticker-controls { padding-left: 0; gap: 0.4rem; }
  .ticker-prev .icon, .ticker-next .icon { transform: rotate(-90deg); }   /* up/down become left/right */
  .ticker-count { display: none; }
  .ticker.is-ready .ticker-item .what { padding-left: 0; }
  .timeline > li { display: block; padding-left: 1.5rem; }
  .timeline > li::before { left: 4px; top: 0.7rem; }
  .timeline > li::after { left: 0; top: 0.45rem; }
}

/* Touch screens: small text links get a finger-sized hit area; the layout doesn't move. */
@media (pointer: coarse) {
  .pub-links a, .toggle, .pub-foot a, .more a, .ticker-label {
    padding: 0.55rem 0.3rem; margin: -0.55rem -0.3rem;
  }
  .ticker-nav { width: 2.25rem; height: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ticker-bar > span { display: none; }   /* nothing advances on its own */
}

@media print {
  :root { --bg: #fff; --band: #fff; --card: #fff; --ink: #000; --muted: #333; --accent: #000; }
  .research-figure.will-draw .stair { stroke-dashoffset: 0; }   /* printed before it scrolled into view */
  body { font-size: 10.5pt; }
  .topbar, .skip, .toggle, .panel, .ticker, .pub-foot, .more, .masthead-mark, .divider, .contact { display: none !important; }
  .masthead { display: block; padding-top: 0; }
  .section { padding-block: 1.25rem; border: 0; }
  .pub, .row, .card { break-inside: avoid; }
  a, .links a span { text-decoration: none; color: inherit; }
}
