:root {
  /* Layout: one centered reading column; a fixed-width left gutter holds the portrait,
     section labels and publication numbers so everything lines up on one vertical. */
  --bg: #f6f7f9;
  --ink: #151b26;
  --muted: #535d70;
  --faint: #868fa0;
  --rule: #dce0e7;
  --accent: #2445a8;
  --accent-wash: #e7ecf8;
  --accent-2: #b0612c;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-math: "Newsreader", "STIX Two Math", "Cambria Math", "Latin Modern Math", "Times New Roman", serif;
  --gutter: 10rem;
  --measure: 64rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1219; --ink: #e4e8ee; --muted: #a2aab9; --faint: #6f7889;
    --rule: #262d3a; --accent: #95aef7; --accent-wash: #18213a; --accent-2: #e2a171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1219; --ink: #e4e8ee; --muted: #a2aab9; --faint: #6f7889;
  --rule: #262d3a; --accent: #95aef7; --accent-wash: #18213a; --accent-2: #e2a171;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.m { font-family: var(--font-math); white-space: nowrap; }
.m sup, .m sub { font-size: 0.7em; line-height: 0; }

.wrap {
  max-width: calc(var(--measure) + 4rem);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) {
  .wrap {
    padding-left: max(40px, env(safe-area-inset-left, 0px));
    padding-right: max(40px, env(safe-area-inset-right, 0px));
  }
}

/* header */
.site-head { border-bottom: 1px solid var(--rule); }
.bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  column-gap: 32px; padding-top: 18px;
}
.wordmark {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; letter-spacing: -0.005em;
  color: var(--ink); text-decoration: none; padding-bottom: 12px; line-height: 1.2;
}
.tabs {
  display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  font-size: 0.9rem; color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 12px 0 11px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .ext span { color: var(--faint); margin-left: 3px; font-size: 0.8em; }
.lbl-short { display: none; }
.nw { white-space: nowrap; }

/* page frame */
.page { display: grid; gap: 56px; padding-block: 52px 80px; }
.page-head { display: grid; gap: 10px; }
.page-title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(2.1rem, 5vw, 2.8rem);
  line-height: 1.08; letter-spacing: -0.012em; margin: 0; text-wrap: balance;
}
.lede { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.55; color: var(--muted); margin: 0; max-width: 72ch; }
h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.2; margin: 0; text-wrap: balance; }
.label {
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--faint); margin: 0;
}
.prose { display: grid; gap: 14px; }
.prose p { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.6; margin: 0; max-width: 74ch; }

/* home */
.hero { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); gap: 24px 36px; align-items: end; }
.portrait {
  grid-row: 1 / span 2; align-self: start;
  width: 100%; max-width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%;
  border-radius: 3px; background: var(--accent-wash); display: block;
}
.portrait-mono { display: grid; place-items: center; }
.portrait-mono span { font-family: var(--font-display); font-size: 2.6rem; color: var(--accent); letter-spacing: 0.02em; }
.hero-text { display: grid; gap: 10px; min-width: 0; }
.name {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem, 7vw, 3.6rem);
  line-height: 1; letter-spacing: -0.018em; margin: 0;
}
.role, .affil { margin: 0; font-size: 1rem; line-height: 1.5; }
.role strong { font-weight: 600; }
.affil { color: var(--muted); }
.contact { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 0; min-width: 0; align-self: start; }
.contact div { display: grid; gap: 2px; }
.contact dd { margin: 0; font-size: 0.92rem; }

.hero-rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.rows { display: grid; gap: 44px; }
.row { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); gap: 12px 36px; }
.row > h2 { font-size: 1.2rem; padding-top: 0.15em; }
.row-body { min-width: 0; display: grid; gap: 16px; }
.more { margin: 0; font-size: 0.92rem; }
.more a { text-decoration: none; }
.more a:hover { text-decoration: underline; }

/* publications */
.pubs { list-style: none; margin: 0; padding: 0; display: flow-root; }
.pub { position: relative; padding-left: calc(2.25rem + 14px); padding-bottom: 14px; }
.pubs.compact .pub { padding-left: 0; }
.pub-n {
  position: absolute; left: 0; top: 0; width: 2.25rem;
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); text-align: right;
  padding-top: 0.32rem; font-variant-numeric: tabular-nums;
}
.pub-fig { margin: 0; }
.pub-fig img, .pub-fig svg { display: block; width: 100%; height: auto; }
/* An entry with a figure is one row: the figure on one side, the entry on the other.
   site.js alternates fig-right / fig-left over the entries that are showing. */
