:root {
  --nav: #111417;
  --nav-active: #202a34;
  --blue: #0a3f70;
  --blue-dark: #062b4e;
  --cream: #f2f1ee;
  --text: #1b1f23;
  --muted: #68717a;
  --line: rgba(17, 20, 23, 0.16);
  --paper: #ffffff;
  --top-gradient: linear-gradient(115deg, #8d452b 0%, #b8663d 54%, #d29357 100%);
  --heading: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Space Grotesk", "Trebuchet MS", Arial, sans-serif;
  --code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(17, 20, 23, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 20, 23, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
}

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

.topbar {
  min-height: 64px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--top-gradient);
  border-bottom: 0;
}

.site-title {
  display: flex;
  align-items: center;
  padding: 13px 40px;
  color: #e5e7eb;
  font-family: var(--code);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  padding-right: 28px;
}

nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  color: rgba(255, 250, 244, 0.9);
  font-family: var(--code);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

nav a.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 700;
}

.wrap {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
}

.banner {
  min-height: 192px;
  display: flex;
  align-items: center;
  color: white;
  background: var(--top-gradient);
  border-bottom: 1px solid rgba(17, 20, 23, 0.2);
}

.home-banner {
  min-height: 218px;
}

.banner.compact {
  min-height: 118px;
}

.label {
  margin: 0 0 10px;
  color: inherit;
  font-family: var(--code);
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--blue);
  font-family: var(--heading);
  font-weight: 500;
  line-height: 1.18;
}

.banner h1,
.banner .subtitle {
  color: #ffffff;
}

.banner h1 {
  font-family: var(--heading);
  font-weight: 500;
}

h1 {
  font-size: clamp(27px, 3.5vw, 36px);
  font-weight: 500;
  line-height: 1.08;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 16px;
}

.subtitle {
  max-width: 720px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--code);
  font-size: 13px;
  line-height: 1.7;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 666px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 48px 0;
}

.intro-bio {
  display: grid;
  grid-template-columns: 220px minmax(0, 420px);
  gap: 26px;
  align-items: start;
}

.intro-portrait {
  width: 220px;
  margin: 0;
}

.intro-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 28%;
}

.intro-bio-copy {
  max-width: 420px;
  font-size: 17px;
  line-height: 1.65;
}

.prose p:first-child {
  margin-top: 0;
}

.prose p,
.research-opening p,
.page-copy,
.paper-copy,
.other-work p {
  color: var(--text);
}

.selected-work {
  padding: 36px 0 72px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.selected-work h2 {
  margin-bottom: 18px;
}

.portfolio-line {
  display: grid;
  grid-template-columns: 56px 1fr 320px;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.selected-work .work-no {
  color: var(--muted);
  font-family: var(--code);
  font-size: 12px;
  font-weight: 600;
}

.portfolio-line > span:not(.work-no) {
  color: var(--blue);
  font-family: var(--heading);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.28;
}

.selected-work small {
  align-self: center;
  color: var(--muted);
  font-family: var(--code);
  font-size: 12px;
}

.research-opening {
  max-width: 960px;
  padding: 34px 0 22px;
}

.research-opening h2 {
  max-width: 820px;
}

.research-opening p {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: 17px;
}

.project-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "section-1 section-2"
    "papers-1 papers-2";
  grid-template-rows: auto auto;
  align-items: start;
  gap: 22px;
  row-gap: 13px;
  padding-top: 34px;
  padding-bottom: 32px;
}

.project-index-section {
  display: block;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  color: var(--blue);
  font-family: var(--heading);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
}

.project-index-section-1 { grid-area: section-1; }
.project-index-section-2 { grid-area: section-2; }
.project-index-section-3 { grid-area: section-3; }

.project-index-section span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--code);
  font-size: 12px;
  font-weight: 600;
}

.paper-index {
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper-index-1 { grid-area: papers-1; }
.paper-index-2 { grid-area: papers-2; }
.paper-index-3 { grid-area: papers-3; }

.paper-index li + li {
  margin-top: 8px;
}

.paper-index a {
  display: block;
  color: #7b838b;
  font-family: var(--heading);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.4;
  text-decoration: none;
}

.paper-index a:hover {
  color: #5f6871;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.research-group {
  padding: 20px 0 28px;
  scroll-margin-top: 24px;
}

.research-group > h2 {
  padding-bottom: 22px;
  font-size: clamp(23px, 3vw, 30px);
}

.research-paper {
  padding: 26px 0 32px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.research-paper h3 {
  max-width: 1100px;
  color: #70777d;
  font-size: clamp(21px, 2.7vw, 28px);
  font-weight: 300;
  line-height: 1.3;
}

.paper-stage {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--code);
  font-size: 12px;
}

.paper-authors {
  margin: 12px 0;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 18px 0;
  font-family: var(--heading);
  font-size: 14px;
}

.note-marker {
  margin-left: 4px;
  font-size: 0.65em;
  vertical-align: super;
}

.note-marker a {
  text-decoration: none;
}

.paper-disclosure {
  max-width: 820px;
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.paper-disclosure sup {
  margin-right: 3px;
}

.paper-abstract {
  max-width: 820px;
  margin: 18px 0 24px;
}

.research-page .wrap {
  width: min(1240px, calc(100% - 56px));
}

.paper-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-top: 22px;
}

.paper-columns .paper-abstract,
.paper-columns .paper-figure-stack,
.paper-columns .paper-figure {
  min-width: 0;
  margin: 0;
}

.integrated-paper-columns {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
}

.integrated-paper-columns .integrated-paper-figure {
  width: 100%;
  max-width: 430px;
  justify-self: end;
}

.integrated-paper-columns .paper-abstract {
  max-width: 820px;
}

@media (min-width: 761px) {
  .research-paper:nth-of-type(even) .paper-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

  .research-paper:nth-of-type(even) .paper-columns > .paper-figure,
  .research-paper:nth-of-type(even) .paper-columns > .paper-figure-stack {
    order: 2;
  }

  .research-paper:nth-of-type(even) .paper-columns .paper-abstract {
    order: 1;
  }

  #intermediation .integrated-paper-columns {
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  }
}

