:root {
  --background: #ffffff;
  --text: #171717;
  --muted: #666666;
  --link: #087a2c;
  --link-hover: #04571e;
  --line: #dddddd;
  --sidebar-width: 245px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Raleway", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

/* The header is full-width on every page. The navigation itself is centered
   relative to the browser viewport, not relative to the content columns. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  width: min(1200px, calc(100% - 3rem));
  min-height: 64px;
  margin: 0 auto;
  padding: 0 0 0 calc(230px + 2.2rem);
  gap: 2.6rem;
  white-space: nowrap;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  color: #2e2e2e;
  font-family: "Work Sans", Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.active {
  color: var(--link);
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--link);
}

.page-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 2.2rem;
  width: min(1200px, calc(100% - 3rem));
  margin: 2rem auto 4rem;
}

.sidebar {
  position: sticky;
  top: 6.2rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 3rem;
  text-align: center;
}

.profile-link {
  display: block;
  text-decoration: none;
}

.profile-frame {
  position: relative;
  width: 202px;
  height: 202px;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 27%;
  background: #eeeeee;
}

.profile-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #777777;
  font-family: "Work Sans", sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.05em;
}

.profile-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.name {
  margin: 0 0 0.35rem;
  font-family: "Work Sans", Arial, sans-serif;
  font-size: 1.32rem;
  font-weight: 500;
}

.profile-details {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

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

.profile-details a:hover,
.profile-details a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

.content {
  min-width: 0;
  padding-top: 0.35rem;
}

.content h1,
.content h2 {
  font-family: "Work Sans", Arial, sans-serif;
  font-size: 1.32rem;
  font-weight: 500;
}

.content h1 {
  margin: 0 0 1rem;
}

.content h2 {
  margin: 2.35rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
}

.first-group h2 {
  margin-top: 0;
}

.content p {
  margin: 0 0 1rem;
}

.content a,
.abstract-toggle {
  color: var(--link);
  text-decoration: none;
}

.content a:hover,
.content a:focus,
.abstract-toggle:hover,
.abstract-toggle:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

.semi-bold,
.paper-title {
  font-weight: 600;
}

.paper {
  margin-bottom: 0.8rem;
}

/* Use the same compact line spacing for Working Papers,
   Work in Progress, and Publications. These selectors are deliberately
   more specific than `.content p`, so browser-default paragraph spacing
   cannot reappear. */
.content .paper-title-line,
.content .paper-author-line,
.content .paper-status-line,
.content .publication-info,
.wip-item,
.wip-item .paper-title,
.wip-item .paper-author-line {
  line-height: 1.48;
}

.content .paper-title-line,
.content .paper-author-line,
.content .paper-status-line,
.content .publication-info {
  margin: 0;
}

.content .paper-author-line,
.content .paper-status-line,
.content .publication-info {
  margin-top: 0;
}

.paper-author-line {
  font-size: 0.95rem;
}

.paper-status-line,
.publication-info {
  color: var(--muted);
  font-size: 0.94rem;
}

.title-link {
  color: var(--text) !important;
  text-decoration: none !important;
}

.title-link:hover,
.title-link:focus {
  color: var(--text) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.17em;
}

.abstract-toggle {
  display: inline;
  margin-left: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.solo-abstract {
  margin-left: 0;
}

.paper-status-line a,
.publication-info a {
  margin-left: 0.12rem;
}

.abstract-content {
  display: none;
  max-width: 820px;
  margin-top: 0.55rem;
  color: #3e3e3e;
  font-size: 0.89rem;
  line-height: 1.62;
  text-align: justify;
}

.abstract-content.open {
  display: block;
}

.abstract-content p {
  margin-bottom: 0;
}

.wip-item {
  margin-bottom: 0.8rem;
}

.wip-item .paper-author-line {
  color: var(--muted);
}

.publication {
  margin-bottom: 0.8rem;
}

.presentation-group,
.teaching-group {
  margin-bottom: 2rem;
}

.presentation-group h2,
.teaching-group h2 {
  margin-top: 1.9rem;
  font-size: 1.06rem;
  font-weight: 600;
}

.first-group h2 {
  margin-top: 0;
}

.content ul {
  margin: 0.2rem 0 0;
  padding-left: 1.25rem;
}

.content li {
  margin-bottom: 0.3rem;
}

@media (max-width: 780px) {
  .site-nav {
    width: min(680px, calc(100% - 2.2rem));
    min-height: 58px;
    margin: 0 auto;
    padding: 0;
    gap: 1.3rem;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    min-height: 58px;
    font-size: 0.9rem;
  }

  .page-shell {
    grid-template-columns: 1fr;
    width: min(680px, calc(100% - 2.2rem));
    gap: 1.2rem;
    margin-top: 0.7rem;
  }

  .sidebar {
    position: relative;
    top: auto;
    padding: 1rem 0 1.25rem;
    border-bottom: 1px solid var(--line);
  }

  .profile-frame {
    width: 118px;
    height: 118px;
    margin-bottom: 0.65rem;
    border-radius: 24%;
  }

  .content {
    padding-top: 0;
  }
}

@media (max-width: 470px) {
  body {
    font-size: 15px;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.85rem;
  }

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

  .paper-author-line,
  .paper-status-line,
  .publication-info {
    font-size: 0.91rem;
  }
}
