/* =============================================================================
   site.css — the "homepage" style (AGENTS.md §7.0)

   An early-2000s academic homepage: wide near-fluid page, LaTeX's Latin Modern
   (Roman 8 cut),
   quiet hairline section headings, bracketed nav, blue/purple underlined links, bold dates.
   Plain CSS, no framework, no icon fonts. Dark mode follows the system setting.

   Colours — every colour is a variable below; keep to these (light / dark):
     ink #000/#dcdad6 · paper #fff/#181818 · link #0000ee/#8ab4ff
     visited #551a8b/#c9a0ff · hover #cc0000/#ff8080
     bar tint #e6e9f2/#20263a · bar rule #a8b0c8/#3e4a6b
     greys: muted #555/#a8a8a8 · rule #999/#5a5a5a · hair #ccc/#333 · wash #f5f5f5/#1c1c1c
   ========================================================================== */

/* Latin Modern Roman 8 — LaTeX's Latin Modern at its 8pt optical size: the same
   design drawn sturdier and wider, which reads better on screens than the 10pt
   cut. Subset to Latin + punctuation from the CTAN OTFs (GUST Font License).
   There is no LM Roman 8 bold italic; the 10pt bold italic stands in. */
@font-face { font-family: "LM Roman 8"; font-style: normal; font-weight: normal; font-display: swap; src: url("fonts/LM8-regular.woff2") format("woff2"); }
@font-face { font-family: "LM Roman 8"; font-style: italic; font-weight: normal; font-display: swap; src: url("fonts/LM8-italic.woff2") format("woff2"); }
@font-face { font-family: "LM Roman 8"; font-style: normal; font-weight: bold; font-display: swap; src: url("fonts/LM8-bold.woff2") format("woff2"); }
@font-face { font-family: "LM Roman 8"; font-style: italic; font-weight: bold; font-display: swap; src: url("fonts/LM-bold-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: normal; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: normal; font-display: swap; src: url("fonts/inter-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: bold; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: bold; font-display: swap; src: url("fonts/inter-latin-700-italic.woff2") format("woff2"); }

@font-face { font-family: "Charis"; font-style: normal; font-weight: normal; font-display: swap; src: url("fonts/charis-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Charis"; font-style: normal; font-weight: bold; font-display: swap; src: url("fonts/charis-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Charis"; font-style: italic; font-weight: normal; font-display: swap; src: url("fonts/charis-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Charis"; font-style: italic; font-weight: bold; font-display: swap; src: url("fonts/charis-latin-700-italic.woff2") format("woff2"); }

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: normal; font-display: swap; src: url("fonts/atkinson-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: bold; font-display: swap; src: url("fonts/atkinson-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: normal; font-display: swap; src: url("fonts/atkinson-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: bold; font-display: swap; src: url("fonts/atkinson-latin-700-italic.woff2") format("woff2"); }

@font-face { font-family: "Inter Light"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/inter-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Light"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Light"; font-style: italic; font-weight: 300; font-display: swap; src: url("fonts/inter-latin-300-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter Light"; font-style: italic; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-italic.woff2") format("woff2"); }

:root {
  /* Body font: swap this one line to change the whole site's typeface. */
  --font: "Inter Light", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; /* Inter at weight 300 (body) and 600 (bold/headings). Earlier: system-ui, Atkinson Hyperlegible, Charis, LM Roman 8 */
  --sans: var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink: #333; --paper: #fbfbf9; --muted: #737373; --rule: #d4d4d4; --hair: #e8e8e8; --wash: #f7f7f7;
  --link: #2c4a8a; --visited: #2c4a8a; --hover: #000;
  --bar: #f0f0f0; --bar-rule: #cfcfcf;
  --box: #fafafa; --mark: #ffff99; --target: #ffffcc; --err-wash: #fff4f4;
  --code-str: #a31515; --code-num: #000080; --code-add: #006400;
  --prompt-in: #00008b; --prompt-out: #8b0000;
  color-scheme: light;
}
/* Dark palette. The [light]/[dark] switch (includes/theme.html) sets
   <html data-theme="light|dark">; without JS, the system setting decides.
   The two blocks below must stay identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #dadada; --paper: #1a1a1a; --muted: #8c8c8c; --rule: #3e3e3e; --hair: #2a2a2a; --wash: #202020;
  --link: #93a9d6; --visited: #93a9d6; --hover: #e4e4e4;
  --bar: #20263a; --bar-rule: #3e4a6b;
  --box: #1e1e1e; --mark: #5c5200; --target: #3a3600; --err-wash: #2e1616;
  --code-str: #f1a3a3; --code-num: #a8c7ff; --code-add: #8fd48f;
  --prompt-in: #a8c7ff; --prompt-out: #f1a3a3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #dadada; --paper: #1a1a1a; --muted: #8c8c8c; --rule: #3e3e3e; --hair: #2a2a2a; --wash: #202020;
    --link: #93a9d6; --visited: #93a9d6; --hover: #e4e4e4;
    --bar: #20263a; --bar-rule: #3e4a6b;
    --box: #1e1e1e; --mark: #5c5200; --target: #3a3600; --err-wash: #2e1616;
    --code-str: #f1a3a3; --code-num: #a8c7ff; --code-add: #8fd48f;
    --prompt-in: #a8c7ff; --prompt-out: #f1a3a3;
  }
}
/* TikZ figures are drawn dark-on-white: flip them in dark mode, never photos. */
:root[data-theme="dark"] .tex-html .tex-tikz img { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .tex-html .tex-tikz img { filter: invert(1) hue-rotate(180deg); } }

/* ---------------------------------------------------------------- base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  max-width: 760px; margin: 0 auto; padding: 18px 20px 40px;
  background: var(--paper); color: var(--ink);
  font: 112.5%/1.65 var(--font); font-weight: 300; overflow-wrap: break-word;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }
a:visited { color: var(--visited); }
a:hover { color: var(--hover); text-decoration-color: currentColor; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; }
img, video, iframe, svg { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.5em 0; }
code, kbd, samp, pre { font-family: var(--mono); font-size: .9em; }
pre { background: var(--wash); border: 1px solid var(--hair); padding: .6em .8em; overflow-x: auto; line-height: 1.35; }
pre code { font-size: 1em; }
blockquote { margin: 1.2em 0; padding: .1em 0 .1em 1.1em; border-left: 3px solid var(--rule); color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
table { border-collapse: collapse; margin: 1em 0; display: block; max-width: 100%; overflow-x: auto; }
th, td { border: 1px solid var(--rule); padding: 2px 8px; text-align: left; vertical-align: top; }
th { background: var(--bar); }
dt { font-weight: bold; }
figure { margin: 1.2em 0; }
figcaption { color: var(--muted); font-size: .9em; }
details > summary { cursor: pointer; }
button { font: inherit; }

/* Icon fonts are gone; leftover <i class="ph …"> / <i class="fa-…"> render nothing. */
i.ph, i[class^="fa-"], i[class*=" fa-"], i[class^="ai-"], i[class*=" ai-"] { display: none; }

/* Screen-reader-only text: hidden visually, still indexed and read aloud. */
.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Section headings: a bold line over a hairline (the tinted bar was too loud). */
/* One heading style everywhere: Inter (--sans), bold, normal text colour, sentence case. Size steps down 1.6 / 1.3 / 1.1 / 1em; only h2 carries a hairline. */
h1, h2, h3, h4, h5, h6 { font-family: var(--sans); font-weight: bold; color: var(--ink); text-transform: none; letter-spacing: -.01em; }
h1 { font-size: 1.6em; margin: 1.2em 0 .5em; }
h2 { font-size: 1.3em; border-bottom: 1px solid var(--hair); padding: 0 0 4px; margin: 1.8em 0 .7em; }
h3 { font-size: 1.1em; margin: 1.5em 0 .5em; }
h4 { font-size: 1em; font-style: italic; margin: 1.3em 0 .4em; }
.aside, .meta { color: var(--muted); font-size: .9em; }
.small { font-size: .9em; }

/* -------------------------------------------------------------- header --- */
.masthead { margin-bottom: 1.2em; position: relative; overflow: hidden; }
.site-name { font-size: 1.4em; font-weight: bold; line-height: 1.15; margin: 0 0 .15em; }
.masthead--home .site-name { font-size: 1.9em; }
.site-name a, .site-name a:visited { color: var(--ink); text-decoration: none; }
.who { margin: 0 0 .4em; font-style: italic; color: var(--muted); font-size: .9em; }
.contact { margin: 0 0 .8em; line-height: 1.35; }
.masthead--home { text-align: center; margin-bottom: 1.6em; }
.masthead--home .nav { justify-content: center; }
.masthead--home .nav-search { margin-left: 0; }
.portrait-link { display: block; width: max-content; margin: 0 auto .7em; }
.portrait { display: block; width: 230px; height: 230px; object-fit: cover; object-position: center 20%; border-radius: 50%; border: 1px solid var(--rule); padding: 0; background: var(--paper); }
.nav { margin: .6em 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .5em; }
.nav > a { white-space: nowrap; }
.nav > a::before, .nav > a::after { color: var(--ink); }
.nav > a::before { content: "["; }
.nav > a::after { content: "]"; }
.nav > a[aria-current="page"] { color: var(--ink); font-weight: bold; text-decoration: none; }

/* [light]/[dark] switch — a button dressed as a bracketed nav link */
.theme-toggle { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; white-space: nowrap; }
.theme-toggle:hover { color: var(--hover); }
.theme-toggle::before { content: "["; color: var(--ink); }
.theme-toggle::after { content: "]"; color: var(--ink); }
.theme-toggle[hidden] { display: none; }

/* search (includes/search.html) — an old-fashioned box at the end of the nav */
.nav-search { position: relative; margin-left: auto; }
.nav-search input { font: .9em var(--font); padding: 0 2px; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; width: 7em; background: transparent; color: var(--ink); }
.nav-search input:focus { outline: 0; border-bottom-color: var(--ink); }
.search-panel { display: none; position: absolute; right: 0; top: 1.8em; z-index: 20; width: min(34em, 90vw); max-height: 70vh; overflow-y: auto; background: var(--paper); border: 1px solid var(--ink); padding: 4px 8px; box-shadow: 2px 2px 0 var(--hair); }
.search-panel.open, .nav-search.open .search-panel, .search-panel.is-open { display: block; }
.search-count { color: var(--muted); font-size: .85em; margin: 2px 0 4px; }
.search-results { list-style: none; margin: 0; padding: 0; }
.sr-item { border-top: 1px solid var(--hair); padding: 4px 0; }
.sr-item.active, .sr-item[aria-selected="true"] { background: var(--bar); }
.sr-item a { display: block; text-decoration: none; color: var(--ink); }
.sr-title { color: var(--link); text-decoration: underline; font-weight: bold; }
.sr-badge { color: var(--muted); font-size: .8em; margin-left: .4em; text-transform: lowercase; }
.sr-badge::before { content: "("; } .sr-badge::after { content: ")"; }
.sr-meta, .search-empty { color: var(--muted); font-size: .85em; }
.sr-snippet { display: block; font-size: .88em; color: var(--ink); }
.sr-snippet mark, .sr-title mark { background: var(--mark); color: inherit; }

/* -------------------------------------------------------------- footer --- */
.site-footer { margin-top: 3em; border-top: 1px solid var(--hair); padding-top: .5em; font-size: .88em; color: var(--muted); }
.site-footer p { margin: 0 0 .2em; }
.site-footer .modified { margin-top: .1em; }

/* ------------------------------------------------------- page headings --- */
.page-title { line-height: 1.2; margin: .3em 0 .4em; }
.page-intro { margin-bottom: 1em; }

/* ---------------------------------------------------------------- home --- */
.intro { margin: .4em 0 .8em; }
.intro p:last-child { margin-bottom: 0; }
.links-line { margin: 0 0 .8em; }
ul.things, ul.plain-list, ol.dated { padding-left: 1.6em; margin: .4em 0 .8em; }
ul.things { list-style: disc; }
ul.things li, ol.dated li { margin: 0 0 .3em; }
ul.things li > a:first-child { font-weight: bold; }
ol.dated { list-style: none; padding-left: 0; }
ol.dated li { margin: 0 0 .6em; }
ol.dated li > a { font-weight: bold; }  /* item titles are bold links everywhere: papers, writing, notes, posts, projects */
ol.dated time, .date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9em; margin-right: .7em; }
.more { margin: -.2em 0 1em; }

/* ---------------------------------------------------------------- news --- */
.news-list .news-type { color: var(--muted); font-size: .9em; }
.news-list .news-summary { display: block; color: var(--ink); }
.news-list .news-links a { margin-right: .4em; }
.bracket-links a::before { content: "["; color: var(--ink); }
.bracket-links a::after { content: "]"; color: var(--ink); }
.bracket-links a { margin-right: .35em; white-space: nowrap; }

/* --------------------------------------------------------------- about --- */
.profile { text-align: center; margin-bottom: 1.6em; }
.profile .portrait { margin: .3em auto .7em; }
.profile-name { margin: 0 0 .5em; }
/* Experience logos: one centred row spread across the full width; each logo
   gets an equal cell and is scaled to fit it. Wraps into centred rows on phones. */
.logo-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 22px 0; margin: 1em 0 1.2em; }
.logo-strip a { flex: 1 1 0; min-width: 150px; display: flex; justify-content: center; align-items: center; padding: 0 14px; }
.logo-strip img { height: 54px; width: auto; max-width: 100%; object-fit: contain; }

/* ------------------------------------------------------------ research --- */
.bib { list-style: none; padding: 0; margin: .4em 0 1em; }
.bib li { margin: 0 0 1.4em; }
.pub-entry { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: start; }
.pub-thumb img { width: 100%; border: 1px solid var(--hair); }
.pub-title { font-weight: bold; margin: 0 0 .15em; }
.pub-authors { margin: 0 0 .15em; }
.pub-venue { margin: 0 0 .3em; font-style: italic; }
.pub-links { margin: 0 0 .3em; }
.pub-detail { margin: .2em 0 .4em; }
.pub-detail > summary { display: inline; color: var(--link); text-decoration: underline; list-style: none; }
.pub-detail > summary::-webkit-details-marker { display: none; }
.pub-detail > summary::before { content: "["; color: var(--ink); }
.pub-detail > summary::after { content: "]"; color: var(--ink); }
.pub-detail[open] > summary { color: var(--hover); }
.pub-detail pre { margin: .4em 0 0; font-size: .8em; }
.pub-detail p { margin: .4em 0 0; padding: .4em .7em; border-left: 3px solid var(--bar-rule); background: var(--box); }
.pub-detail-group { display: flex; flex-wrap: wrap; gap: 0 .5em; align-items: baseline; }
.pub-detail-group > .pub-detail[open] { flex-basis: 100%; }
ul.bib-compact { list-style: disc; padding-left: 1.6em; }
ul.bib-compact li { margin-bottom: .45em; }

/* ------------------------------------------------------------ projects --- */
.projects { list-style: none; padding: 0; margin: .5em 0 1em; }
.project { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; padding: 0 0 1.2em; margin: 0 0 1.2em; border-bottom: 1px solid var(--hair); }
.project:last-child { border-bottom: 0; }
.project-media img, .project-media video { display: block; width: 100%; height: auto; border: 1px solid var(--hair); background: var(--wash); }
.project-media figcaption { font-size: .82em; margin-top: .2em; }
.project-name { font-weight: bold; margin: 0 0 .1em; }
.project-sub { font-style: italic; color: var(--muted); margin: 0 0 .4em; }
.project p { margin-bottom: .4em; }

/* --------------------------------------------------------- blog / notes --- */
.post-list { list-style: none; padding: 0; margin: .5em 0 1em; }
.post-list > li { margin: 0 0 .45em; }
.post-list .post-link { font-weight: bold; font-size: 1.05em; }
.post-list .excerpt { margin: .15em 0 0; }
.tags { color: var(--muted); font-size: .9em; }
.status { font-variant: small-caps; color: var(--muted); }
.category-index { margin: 0 0 1em; }
.category-index a + a::before { content: " · "; color: var(--ink); display: inline-block; text-decoration: none; margin: 0 .2em 0 -.1em; }

/* ------------------------------------------------------------ articles --- */
.article-head { margin: .4em 0 1.4em; border-bottom: 1px solid var(--rule); }
.article-back { margin: 0 0 .4em; font-size: .9em; }
.article-title { line-height: 1.2; margin: 0 0 .2em; }
.article-meta { font-style: italic; color: var(--muted); font-size: .9em; margin: 0 0 .6em; }
.article-body li { margin-bottom: .25em; }
.article-body img { border: 1px solid var(--hair); }
.article-body :target { background: var(--target); }

/* Pictures are centred: the figure include, plain ![](…) images (kramdown puts
   a lone image in its own <p>), videos and GIF embeds. Wide ones shrink to fit. */
figure, .post-figure, .post-video, .post-gif { text-align: center; margin-left: auto; margin-right: auto; }
.post-figure img, .post-gif img, .post-gif video, .post-video video { display: block; margin: 0 auto; }
.article-body p > img:only-child, .page-body p > img:only-child,
.article-body p > a:only-child > img:only-child { display: block; margin: 0 auto; }
.article-body p:has(> img:only-child) { text-align: center; }
.video-embed { position: relative; aspect-ratio: 16 / 9; max-width: 720px; margin: 0 auto; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* "Contents" navigation built by includes/post-toc.html. No animation.
   One design at every width: a one-line "Contents" bar pinned to the top of the
   window; click it (a <details>) and the list drops over the text. */
.toc-inline { position: sticky; top: 0; z-index: 5; margin: 0 0 1em; background: var(--paper); border-bottom: 1px solid var(--rule); font-size: .92em; }
.toc-inline[hidden] { display: none; }
.toc-inline details { position: relative; }
.toc-inline summary { cursor: pointer; padding: .35em 0; font-weight: bold; list-style: none; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: " \25BE"; }
.toc-inline details[open] summary::after { content: " \25B4"; }
.toc-inline ol { position: absolute; left: 0; top: 100%; width: min(100%, 36em); margin: 0; padding: .4em .8em .5em 2.2em; max-height: 60vh; overflow-y: auto; background: var(--box); border: 1px solid var(--rule); }
.toc-inline li { margin: .15em 0; }
.toc-inline .lvl-1 { list-style: none; margin-left: -1.4em; font-weight: bold; }
.toc-inline .lvl-3 { margin-left: 1em; }
.toc-inline .lvl-4 { margin-left: 2em; font-size: .95em; }
.article-body :is(h1, h2, h3, h4) { scroll-margin-top: 2.6em; }

/* --------------------------------------------- photography + lightbox --- */
.photo-intro { margin-bottom: 1em; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; text-align: center; }
.photo-item { margin: 0; cursor: zoom-in; }
.photo-item a { display: block; }
.photo-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--ink); padding: 2px; background: var(--paper); }
.photo-caption { font-size: .88em; color: var(--ink); margin-top: .3em; }
.photo-caption .photo-title { display: block; font-weight: bold; }
.photo-caption .photo-loc { display: block; color: var(--muted); }
.photo-lightbox { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .9); align-items: center; justify-content: center; }
.photo-lightbox.open { display: flex; }
.photo-stage { max-width: 92vw; max-height: 92vh; text-align: center; color: #fff; }
.photo-stage img { max-width: 92vw; max-height: 80vh; border: 1px solid #fff; background: #fff; }
.photo-meta { margin-top: .5em; font-size: .9em; color: #ddd; }
.photo-meta .lb-title { font-weight: bold; color: #fff; }
.photo-close, .photo-nav { position: absolute; background: none; border: 0; color: #fff; font-size: 1.8em; line-height: 1; cursor: pointer; padding: .3em .5em; }
.photo-close { top: .3em; right: .5em; }
.photo-prev { left: .3em; top: 50%; }
.photo-next { right: .3em; top: 50%; }
.photo-close:hover, .photo-nav:hover { color: #ff9999; }

/* ----------------------------------------------- Jupyter notebook embed --- */
.jupyter-notebook { margin: 1.2em 0; border: 1px solid var(--rule); font-size: .92em; }
.jupyter-toolbar { display: flex; justify-content: flex-end; padding: 2px 8px; background: var(--bar); border-bottom: 1px solid var(--rule); font-size: .85em; }
.jupyter-download::before { content: "["; color: var(--ink); } .jupyter-download::after { content: "]"; color: var(--ink); }
.jupyter-cell { padding: 6px 10px; border-bottom: 1px solid var(--hair); }
.jupyter-cell:last-child { border-bottom: 0; }
.jupyter-markdown p { margin-bottom: .4em; }
.jupyter-markdown h1, .jupyter-markdown h2, .jupyter-markdown h3 { background: none; border: 0; padding: 0; font-size: 1.05em; margin: .5em 0 .3em; }
.jupyter-code { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 8px; align-items: start; }
.jupyter-noprompt { grid-template-columns: minmax(0, 1fr); }
.jupyter-noprompt .jupyter-output-block { grid-column: 1 / 2; }
.jupyter-prompt { color: var(--prompt-in); font-family: var(--mono); font-size: .8em; padding-top: 6px; text-align: right; user-select: none; }
.jupyter-prompt-out { color: var(--prompt-out); }
.jupyter-input pre.highlight, .jupyter-input > code { margin: 0; }
.jupyter-output-block { grid-column: 2 / 3; display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.jupyter-output { margin: 0; font-family: var(--mono); font-size: .85em; line-height: 1.35; padding: 4px 8px; border-left: 3px solid var(--hair); overflow-x: auto; white-space: pre-wrap; }
.jupyter-stderr, .jupyter-error-output { border-left-color: var(--hover); background: var(--err-wash); }
.jupyter-image, .jupyter-html, .jupyter-latex { border-left: 0; padding: 4px 0; white-space: normal; font-family: var(--font); }
.jupyter-image img, .jupyter-image svg { max-width: 100%; height: auto; }
.jupyter-error { color: var(--hover); padding: 10px; }
@media (max-width: 600px) {
  .jupyter-code { grid-template-columns: minmax(0, 1fr); }
  .jupyter-prompt { text-align: left; padding-top: 0; }
  .jupyter-output-block { grid-column: 1 / 2; }
}

/* ------------------------------------------------- compiled LaTeX embed --- */
.tex-paper { margin: 1.2em 0; border: 1px solid var(--rule); }
.tex-toolbar { display: flex; align-items: center; gap: 10px; padding: 2px 8px; background: var(--bar); border-bottom: 1px solid var(--rule); font-size: .85em; }
.tex-label { font-weight: bold; }
.tex-meta { flex: 1; color: var(--muted); text-align: right; }
.tex-download::before { content: "["; color: var(--ink); } .tex-download::after { content: "]"; color: var(--ink); }
.tex-download { white-space: nowrap; }
.tex-pdf-warn { color: var(--hover); white-space: nowrap; cursor: help; }
.tex-html { padding: 18px 24px 22px; line-height: 1.5; }
.tex-html .tex-titleblock { text-align: center; margin: 4px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hair); }
.tex-html .tex-titleblock .title { margin: 0 0 6px; font-size: 1.5em; background: none; border: 0; padding: 0; }
.tex-html .tex-titleblock .author, .tex-html .tex-titleblock .date { margin: 2px 0; }
.tex-html .tex-abstract { margin: 0 2em 18px; font-size: .92em; }
.tex-html .tex-abstract h1 { font-size: 1em; text-align: center; margin: 0 0 4px; }
.tex-html h1, .tex-html h2, .tex-html h3, .tex-html h4 { background: none; border: 0; padding: 0; margin: 1.3em 0 .4em; }
.tex-html h1 { font-size: 1.2em; } .tex-html h2 { font-size: 1.08em; } .tex-html h3 { font-size: 1em; }
.tex-html p { margin: .5em 0; text-align: justify; hyphens: auto; }
.tex-html .tex-eqref { text-decoration: none; }
.tex-html .tex-tikz { margin: 1em auto; text-align: center; }
.tex-html .tex-tikz img { display: inline-block; max-width: 100%; height: auto; }
.tex-html table caption { caption-side: bottom; color: var(--muted); font-size: .85em; padding-top: 4px; }
.tex-html .math.display { display: block; margin: .8em 0; overflow-x: auto; }
.tex-html .tex-references { margin-top: 18px; font-size: .88em; }
.tex-html .tex-references p { margin: .3em 0; padding-left: 2.4em; text-indent: -2.4em; text-align: left; }
.tex-html .tex-bibnum { margin-right: 6px; }
.tex-source { border-top: 1px solid var(--rule); background: var(--wash); }
.tex-source summary { color: var(--link); font-size: .85em; padding: 4px 8px; text-decoration: underline; }
.tex-source pre.highlight, .tex-source pre { margin: 0; border: 0; padding: 4px 10px 10px; font-size: .8em; }
.tex-error-body { color: var(--hover); padding: 10px 12px; }
.tex-error-log summary { color: var(--hover); }
@media (max-width: 600px) { .tex-meta { display: none; } .tex-html { padding: 12px 12px 16px; } }

/* --------------------------------------- syntax highlighting (rouge) --- */
/* Period-plain: comments grey, keywords bold, strings dark red, numbers navy. */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .ch, .highlight .cpf { color: var(--muted); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .kc, .highlight .kp, .highlight .ow, .highlight .nt { font-weight: bold; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sd, .highlight .se, .highlight .si, .highlight .sr, .highlight .ss, .highlight .sx, .highlight .dl { color: var(--code-str); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: var(--code-num); }
.highlight .gd { color: var(--code-str); } .highlight .gi { color: var(--code-add); } .highlight .err { color: inherit; background: none; }

/* --------------------------------------------------------------- phone --- */
@media (max-width: 620px) {
  body { font-size: 16px; padding: 12px 14px 30px; }
  .portrait { width: 160px; height: 160px; }
  .nav-search { margin-left: 0; width: 100%; }
  .nav-search input { width: 100%; }
  .logo-strip a { flex: 0 0 50%; min-width: 0; }
  .logo-strip img { height: 42px; }
  .pub-entry, .project { grid-template-columns: 1fr; }
  .pub-thumb { max-width: 320px; }
  blockquote { margin: 1em 1em; }
  .site-name, .masthead--home .site-name { font-size: 1.5em; }
}

/* --------------------------------------------------------------- print --- */
@media print {
  .nav, .nav-search, .toc-inline, .photo-lightbox { display: none !important; }
  body { max-width: none; font-size: 11pt; }
  a { color: inherit; }
}

/* jekyll-scholar wraps entries in <ol class="bibliography"><li> */
ol.bibliography { list-style: none; padding: 0; margin: .4em 0 1em; }
ol.bibliography > li { margin: 0 0 1.5em; }
.bib-compact ol.bibliography { list-style: none; padding: 0; }
.bib-compact ol.bibliography > li { margin: 0 0 1.1em; }
.bib-compact span { display: block; }
.bc-title { font-weight: bold; line-height: 1.35; }
.bc-authors { color: var(--ink); font-size: .92em; margin-top: .15em; }
.bc-venue { color: var(--muted); font-style: italic; font-size: .92em; }

/* Affiliation logos were drawn light for the old dark theme: show them as dark
   silhouettes on white; in dark mode they already read as light-on-dark. */
.logo-strip img { filter: brightness(0); opacity: .75; }
.logo-strip a:hover img { opacity: 1; }
:root[data-theme="dark"] .logo-strip img { filter: none; opacity: .9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .logo-strip img { filter: none; opacity: .9; } }

/* sans for the chrome (name, nav, headings, footer), serif for reading */
.site-name, .nav, .toc-inline, .site-footer { font-family: var(--sans); }
.nav, .site-footer { font-size: .85em; }
/* LaTeX cells keep the paper's own structure, set in the body serif rather than the site's sans headings */
.tex-html :is(h1, h2, h3, h4), .tex-html .title { font-family: var(--font); letter-spacing: 0; }

/* Line breaking and rhythm: balanced headings, no one-word last lines, no hyphenation, comfortable list spacing. */
h1, h2, h3, h4, .site-name, .who, .bc-title, .pub-title, .project-name { text-wrap: balance; }
p, li, dd, figcaption, blockquote { text-wrap: pretty; }
body { hyphens: none; }
.article-body li { margin: 0 0 .35em; }
.article-body ul, .article-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.article-body li > ul, .article-body li > ol { margin: .35em 0 .2em; }

/* Reading comfort (evidence-based defaults):
   - the whole page is one centred 760px column (40em of text, ~65-75 characters a line), so header, text and lists share the same left and right edges.
   - 18px (112.5%, so it honours the browser's font-size setting) at 1.65 leading, left-aligned, no justification.
   - Off-white / charcoal paper and soft ink: contrast 11-12:1 (AAA, but short of the glare of pure black on white); muted text >= 4.5:1.
   - Dark mode gets a little extra letter-spacing, because light-on-dark text blooms and looks tighter.
   - Links are always underlined (never colour alone); visitors who ask for more contrast get it. */
:root[data-theme="dark"] body { letter-spacing: .01em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { letter-spacing: .01em; } }
@media (prefers-contrast: more) {
  :root { --ink: #000; --muted: #444; --link: #0a2a6e; --rule: #777; --hair: #aaa; }
  :root[data-theme="dark"] { --ink: #fff; --muted: #ccc; --link: #bcd0ff; --rule: #888; --hair: #555; }
}
