:root {
  --bg: #161616;
  --text: #e6e6e6;
  --muted: #9a9a9a;
  --link: #e8b84b;
  --rule: #333333;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666666;
  --link: #8a6100;
  --rule: #e0e0e0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 1040px;
  padding: 0 1.25rem 3rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

a:hover {
  text-decoration: underline;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

#theme-toggle {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.intro-text {
  flex: 1;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
  font-weight: normal;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
}

.portrait {
  display: block;
  width: 340px;
  flex-shrink: 0;
  /* Drop the photo by the h1's half-leading + cap gap so its top edge lines up
     with the top of the "B", not with the invisible top of the h1 line box. */
  margin: 0.875rem 0 0;
}

.portrait-link {
  display: block;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.portrait figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.3rem;
  font-size: 1.35rem;
  font-weight: normal;
  border-bottom: 1px solid var(--rule);
}

.news-list,
.teaching-list {
  list-style: none;
  padding: 0;
}

.news-list li,
.teaching-list li {
  margin-bottom: 0.6rem;
}

.date {
  display: inline-block;
  min-width: 6rem;
  color: var(--muted);
  font-style: italic;
}

.pub-list {
  padding-left: 1.25rem;
}

.pub-list li {
  margin-bottom: 1rem;
}

.pub-title {
  font-weight: bold;
}

.venue {
  color: var(--muted);
  font-style: italic;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 600px) {
  .intro {
    flex-direction: column-reverse;
  }

  .portrait {
    width: 100%;
    /* Stacked above the text here, so the cap-height nudge is meaningless. */
    margin-top: 0;
  }
}
