* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

nav.site-nav {
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

nav.site-nav ul {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1.25rem;
  font-size: 17px;
}

nav.site-nav a {
  color: #444;
  text-decoration: none;
}

nav.site-nav a:hover {
  color: #1f4e8c;
}

nav.site-nav a.active {
  color: #1f4e8c;
  font-weight: 500;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

h1 {
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
}

/* Homepage: name and subtitle on top, then photo + CV button beside the intro text */
main.home {
  max-width: 900px;
  padding-top: 3rem;
  padding-bottom: 4rem;
  color: #222;
}

.home__name {
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0 0 6px;
}

.home__title {
  font-size: 18px;
  color: #555;
  margin: 0 0 28px;
}

.home__row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

.home__aside {
  flex: 0 1 272px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home__photo {
  display: block;
  width: 100%;
  height: auto; /* required: otherwise the img's height attribute overrides aspect-ratio */
  aspect-ratio: 18 / 25;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.home__cv {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #1f4e8c;
  border-radius: 2px;
  color: #1f4e8c;
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
}

.home__cv:hover {
  background: #1f4e8c;
  color: #fff;
}

.home__bio {
  flex: 999 1 360px;
  min-width: 0;
  font-size: 17px;
  line-height: 1.6;
}

.home__bio p {
  margin: 0 0 16px;
}

.home__bio p:last-child {
  margin-bottom: 0;
}

.home__bio a {
  color: #1f4e8c;
  text-decoration-color: currentcolor;
}

.home__bio a:hover {
  color: #163a69;
  text-decoration-color: currentcolor;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e5e5e5;
}

p {
  margin-bottom: 1.1rem;
}

a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: #aaa;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: #1a1a1a;
}

h2.section-heading {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2.25rem;
  margin-bottom: 1.1rem;
  letter-spacing: 0.01em;
}

h2.section-heading:first-of-type {
  margin-top: 0.5rem;
}

.paper {
  margin-bottom: 1.75rem;
}

.paper-title {
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.2rem;
  display: block;
}

.paper-meta {
  color: #555;
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 0.4rem;
}

.paper-abstract {
  font-size: 0.95rem;
  color: #2a2a2a;
  text-align: justify;
}

.paper-links {
  font-size: 0.85rem;
  color: #555;
  margin: -0.15rem 0 0.15rem;
}

.paper-presented {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 0.6rem;
}

.paper-details {
  margin-top: 0.1rem;
}

.paper-details summary {
  display: inline-block;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555;
  list-style: none;
  line-height: 1.4;
  border-bottom: 1px solid #aaa;
  user-select: none;
}

.paper-details summary::-webkit-details-marker {
  display: none;
}

.paper-details summary::after {
  content: " \25BE";
  font-size: 0.8em;
}

.paper-details[open] summary::after {
  content: " \25B4";
}

.paper-details summary:hover {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
}

.paper-details summary:focus-visible {
  outline: 1px dotted #1a1a1a;
  outline-offset: 2px;
}

.paper-details > .paper-abstract,
.paper-details > .paper-body {
  margin-top: 0.6rem;
}

.paper-details .paper-abstract {
  margin-bottom: 0.4rem;
}

.paper-body {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.paper-figure {
  flex: 0 0 240px;
  margin: 0;
}

.paper-figure a {
  display: block;
  text-decoration: none;
}

.paper-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.paper-figure figcaption {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.3rem;
  line-height: 1.45;
}

.teaching-entry {
  margin-bottom: 1.5rem;
}

.teaching-course {
  font-weight: 600;
  font-size: 1.02rem;
}

.teaching-meta {
  color: #555;
  font-size: 0.95rem;
  font-style: italic;
  margin: 0.15rem 0 0.35rem;
}

.teaching-desc {
  font-size: 0.95rem;
  color: #2a2a2a;
}

.eval-note {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.eval {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid #e5e5e5;
}

.eval blockquote {
  font-size: 0.98rem;
  color: #2a2a2a;
}

.eval figcaption {
  color: #555;
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.2rem;
}

@media (max-width: 600px) {
  nav.site-nav ul {
    padding: 0.9rem 1.25rem;
  }
  main {
    padding: 2.25rem 1.25rem 4rem;
  }
  h1 {
    font-size: 1.55rem;
  }
  .page-title {
    font-size: 1.45rem;
  }
  .paper-body {
    flex-direction: column;
  }
  .paper-figure {
    flex-basis: auto;
    max-width: 320px;
  }
}

@media (max-width: 640px) {
  main.home {
    padding-top: 2rem;
  }
  .home__name {
    font-size: 34px;
  }
  .home__aside {
    flex-basis: 100%;
    max-width: 272px;
    margin: 0 auto;
  }
}
