:root {
  color-scheme: light;
  --bg: #fff;
  --text: #202127;
  --muted: #60616b;
  --accent: #7651b3;
  --soft: #f5f1fb;
  --line: #e7e7ec;
  --code: #f7f7f9;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17181d;
  --text: #e7e7ef;
  --muted: #b0b0bf;
  --accent: #bc9ced;
  --soft: #292334;
  --line: #34343f;
  --code: #22232b;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 16px; }
h1, h2, h3, h4 { line-height: 1.35; }
h1 { margin: 0 0 8px; font-size: clamp(34px, 4vw, 44px); letter-spacing: -1.5px; font-weight: 700; }
h2 { font-size: 23px; margin: 34px 0 18px; }
h3 { font-size: 17px; margin: 25px 0 12px; font-weight: 600; }
h4 { font-size: 15px; }
ul, ol { padding-left: 22px; }
li + li { margin-top: 9px; }
code, pre, tt { font-family: var(--mono); }
code { font-size: .9em; background: var(--code); border-radius: 3px; padding: 2px 4px; }
pre { max-width: 100%; overflow-x: auto; padding: 18px; background: var(--code); border: 1px solid var(--line); border-radius: 5px; font-size: 12px; line-height: 1.7; }
pre code { background: none; padding: 0; font-size: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 50; padding: 10px 16px; background: var(--bg); border: 1px solid var(--accent); }
.skip-link:focus { top: 10px; }
.site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 928px; margin: auto; min-height: 64px; padding: 10px 24px; display: flex; gap: 24px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font: 600 14px/1.4 var(--mono); color: var(--text); text-decoration: none; }
.monogram { display: inline-grid; place-items: center; width: 27px; height: 27px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--soft); color: var(--accent); border-radius: 5px; font-size: 11px; }
.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.site-nav a { padding: 5px 0; font: 12px/1.6 var(--mono); text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent); }
.theme-toggle { display: none; flex-shrink: 0; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; line-height: 1; }
.js .theme-toggle { display: block; }
.page { max-width: 928px; margin: 0 auto; padding: 48px 24px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 172px; column-gap: 36px; row-gap: 20px; align-items: start; margin-bottom: 52px; }
.hero-heading { grid-column: 1; }
.affiliation { color: var(--muted); font-size: 15px; margin-bottom: 0; }
.portrait { grid-column: 2; grid-row: 1 / 4; width: 172px; border-radius: 8px; border: 1px solid var(--line); }
.research-interests { grid-column: 1; list-style: none; padding: 0; margin: 0; font: 13px/1.8 var(--mono); }
.research-interests li + li { margin-top: 2px; }
.research-interests li::before { content: ">"; color: var(--accent); margin-right: 10px; }
.hero-description { grid-column: 1; max-width: 64ch; }
.hero-description p:last-child { margin-bottom: 0; }
.quick-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; list-style: none; }
.quick-links li + li { margin-top: 0; }
.quick-links a { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 5px; font: 12px/1.6 var(--mono); color: var(--muted); text-decoration: none; }
.quick-links a:hover { color: var(--accent); border-color: var(--accent); }
.content-section { margin-top: 52px; }
.section-heading { display: flex; align-items: center; gap: 10px; font: 600 13px/1.5 var(--mono); letter-spacing: .01em; margin: 0 0 24px; color: var(--muted); }
.section-heading::before { content: ">"; color: var(--accent); }
.section-heading::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.section-links { font: 12px/1.8 var(--mono); display: flex; flex-wrap: wrap; gap: 10px 20px; margin: -8px 0 26px; }
.section-links a { text-decoration: none; }
.publication { padding: 0 0 26px; }
.publication + .publication { border-top: 1px solid var(--line); padding-top: 26px; }
.publication h3 { font-size: 20px; margin: 7px 0 8px; letter-spacing: -.3px; }
.publication h3 a { color: var(--text); text-decoration: none; }
.publication h3 a:hover { color: var(--accent); text-decoration: underline; }
.venue { font: 600 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.authors, .entry-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.resource-links { display: flex; flex-wrap: wrap; gap: 5px 18px; font: 12px/1.8 var(--mono); margin: 10px 0; }
.resource-links a { text-decoration: none; }
.resource-links a:hover { text-decoration: underline; }
.version-note, .page-updated, .fine-print { color: var(--muted); font-size: 12px; }
details { margin-top: 14px; }
summary { cursor: pointer; color: var(--muted); font: 12px/1.8 var(--mono); width: fit-content; max-width: 100%; }
details[open] > summary { color: var(--accent); margin-bottom: 14px; }
.abstract { max-width: 78ch; font-size: 14px; line-height: 1.8; }
.math { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; white-space: nowrap; }
.bibtex-tools { display: flex; gap: 16px; align-items: center; margin: 10px 0; font: 12px var(--mono); }
.copy-button { display: none; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); cursor: pointer; padding: 6px 10px; }
.js .copy-button { display: inline-block; }
.copy-status { color: var(--muted); }
.bio { max-width: 79ch; }
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list > li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.entry-list > li:last-child { border-bottom: none; }
.entry-list h4 { margin: 0 0 5px; font-weight: 500; }
.entry-list p:last-child { margin-bottom: 0; }
.dated-list > li { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 16px; }
.entry-date { font: 11px/1.9 var(--mono); color: var(--muted); padding-top: 2px; }
.entry-title { color: var(--text); font-weight: 500; }
.entry-meta { margin: 3px 0 0; }
.teaching-list h4 { font-size: 15px; }
.teaching-list .resource-links { margin-bottom: 0; }
.subsection { margin-top: 30px; }
.personal-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.personal-links a { text-decoration: none; }
.personal-links h3 { color: var(--accent); margin-top: 0; font-size: 16px; }
.personal-links p { color: var(--muted); font-size: 14px; }
.contact-block { font-size: 13px; color: var(--muted); }
.contact-block address { font-style: normal; }
.profile-links { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 18px; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 928px; margin: auto; padding: 22px 24px 30px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.footer-inner a { text-decoration: none; }
.subpage .page-heading { margin-bottom: 32px; }
.subpage .page-heading p { max-width: 70ch; color: var(--muted); }
.subpage section { margin-block: 40px; }
.back-link { display: inline-block; font: 12px/1.6 var(--mono); margin-bottom: 24px; text-decoration: none; }
.prose { overflow-wrap: anywhere; }
.prose p, .prose ul, .prose ol { max-width: 80ch; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; }
.photo { min-width: 0; margin: 0; }
.photo a { display: block; }
.photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 5px; background: var(--code); }
.photo.vertical img { aspect-ratio: 3 / 4; }
.photo figcaption { font-size: 12px; color: var(--muted); padding-top: 8px; }
.location + .location { margin-top: 52px; }
.restaurant-list { padding: 0; list-style: none; }
.restaurant-entry { padding: 20px 0; border-bottom: 1px solid var(--line); }
.restaurant-entry h3 { margin-top: 0; }
.restaurant-entry p:last-child { margin-bottom: 0; }
.restaurant-entry .entry-meta { margin-bottom: 10px; }
.toronto-illustration img { width: 198px; height: auto; }
.guide-toc { padding: 18px 22px; background: var(--code); border: 1px solid var(--line); border-radius: 5px; }
.guide pre { overflow-x: auto; white-space: pre; }
.guide img { height: auto; border: 1px solid var(--line); border-radius: 5px; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; }

