/* Site styles for jciambella.github.io
   1. fonts: self-hosted variable fonts (Geist, Geist Mono; Inter for Greek letters; SIL Open Font License)
   2. base: layout and components shared by every page
   3. theme: "Bento" layer at the end of the file, which sets colours, type, the home-page tiles and the Contact page.
      To change the look, edit the theme layer; the base rules rarely need touching. */

/* ------------------------------------------------------------------ fonts (self-hosted, SIL OFL) */
@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/geist-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: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/geist-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: 'Geist Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/geist-latin-ext-wght-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: 'Geist Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/geist-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;
}
@font-face {
  font-family: 'Geist Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/geist-mono-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: 'Geist Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/geist-mono-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: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-greek-wght-normal.woff2') format('woff2');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-greek-wght-italic.woff2') format('woff2');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1d1c1a;
  --muted: #5c5852;
  --faint: #8a857d;
  --line: #e6e2da;
  --accent: #822433;          /* Sapienza red */
  --accent-strong: #6a1b29;
  --accent-soft: #f5eaeb;
  --band: #f3ebe8;
  --hero-from: #fbeeee;
  --hero-to: #faf9f6;
  --shadow: 0 1px 2px rgba(60, 20, 25, .06), 0 8px 24px -12px rgba(60, 20, 25, .18);
  --focus: #2b62c9;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1080px;
  --gutter: 24px;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1b1a18;
    --text: #ebe8e2;
    --muted: #b1aba1;
    --faint: #8b857b;
    --line: #2f2c28;
    --accent: #e8949e;
    --accent-strong: #f3b3bb;
    --accent-soft: #2c1d20;
    --band: #1a1517;
    --hero-from: #2e1a1f;
    --hero-to: #131211;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --focus: #8fb2ff;
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
p { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.icon { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }

/* ------------------------------------------------------------------ header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 2rem;
  flex-wrap: wrap; min-height: 4rem; padding-top: 0.6rem; padding-bottom: 0.6rem;
}
.brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--accent); }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0.15rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

main { padding-bottom: 4rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem;
  flex-wrap: wrap; padding-top: 2rem; padding-bottom: 2.5rem;
}
.site-footer address { font-style: normal; line-height: 1.55; }

/* ------------------------------------------------------------------ hero */
.hero {
  display: grid; grid-template-columns: 220px 1fr; gap: 3rem; align-items: start;
  padding: 3.5rem 0 3rem;
}
.portrait img, .monogram {
  display: block; width: 220px; height: 220px; border-radius: 18px; object-fit: cover;
}
.monogram {
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font: 600 4.5rem/1 var(--serif); letter-spacing: 0.02em;
  border: 1px solid var(--line);
}
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
.eyebrow a { text-decoration: none; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.1rem); margin: 0.35rem 0 0.5rem; }
.role { color: var(--muted); font-size: 1.05rem; line-height: 1.5; }
.bio { margin-top: 1.25rem; max-width: 64ch; }

.links { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
.links a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.92rem;
  transition: border-color .15s, color .15s;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links a .icon { color: var(--accent); }

/* ------------------------------------------------------------------ blocks */
.block { padding-top: 2.75rem; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: 1.25rem;
}
.block-head h2 { font-size: 1.45rem; }
.more {
  display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.92rem;
  text-decoration: none; white-space: nowrap;
}
.more:hover .icon { transform: translateX(2px); }
.more .icon { transition: transform .15s; }

.label {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin: 1.5rem 0 0.75rem;
}

.page-head { padding: 3rem 0 0.5rem; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); }
.lede { color: var(--muted); font-size: 1.1rem; margin-top: 0.75rem; max-width: 68ch; }
.prose { max-width: 72ch; }

/* themes (home) */
.themes {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem;
  list-style: none; margin: 0; padding: 0;
}
.theme a {
  display: block; height: 100%; padding: 1.15rem 1.25rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.theme a:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.theme a:hover h3 { color: var(--accent); }
.theme p { color: var(--muted); font-size: 0.94rem; line-height: 1.5; }

/* home split */
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0 3rem; }

