:root {
  --background: #fbfaf7;
  --text: #252525;
  --muted: #66615b;
  --link: #1f5f8b;
  --line: #ded6c8;
  --accent-orange: #bf6a30;
  --accent-blue: #1f5f8b;
  --abstract-bg: #f6f4ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.page {
  max-width: 930px;
  margin: 0 auto;
  padding: 46px 30px 80px;
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 42px;
  align-items: center;
  margin-bottom: 48px;
}

.intro-text {
  max-width: 660px;
}

h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
  font-size: 19px;
}

.profile {
  width: 185px;
  height: 185px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: white;
}

h2 {
  margin-top: 46px;
  margin-bottom: 30px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
}

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

a:hover {
  text-decoration: underline;
}

section > p {
  margin: 0 0 26px 0;
  max-width: 820px;
}

/* Research entries */

.research-item {
  position: relative;
  margin-bottom: 36px;
  padding-left: 26px;
}

.research-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    var(--accent-orange) 0%,
    var(--accent-orange) 35%,
    var(--accent-blue) 100%
  );
  opacity: 0.85;
}

.research-item h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 700;
}

.research-meta {
  margin: 5px 0 0;
  font-size: 17px;
  line-height: 1.4;
}

.research-links {
  margin: 3px 0 0;
  font-size: 17px;
  line-height: 1.4;
}

.research-item details {
  margin-top: 8px;
}

.research-item summary {
  display: inline-block;
  cursor: pointer;
  color: var(--link);
  font-size: 16px;
  font-weight: 600;
}

.research-item summary:hover {
  text-decoration: underline;
}

.research-item details[open] summary {
  margin-bottom: 8px;
}

.research-item details p {
  margin: 8px 0 0;
  padding: 12px 16px;
  background: var(--abstract-bg);
  border-left: 3px solid var(--line);
  font-size: 15.5px;
  line-height: 1.55;
}

/* Olympiad problems */

.problem-item {
  margin: 0 0 34px 0;
  padding: 0;
  width: 100%;
}

.problem-item h3 {
  margin: 0 0 8px 0;
  padding: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

.problem-source {
  color: var(--link);
}

.problem-statement {
  margin: 0;
  padding: 12px 15px;
  width: 100%;
  background: var(--abstract-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  font-size: 16.5px;
  line-height: 1.58;
}

.problem-statement p {
  margin: 0 0 8px 0;
}

.problem-statement p:last-child {
  margin-bottom: 0;
}

.problem-statement ul {
  margin: 10px 0 10px 24px;
  padding: 0;
}

.problem-statement li {
  margin-bottom: 6px;
}

.problem-figure {
  margin: 16px 0 12px 0;
  padding: 0;
  width: 100%;
  text-align: center;
}

.problem-figure img {
  display: block;
  max-width: min(100%, 700px);
  max-height: 560px;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.problem-links {
  margin: 4px 0 0 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.4;
}

/* Simpler entries for notes */

.list-item {
  margin-bottom: 26px;
}

.list-item h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

.list-item p {
  margin: 4px 0 0;
}

/* Mobile */

@media (max-width: 720px) {
  body {
    font-size: 16.5px;
  }

  .page {
    padding: 32px 22px 70px;
  }

  .intro {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 24px;
  }

  h1 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 18px;
  }

  h2 {
    font-size: 26px;
  }

  .profile {
    width: 150px;
    height: 150px;
  }

  .research-item {
    padding-left: 20px;
    margin-bottom: 32px;
  }

  .research-item::before {
    width: 3px;
  }

  .research-item h3 {
    font-size: 19px;
  }

  .research-meta,
  .research-links {
    font-size: 16.5px;
  }

  .research-item summary {
    font-size: 16px;
  }

  .research-item details p {
    font-size: 15.5px;
  }

  .problem-item h3 {
    font-size: 19px;
  }

  .problem-statement {
    font-size: 16px;
    padding: 10px 12px;
  }

  .problem-figure img {
    max-width: 100%;
    max-height: none;
  }

  .list-item h3 {
    font-size: 19px;
  }
}