@media (min-width: 760px) {
  .pub.has-fig {
    display: grid; column-gap: 14px; align-items: start;
    grid-template-rows: auto auto auto auto 1fr;
    padding: 20px 0; border-top: 1px solid var(--rule);
  }
  .pub.has-fig > .pub-n { position: static; width: auto; grid-row: 1; }
  .pub.has-fig > .pub-fig { grid-row: 1 / -1; align-self: center; }
  .pub.has-fig.fig-right { grid-template-columns: 2.25rem minmax(0, 1fr) 216px; }
  .pub.has-fig.fig-right > * { grid-column: 2; }
  .pub.has-fig.fig-right > .pub-n { grid-column: 1; }
  .pub.has-fig.fig-right > .pub-fig { grid-column: 3; margin-left: 22px; }
  .pub.has-fig.fig-left { grid-template-columns: 216px 2.25rem minmax(0, 1fr); }
  .pub.has-fig.fig-left > * { grid-column: 3; }
  .pub.has-fig.fig-left > .pub-n { grid-column: 2; }
  .pub.has-fig.fig-left > .pub-fig { grid-column: 1; margin-right: 22px; }
}
.pub.has-fig + .pub:not(.has-fig) { border-top: 1px solid var(--rule); padding-top: 18px; }
.pub.has-fig + .pub:not(.has-fig) > .pub-n { top: 18px; }
@media (max-width: 759px) {
  .pub.has-fig { display: flex; flex-direction: column; border-top: 1px solid var(--rule); padding-top: 16px; padding-bottom: 18px; }
  .pub.has-fig > .pub-n { top: 16px; }
  .pub.has-fig > .pub-fig { order: 9; margin: 14px 0 0; max-width: 17rem; }
}
.pub-title { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.38; font-weight: 500; margin: 0; text-wrap: pretty; }
.pub-authors, .pub-venue { margin: 1px 0 0; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
.pub-venue { font-style: italic; }
.pub-authors a { color: inherit; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.pub-links a {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.02em; line-height: 1.6;
  text-decoration: none; color: var(--accent); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 7px;
}
.pub-links a:hover { border-color: var(--accent); background: var(--accent-wash); }

.pub-tools { display: grid; gap: 14px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
#pub-filter {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 4px; padding: 9px 12px;
  width: 100%; max-width: 26rem; min-width: 0; flex: 1 1 16rem;
}
#pub-filter::placeholder { color: var(--faint); }
#pub-filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.pub-count { margin: 0; font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.88rem; }
.jump a { color: var(--muted); text-decoration: none; }
.jump a:hover { color: var(--ink); }
.jump span, .count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); margin-left: 4px; font-weight: 400; }
.pub-sections { display: grid; gap: 44px; }
.pub-section { display: grid; gap: 16px; scroll-margin-top: 24px; }
.pub-section > h2 { padding-left: calc(2.25rem + 14px); }
.empty { margin: 0; color: var(--muted); font-family: var(--font-display); font-size: 1.1rem; }
.notice { margin: 0; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 0.8rem; line-height: 1.55; color: var(--faint); max-width: 72ch; }
.notice strong { color: var(--muted); font-weight: 500; }

/* teaching */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 24px 40px; }
.fact { display: grid; gap: 6px; align-content: start; }
.fact p { margin: 0; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.55; }
.past { display: grid; gap: 26px; }
.years { display: grid; gap: 0; }
.year { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 8px 24px; padding-block: 18px; border-top: 1px solid var(--rule); }
.year-label { font-family: var(--font-mono); font-size: 0.82rem; color: var(--faint); padding-top: 3px; font-variant-numeric: tabular-nums; }
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.course { display: grid; grid-template-columns: 4rem 6.5rem minmax(0, 1fr); gap: 2px 14px; align-items: baseline; }
.term { font-size: 0.82rem; color: var(--muted); }
.code { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink); white-space: nowrap; }
.ctitle { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.4; min-width: 0; }

/* letters */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 34px; }
.step { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 4px 18px; }
.step-n { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--accent); text-align: right; }
.step-body { display: grid; gap: 10px; min-width: 0; }
.step-body h2 { font-size: 1.3rem; }
.step-body p { margin: 0; font-family: var(--font-display); font-size: 1.12rem; line-height: 1.6; max-width: 74ch; }
.docs, .docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.docs { font-size: 0.98rem; }
.docs li { position: relative; padding-left: 18px; }
.docs li::before { content: ""; position: absolute; left: 2px; top: 0.66em; width: 5px; height: 5px; background: var(--accent); border-radius: 1px; }
.docs ul { margin-top: 6px; }
.docs ul li::before { background: transparent; border: 1px solid var(--faint); }
.addr { font-family: var(--font-mono); font-size: 0.9em; }

/* footer */
.site-foot { border-top: 1px solid var(--rule); }
.foot {
  display: grid; grid-template-columns: var(--gutter) repeat(2, minmax(0, 1fr)); gap: 16px 36px;
  padding-block: 32px 40px; font-size: 0.86rem; color: var(--muted);
}
.foot p { margin: 0; }
.foot-name { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.copy { grid-column: 1 / -1; font-size: 0.78rem; color: var(--faint); }
.sc { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (max-width: 700px) {
  :root { --gutter: 6rem; }
  .page { gap: 44px; padding-block: 36px 64px; }
  .hero { column-gap: 20px; align-items: center; }
  .portrait { grid-row: auto; }
  .contact { grid-column: 1 / -1; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .rows { gap: 36px; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .year { grid-template-columns: minmax(0, 1fr); }
  .course { grid-template-columns: 4rem minmax(0, 1fr); }
  .ctitle { grid-column: 1 / -1; }
  .pub-section > h2 { padding-left: 0; }
  .pub { padding-left: calc(1.75rem + 10px); }
  .pub-n { width: 1.75rem; }
}
@media (max-width: 560px) {
  .tabs { gap: 18px; }
  #pub-filter { flex-basis: 100%; max-width: none; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}
@media (max-width: 420px) {
  .wordmark { width: 100%; padding-bottom: 2px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
