:root {
  --paper: #ffffff;
  --ink: #18212a;
  --muted: #5f6973;
  --link: #1c5d96;
  --rule: #d7e0e7;
  --soft-rule: #e8edf1;
  --page-width: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.layout {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(54px, 8vw, 92px);
  width: min(calc(100% - 56px), var(--page-width));
  margin: 0 auto;
  padding: 62px 0 48px;
}

.profile {
  position: sticky;
  top: 62px;
  align-self: start;
}

.profile h1 {
  margin: 0 0 18px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.portrait {
  width: 200px;
  margin: 0 0 11px;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--soft-rule);
  background: #f3f5f7;
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  margin: 16px 0 0;
  padding-top: 0;
  font-size: 16px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  color: var(--ink);
  line-height: 1;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--link);
}

.contact-link svg {
  display: block;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.contact-link span {
  display: block;
  line-height: 17px;
}

.content {
  min-width: 0;
  padding-top: 3px;
}

.content > .bio {
  max-width: 650px;
  margin-bottom: 46px;
}

p {
  margin: 0 0 14px;
}

.bio p {
  font-size: 17px;
  line-height: 1.66;
}

.content-section {
  margin-top: 37px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 24px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.paper {
  margin-bottom: 30px;
}

.paper h3,
.writing-entry h3 {
  max-width: 640px;
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
}

.paper-title-link {
  color: var(--link);
}

details {
  max-width: 650px;
  margin-top: 2px;
}

summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: fit-content;
  padding: 2px 8px 3px;
  border: 1px solid #d3dbe2;
  border-radius: 4px;
  background: #fff;
  color: #53606b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
  list-style: none;
}

summary:hover,
summary:focus-visible {
  border-color: #aebdca;
  color: var(--link);
}

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

summary::before {
  content: "+";
  color: var(--muted);
}

details[open] summary::before {
  content: "−";
}

details p {
  margin: 12px 0 0;
  padding: 15px 18px;
  border-left: 2px solid var(--rule);
  background: rgba(28, 93, 150, 0.035);
  color: #3e4953;
  font-size: 14px;
  line-height: 1.62;
}

.writing-entry {
  max-width: 650px;
}

.site-footer {
  width: min(calc(100% - 56px), var(--page-width));
  margin: 0 auto;
  padding: 16px 0 34px;
  border-top: 1px solid var(--soft-rule);
  color: #8a9299;
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 38px;
    width: min(calc(100% - 38px), 620px);
    padding: 34px 0 52px;
  }

  .profile {
    position: static;
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 23px;
  }

  .profile h1 {
    grid-column: 2;
    margin-top: 4px;
    font-size: 27px;
  }

  .portrait {
    grid-row: 1 / span 2;
    width: 145px;
    margin: 0;
  }

  .profile-links {
    grid-column: 2;
    align-self: start;
    justify-content: flex-start;
    width: max-content;
    margin: 16px 0 0;
  }

  .content {
    padding-top: 0;
  }

  .content > .bio {
    margin-bottom: 38px;
  }

  .site-footer {
    width: min(calc(100% - 38px), 620px);
  }
}

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

  .profile {
    grid-template-columns: 112px minmax(0, 1fr);
    column-gap: 18px;
  }

  .portrait {
    width: 112px;
  }

  .profile h1 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
