:root {
  --mit-red: #A31F34;
  --text: #1f1f1f;
  --muted: #5a5a5a;
  --rule: #dcdcdc;
  --bg: #ffffff;
  --bg-alt: #f6f6f4;
  --link: #A31F34;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e6e3;
    --muted: #a8a6a2;
    --rule: #3a3a3a;
    --bg: #161616;
    --bg-alt: #1f1f1f;
    --link: #e57385;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 Georgia, "Times New Roman", serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

header.top {
  border-top: 6px solid var(--mit-red);
  border-bottom: 1px solid var(--rule);
}
header.top .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 14px; padding-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.site-name { font-weight: bold; color: var(--text); font-size: 18px; }
nav a {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; margin-left: 18px; color: var(--muted);
}
nav a:first-child { margin-left: 0; }
nav a:hover { color: var(--link); }

.intro {
  display: flex; gap: 32px; align-items: flex-start;
  padding: 40px 0 28px;
}
.intro img {
  width: 170px; height: auto; border-radius: 4px; flex-shrink: 0;
  border: 1px solid var(--rule);
}
h1 { font-size: 34px; margin: 0 0 6px; font-weight: normal; }
.title-lines { color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.contact { font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 15px; }
.contact a { margin-right: 16px; }

section { padding: 22px 0; border-top: 1px solid var(--rule); }
h2 {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mit-red); margin: 0 0 12px;
}
@media (prefers-color-scheme: dark) { h2 { color: var(--link); } }
p { margin: 0 0 12px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin-bottom: 10px; }
ol.pubs { padding-left: 22px; margin: 0; }
ol.pubs li { margin-bottom: 10px; }
.venue { font-style: italic; }
.meta { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags span {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px; background: var(--bg-alt); border: 1px solid var(--rule);
  padding: 2px 10px; border-radius: 12px;
}
table.awards { width: 100%; border-collapse: collapse; }
table.awards td { padding: 4px 0; vertical-align: top; }
table.awards td.yr { width: 90px; color: var(--muted); }
.more { font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 15px; }

footer {
  border-top: 1px solid var(--rule); color: var(--muted);
  font-size: 14px; padding: 20px 0 40px;
}

@media (max-width: 600px) {
  .intro { flex-direction: column; align-items: center; text-align: center; }
  .intro img { width: 150px; }
  nav a { margin-left: 12px; }
}

/* Publications page */
.page-head { padding: 36px 0 8px; }
.page-head p { color: var(--muted); }
.pub-tools {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 15px;
  margin: 8px 0 4px;
}
.pub-tools input {
  flex: 1 1 260px; min-width: 0; padding: 8px 12px; font-size: 15px;
  border: 1px solid var(--rule); border-radius: 4px;
  background: var(--bg); color: var(--text);
}
.pub-tools .count { color: var(--muted); }
.jump {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 14px;
  line-height: 1.9; margin: 10px 0 0;
}
.jump a { margin-right: 10px; }
h3.year {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; color: var(--muted); margin: 22px 0 8px;
  border-bottom: 1px solid var(--rule); padding-bottom: 4px;
}
ul.publist { list-style: none; padding: 0; margin: 0; }
ul.publist li { margin-bottom: 12px; padding-left: 1.6em; text-indent: -1.6em; }
ul.publist li a.doi {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 13px;
  margin-left: 4px;
}
.me { font-weight: bold; }

/* Software list */
ul.repos { list-style: none; padding: 0; margin: 0 0 12px; }
ul.repos li { margin-bottom: 14px; }
ul.repos .repo {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600; font-size: 16px;
}
ul.repos p { margin: 2px 0 0; }

/* By year / By topic switch */
.view-tabs {
  display: flex; gap: 0; margin: 0 0 12px;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 15px;
}
.view-tabs a {
  padding: 6px 16px; border: 1px solid var(--rule); color: var(--muted);
}
.view-tabs a:first-child { border-radius: 4px 0 0 4px; }
.view-tabs a:last-child { border-radius: 0 4px 4px 0; border-left: none; }
.view-tabs a.active { background: var(--mit-red); border-color: var(--mit-red); color: #fff; }
.view-tabs a:hover { text-decoration: none; }
h3.year .n { font-weight: normal; }
.pub-view .note { color: var(--muted); font-size: 15px; }

/* PhD students */
table.students td { padding: 5px 0; }
table.students td.yr { width: 64px; }

/* Dropdown menus */
nav.menu { display: flex; gap: 4px; flex-wrap: wrap; }
nav.menu details { position: relative; }
nav.menu summary {
  list-style: none; cursor: pointer; user-select: none;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 15px;
  color: var(--muted); padding: 6px 10px; border-radius: 4px;
}
nav.menu summary::-webkit-details-marker { display: none; }
nav.menu summary::after {
  content: ""; display: inline-block; margin-left: 6px; vertical-align: 2px;
  border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0;
}
nav.menu summary:hover, nav.menu details[open] summary { color: var(--link); background: var(--bg-alt); }
nav.menu details.current summary { color: var(--text); font-weight: 600; }
nav.menu .dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 10; min-width: 210px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); padding: 6px 0;
}
nav.menu details:last-of-type .dropdown { left: auto; right: 0; }
nav.menu .dropdown a {
  display: block; margin: 0; padding: 8px 16px; font-size: 15px; color: var(--text);
}
nav.menu .dropdown a:hover { background: var(--bg-alt); color: var(--link); text-decoration: none; }
nav.menu .dropdown a[aria-current="page"] { color: var(--link); font-weight: 600; }

/* Home page link cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
a.card {
  display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 6px;
  color: var(--text);
}
a.card:hover { border-color: var(--link); text-decoration: none; }
.card-title {
  display: block; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600; color: var(--link); margin-bottom: 4px;
}
.card-text { display: block; font-size: 15px; color: var(--muted); line-height: 1.45; }
.page-head + section { border-top: none; padding-top: 4px; }

/* CV page */
.cv-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  flex-wrap: wrap; padding: 36px 0 18px; border-bottom: 2px solid var(--mit-red);
}
.cv-head h1 { margin-bottom: 4px; }
.cv-head .title-lines { margin-bottom: 6px; }
.cv-head .contact { margin: 0; }
.cv-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 14px;
}
.cv-actions a, .cv-actions button {
  padding: 6px 12px; border: 1px solid var(--rule); border-radius: 4px;
  background: var(--bg); color: var(--link); font: inherit; cursor: pointer;
}
.cv-actions a:hover, .cv-actions button:hover { border-color: var(--link); text-decoration: none; }
section.cv-sec {
  display: grid; grid-template-columns: 170px 1fr; gap: 0 24px;
  padding: 18px 0; border-top: 1px solid var(--rule);
}
.cv-head + section.cv-sec { border-top: none; }
section.cv-sec > h2 { margin: 3px 0 10px; font-size: 13px; line-height: 1.4; }
section.cv-sec > :not(h2) { grid-column: 2; }
.cv-count { color: var(--muted); font-weight: normal; letter-spacing: 0; text-transform: none; }
.cv-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; margin-bottom: 8px; }
.cv-when {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 14px;
  color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums;
}
.cv-org { display: block; color: var(--muted); }
.cv-sec p { margin-bottom: 8px; }
.cv-more { font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 14px; }
ul.cv-list { margin: 0; padding-left: 18px; }
ul.cv-list li { margin-bottom: 4px; }

@media (max-width: 640px) {
  section.cv-sec { grid-template-columns: 1fr; }
  section.cv-sec > :not(h2) { grid-column: 1; }
  .cv-row { grid-template-columns: 78px 1fr; }
}

@media print {
  header.top, footer, .cv-actions, .cv-more { display: none !important; }
  body { font-size: 10.5pt; line-height: 1.4; background: #fff; color: #000; }
  :root { --text: #000; --muted: #444; --rule: #bbb; --link: #000; --bg: #fff; }
  a { color: #000; }
  .wrap { max-width: none; padding: 0; }
  .cv-head { padding-top: 0; }
  section.cv-sec { padding: 10px 0; }
  section.cv-sec > h2 { break-after: avoid; }
  .cv-rows a[href*="doi.org"] { display: none; }
  .cv-row { break-inside: avoid; margin-bottom: 4px; }
  @page { margin: 0.7in; }
}
ul.publist li a.pdf { font-weight: 600; }
#articles > .note { color: var(--muted); font-size: 15px; }
.page-head .compiled {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 13px;
  color: var(--muted); font-style: italic; margin-top: -4px;
}
