:root {
  --ink: #1a1a1a;
  --muted: #5d5a54;
  --paper: #ffffff;
  --rule: #e4dfd4;
  --gold: #cfb991;      /* Purdue Boilermaker Gold */
  --gold-deep: #8e6f3e; /* Purdue Aged gold, used for links */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece8e0; --muted: #a8a296; --paper: #161514;
    --rule: #34312c; --gold-deep: #d9c49c;
  }
}
:root[data-theme="dark"] {
  --ink: #ece8e0; --muted: #a8a296; --paper: #161514;
  --rule: #34312c; --gold-deep: #d9c49c;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.1875rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem .75rem; z-index: 10; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.5rem; }

/* Navigation */
nav {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: .875rem;
}
nav .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; min-height: 3.25rem; padding-top: .5rem; padding-bottom: .5rem; }
nav a { color: var(--muted); text-decoration: none; padding: .3rem 0; white-space: nowrap; }
nav a:hover { color: var(--ink); }
nav .home { color: var(--ink); font-weight: 600; margin-right: auto; }
#theme-toggle {
  font: inherit; color: var(--muted); background: none; border: 1px solid var(--rule);
  border-radius: 999px; padding: .2rem .7rem; cursor: pointer;
}
#theme-toggle:hover { color: var(--ink); }

/* Header */
header { padding: 3.5rem 0 2.5rem; border-bottom: 3px solid var(--gold); }
header .wrap { display: grid; grid-template-columns: 9.5rem 1fr; gap: 2rem; align-items: start; }
.portrait {
  width: 9.5rem; aspect-ratio: 4 / 5; object-fit: cover;
  background: var(--rule); border-radius: 3px;
}
.portrait-fallback {
  width: 9.5rem; aspect-ratio: 4 / 5; border-radius: 3px; background: var(--rule);
  display: grid; place-items: center; font-size: 2.5rem; color: var(--muted);
}
h1 { font-size: clamp(2.25rem, 5vw, 3rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 .5rem; }
.role { margin: 0 0 1.25rem; color: var(--muted); font-style: italic; }
.contact { font-family: var(--sans); font-size: .9375rem; line-height: 1.7; margin: 0; }
.contact dt { float: left; clear: left; width: 4.5rem; color: var(--muted); }
.contact dd { margin: 0 0 0 4.5rem; }
.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; font-family: var(--sans); font-size: .875rem; }
.links a {
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px; padding: .3rem .85rem;
}
.links a:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); }

@media (max-width: 34rem) {
  header .wrap { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Sections */
h2 { font-size: 1.625rem; font-weight: 500; margin: 0 0 1.25rem; }
h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 1.75rem 0 .5rem; }
main section h2 { margin-top: 2.25rem; }
main section h2:first-child { margin-top: 0; }
p { margin: 0 0 1rem; }


/* Publications */
ol.pubs { padding-left: 2rem; margin: 0; }
ol.pubs li { padding-left: .35rem; margin-bottom: 1.1rem; }
ol.pubs li::marker { font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.title { font-weight: 600; }
.venue { font-style: italic; }
.meta { display: block; font-family: var(--sans); font-size: .8125rem; margin-top: .15rem; }
.meta a { margin-right: .75rem; }
.status { color: var(--muted); }

/* Talks & conferences: year in the margin */
.dated { list-style: none; padding: 0; margin: 0; }
.dated li { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--rule); }
.dated li:last-child { border-bottom: 1px solid var(--rule); }
.dated time, .dated .when { font-family: var(--sans); font-size: .8125rem; color: var(--muted); padding-top: .25rem; }
.dated .where { color: var(--muted); }
@media (max-width: 34rem) {
  .dated li { grid-template-columns: 1fr; gap: 0; }
}


footer { margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; }
footer .wrap span:first-child { margin-right: auto; }

/* Current page in the menu */
nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }

/* Justified paragraphs; hyphenation keeps word spacing even on narrow screens */
main p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }

/* Pages other than home get a smaller title band */
.page-title { padding: 2.75rem 0 1.75rem; border-bottom: 3px solid var(--gold); }
.page-title h1 { margin: 0; }
main.wrap { padding-top: 2.25rem; }
main section { padding: 0 0 1rem; }


h2 { line-height: 1.25; }

/* On phones the column is too narrow for justified text to look even, so it falls back to left-aligned,
   and the menu wraps onto two lines instead of scrolling sideways */
@media (max-width: 34rem) {
  main p { text-align: left; }
  nav .home { flex-basis: 100%; }
}

/* Never show a scrollbar in the menu, even if another stylesheet tries to add one */
nav, nav .wrap { overflow: visible !important; height: auto !important; max-height: none !important; scrollbar-width: none; }
nav::-webkit-scrollbar, nav *::-webkit-scrollbar { display: none; width: 0; height: 0; }
