/* =========================================================
   Academic site — shared styles
   Identity: a quiet, journal-like masthead. Serif display
   (Newsreader) over a clean humanist sans (Public Sans),
   black for headings and links, a single burgundy hairline
   as the signature. Everything else stays disciplined.
   ========================================================= */

:root {
  --paper:      #fcfcfa;   /* warm near-white, like paper   */
  --ink:        #1b1b1d;   /* body text                     */
  --heading:    #111111;   /* headings, masthead             */
  --link:       #111111;   /* links, underlined              */
  --link-hover: #7a2431;   /* link hover, same as accent     */
  --accent:     #7a2431;   /* burgundy, the signature        */
  --muted:      #6c6c66;   /* secondary text, captions      */
  --rule:       #e4e2db;   /* hairlines                     */
  --maxw:       900px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem 1.4rem 4rem;
}

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding: 1.4rem 0 0.9rem;
  border-bottom: 1px solid var(--accent);
}

/* One long page: sections are scroll targets, offset for the sticky masthead */
.block { scroll-margin-top: 5.5rem; }
.intro { scroll-margin-top: 5.5rem; }
.block .subhead { margin-top: 2.2rem; }
.block .subhead:first-of-type { margin-top: 1.4rem; }

.site-name {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0;
}

.site-name a { color: var(--heading); text-decoration: none; }
.site-name a:hover { color: var(--heading); }

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

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

main { margin-top: 2.4rem; }

p { margin: 0 0 1.05rem; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover { color: var(--link-hover); }

strong { font-weight: 600; }

/* Section headers: a small sans eyebrow over a hairline */
.eyebrow {
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.8rem 0 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--accent);
}
/* grey separator above a sub-block */
.subhead.ruled { border-top: 1px solid var(--rule); padding-top: 1.6rem; }

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

.intro {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  align-items: center;                  /* portrait stays centred on the text block however long the text is */
}

.portrait {
  width: 250px;
  height: 300px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--rule);
  display: block;
}

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

/* Inline link row (CV / Scholar / Email) */
.linkbar {
  margin-top: 0.4rem;
  font-size: 0.97rem;
  color: var(--muted);
}
.linkbar a { color: var(--link); }
.linkbar .sep { color: var(--rule); margin: 0 0.55rem; }

.fields {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.8rem;
}
.fields strong { color: var(--ink); font-weight: 600; }

/* ---------- Highlight block (JMP on home) ---------- */

.feature {
  margin-top: 2.6rem;
  padding: 1.4rem 1.5rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
}
.feature .eyebrow { margin: 0 0 0.4rem; padding-bottom: 0; border-bottom: none; }
.feature h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 0.1rem 0 0.5rem;
  color: var(--heading);
}
.feature p { margin-bottom: 0.6rem; }
.feature .meta { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------- Research entries ---------- */

.paper {
  margin: 0 0 2rem;
  padding-bottom: 0.2rem;
}
.paper .title {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  color: var(--ink);
}
.paper .title a { color: var(--link); text-decoration: none; }
.paper .title a:hover { color: var(--link-hover); text-decoration: underline; }

.paper .authors { color: var(--muted); font-size: 0.97rem; margin: 0 0 0.15rem; }
.feature .authors { color: var(--muted); font-size: 0.97rem; margin: -0.3rem 0 0.6rem; }
.paper .status  { color: var(--muted); font-size: 0.92rem; font-style: italic; margin: 0 0 0.45rem; }

.paper .abstract { font-size: 0.98rem; margin: 0.4rem 0 0.55rem; }

.paper .links {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.paper .links a {
  color: var(--link);
  text-decoration: none;
  margin-right: 1rem;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 1px;
}
.paper .links a:hover { border-bottom-color: var(--accent); }

/* details/summary for collapsible abstracts */
details.abs { margin: 0.35rem 0 0.55rem; }
details.abs > summary {
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--link);
  list-style: none;
  display: inline-block;
  border-bottom: 1.5px solid transparent;
}
details.abs > summary::-webkit-details-marker { display: none; }
details.abs > summary:hover { border-bottom-color: var(--accent); }
details.abs[open] > summary { color: var(--muted); }
details.abs .abstract { margin-top: 0.5rem; }

/* ---------- Teaching ---------- */

.subhead {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--heading);
  margin: 1.8rem 0 0.3rem;
}
.subhead.accent { color: var(--accent); }
.courses + p { margin-top: 1.6rem; }
.course {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.course:last-child { border-bottom: none; }
.course .code {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--heading);
  min-width: 78px;
  font-size: 0.92rem;
  padding-top: 0.05rem;
}
.course .detail { flex: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.course .detail .name  { font-weight: 500; }
.course .detail .sub   { font-weight: 400; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.course .detail .terms { color: var(--muted); font-size: 0.82rem; white-space: nowrap; text-align: right; }
@media (max-width: 640px) {
  .course .detail { display: block; }
  .course .detail .terms { display: block; white-space: normal; text-align: left; margin-top: 0.1rem; }
}

.callout {
  margin: 1.6rem 0;
  padding: 1.1rem 1.3rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 0.98rem;
}
.callout strong { color: var(--heading); }

/* ---------- Footer ---------- */

footer {
  margin-top: 3.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
}
footer a { color: var(--muted); }

/* ---------- Page-load motion (the one moment) ---------- */

main { animation: rise 0.5s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- A11y / responsive ---------- */

:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 620px) {
  body { font-size: 1.02rem; }
  .masthead { flex-direction: column; align-items: center; text-align: center; }   /* phone: name + nav centred in the sticky bar */
  .intro { grid-template-columns: 1fr; gap: 1.1rem; }
  .portrait { width: 72%; max-width: 260px; height: auto; aspect-ratio: 5 / 6; justify-self: center; }   /* phone: centred with side margins */
  nav.site-nav { gap: 0.9rem; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Print (handy if a committee prints a page) ---------- */
@media print {
  nav.site-nav, footer { display: none; }
  a { color: #000; text-decoration: none; }
  body { background: #fff; }
}
