:root {
  --text: #1c1b19;
  --muted: #68645f;
  --rule: #ded8cf;
  --soft-rule: #ece7df;
  --paper: #fffdf9;
  --link: #428bca;
  --link-hover: #2a6496;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--text);
  background: var(--paper);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body {
  margin: 0 auto;
  max-width: 940px;
  min-height: 100vh;
  padding: 0 28px;
}

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

a:hover,
a:focus {
  color: var(--link-hover);
}

.site-header {
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  margin-bottom: 54px;
  padding: 30px 0 14px;
}

.site-name {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

main {
  margin: 0 auto;
}

.about {
  align-items: stretch;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.about-copy {
  max-width: 32rem;
}

.portrait {
  height: auto;
  margin: 6px 0 0;
}

.portrait img {
  display: block;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: 48% center;
  width: 100%;
}

h1,
h2 {
  line-height: 1.18;
  margin: 0;
}

h1 {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 18px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 12px;
}

p {
  margin: 0 0 18px;
}

.about-copy p {
  font-size: 1rem;
  line-height: 1.62;
  max-width: 35rem;
}

.link-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 10px;
  margin-top: 26px;
}

.link-group a {
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.9rem;
  gap: 6px;
  line-height: 1;
  padding: 7px 12px;
  text-decoration: none;
}

.link-group a:hover,
.link-group a:focus {
  border-color: var(--link);
  color: var(--link);
}

.link-icon {
  display: block;
  fill: currentColor;
  flex: 0 0 auto;
  height: 15px;
  width: 15px;
}

.link-icon-bluesky {
  height: 17px;
  width: 17px;
}

.email {
  font-size: 0.98rem;
  margin: 8px 0 0;
}

.media-section {
  border-top: 1px solid var(--rule);
  margin-top: 58px;
  padding-top: 34px;
}

.media-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-item {
  border: 1px solid var(--rule);
  color: var(--text);
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  min-height: 116px;
  text-decoration: none;
}

.media-item:hover,
.media-item:focus {
  border-color: #c9bdb0;
  color: var(--text);
}

.media-item img {
  height: 100%;
  min-height: 116px;
  object-fit: cover;
  width: 100%;
}

.media-item span {
  align-self: center;
  display: grid;
  gap: 5px;
  padding: 14px 15px;
}

.media-item strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.media-item em {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: normal;
  line-height: 1.35;
}

.pubs-page h1 {
  margin-bottom: 36px;
}

.pub-section {
  margin-bottom: 32px;
}

.pub-section h2 {
  border-bottom: 1px solid var(--soft-rule);
  padding-bottom: 6px;
}

.pub-list {
  font-size: 1rem;
  line-height: 1.55;
  list-style-position: outside;
  margin: 13px 0 0;
  padding-left: 21px;
}

.pub-list li {
  margin-bottom: 13px;
  padding-left: 2px;
}

.pub-list a {
  font-weight: 400;
}

.repo-link {
  font-weight: 400 !important;
  margin-left: 4px;
  white-space: nowrap;
}

sup {
  line-height: 0;
}

.author-note,
.pdf-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  body {
    padding: 0 20px;
  }

  .site-header {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 36px;
  }

  .about {
    gap: 18px;
    grid-template-columns: clamp(96px, 28vw, 210px) minmax(0, 1fr);
  }

  .portrait {
    max-width: none;
  }

  .portrait img {
    aspect-ratio: 4 / 5;
    height: auto;
    min-height: 0;
  }

  h1 {
    font-size: 2rem;
  }

  .media-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  html {
    font-size: 16px;
  }

  body {
    padding: 0 18px;
  }

  .site-header {
    display: block;
    padding-top: 24px;
  }

  .site-nav {
    margin-top: 8px;
  }

  .media-item {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}
