/* The research page: a light reading page, apart from the home page's black boards. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/figtree-400.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/figtree-500.woff2") format("woff2"); }
:root {
  --paper: #fff; --ink: #161616; --muted: #666; --line: #e6e6e6; --dot: #d7d7d7;
  --face: "Figtree", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font: 400 17px/1.65 var(--face); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: #999; text-underline-offset: 3px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Header, title and footer */
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 24px 5.5%; border-bottom: 1px solid var(--line); }
.name { color: inherit; text-decoration: none; }
.name svg { display: block; width: 156px; height: auto; fill: currentColor; }
nav { display: flex; flex-wrap: wrap; gap: 22px; }
nav a { padding: 6px 0; color: var(--muted); font-size: 13px; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.hero { max-width: 960px; margin: auto; padding: 58px 24px 48px; text-align: center; font-size: clamp(34px, 5.4vw, 56px); line-height: 1.08; font-weight: 500; letter-spacing: -.05em; text-wrap: balance; }
.bottom { padding: 22px 5.5%; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* Layout columns */
.wide { width: 89%; max-width: 1180px; margin: 0 auto; }
.reading { width: calc(100% - 48px); max-width: 860px; margin: 58px auto 0; }
.reading p { margin: 0 0 22px; }
.opening { margin-bottom: 72px; }
#results, #method, #references, [id^="ref-"] { scroll-margin-top: 30px; }

/* The result carousel: four images a slide */
.label { margin: 0 0 16px; font-size: 14px; font-weight: 500; }
.window { overflow: hidden; touch-action: pan-y; }
.track { display: flex; align-items: flex-start; }
.is-ready .track { transition: transform 480ms cubic-bezier(.22, 1, .36, 1); }
.slide { flex: 0 0 100%; min-width: 0; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 683 / 1024; object-fit: cover; background: #f5f5f5; }
.controls { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 22px; }
.arrow { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 22px; cursor: pointer; }
.arrow:hover:not(:disabled) { border-color: var(--ink); }
.arrow:disabled { opacity: .28; cursor: default; }
.dots { display: flex; align-items: center; justify-content: center; height: 32px; }
.dot { display: grid; place-items: center; width: 44px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.dot > span { display: block; width: 7px; height: 7px; border-radius: 4px; background: var(--dot); transition: width 160ms ease, background-color 160ms ease; }
.dot:hover > span { background: #8a8a8a; }
.dot.is-current > span { width: 20px; background: var(--ink); }

/* The pipeline animation */
.figure { margin-top: 0; margin-bottom: 0; }
.figure video { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 924; background: var(--paper); object-fit: contain; }

/* Method and math */
.method { margin-top: 56px; }
h2 { margin: 0 0 28px; font-size: 30px; line-height: 1.2; font-weight: 500; letter-spacing: -.035em; }
h3 { margin: 44px 0 22px; font-size: 23px; line-height: 1.3; font-weight: 500; letter-spacing: -.025em; }
.equation { width: min(1040px, calc(100vw - 56px)); margin: 26px 0 30px 50%; padding: 8px 0; overflow-x: auto; overflow-y: hidden; transform: translateX(-50%); }
.equation .katex-display { width: max-content; margin: 0 auto; }
.equation .katex { font-size: 1.08em; white-space: nowrap; }
.math .katex { font-size: 1.04em; }
.cite { font-size: 12px; white-space: nowrap; }
.cite a { margin-right: 2px; text-decoration: none; }
.cite a:hover { text-decoration: underline; }

/* References */
.references { padding: 32px 0 48px; border-top: 1px solid var(--line); }
.references ol { margin: 0; padding-left: 24px; font-size: 13px; line-height: 1.75; }
.references li { padding: 0 0 20px 6px; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .top { padding: 18px 20px; }
  nav { gap: 16px; }
  nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
  .hero { padding: 38px 22px 34px; }
  .wide { width: calc(100% - 32px); }
  .reading { width: calc(100% - 40px); margin-top: 42px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .controls { gap: 4px 16px; }
  .equation { width: calc(100vw - 32px); font-size: 16px; }
  h2 { font-size: 27px; }
  h3 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .is-ready .track, .dot > span { transition: none; }
}
