:root {
  --text: #111;
  --muted: #555;
  --line: #ddd;
  --link: #0645ad;
  --max-width: 820px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 20px 18px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

nav a:hover {
  color: var(--link);
  text-decoration: underline;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 46px 20px 32px;
}

.intro {
  padding-bottom: 18px;
}

.intro-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  grid-template-areas: "text portrait";
  gap: 36px;
  align-items: start;
}

.intro-text {
  grid-area: text;
  min-width: 0;
}

.intro-portrait {
  grid-area: portrait;
  display: block;
  width: 216px;
  max-width: 100%;
  height: auto;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 4px;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #d2d7df;
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.profile-button:hover {
  border-color: #9cabc2;
  color: var(--link);
  background: #f5f7fa;
}

.profile-button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.profile-icon {
  flex: 0 0 18px;
}

.profile-button-linkedin .profile-icon {
  color: #0a66c2;
}

.welcome {
  margin-bottom: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 400;
}

.subtitle {
  margin-bottom: 28px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

section:first-child {
  border-top: 0;
}

h2 {
  margin-bottom: 18px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 19px;
  font-weight: 700;
}

h3 {
  margin-bottom: 4px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
}

.paper {
  margin-bottom: 28px;
}

.paper:last-child {
  margin-bottom: 0;
}

.paper-meta,
.fields {
  color: var(--muted);
}

.paper-meta {
  margin-bottom: 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.paper-resources {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  column-gap: 20px;
  align-items: baseline;
}

.paper-abstract {
  display: contents;
}

.paper-abstract::details-content {
  display: contents;
}

.paper-abstract summary,
.paper-draft,
.paper-code {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.paper-abstract summary {
  grid-area: 1 / 1;
  display: block;
  list-style: none;
  width: fit-content;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

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

.paper-abstract summary:hover {
  text-decoration-thickness: 2px;
}

.paper-abstract summary:focus-visible,
.paper-draft:focus-visible,
.paper-code:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}

.paper-abstract p {
  grid-area: 2 / 1 / 3 / -1;
  min-width: 0;
  margin: 14px 0 0;
}

.paper-abstract:not([open]) p {
  display: none;
}

.paper-draft,
.paper-code {
  grid-area: 1 / 2;
  justify-self: start;
}

.paper-resources.has-draft .paper-code {
  grid-column: 3;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 24px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.links a {
  white-space: nowrap;
}

.subheading {
  margin-top: 10px;
}

ul {
  margin-top: -6px;
  padding-left: 24px;
}

li {
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .site-header {
    display: block;
  }

  nav {
    margin-top: 12px;
  }

  .page {
    padding-top: 34px;
  }

  .intro-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "portrait" "text";
    gap: 24px;
  }

  .intro-portrait {
    width: 180px;
  }

  h1 {
    font-size: 32px;
  }
}
