* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #222;
  background: #fff;
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  font-size: clamp(1.125rem, calc(1rem + 0.3vw), 1.3125rem);
  line-height: 1.65;
}

.page {
  width: min(90%, 68rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 3rem) 0 4rem;
}

a {
  color: #4b3c94;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #4b3c94;
  outline-offset: 4px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.4rem 0 1.1rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  border-bottom: 1px solid #e3e0ea;
}

nav a {
  padding: 0.3rem 1.05rem;
  border: 1px solid #d6d0e8;
  border-radius: 6px;
  color: #4b3c94;
}

nav a:hover {
  background: #f3f0fa;
  border-color: #b8afd9;
  text-decoration: none;
}

nav a[aria-current="page"] {
  background: #232136;
  border-color: #232136;
  color: #fff;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 2.4vw, 3.2rem);
  font-weight: normal;
  line-height: 1.25;
  color: #232136;
}

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.2em;
  font-weight: normal;
  color: #232136;
}

p {
  margin: 0 0 1rem;
}

hr {
  margin: 1.1rem 0 1.4rem;
  border: 0;
  border-top: 1px solid #e3e0ea;
}

.muted {
  color: #666;
}

.math {
  font-family: "Cambria Math", "STIX Two Math", "Noto Sans Math", serif;
}

/* Home: text with the photo on the right */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(17.5rem, 26vw, 21rem);
  grid-template-areas: "heading photo" "text photo";
  align-items: start;
  column-gap: clamp(2rem, 4.5vw, 3.5rem);
}

.home-heading {
  grid-area: heading;
  max-width: 68ch;
}

.home-text {
  grid-area: text;
  min-width: 0;
  max-width: 68ch;
}

.photo {
  grid-area: photo;
  width: 100%;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 3px 16px rgb(35 33 54 / 7%);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  transform: scale(1.3);
  transform-origin: center bottom;
}

.contact {
  margin-top: 1.5rem;
  overflow-wrap: anywhere;
  scroll-margin-top: 2rem;
}

/* Papers and teaching */
.list {
  margin: 0.75rem 0 0;
  padding-left: 1.5rem;
  max-width: 72ch;
  line-height: 1.55;
}

.list li {
  margin-bottom: 1.3rem;
}

.list .muted {
  font-size: 0.93em;
}

@media (max-width: 840px) {
  body {
    font-size: 1.125rem;
  }

  .page {
    width: calc(100% - 2.5rem);
  }

  .home {
    grid-template-columns: 1fr;
    grid-template-areas: "heading" "photo" "text";
  }

  .photo {
    width: min(100%, 18rem);
    margin-bottom: 1.5rem;
  }

  nav {
    gap: 0.5rem;
  }

  nav a {
    padding: 0.3rem 0.85rem;
  }
}