@media (max-width: 760px) {
  .header-inner { gap: 16px; flex-wrap: wrap; padding-block: 13px; }
  .site-nav { order: 3; flex-basis: 100%; margin-left: 0; gap: 10px 22px; }
  .theme-toggle { margin-left: auto; }
  html { scroll-padding-top: 125px; }
}
@media (max-width: 540px) {
  .site-header { position: static; }
  .header-inner { padding-inline: 20px; }
  .site-nav { gap: 8px 12px; }
  .site-nav a { min-height: 32px; display: inline-flex; align-items: center; font-size: 11.5px; }
  .page { padding: 32px 20px 48px; }
  .hero { grid-template-columns: minmax(0, 1fr) 88px; gap: 20px 16px; margin-bottom: 40px; }
  .portrait { grid-column: 2; grid-row: 1; width: 88px; }
  .affiliation { font-size: 13px; }
  .research-interests, .hero-description { grid-column: 1 / -1; }
  .research-interests { font-size: 12px; }
  .hero-description { font-size: 14px; }
  .quick-links { gap: 8px; }
  .quick-links a { padding: 7px 10px; }
  .content-section { margin-top: 40px; }
  .publication h3 { font-size: 18px; }
  .dated-list > li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dated-list .entry-date { grid-row: 2; }
  .gallery-grid, .personal-links { grid-template-columns: minmax(0, 1fr); }
  .personal-links { gap: 8px; }
  .footer-inner { padding-inline: 20px; }
  html { scroll-padding-top: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button { transition: color .15s ease, border-color .15s ease; }
}
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --text: #000; --muted: #444; --accent: #333; --line: #ddd; --code: #f7f7f7; color-scheme: light; }
  .site-header, .skip-link, .theme-toggle, .copy-button, .back-link { display: none !important; }
  .page { max-width: none; padding: 0; }
  .content-section { margin-top: 28px; }
  a { color: inherit; }
  .publication, .entry-list > li, .photo { break-inside: avoid; }
  .site-footer { margin-top: 24px; }
}
