@font-face {
  font-family: "Jost";
  src: url("assets/jost-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("assets/jost-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("assets/source-serif-4-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("assets/source-serif-4-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  background: #f7f3ea;
  color: #162d43;
  font-family: "Jost", "Avenir Next", Avenir, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }

::selection {
  background: #dae4ee;
  color: #162d43;
}

.masthead {
  display: flex;
  justify-content: center;
  padding: 36px 24px 0;
}

.brand {
  display: block;
  width: 190px;
  height: auto;
  aspect-ratio: 1066 / 674;
  overflow: hidden;
}

.opening {
  padding: 47px 48px 48px;
}

.introduction {
  text-align: center;
  margin: 0 auto;
  max-width: 1120px;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 5.4vw, 78px);
  font-weight: 700;
  line-height: 1.09;
  letter-spacing: -0.038em;
}

.introduction p {
  max-width: 750px;
  margin: 25px auto 0;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: #515752;
  text-wrap: pretty;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 24px;
  padding: 8px 10px;
  color: #626963;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.scroll-cue:hover { color: #162d43; }
.scroll-cue:focus-visible {
  outline: 2px solid #162d43;
  outline-offset: 4px;
}
.scroll-cue svg { transition: transform 180ms ease; }
.scroll-cue:hover svg { transform: translateY(3px); }

.hero {
  max-width: 1320px;
  margin: 47px auto 0;
  overflow: hidden;
  background: #e8d9c4;
  scroll-margin-top: 24px;
}

.hero img {
  width: 100%;
  height: auto;
  display: block;
}

.lab-story {
  padding: 52px 48px 120px;
  color: #303c43;
  font-family: "Source Serif 4", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.75;
}

.reading-column {
  max-width: 752px;
  margin-inline: auto;
}

.lab-story.research-section { padding-top: 0; }

.lab-story h2,
.lab-story h3 {
  margin: 0 0 30px;
  color: #162d43;
  font-family: "Jost", "Avenir Next", Avenir, sans-serif;
  font-size: clamp(36px, 3.7vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.028em;
  text-wrap: wrap;
}

.lab-story h3 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.022em;
  scroll-margin-top: 24px;
}

.research-subsection { margin-top: 96px; }

.research-subsection blockquote {
  margin: 28px 0 32px;
  padding: 6px 0 6px 26px;
  border-left: 2px solid #9cacb6;
  color: #162d43;
}

.research-subsection ul {
  margin: 22px 0 28px;
  padding-left: 1.25em;
}

.research-subsection li + li { margin-top: 8px; }
.research-subsection li::marker { color: #162d43; }

.lab-story p { margin: 0; }
.lab-story p + p { margin-top: 1.25em; }
.welcome p { font-size: 24px; line-height: 1.65; }

.math-inline .katex,
.math-display .katex { font-size: 1.05em; }

.math-display {
  max-width: 100%;
  margin-block: 1.5em;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.25em;
}

.math-display .katex-display { margin: 0; }
.math-display .katex-display > .katex {
  width: max-content;
  min-width: 100%;
  text-align: center;
}
.math-display:focus-visible {
  outline: 2px solid #162d43;
  outline-offset: 4px;
}

.contact-link,
.text-link,
.note-link {
  color: #162d43;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.contact-link:hover,
.text-link:hover,
.note-link:hover { color: #325875; }
.contact-link:focus-visible,
.text-link:focus-visible,
.note-link:focus-visible {
  outline: 2px solid #162d43;
  outline-offset: 4px;
}

.note-link {
  display: inline-block;
  min-height: 44px;
  padding-block: 8px;
  font-family: "Jost", "Avenir Next", Avenir, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.story-image {
  max-width: 1040px;
  margin: 64px auto;
}

.story-image img {
  display: block;
  width: 100%;
  height: auto;
}

.story-image.story-image--portrait {
  max-width: 320px;
  margin-bottom: 0;
}

.story-image.story-image--characters { max-width: 400px; }

.references .reference-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
}

.references .reference-list li {
  padding-left: 1.25em;
  text-indent: -1.25em;
}

.references .reference-list li + li { margin-top: 1.25em; }

.references a {
  color: #162d43;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.references a:hover { color: #325875; }
.references a:focus-visible {
  outline: 2px solid #162d43;
  outline-offset: 4px;
}

.notes { margin-top: 64px; }
.note { border-top: 1px solid #d2cec4; }
.note:last-child { border-bottom: 1px solid #d2cec4; }

.note summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  color: #162d43;
  font-family: "Jost", "Avenir Next", Avenir, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.note summary::-webkit-details-marker { display: none; }
.note summary:hover { color: #325875; }
.note summary:focus-visible {
  outline: 2px solid #162d43;
  outline-offset: 5px;
}
.note-indicator { flex-shrink: 0; }
.note[open] .indicator-vertical { display: none; }
.note-content { padding: 0 44px 28px 0; }

@media (min-width: 1700px) {
  .masthead { padding-top: 48px; }
  .opening { padding-top: 55px; }
  .hero { margin-top: 56px; }
}

@media (max-width: 700px) {
  .masthead { padding-top: 28px; }
  .brand { width: 160px; }
  .opening { padding: 38px 24px 24px; }
  h1 {
    max-width: 520px;
    margin-inline: auto;
    font-size: clamp(38px, 7.5vw, 51px);
    line-height: 1.12;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }
  .desktop-break { display: none; }
  .introduction p {
    max-width: 480px;
    margin-top: 23px;
    font-size: 20px;
    line-height: 1.5;
  }
  .hero { margin-top: 34px; }
  .lab-story {
    padding: 40px 24px 72px;
    font-size: 20px;
    line-height: 1.7;
  }
  .lab-story h2 { margin-bottom: 25px; }
  .lab-story h3 { margin-bottom: 25px; }
  .research-subsection { margin-top: 64px; }
  .research-subsection blockquote { padding-left: 20px; }
  .welcome p { font-size: 21px; }
  .story-image { margin-block: 40px; }
  .notes { margin-top: 40px; }
  .note summary { padding-block: 21px; gap: 18px; font-size: 20px; }
  .note-content { padding-right: 0; padding-bottom: 24px; }
}

@media (max-width: 380px) {
  .opening { padding-inline: 18px; }
  h1 { font-size: 36px; }
  .introduction p { font-size: 19px; }
  .lab-story { padding-inline: 18px; font-size: 19px; }
  .lab-story h2 { font-size: 33px; }
  .welcome p { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue svg { transition: none; }
}
