/* =========================================================
   Global controls
   ========================================================= */

:root {
  --topbar-height: 62px;

  --home-hero-height: 260px;
  --research-hero-height: 180px;
  --title-photo-width: 1120px;

  --home-content-width: 1080px;
  --research-content-width: 980px;
  --code-content-width: 980px;
  --research-side-margin: 240px;

  --dark-navbar: #1f1f1f;
  --link-blue: #00728a;
  --heading-blue: #1f78a6;
}

/* =========================================================
   General
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Lato", Arial, sans-serif;
  color: #222;
  background: #fff;
  font-size: 18px;
  line-height: 1.65;
}

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

a:hover {
  color: #00a0c6;
}

/* =========================================================
   Top navigation bar
   ========================================================= */

.topbar {
  height: var(--topbar-height);
  background: #fff;
  color: #111;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;
}

.topbar-transparent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 20;
}

.site-name {
  color: #111;
  font-size: 22px;
  font-weight: 300;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: #111;
  text-decoration: none;
  font-size: 17px;
  font-weight: 300;
}

.nav-links a.active {
  color: #37b6d9;
}

.nav-links a.active-white {
  color: #111;
  font-weight: 400;
}

.nav-links a:hover {
  color: #37b6d9;
}

/* =========================================================
   Home page hero
   Image is set directly in index.html
   ========================================================= */

.hero {
  height: var(--home-hero-height);

  background-size: cover;
  background-position: center 50%;

  display: flex;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  margin: 0;
  color: white;
  font-weight: 300;
  font-size: 66px;
  letter-spacing: 2px;
}

/* =========================================================
   Home page content
   ========================================================= */

.home-content {
  font-family: "Source Sans Pro", Arial, sans-serif;
  font-weight: 300;
  color: #383838;
  background: white;
  min-height: 720px;

  padding-top: 58px;
  padding-bottom: 90px;
}

.home-wrapper {
  max-width: var(--home-content-width);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  column-gap: 72px;
  align-items: start;

  padding: 0 24px;
}

.photo-column {
  width: 100%;
  padding-top: 8px;
}

.profile-photo-frame {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #d8e3e8;
  background: #f4f8fa;
  overflow: hidden;
}

.profile-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 37% 10%;
  transform: scale(1.15);
  transform-origin: center;
}

.profile-name {
  margin: 22px 0 4px 0;
  color: #111;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

.profile-role,
.profile-affiliation {
  margin: 0 0 4px 0;
  color: #555;
  font-size: 16px;
  line-height: 1.4;
}

.profile-links {
  margin: 18px 0 0 0;
  color: #888;
  font-size: 16px;
  line-height: 1.65;
}

.profile-links a {
  display: block;
  width: fit-content;
  margin-bottom: 3px;
  white-space: nowrap;
}

.bio-column {
  max-width: 760px;
  padding-top: 0;
}

.bio-column h2 {
  margin: 0 0 24px 0;
  color: #111;
  font-size: 31px;
  font-weight: 600;
  line-height: 1.25;
}

.bio-column h3 {
  margin: 34px 0 10px 0;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
}

.bio-column p {
  margin: 0 0 18px 0;
  font-size: 18px;
  line-height: 1.7;
}

.research-summary {
  text-align: justify;
  text-align-last: left;
}

.contact-block {
  margin-top: 34px;
}

.contact-block h3 {
  margin-top: 46px;
  margin-bottom: 8px;
}

.contact-block p {
  margin-bottom: 8px;
  line-height: 1.48;
}

.contact-block .cv-line {
  margin-bottom: 22px;
}

.quick-links a {
  margin-right: 4px;
}

/* =========================================================
   Research page hero
   Image is set directly in research.html
   ========================================================= */

.research-hero {
  height: var(--research-hero-height);

  background-size: cover;
  background-position: center center;

  display: flex;
  justify-content: center;
  align-items: center;
}

.research-hero h1 {
  margin: 0;
  color: white;
  font-weight: 300;
  font-size: 66px;
  letter-spacing: 2px;
}

/* =========================================================
   Research page content
   ========================================================= */

.research-content {
  font-family: "Source Sans Pro", Arial, sans-serif;
  font-weight: 300;
  color: #383838;
  background: white;
  padding-top: 52px;
  padding-bottom: 100px;
  min-height: 650px;
}

.research-wrapper {
  width: min(
    var(--research-content-width),
    calc(100vw - 96px)
  );

  margin: 0 auto;
}

.research-wrapper h2 {
  margin: 0 0 30px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #dbe8ee;
  color: #176f8c;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.7px;
}

.research-wrapper h2.section-heading-secondary {
  margin-top: 72px;
}

.paper {
  margin-bottom: 25px;
}

.paper-title {
  margin: 0 0 6px 0;
  font-size: 14pt;
  line-height: 1.45;
}

.paper-title strong {
  color: #1f2f38;
  font-weight: 600;
}

.draft-note {
  margin-left: 8px;
  color: #666;
  font-size: 11pt;
  font-weight: 400;
  white-space: nowrap;
}

.paper-link {
  display: inline-block;
  font-size: 12pt;
  margin-left: 8px;
  white-space: nowrap;
}

.paper-link + .paper-link {
  margin-left: 4px;
}

.paper-note {
  margin: 0 0 10px 0;
  color: #4c4c4c;
  font-size: 12pt;
  line-height: 1.45;
}

.coauthor-link {
  color: #111;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.coauthor-link:hover {
  color: #111;
}

.paper-status {
  margin: 0 0 10px 0;
  color: #4c4c4c;
  font-size: 12pt;
  line-height: 1.45;
}

.journal-name {
  color: #222;
  font-weight: 500;
}

.paper-presentations {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 10.5pt;
  line-height: 1.45;
}

.abstract-toggle {
  margin: 0;
}

.abstract-toggle summary {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--link-blue);
  color: var(--link-blue);
  cursor: pointer;
  font-size: 10pt;
  font-weight: 400;
  line-height: 1.25;
  list-style: none;
}

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

