:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #555555;
  --line: #d9d9d9;
  --link: #1d4f91;
  --link-hover: #163d70;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.06em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 0.1em;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3 {
  color: #111111;
  font-family: "Source Sans 3", Arial, sans-serif;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.15;
}

h2 {
  margin: 0 0 1.2rem;
  font-size: 1.32rem;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
  font-size: 0.98rem;
}

.site-nav a[aria-current="page"] {
  color: #111111;
  font-weight: 600;
  text-decoration: none;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding-top: 2rem;
}

.large-photo {
  margin: 0;
}

.large-photo img {
  width: 100%;
  border: 1px solid var(--line);
}

.profile-details {
  max-width: 40rem;
}

.profile-details section,
.subpage section {
  margin-bottom: 2.5rem;
}

p,
li {
  color: var(--muted);
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0;
  padding-left: 1.15rem;
}

.link-list li,
.plain-list li {
  margin-bottom: 0.45rem;
}

.subpage {
  max-width: 54rem;
  padding-top: 2rem;
}

.refined-research {
  max-width: 50rem;
}

.paper-stack,
.course-list {
  display: grid;
}

.paper-row,
.paper-static-row,
.course-row {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0;
}

.paper-row:last-child,
.paper-static-row:last-child,
.course-row:last-child {
  border-bottom: 1px solid var(--line);
}

.paper-row summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

.paper-row summary::marker {
  content: "";
}

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

.paper-head,
.static-paper-head {
  display: block;
}

.paper-title {
  display: block;
  color: var(--link);
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.45;
}

.static-title {
  color: #222222;
}

.paper-meta,
.course-term,
.course-links {
  display: block;
  color: var(--muted);
  margin-top: 0.18rem;
}

.paper-abstract-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  color: var(--muted);
}

.paper-abstract-toggle::before {
  content: ">";
  color: #666666;
  line-height: 1;
}

.paper-row[open] .paper-abstract-toggle::before {
  content: "v";
}

.abstract {
  padding-top: 0.9rem;
  max-width: 44rem;
}

.abstract p,
.paper-abstract {
  margin: 0;
  max-width: 44rem;
  color: var(--muted);
}

.teaching-page {
  max-width: 52rem;
}

.course-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
}

.course-row p {
  margin-bottom: 0;
}

.course-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.course-term {
  min-width: 9rem;
  text-align: right;
}

.cv-page {
  max-width: 52rem;
}

.cv-actions {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 800px) {
  .site-header,
  .profile-layout,
  .course-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: start;
  }

  .subpage,
  .profile-details,
  .refined-research,
  .cv-page,
  .teaching-page {
    max-width: none;
  }

  .course-term {
    min-width: 0;
    text-align: left;
  }
}