.news, .talks, .projects { list-style: none; margin: 0; padding: 0; }
.news li, .talks li { display: grid; gap: 0.15rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.news li:first-child, .talks li:first-child { padding-top: 0; }
.date { color: var(--faint); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.talk-title { font-family: var(--serif); font-weight: 600; line-height: 1.35; }
.talk-event { color: var(--muted); }

/* ------------------------------------------------------------------ publications */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 1rem 0 1.05rem; border-bottom: 1px solid var(--line); }
.pub:first-child { padding-top: 0.2rem; }
.pub p { margin: 0; }
.pub-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; line-height: 1.35; }
.pub-title a { color: var(--text); text-decoration: none; }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-authors { margin-top: 0.3rem; font-size: 0.95rem; color: var(--muted); }
.pub-authors .me { color: var(--text); font-weight: 650; }
.pub-venue { font-size: 0.95rem; color: var(--muted); }
.pub-venue em { color: var(--text); }
.pub-venue .vol { font-weight: 600; color: var(--text); }

.pub-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.55rem; }
.tag {
  font-size: 0.7rem; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.12rem 0.45rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent);
}
.tag-conference, .tag-book { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.tag-selected { background: transparent; color: var(--accent); border: 1px solid currentColor; }
.action {
  display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.85rem; font-weight: 600;
  color: var(--accent); text-decoration: none; cursor: pointer;
}
.action:hover { text-decoration: underline; }
.action .icon { width: 0.85em; height: 0.85em; }

.bibtex { position: relative; flex-basis: 100%; }
.bibtex summary { list-style: none; width: max-content; }
.bibtex summary::-webkit-details-marker { display: none; }
.bibtex summary::after { content: " ▾"; font-size: 0.75em; }
.bibtex[open] summary::after { content: " ▴"; }
.pub-actions .bibtex:not([open]) { flex-basis: auto; }
.bibtex pre {
  margin: 0.5rem 0 0; padding: 0.85rem 1rem; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  font: 0.8rem/1.5 var(--mono); color: var(--text);
}
.bibtex .copy {
  position: absolute; right: 0.5rem; top: 2.1rem;
  font: 600 0.75rem var(--sans); padding: 0.25rem 0.6rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer;
}
.bibtex .copy:hover { color: var(--accent); border-color: var(--accent); }

.pubs.compact .pub-title { font-size: 1.04rem; }

/* publication tools */
.pub-tools {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem;
  margin: 1.5rem calc(-1 * var(--gutter)) 0.5rem; padding: 0.75rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button {
  font: 500 0.88rem var(--sans); color: var(--muted); background: transparent;
  border: 0; border-right: 1px solid var(--line); padding: 0.42rem 0.8rem; cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { color: #1b1a18; } }
.pub-tools select, .pub-tools input {
  font: 0.9rem var(--sans); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.42rem 0.7rem; min-height: 2.2rem;
}
.pub-tools input { flex: 1 1 14rem; min-width: 0; }
.pub-tools select { max-width: 100%; }
.pub-count { margin-left: auto; color: var(--faint); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.year-group { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 1.5rem; padding-top: 1.5rem; }
.year {
  font-size: 1.5rem; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums;
  position: sticky; top: 4.5rem; align-self: start; padding-top: 0.05rem;
}
.no-results { color: var(--muted); padding: 2rem 0; }

/* ------------------------------------------------------------------ research */
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.toc a {
  font-size: 0.88rem; padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); text-decoration: none;
}
.toc a:hover { color: var(--accent); border-color: var(--accent); }

.theme-block {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem 3rem;
  margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.theme-index { font: 600 0.85rem var(--sans); color: var(--accent); letter-spacing: 0.08em; }
.theme-text h2 { font-size: 1.55rem; margin: 0.2rem 0 0.8rem; }
.theme-text p { max-width: 62ch; }
.theme-papers .label { margin-top: 0.3rem; }
.pubs.mini li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; line-height: 1.4; }
.pubs.mini li:first-child { padding-top: 0; }
.pubs.mini .t { color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 600; }
.pubs.mini a:hover { color: var(--accent); text-decoration: underline; }
.pubs.mini .meta { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 0.15rem; }
.theme-papers .more { margin-top: 0.85rem; }

.projects li {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.2rem 1.5rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line);
}
.what { display: block; }
.where { display: block; color: var(--muted); font-size: 0.93rem; }
.projects .date { padding-top: 0.2rem; }

.code-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.code-list li { padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.code-list a { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: 0.95rem; font-weight: 600; text-decoration: none; }
.code-list p { color: var(--muted); font-size: 0.93rem; margin-top: 0.4rem; }

/* ------------------------------------------------------------------ group */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.people li { padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.people .name { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.people .where { margin-top: 0.1rem; }
.people .topic { display: block; margin-top: 0.5rem; font-size: 0.93rem; }
.people + .muted { margin-top: 1.25rem; }

/* ------------------------------------------------------------------ cv */
.timeline { margin: 0; }
.timeline .row {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.15rem 1.5rem;
  padding: 0.65rem 0; border-bottom: 1px solid var(--line);
}
.timeline .row:first-child { padding-top: 0; }
.timeline dt { color: var(--faint); font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 0.12rem; }
.timeline dd { margin: 0; }

/* ------------------------------------------------------------------ colour & depth */
.site-header { border-bottom: 0; border-top: 4px solid var(--accent); box-shadow: 0 1px 0 var(--line); }

.hero, .hero + .block { position: relative; isolation: isolate; }
.hero::before, .hero + .block::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0;
  left: 50%; width: 100vw; transform: translateX(-50%);
}
.hero::before { background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 70%); }
.hero + .block { padding-bottom: 3rem; margin-bottom: 1rem; }
.hero + .block::before { background: var(--band); }
.hero + .block .block-head { border-top-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }

.portrait img, .monogram { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--accent), var(--shadow); }
.hero h1 {
  background: linear-gradient(90deg, var(--text) 40%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow { color: var(--accent); }

.block-head h2 { position: relative; }
.block-head h2::after {
  content: ""; display: block; width: 2.25rem; height: 3px; margin-top: 0.4rem;
  background: var(--accent); border-radius: 2px;
}

.theme a, .code-list li, .people li { box-shadow: var(--shadow); }
.theme a { border-top: 3px solid var(--accent); transition: border-color .15s, transform .2s, box-shadow .2s; }
.theme a:hover, .code-list li:hover, .people li:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(60, 20, 25, .08), 0 16px 32px -12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.code-list li, .people li { transition: transform .2s, box-shadow .2s; }

.links a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.links a:hover .icon { color: inherit; }
@media (prefers-color-scheme: dark) {
  .links a:hover { color: #1b1a18; }
}
.theme-block { border-top-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
@media (prefers-reduced-motion: reduce) {
  .theme a, .code-list li, .people li { transition: none; }
  .theme a:hover, .code-list li:hover, .people li:hover { transform: none; }
}

/* ------------------------------------------------------------------ jref */
.jref-head { display: flex; gap: 1.5rem; align-items: flex-start; }
.jref-head .links { margin-top: 1rem; }
.jref-logo { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--shadow); flex: none; }
.shot { margin: 2rem 0 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot figcaption { margin-top: 0.6rem; }
.theme .card {
  height: 100%; padding: 1.15rem 1.25rem; border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--accent-soft); padding: 0.05em 0.35em; border-radius: 4px; }
pre.cmd { margin: 1rem 0; padding: 0.85rem 1rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
pre.cmd code { background: none; padding: 0; font-size: 0.85rem; line-height: 1.5; }
@media (max-width: 680px) { .jref-head { flex-direction: column; gap: 1rem; } .jref-logo { width: 64px; height: 64px; } }

/* ------------------------------------------------------------------ research figures */
/* Figures sit on a white "paper" panel in both colour schemes, since plots and
   simulation snapshots are usually drawn on white. */
.theme.has-fig a { display: flex; flex-direction: column; overflow: hidden; padding-top: 0; }
.theme-thumb {
  display: block; margin: 0 -1.25rem 1rem; aspect-ratio: 16 / 10; overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--line);
}
.theme-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.theme.has-fig a:hover .theme-thumb img { transform: scale(1.04); }

.theme-block.with-fig {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas: "text fig" "papers fig";
  align-items: start;
}
.theme-block.with-fig.flip {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas: "fig text" "fig papers";
}
.with-fig .theme-text { grid-area: text; }
.with-fig .theme-papers { grid-area: papers; }
.with-fig .theme-papers .label { margin-top: 0.75rem; }
.theme-figure { grid-area: fig; margin: 0.35rem 0 0; }
.theme-figure a {
  display: block; overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.theme-figure a:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(60, 20, 25, .08), 0 16px 32px -12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.theme-figure img { display: block; width: 100%; height: auto; }
.theme-figure figcaption { margin-top: 0.65rem; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.theme-figure .credit { color: var(--faint); }
@media (prefers-color-scheme: dark) {
  .theme-thumb img, .theme-figure img { filter: brightness(.93); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-thumb img, .theme-figure a { transition: none; }
  .theme.has-fig a:hover .theme-thumb img, .theme-figure a:hover { transform: none; }
}
@media (max-width: 880px) {
  .theme-block.with-fig, .theme-block.with-fig.flip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "text" "fig" "papers";
  }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .theme-block { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .header-inner { padding-top: 0.75rem; padding-bottom: 0.5rem; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; }
  .portrait img, .monogram { width: 120px; height: 120px; border-radius: 14px; }
  .monogram { font-size: 2.6rem; }
  .year-group { grid-template-columns: 1fr; }
  .year { position: static; font-size: 1.3rem; padding-bottom: 0.4rem; }
  .pub-tools { position: static; }
  .pub-count { margin-left: 0; flex-basis: 100%; }
  .timeline .row, .projects li { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ print */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --faint: #555; --line: #ccc; --accent: #000; }
  .site-header nav, .pub-tools, .pub-actions, .more, .toc, .skip { display: none !important; }
  .block, .theme-block { break-inside: avoid-page; }
  .hero::before, .hero + .block::before { display: none; }
  .hero h1 { color: #000; background: none; }
  a { color: inherit; text-decoration: none; }
}

/* ================================================================== theme: bento (layer 3)
   Geist sans + Geist Mono, tiles on a quiet background, data-driven figures
   (counts come from the _data files), floating navigation. */
:root {
  --bg: #f2f2ef;
  --surface: #ffffff;
  --text: #121212;
  --muted: #55554f;
  --faint: #8a8a83;
  --line: #e4e4df;
  --accent: #9b1b30;
  --accent-strong: #7a1424;
  --accent-soft: #f6e8ea;
  --band: #ebebe7;
  --shadow: 0 1px 0 rgba(0, 0, 0, .02);
  --serif: "Geist Variable", Geist, system-ui, sans-serif;
  --sans: "Geist Variable", Geist, "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono Variable", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1200px;
  --radius: 22px;
  --gap: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b; --surface: #151517; --text: #f1f1ef; --muted: #a9a9a3; --faint: #77776f;
    --line: #26262a; --accent: #ff7d8e; --accent-strong: #ffa3af; --accent-soft: #2b171b; --band: #111113;
  }
}

body { font: 400 1rem/1.6 var(--sans); letter-spacing: -0.006em; }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -0.03em; }
.mono { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--faint); }

/* floating island header */
.site-header {
  position: sticky; top: 12px; z-index: 30; border: 0; box-shadow: none; background: transparent;
  margin-top: 12px; padding-inline: var(--gutter);
}
.header-inner {
  max-width: calc(var(--wrap) - 2 * var(--gutter)); min-height: 3.4rem; padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 8px 30px -14px rgba(0, 0, 0, .18);
}
.brand { font-family: var(--sans); font-weight: 650; font-size: 1rem; letter-spacing: -0.02em; }
.site-header nav ul { gap: 0.15rem; }
.site-header nav a { display: block; padding: 0.42rem 0.85rem; border-radius: 999px; border: 0; font-size: 0.88rem; }
.site-header nav a:hover { background: var(--band); }
.site-header nav a[aria-current="page"] { background: var(--text); color: var(--bg); }

main.wrap { padding-top: 2.25rem; padding-bottom: 4.5rem; }

/* tiles */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.tile {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; overflow: hidden; color: var(--text); text-decoration: none;
}
a.tile { transition: transform .25s cubic-bezier(.2, .7, .2, 1), border-color .2s, box-shadow .25s; }
a.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .35); color: var(--text); }

.tile-intro { grid-column: 1 / -1; padding: 2.4rem 2.6rem 2.2rem; }
.intro-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.4rem 2.2rem; align-items: center; }
.intro-photo { display: block; width: 176px; height: 176px; object-fit: cover; object-position: 50% 30%; border-radius: 20px; }
.intro-photo.monogram { display: grid; place-items: center; font-size: 3rem; }
.tile-intro h1 { font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1; letter-spacing: -0.045em; margin: 0 0 1rem; }
.affil { display: flex; align-items: center; gap: 1rem; }
.affil-logo { flex: none; display: block; padding-right: 1rem; border-right: 1px solid var(--line); }
.affil-logo img { display: block; height: 62px; width: auto; }
.tile-intro .role { color: var(--muted); font-size: 1.02rem; line-height: 1.5; }
.tile-intro .role a { color: var(--text); font-weight: 500; text-decoration: none; }
.tile-intro .role a:hover { color: var(--accent); }
.tile-intro .bio { max-width: none; margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 1.02rem; line-height: 1.7; text-wrap: pretty; }
.tile-intro .links { margin-top: 1.4rem; }
.footer-affil { display: flex; align-items: flex-start; gap: 0.9rem; }
.footer-affil img { display: block; height: 42px; width: auto; margin-top: 0.15rem; }

.tile-stat { grid-column: span 3; display: flex; flex-direction: column; gap: 0.15rem; padding: 1.35rem 1.5rem; min-height: 9.5rem; }
.tile-stat .num { font-size: 3rem; font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-stat .lbl { font-size: 1rem; font-weight: 500; }
.tile-stat .lbl.strong { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin: 0.4rem 0 0.2rem; }
.tile-stat .sub { margin-top: auto; color: var(--muted); font-size: 0.85rem; }
.tile-stat .sub.mono { font-size: 0.7rem; color: var(--faint); }
.tile-stat.tile-accent .sub.mono { margin-top: 0; }
.tile-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.tile-accent .sub, .tile-accent .sub.mono { color: rgba(255, 255, 255, .8); }
a.tile-accent:hover { color: #fff; }
@media (prefers-color-scheme: dark) { .tile-accent { background: #9e2238; border-color: #9e2238; } }

.links a { border-radius: 999px; background: var(--band); border-color: transparent; font-size: 0.86rem; }
.links li:first-child a { background: var(--text); color: var(--bg); }
.links li:first-child a .icon { color: inherit; }

/* research */
.bento-section { padding-top: 3.5rem; }
.bento-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0.25rem 1.1rem; }
.bento-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.bento-head.small { margin: 0 0 1rem; }
.bento-head.small h2 { font-size: 1.3rem; letter-spacing: -0.02em; }

.tile-theme { padding: 0; display: flex; flex-direction: column; grid-column: span 3; }
.tile-theme .tile-img { display: block; aspect-ratio: 16 / 10; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.tile-theme .tile-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
a.tile-theme:hover .tile-img img { transform: scale(1.05); }
.tile-theme .tile-body { display: block; padding: 1.05rem 1.25rem 1.25rem; }
.tile-theme h3 { font-size: 1.06rem; line-height: 1.25; margin: 0.35rem 0 0.35rem; }
.tile-theme p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.tile-theme.t1 { grid-column: span 6; grid-row: span 2; }
.tile-theme.t1 .tile-img { aspect-ratio: auto; flex: 1; }
.tile-theme.t1 .tile-img img { object-fit: contain; padding: 1.5rem; }
.tile-theme.t1 h3 { font-size: 1.5rem; letter-spacing: -0.03em; }
.tile-theme.t1 p { font-size: 0.95rem; }
.tile-theme.t6 { grid-column: span 12; flex-direction: row; }
.tile-theme.t6 .tile-img { width: 50%; aspect-ratio: 16 / 7; border-bottom: 0; border-right: 1px solid var(--line); }
.tile-theme.t6 .tile-body { display: flex; flex-direction: column; justify-content: center; padding: 2rem 2.25rem; }
.tile-theme.t6 h3 { font-size: 1.5rem; letter-spacing: -0.03em; }
@media (prefers-color-scheme: dark) { .tile-theme .tile-img img { filter: brightness(.92); } }

/* feed */
.bento-feed { padding-top: 3.5rem; grid-template-rows: auto auto; }
.tile-pubs { grid-column: span 7; grid-row: span 2; }
.tile-news, .tile-talks { grid-column: span 5; }
.pub-title, .pubs.mini .t, .talk-title { font-family: var(--sans); font-weight: 600; letter-spacing: -0.015em; }
.pub-title { font-size: 1rem; line-height: 1.4; }
.pub-authors, .pub-venue { font-size: 0.88rem; }
.pub:last-child { border-bottom: 0; }
.news li:last-child, .talks li:last-child { border-bottom: 0; padding-bottom: 0; }
.date { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.tag { font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; border-radius: 999px; padding: 0.15rem 0.55rem; }

/* inner pages */
.block-head { border-top: 0; padding-top: 0; }
.block-head h2 { font-size: 1.6rem; }
.block-head h2::after { display: none; }
.page-head { padding: 3rem 0 0.5rem; }
.page-head h1 { font-size: clamp(2.6rem, 5.5vw, 4rem); letter-spacing: -0.045em; }
.toc a { border-radius: 999px; border-color: transparent; background: var(--surface); }
.theme-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 2.2rem; margin-top: var(--gap); }
.theme-block:first-of-type { margin-top: 2rem; }
.theme-index { font-family: var(--mono); font-weight: 500; }
.theme-text h2 { font-size: 1.8rem; }
.theme-figure a { box-shadow: none; }
.projects li, .timeline .row { border-bottom-color: var(--line); }
.code-list li, .people li, .theme .card { border-radius: var(--radius); box-shadow: none; border-top-width: 1px; border-top-color: var(--line); }
.code-list li:hover, .people li:hover { box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .35); }
.pub-tools { border-radius: var(--radius); margin-left: 0; margin-right: 0; top: 76px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 85%, transparent); }
.year { top: 8rem; }
.site-footer { border-top: 0; }
.footer-inner { border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .tile-stat { grid-column: span 4; }
  .tile-stat.tile-accent { grid-column: span 12; min-height: 0; }
  .intro-photo { width: 140px; height: 140px; }
  .tile-theme { grid-column: span 6; }
  .tile-theme.t1 { grid-column: span 12; grid-row: auto; }
  .tile-theme.t1 .tile-img { aspect-ratio: 16 / 9; flex: none; }
  .tile-pubs, .tile-news, .tile-talks { grid-column: span 12; grid-row: auto; }
}
@media (max-width: 680px) {
  .tile-intro { padding: 1.5rem 1.3rem 1.4rem; }
  .intro-head { grid-template-columns: 92px minmax(0, 1fr); gap: 1rem 1.1rem; align-items: start; }
  .intro-photo { width: 92px; height: 92px; border-radius: 16px; }
  .tile-intro h1 { font-size: 2.05rem; margin: 0.35rem 0 0; }
  .affil { grid-column: 1 / -1; }
  .intro-id { display: contents; }
  .affil-logo img { height: 52px; }
  .tile-intro .role { font-size: 0.95rem; }
  .tile-intro .bio { margin-top: 1.3rem; padding-top: 1.2rem; font-size: 0.98rem; }
  .tile-theme, .tile-theme.t6 { grid-column: span 12; flex-direction: column; }
  .tile-theme.t6 .tile-img { width: 100%; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--line); }
  .site-header { top: 8px; margin-top: 8px; }
  .header-inner { border-radius: 20px; padding: 0.55rem 0.6rem 0.5rem 0.9rem; gap: 0.3rem; }
  .site-header nav { width: 100%; }
  .site-header nav ul { gap: 0.15rem 0.1rem; margin-left: -0.3rem; }
  .site-header nav a { padding: 0.3rem 0.62rem; font-size: 0.86rem; }
  .tile-stat { grid-column: span 4; min-height: 0; padding: 1rem 1rem 1.05rem; }
  .tile-stat .num { font-size: 2rem; }
  .tile-stat .lbl { font-size: 0.85rem; line-height: 1.25; }
  .tile-stat .sub.mono { display: none; }
  .tile-stat.tile-accent { grid-column: span 12; padding: 1rem 1.1rem; }
  .tile-stat.tile-accent .sub.mono { display: block; }
  .tile-stat .lbl.strong { font-size: 1rem; }
  .theme-block { padding: 1.4rem 1.2rem; }
}

/* contact page */
.contact { grid-template-columns: repeat(12, minmax(0, 1fr)); margin-top: 1.5rem; }
.contact .tile { grid-column: span 6; display: flex; flex-direction: column; gap: 0.5rem; }
.contact .tile.wide { grid-column: span 12; }
.contact .tile .mono { margin-bottom: 0.35rem; }
.contact-main { font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; overflow-wrap: anywhere; }
.contact address { font-style: normal; font-size: 1.05rem; line-height: 1.6; }
.contact address strong { font-weight: 600; }
.contact .more { margin-top: auto; padding-top: 0.8rem; }
.contact p { color: var(--muted); max-width: 70ch; }
.contact .links { margin-top: 0.2rem; }
.contact .tile-logo { display: flex; align-items: center; gap: 1rem; }
.contact .tile-logo img { height: 56px; width: auto; flex: none; }
@media (max-width: 760px) { .contact .tile { grid-column: span 12; } }

/* news page and LinkedIn posts */
.news-li { display: inline-flex; align-items: center; gap: 0.35rem; justify-self: start; margin-top: 0.2rem; font-size: 0.8rem; font-weight: 500; text-decoration: none; }
.news-li:hover { text-decoration: underline; }
.news-li .icon { width: 0.95em; height: 0.95em; }
.news-list { display: grid; gap: var(--gap); margin-top: 1.75rem; }
.news-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem 2.25rem; align-items: start; padding: 1.5rem 1.7rem; }
.news-item.has-li { grid-template-columns: minmax(0, 1fr) minmax(0, 504px); }
.news-item .date { grid-column: 1 / -1; }
.news-text { font-size: 1.04rem; line-height: 1.65; text-wrap: pretty; }
.news-text p { margin: 0; }
.li-facade { display: grid; gap: 0.75rem; padding: 1rem 1.15rem; border: 1px dashed color-mix(in srgb, var(--faint) 55%, var(--line)); border-radius: 16px; background: var(--bg); }
.li-note { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.li-note .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.05rem; color: var(--accent); }
.li-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; }
.li-actions a { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.86rem; font-weight: 500; text-decoration: none; }
.li-actions a .icon { width: 0.85em; height: 0.85em; }
.li-load, .li-all { font: 500 0.86rem var(--sans); padding: 0.48rem 1rem; border: 0; border-radius: 999px; background: var(--text); color: var(--bg); cursor: pointer; }
.li-load:hover, .li-all:hover { background: var(--accent); color: #fff; }
.li-load[hidden], .li-all[hidden] { display: none; }
.li-all-wrap { margin-top: 1.1rem; }
.li-embed.loaded .li-facade { display: none; }
.li-embed iframe { display: block; width: 100%; border: 0; border-radius: 12px; background: #fff; }
@media (prefers-color-scheme: dark) { .li-load:hover, .li-all:hover { color: #1b1a18; } }
@media (max-width: 880px) { .news-item.has-li { grid-template-columns: minmax(0, 1fr); } .li-embed iframe { max-width: 504px; } }

/* research clips */
.theme-video { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.theme-video video { display: block; width: 100%; height: auto; }
.theme-block.with-fig.with-video, .theme-block.with-fig.with-video.flip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "text papers" "fig fig";
}
.with-video .theme-papers .label { margin-top: 0.4rem; }
.with-video .theme-figure { margin-top: 1rem; }
@media (prefers-color-scheme: dark) { .theme-video video { filter: brightness(.93); } }
@media (max-width: 880px) {
  .theme-block.with-fig.with-video, .theme-block.with-fig.with-video.flip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "text" "fig" "papers";
  }
}
.year.year-label { font-size: 1.05rem; line-height: 1.25; padding-top: 0.3rem; }
.tag-submitted { background: transparent; color: var(--faint); border: 1px dashed color-mix(in srgb, var(--faint) 60%, var(--line)); }
