:root {
  --bg: #fdfcfa;
  --text: #1f2328;
  --muted: #5b6370;
  --accent: #a51c30; /* Harvard crimson */
  --rule: #e4e1dc;
  --max: 54rem;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { text-decoration-color: currentColor; }

/* ---------- Header & nav ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: flex-end;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* ---------- Main ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

h1, h2, h3 {
  font-family: var(--sans);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.9rem; margin: 0 0 1.25rem; }
h2 {
  font-size: 1.2rem;
  margin: 3.75rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

.note { color: var(--muted); font-size: 0.95rem; font-style: italic; }

/* Label / value pairs, e.g. the contact details */
.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  margin: 0;
}

.details dt { grid-column: 1; color: var(--muted); font-size: 0.95rem; }
.details dd { grid-column: 2; margin: 0; }
.details dd + dt { margin-top: 0.5rem; }
.details a { text-decoration: none; }
.details a:hover { text-decoration: underline; }

/* ---------- Home ---------- */

.intro {
  display: grid;
  grid-template-columns: 1fr 14rem;
  gap: 2rem;
  align-items: start;
}

.intro p:first-child { margin-top: 0; }

.intro img {
  /* Line spacing + the font's ascender space put the first line's capitals ~0.47em below the
     top of the paragraph box; offset the photo so its top edge lines up with them. */
  margin-top: 0.47em;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .site-nav { gap: 0.25rem 0.9rem; font-size: 0.9rem; }
  h2 { margin-top: 2.5rem; }
  .intro { grid-template-columns: 1fr; }
  .intro img { max-width: 16rem; order: -1; margin-top: 0; }
}

/* ---------- Publication lists ---------- */

.pubs {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pubs > li {
  margin: 0 0 1.6rem;
  line-height: 1.5;
}

.pubs .title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.pubs .meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.pubs .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

.pubs .links a { text-decoration: none; }
.pubs .links a:hover { text-decoration: underline; }

/* Collapsible abstract: the toggle sits first in the links row; when open it takes the full
   width, so the abstract appears under the toggle and the other links wrap below it. */
.abstract[open] { flex-basis: 100%; }

.abstract summary {
  display: inline;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::after { content: " \25B8"; font-size: 0.8em; }
.abstract[open] summary::after { content: " \25BE"; }
.abstract summary:hover { text-decoration: underline; }

.pubs .abstract p {
  margin: 0.4rem 0 0.5rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--rule);
  color: var(--text);
  line-height: 1.6;
}

.pubs p { margin: 0.6rem 0 0; }

code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 0.85em;
}

pre {
  margin: 0.5rem 0 0;
  padding: 0.75rem 1rem;
  background: #f3f1ed;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