.paper-section-label {
  display: block;
  color: var(--blue-dark);
  font-family: var(--heading);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 10px;
}

.paper-abstract summary {
  width: fit-content;
  cursor: pointer;
  color: var(--blue);
  font-family: var(--heading);
  font-size: 14px;
  padding: 5px 0;
}

.paper-abstract p {
  color: #343a40;
  font-family: var(--heading);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.72;
  margin: 0 0 14px;
}

.paper-figure {
  max-width: 900px;
  margin: 26px 0 0;
}

.paper-figure-stack {
  display: grid;
  gap: 32px;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.paper-figure figcaption {
  max-width: 820px;
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 18px;
}

.paper-figure figcaption p {
  margin: 0 0 10px;
}

.paper-figure figcaption a {
  white-space: nowrap;
}

.paper-expand summary,
.figure-notes summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
  margin-bottom: 10px;
}

.figure-notes {
  margin: 10px 0;
}

.portfolio-project {
  display: grid;
  grid-template-columns: 92px minmax(360px, 1.12fr) minmax(280px, 0.88fr);
  gap: 34px;
  align-items: start;
  padding: 46px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
}

.project-meta {
  position: sticky;
  top: 28px;
  color: var(--muted);
  font-family: var(--code);
  font-size: 13px;
  line-height: 1.5;
}

.project-meta span {
  display: block;
  color: var(--blue);
  font-family: var(--code);
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
}

.project-meta p {
  margin: 12px 0 0;
}

.research-plate {
  margin: 0;
}

.plate-placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(6, 43, 78, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(6, 43, 78, 0.06) 1px, transparent 1px),
    #f7f8f8;
  background-size: 24px 24px;
  border: 1px solid var(--line);
}

.plate-placeholder span {
  color: rgba(6, 43, 78, 0.48);
  font-family: var(--code);
  font-size: 13px;
  font-weight: 600;
  text-transform: lowercase;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--code);
  font-size: 13px;
  line-height: 1.45;
}

.project-text h2 {
  font-size: clamp(19px, 2vw, 25px);
}

.takeaway {
  margin: 18px 0 16px;
  color: var(--blue-dark);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
}

.paper-copy {
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}

.tags {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.button {
  display: inline-block;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.other-work {
  padding: 44px 0 70px;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
}

.other-work article {
  max-width: 820px;
  margin-top: 16px;
}

.page-copy {
  max-width: 820px;
  padding: 54px 0 90px;
}

.page-copy h2 {
  margin: 38px 0 12px;
  font-size: 20px;
}

.cv-preview {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 480px;
  margin-top: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: auto;
}

.cv-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.cv-preview img + img {
  border-top: 1px solid var(--line);
}

.course-list {
  padding-left: 22px;
}

.course-list li {
  padding-left: 4px;
  margin: 0 0 24px;
}

.course-name,
.course-professor,
.course-institution {
  display: block;
}

.course-name {
  font-weight: 600;
}

.course-program {
  font-weight: 400;
  color: var(--muted);
}

.course-institution {
  color: var(--muted);
}

code {
  color: var(--blue-dark);
}

.fun-quote {
  color: #674ea7;
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  line-height: 1.45;
  margin: 0 0 30px;
}

.fun-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.fun-photos img {
  display: block;
  width: 100%;
  height: auto;
}

.vikings-schedule {
  margin-top: 40px;
}

.vikings-schedule h2 {
  margin: 0 0 12px;
  color: #513581;
}

.vikings-schedule-frame {
  display: block;
  width: 100%;
  height: 1000px;
  height: clamp(700px, 90vh, 1100px);
  border: 0;
  margin: 20px 0 12px;
}

.schedule-fallback {
  margin: 0;
  font-family: var(--heading);
  font-size: 13px;
}

@media (max-width: 760px) {
  .research-page .wrap {
    width: calc(100% - 32px);
  }

  .paper-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .integrated-paper-columns {
    grid-template-columns: 1fr;
  }

  .integrated-paper-columns .integrated-paper-figure {
    max-width: 430px;
    justify-self: start;
  }

  .project-index {
    grid-template-areas:
      "section-1"
      "papers-1"
      "section-2"
      "papers-2";
    row-gap: 13px;
  }

  .topbar {
    display: block;
  }

  .site-title {
    padding: 16px 24px 6px;
  }

  nav {
    flex-wrap: wrap;
    padding: 0 18px 14px;
  }

  nav a {
    min-height: 38px;
    padding: 8px 10px;
  }

  .banner {
    min-height: 180px;
  }

  .banner.compact {
    min-height: 112px;
  }

  .wrap {
    width: min(100% - 32px, 1024px);
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  .intro-grid,
  .intro-bio,
  .fun-photos,
  .portfolio-line,
  .project-index,
  .portfolio-project {
    grid-template-columns: 1fr;
  }

  .intro-portrait {
    width: min(220px, 100%);
  }

  .project-meta {
    position: static;
  }
}
