/* Edit the palette and layout here; the rest of the site uses these values. */
:root {
  --font-body: "Crimson Pro", Georgia, serif;
  --font-size: 20px;
  --line-height: 1.45;
  --gold: #cfb991;
  --background: #fff;
  --text: #242321;
  --secondary: #56534e;
  --link: #87672f;
  --muted: #68645e;
  --divider: rgba(0, 0, 0, .1);
  --code-background: rgba(207, 185, 145, .1);
  --content-max: 1140px;
  --container-width: 94%;
  --header-height: 64px;
  --content-top: 52px;
  --paper-image-width: 140px;
  --paper-gap: 1.15rem;
  --fig-ink: #39434e;
  --fig-soft: #98a4af;
  --fig-blue: #497b99;
  --fig-green: #567f6d;
  --fig-gold: #9a742c;
  --fig-surface: #fff;
  --fig-wash: #edf2f3;
  --fig-gold-wash: #f6efdf;
  --type-page: 2rem;
  --type-section: 1.5rem;
  --type-paper: 1.13rem;
  --section-space: 2.3rem;
  color-scheme: light;
  font-size: var(--font-size);
}

/* The media rule also supplies dark mode when JavaScript is disabled. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #1c1c1d;
    --text: #e8e6e1;
    --secondary: #c0bcb4;
    --link: #cfb991;
    --muted: #aaa69e;
    --divider: #424246;
    --fig-ink: #d7dee5;
    --fig-soft: #71808f;
    --fig-blue: #92bfda;
    --fig-green: #9bc9b1;
    --fig-gold: #d9bf86;
    --fig-surface: #1c1c1d;
    --fig-wash: #28343b;
    --fig-gold-wash: #3b3427;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --background: #1c1c1d;
  --text: #e8e6e1;
  --secondary: #c0bcb4;
  --link: #cfb991;
  --muted: #aaa69e;
  --divider: #424246;
  --fig-ink: #d7dee5;
  --fig-soft: #71808f;
  --fig-blue: #92bfda;
  --fig-green: #9bc9b1;
  --fig-gold: #d9bf86;
  --fig-surface: #1c1c1d;
  --fig-wash: #28343b;
  --fig-gold-wash: #3b3427;
  color-scheme: dark;
}

/* Base typography and small, reusable elements. */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: var(--header-height) 0 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: var(--line-height);
  overflow-wrap: break-word;
}
button { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .17em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5rem;
  line-height: 1.2;
  font-weight: 400;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}
