/* Single column, quiet academic page set in one serif typeface. */
:root {
  --bg: #ffffff;
  --fg: #1d2421;
  --muted: #5d6863;
  --rule: #dfe5e2;
  --accent: #2f5d50;      /* deep green, for links */
  --accent-soft: #eef3f1;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: var(--serif);  /* one serif typeface everywhere */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151a18; --fg: #e3e8e5; --muted: #a0aba6; --rule: #2c3531;
    --accent: #8cc3b1; --accent-soft: #1d2724; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151a18; --fg: #e3e8e5; --muted: #a0aba6; --rule: #2c3531;
  --accent: #8cc3b1; --accent-soft: #1d2724; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Navigation */
.site-nav { border-bottom: 1px solid var(--rule); }
.site-nav .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; padding-block: 18px;
}
.site-nav .name { font-family: var(--sans); font-weight: 600; font-size: 22px; color: var(--fg); text-decoration: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; font-family: var(--sans); font-size: 16px; }
.site-nav ul a { color: var(--muted); text-decoration: none; }
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { color: var(--fg); }

main .wrap { padding-block: 48px 64px; display: grid; gap: 48px; }

/* Profile: large portrait on the left, bio on the right */
.profile { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 40px; align-items: start; }
.profile img { width: 100%; aspect-ratio: 800 / 1026; object-fit: cover; }
.profile h1 { font-size: 30px; line-height: 1.2; margin: 0 0 16px; font-weight: 600; }
.bio p { margin: 0 0 0.9em; }
.bio p:last-child { margin-bottom: 0; }
.bio .market { font-weight: 600; }
.bio .contact span { color: var(--muted); margin: 0 6px; }
.toggle {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.toggle:hover { text-decoration-thickness: 2px; }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.jmp-abstract { margin: 0 0 1em; padding-left: 18px; border-left: 2px solid var(--rule); font-size: 16px; }
.jmp-abstract p { margin: 0 0 0.75em; }
.jmp-abstract p:last-child { margin-bottom: 0; }
.jmp-abstract .jmp-title { color: var(--muted); }

/* Section headings: the largest text on the page after the name, set apart by a rule */
h2 {
  font-family: var(--serif); font-size: 28px; line-height: 1.2; font-weight: 400; font-style: italic;
  color: var(--fg); margin: 0 0 24px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}

/* Papers: title (semibold) > authors (muted) > links and abstract (small) */
.paper + .paper { margin-top: 30px; }
.paper h3 { font-size: 18px; line-height: 1.4; margin: 0 0 3px; font-weight: 600; text-wrap: balance; }
.paper .authors { margin: 0; color: var(--muted); font-size: 15px; }
.paper .status { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.paper details { margin-top: 6px; }
.paper summary { font-size: 14px; color: var(--accent); cursor: pointer; width: fit-content; }
.paper details p { margin: 10px 0 0; font-size: 15px; line-height: 1.65; }

/* Job market paper: bigger title, abstract open by default */
.jmp h3 { font-size: 21px; line-height: 1.3; margin-bottom: 6px; text-wrap: wrap; }  /* fits on one line on a laptop screen */
.jmp .authors { font-size: 16px; }
.jmp details p { font-size: 16px; }

/* Teaching */
.entry + .entry { margin-top: 18px; }
.entry h3 { font-size: 18px; margin: 0; font-weight: 600; }
.entry p { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.entry .when { font-variant-numeric: tabular-nums; }

footer { border-top: 1px solid var(--rule); }
footer .wrap {
  padding-block: 20px 32px; font-family: var(--sans); font-size: 14px; color: var(--muted); line-height: 1.5;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px;
}
footer address { font-style: normal; }
footer p { margin: 0; }
footer .updated { margin-left: auto; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  main .wrap { padding-block: 32px 48px; gap: 40px; }
  .profile { grid-template-columns: 1fr; gap: 24px; }
  .profile img { max-width: 320px; }
  .profile h1 { font-size: 28px; }
}
.paper h3 a { color: inherit; text-decoration-color: var(--rule); }
.paper h3 a:hover { color: var(--accent); }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 22px; }
.shots figure { margin: 0; }
.shots img { width: 100%; border: 1px solid var(--rule); }
.shots figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.5; }
@media (max-width: 600px) { .shots { grid-template-columns: 1fr; } }
.jmp-figure { margin: 24px 0 0; }
.jmp-figure img { width: 100%; height: auto; background: #fff; }
.jmp-figure figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.paper .venues { margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.paper .venues em { font-style: italic; }
