:root {
  --text: #333;
  --muted: #555;
  --link: #2980b9;
  --heading: #2c3e50;
  --rule-blue: #3498db;
  --teaching-blue: #002878;
  --light-rule: #e2e5e8;
  --font-sans: Arial, "Helvetica Neue", Helvetica, "KaiTi", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #fff;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid rgba(41, 128, 185, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 6px 10px;
  transform: translateY(-160%);
  color: #fff;
  background: #222;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.header-inner,
.footer-inner {
  width: min(calc(100% - 40px), 920px);
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.site-title {
  margin: 0;
  font: inherit;
}

.site-name {
  color: #222;
  font-family: var(--font-sans);
  font-size: 1.4em;
  font-weight: 700;
  white-space: nowrap;
}

.site-name:hover,
.site-name:focus-visible {
  text-decoration: none;
}

nav {
  display: flex;
  align-items: stretch;
  gap: 28px;
}

.nav-link {
  padding: 21px 0 18px;
  border-bottom: 3px solid transparent;
  color: #555;
  font-size: 15px;
  line-height: 1.6;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  border-bottom-color: var(--teaching-blue);
  color: var(--teaching-blue);
  text-decoration: none;
}

/* Home: original information order and uncropped image. */

.home-main {
  width: min(calc(100% - 40px), 1155px);
  margin: 0 auto;
  padding: 32px 0 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 57.25%);
  gap: 42px;
  align-items: start;
}

.home-info {
  min-width: 0;
}

.home-info p,
.home-info address {
  margin: 0 0 20px;
  font-style: normal;
  line-height: 1.65;
}

.address-line {
  display: inline-block;
  padding-left: 64px;
}

.profile-links a {
  margin-right: 15px;
}

.featured-photo {
  width: min(100%, 661px);
  margin: 0;
  justify-self: end;
}

.featured-photo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.featured-photo figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Paper-list typography and spacing. */

.content-container {
  width: min(calc(100% - 40px), 920px);
  margin: 0 auto;
  padding-bottom: 50px;
}

.section-title {
  margin: 30px 0 0.83em;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--rule-blue);
  color: var(--heading);
  font-family: var(--font-sans);
  font-size: 1.4em;
  font-variant: small-caps;
  line-height: 1.6;
}

.paper-list {
  margin: 0;
  padding-left: 0;
  list-style-type: none;
}

.paper-item {
  position: relative;
  margin-bottom: 14px;
  padding-left: 2.4rem;
}

.paper-item::before {
  position: absolute;
  top: 0;
  left: calc(2.4rem - 19px);
  color: var(--text);
  content: "•";
}

.paper-list.publication-list {
  padding-left: 2.4rem;
  list-style: decimal outside;
}

.publication-list .paper-item {
  padding-left: 0;
}

.publication-list .paper-item::before {
  content: none;
}

.publication-list .paper-item::marker {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.paper-title {
  line-height: 1.5;
}

.paper-details {
  margin-top: 1px;
  margin-left: 0;
  font-size: 0.95em;
  line-height: 1.45;
}

.paper-inline-resources {
  color: var(--muted);
  font-size: 0.95em;
  line-height: 1.5;
}

.github-resource-link {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  white-space: nowrap;
}

.github-resource-icon {
  display: block;
  width: 0.9em;
  height: 0.9em;
  flex: 0 0 auto;
}

.publications-page .paper-details {
  margin-left: 0;
}

/* Teaching layout with course codes and descriptions. */

.teaching-layout {
  font-family: var(--font-sans);
}

.teaching-page {
  flex: 1 0 auto;
  width: min(calc(100% - 40px), 920px);
  margin: 0 auto;
  padding: 30px 0 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
}

.teaching-university {
  flex: 0 0 auto;
}

.teaching-section {
  margin: 0 0 0.73em;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--rule-blue);
  color: var(--heading);
  font-family: inherit;
  font-size: 1.4em;
  font-weight: 700;
  font-variant: small-caps;
  line-height: 1.6;
}

.university-years {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  font-variant: normal;
  line-height: 1.3;
  white-space: nowrap;
}

.teaching-course {
  display: grid;
  grid-template-columns: calc(8.5em + 1.2rem) minmax(0, 1fr);
  column-gap: 1em;
  align-items: start;
  padding: 0.14em 0 0.16em 1.2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.055);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

.teaching-code {
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 700;
  white-space: nowrap;
}

.teaching-course-title {
  color: #202020;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.teaching-terms {
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9em;
  line-height: 1.25;
}

footer {
  margin-top: auto;
  border-top: 1px solid var(--light-rule);
}

.teaching-layout > .site-header,
.teaching-layout > footer {
  flex: 0 0 auto;
}

.teaching-layout > footer {
  margin-top: 0;
}

.footer-inner {
  padding: 18px 0;
  color: #777;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 900px) {
  .home-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .featured-photo {
    justify-self: start;
  }
}

@media (max-width: 650px) {
  .header-inner,
  .footer-inner,
  .home-main,
  .content-container,
  .teaching-page {
    width: calc(100% - 30px);
  }

  .header-inner {
    padding-top: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    gap: 22px;
  }

  .nav-link {
    padding: 7px 0 9px;
    white-space: nowrap;
  }

  .home-main {
    padding-top: 32px;
  }

  .address-line {
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .teaching-course {
    grid-template-columns: calc(5.25em + 1.2rem) minmax(0, 1fr);
    column-gap: 0.65em;
    row-gap: 0;
    text-align: left;
  }

  .teaching-code {
    font-size: 16px;
  }
}