h1 { font-size: var(--type-page); }
h2 { font-size: var(--type-section); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 1rem; }
p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 40px; }
hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--divider); }
img { max-width: 100%; height: auto; }
code {
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--code-background);
  color: var(--link);
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .875em;
}
pre { overflow-x: auto; padding: 1rem; background: var(--code-background); }
pre code { padding: 0; background: none; }
blockquote { margin: 1.5em 0; padding: .5em 1em; border-left: 2px solid var(--gold); }
blockquote > :last-child { margin-bottom: 0; }
.icon { display: inline-block; flex: none; fill: currentColor; vertical-align: -.125em; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 1rem;
  padding: .5rem 1rem;
  background: var(--background);
  color: var(--text);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

/* Shared shell and navigation. */
.container {
  width: var(--container-width);
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 1rem;
}
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  background: var(--background);
  border-bottom: 1px solid var(--divider);
}
.site-nav { min-height: var(--header-height); display: flex; flex-wrap: wrap; align-items: center; }
.site-brand { color: var(--text); font-size: 1.25rem; white-space: nowrap; }
.site-brand:hover { text-decoration: none; }
.navigation { display: flex; align-items: center; margin-left: auto; }
.navigation ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.navigation a { display: block; padding: .55rem .65rem; color: var(--secondary); font-size: .95rem; }
.navigation a:hover, .navigation a[aria-current="page"] { color: var(--link); text-decoration: none; }
.navigation a[aria-current="page"] { font-weight: 600; }
.theme-toggle, .menu-toggle { border: 0; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle { display: flex; align-items: center; justify-content: flex-end; width: 44px; height: 44px; padding: 0; }
.theme-toggle:hover { color: var(--link); }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
.menu-toggle { display: none; }
.reading-progress { position: absolute; bottom: -1px; left: 0; width: 100%; height: 1px; }
.reading-progress span { display: block; height: 100%; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.site-main { flex: 1; margin-top: var(--content-top); margin-bottom: 3.5rem; }
.site-main:focus { outline: none; }
.home-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(2rem, 4.5vw, 3.5rem); align-items: start; }
.home-content { min-width: 0; }
.page-content { max-width: 780px; margin-inline: auto; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-weight: 600; letter-spacing: -.025em; }
.page-description { margin-top: .55rem; font-size: .9rem; color: var(--secondary); }
.site-footer {
  padding: .85rem 0;
  border-top: 1px solid var(--divider);
  background: var(--background);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
}
.site-footer a { color: var(--secondary); }
.site-footer a:hover { color: var(--link); text-decoration: none; }

/* Homepage profile, news, and selected publications. */
.profile {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.profile-image { display: block; width: 200px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.profile-name { margin: .4rem 0 0; font-size: 36px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; white-space: nowrap; }
.profile-alias { --muted: color-mix(in srgb, var(--text) 67%, var(--background)); max-width: 270px; margin: 0 0 .2rem; font-size: .82rem; }
.profile-alias summary:focus-visible { outline-color: var(--text); }
.profile-alias summary { width: fit-content; margin-inline: auto; padding: .15rem .3rem; color: var(--muted); cursor: pointer; list-style: none; }
.profile-alias summary::-webkit-details-marker { display: none; }
.profile-alias summary:hover { color: var(--text); text-decoration: underline; text-underline-offset: .15em; }
.profile-alias[open] summary { color: var(--text); }
.profile-alias p { margin: .25rem 0 .35rem; }
.profile-alias p span { display: block; margin-top: .1rem; color: var(--muted); font-size: .9em; font-style: italic; }
.contact-icons { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.9rem; line-height: 1; margin-top: .4rem; }
.contact-icons a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text); }
.contact-icons a:hover { color: var(--link); }
.profile-note { margin-top: 1rem; }
.home-section > h2 { display: flex; align-items: center; gap: .55rem; font-weight: 600; letter-spacing: -.02em; }
.home-section > h2 .icon { width: 24px; height: 24px; color: var(--secondary); }
.section-accent { stroke: var(--link); }
.news { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: .95rem; line-height: 1.45; }
.news th, .news td { padding: 0 0 .65rem; vertical-align: top; text-align: left; }
.news th { width: 1%; white-space: nowrap; font-weight: 500; font-size: .84rem; color: var(--muted); padding-top: .12rem; }
.news td { padding-left: 1rem; }
.news p { margin: 0; }
.news p + p { margin-top: .5rem; }
.section-more { margin: .45rem 0 0; font-size: .85rem; }
.section-more a { display: inline-block; padding: .35rem 0; text-underline-offset: .2em; }
.home-content section:last-child .section-more { margin-bottom: 0; }
.biography { max-width: 68ch; line-height: 1.5; }
.biography > p { margin-bottom: .9rem; }
.biography > p:last-child { margin-bottom: 0; }
.biography a, .news a { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: .15em; }
.biography a:hover, .news a:hover { text-decoration-color: currentColor; }
.home-section { margin-top: var(--section-space); padding-top: 1.15rem; border-top: 1px solid var(--divider); scroll-margin-top: calc(var(--header-height) + 1rem); }
.home-section > h2 { margin-bottom: 1rem; }
.paper { display: flex; align-items: flex-start; gap: var(--paper-gap); margin-block: 1.3rem 1.7rem; scroll-margin-top: calc(var(--header-height) + 1rem); }
.paper-image { flex: 0 0 var(--paper-image-width); margin-top: .15rem; background: var(--background); overflow: hidden; }
/* Transparent illustrations retain their colors in either theme; no inversion or white tile. */
.paper-img { display: block; width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; }
/* SVG colors inherit the active theme, including saved and no-script preferences. */
.paper-figure { display: block; width: 100%; height: auto; }
.paper-figure .ink { color: var(--fig-ink); }
.paper-figure .soft { color: var(--fig-soft); }
.paper-figure .blue { color: var(--fig-blue); }
.paper-figure .green { color: var(--fig-green); }
.paper-figure .gold { color: var(--fig-gold); }
.paper-figure path, .paper-figure rect, .paper-figure circle { stroke: currentColor; }
.paper-figure text { fill: currentColor; stroke: none; font-family: system-ui, sans-serif; font-weight: 500; }

.paper-details { flex: 1; min-width: 0; }
.paper h3 { font-size: var(--type-paper); line-height: 1.28; font-weight: 600; margin-bottom: .4rem; text-wrap: pretty; }
.paper p { margin: 0 0 .35rem; }
.paper-authors { font-size: .9rem; line-height: 1.45; }
.paper-citation { font-size: .88rem; line-height: 1.45; color: var(--text); }
.paper-venue { font-weight: 600; white-space: nowrap; }
.paper-context { font-size: .8rem; line-height: 1.4; color: var(--secondary); }
.paper-links { font-size: .82rem; }
.paper-links > a, .paper-links > .paper-award, .paper-bibtex summary { display: inline-block; margin-right: .85rem; margin-bottom: .2rem; }
.paper-links a { color: var(--text); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .2em; }
.paper-bibtex { display: inline; }
.paper-bibtex summary { list-style: none; cursor: pointer; color: var(--text); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .2em; }
.paper-bibtex summary::-webkit-details-marker { display: none; }
.bibtex-indicator { display: inline-block; margin-left: .1em; text-decoration: none; }
.paper-bibtex[open] .bibtex-indicator { transform: rotate(45deg); }
.bibtex-panel { width: 100%; min-width: 0; margin-block: .35rem .6rem; padding: .65rem .8rem; border: 1px solid var(--divider); border-left: 2px solid var(--gold); border-radius: 3px; background: var(--background); }
.bibtex-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; min-height: 1.8rem; margin-bottom: .25rem; }
.bibtex-status { margin-right: auto; color: var(--secondary); font-size: .78rem; }
.bibtex-copy { font: inherit; color: var(--text); background: transparent; border: 1px solid var(--divider); border-radius: 3px; padding: .2rem .6rem; cursor: pointer; }
.bibtex-copy:hover { border-color: var(--gold); }
.bibtex-text { display: block; width: 100%; min-height: 8rem; resize: vertical; border: 0; border-radius: 0; padding: .25rem 0; font: .7rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); background: transparent; }
.paper-award { font-weight: 600; border-left: 2px solid var(--gold); padding-left: .5rem; }
.author-self { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--text) 55%, transparent); text-underline-offset: 3px; }
.publication-group { margin-top: 2rem; }
.publication-group > h2 { font-size: 1.2rem; font-weight: 500; padding-bottom: .6rem; border-bottom: 1px solid var(--divider); }
.publication-list { list-style: none; margin: 0; padding: 0; }
.service-roles { list-style: none; padding: 0; }
.service-roles li { margin-bottom: .8rem; font-size: .95rem; line-height: 1.4; }
.service-years { font-size: .9em; white-space: nowrap; }
.service-detail { margin: .2rem 0 .9rem; font-size: .9rem; }
.service-review-group { margin-top: 1.2rem; }
.service-review-group h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: .6rem; }
.reviewing-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; list-style: none; padding: 0; }
.reviewing-list li { padding: .55rem 0; border-top: 1px solid var(--divider); line-height: 1.3; }
.reviewing-venue { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .65rem; }
.reviewing-venue a { font-size: 1rem; font-weight: 600; }
.reviewing-venue .service-years { font-size: .8rem; }
.reviewing-name { display: block; font-size: .84rem; margin-top: .25rem; line-height: 1.4; color: var(--secondary); }
.review-recognition { display: block; font-size: .8rem; margin-top: .4rem; border-left: 2px solid var(--gold); padding-left: .5rem; }