.abstract-toggle summary:hover {
  color: #00a0c6;
  border-color: #00a0c6;
}

.abstract-toggle[open] summary {
  margin-bottom: 14px;
}

.abstract-toggle[open] summary::after {
  content: " - Hide";
}

.paper-abstract {
  margin: 0;
  font-size: 12pt;
  line-height: 1.72;
  text-align: justify;
}

/* =========================================================
   Code page hero
   Image is set directly in code.html
   ========================================================= */

.code-hero {
  height: var(--research-hero-height);

  background-size: cover;
  background-position: center center;

  display: flex;
  justify-content: center;
  align-items: center;
}

.code-hero h1 {
  margin: 0;
  color: white;
  font-weight: 300;
  font-size: 66px;
  letter-spacing: 2px;
}

/* =========================================================
   Code page content
   ========================================================= */

.code-content {
  font-family: "Source Sans Pro", Arial, sans-serif;
  font-weight: 300;
  color: #383838;
  background: white;
  padding-top: 46px;
  padding-bottom: 100px;
  min-height: 650px;
}

.code-wrapper {
  width: min(
    var(--code-content-width),
    calc(100vw - 96px)
  );

  margin: 0 auto;
}

.code-intro {
  margin: 0 0 72px 0;
  font-size: 14pt;
  line-height: 1.6;
}

.code-item {
  margin-bottom: 25px;
}

.code-item h2 {
  margin: 0 0 6px 0;
  font-size: 14pt;
  line-height: 1.45;
  font-weight: 600;
}

.code-item h2 a {
  color: #1f2f38;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.code-item h2 a.code-action-link {
  display: inline-block;
  margin-left: 8px;
  font-size: 12pt;
  font-weight: 400;
  white-space: nowrap;
}

.code-item p {
  margin: 0 0 10px 0;
  font-size: 12pt;
  line-height: 1.45;
}

/* =========================================================
   Mobile layout
   ========================================================= */

@media (max-width: 900px) {
  :root {
    --topbar-height: auto;
    --home-hero-height: 220px;
    --research-hero-height: 150px;
    --research-side-margin: 48px;
  }

  body {
    font-size: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;

    padding: 16px 22px;
  }

  .nav-links {
    gap: 18px;
    flex-wrap: wrap;
  }

  .nav-links a {
    font-size: 16px;
  }

  .hero,
  .research-hero,
  .code-hero {
    background-position: center center;
  }

  .hero h1,
  .research-hero h1,
  .code-hero h1 {
    font-size: 38px;
  }

  .home-content {
    padding-top: 50px;
    padding-bottom: 60px;
  }

  .home-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 32px;
    padding: 0 24px;
  }

  .photo-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    text-align: center;
  }

  .profile-photo-frame {
    width: 168px;
  }

  .profile-name {
    margin-top: 16px;
  }

  .bio-column {
    max-width: 100%;
  }

  .bio-column h2 {
    font-size: 28px;
  }

  .bio-column p {
    font-size: 18px;
  }

  .research-content {
    padding-top: 42px;
    padding-bottom: 70px;
  }

  .research-wrapper {
    width: calc(100vw - 48px);
  }

  .research-wrapper h2 {
    font-size: 18px;
  }

  .paper {
    margin-bottom: 25px;
  }

  .paper-title {
    font-size: 14pt;
  }

  .paper-note,
  .paper-abstract {
    font-size: 12pt;
  }

  .code-content {
    padding-top: 42px;
    padding-bottom: 70px;
  }

  .code-intro {
    margin-bottom: 48px;
  }

  .code-item {
    margin-bottom: 25px;
  }

  .code-item h2 {
    font-size: 14pt;
  }

  .code-item p {
    font-size: 12pt;
  }
}