@media (max-width: 576px) {
  .reviewing-list { grid-template-columns: 1fr; gap: .25rem; }
}

/* A short desktop viewport gets a flowing sidebar, so every quote stays reachable. */
@media (min-width: 901px) and (max-height: 840px) {
  .profile { position: static; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .home-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; }
  .contact-icons { gap: 2px; font-size: 1.75rem; }
}
@media (max-width: 900px) {
  :root { --content-max: 740px; --content-top: 38px; }
  .home-layout { display: block; }
  .profile { position: static; margin-bottom: 2.25rem; }
  .profile-image { width: 195px; }
}
@media (max-width: 576px) {
  :root { --header-height: 56px; --font-size: 19px; --type-page: 1.8rem; --type-section: 1.42rem; --type-paper: 1.1rem; --section-space: 2rem; --container-width: 100%; }
  .site-brand { padding-block: .5rem; }
  .menu-toggle { display: block; width: 44px; height: 44px; margin-left: auto; padding: 11px; }
  .menu-toggle span { display: block; height: 2px; width: 22px; margin: 4px 0; background: currentColor; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
  .navigation { width: 100%; flex-direction: column; align-items: flex-end; padding-block: .25rem .5rem; }
  .navigation ul { flex-direction: column; align-items: flex-end; }
  .js .navigation { display: none; }
  .js .navigation.is-open { display: flex; }
  /* Without JavaScript the expanded navigation participates in normal flow. */
  html:not(.js) .site-header { position: relative; }
  html:not(.js) body { padding-top: 0; }
  .profile-name { font-size: 34px; }
  :root { --paper-image-width: 96px; --paper-gap: .8rem; }
  .paper { display: grid; grid-template-columns: var(--paper-image-width) minmax(0, 1fr); column-gap: var(--paper-gap); row-gap: .3rem; }
  .paper-image { grid-column: 1; grid-row: 1; width: var(--paper-image-width); }
  .paper-details { display: contents; }
  .paper h3 { grid-column: 2; grid-row: 1; }
  .paper p { grid-column: 1 / -1; margin-bottom: .25rem; }
  .paper-links { grid-column: 1 / -1; }
  .paper-authors { margin-top: .3rem; }
  .news td { padding-left: .7rem; }
}

/* Let long titles use the space beneath the figure on the narrowest screens. */
@media (max-width: 360px) {
  .paper { display: flow-root; }
  .paper-image { float: left; margin: .15rem var(--paper-gap) .35rem 0; }
  .paper p, .paper-links { clear: both; }
}
