@font-face {
  font-family: "Instrument Sans";
  src: url("./assets/type/instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("./assets/type/source-serif-4.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #162939;
  --muted: #52606c;
  --blue: #497b9c;
  --selection-blue: #315b78;
  --speed-yellow: #f4cf62;
  --blue-deep: #344f60;
  --blue-pale: #e1ecf3;
  --yellow: #c79420;
  --yellow-deep: #8a6209;
  --yellow-pale: #f6e4ad;
  --paper: #fdfdfc;
  --line: #dce1e4;
  --video-bg: #202c34;
  --display: "Source Serif 4", Georgia, serif;
  --rail: clamp(13rem, 21vw, 17.25rem);
  --contents-width: 11.5rem;
  --article-gutter: clamp(1.75rem, 3.25vw, 2.75rem);
  --gutter: clamp(1.35rem, 3vw, 2.75rem);
  font: 16px/1.65 "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  width: min(100% - 3rem, 72rem);
  min-height: 3.15rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  color: var(--blue-deep);
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: -.03em;
  text-decoration: none;
}

.masthead-nav { display: flex; gap: clamp(.85rem, 3vw, 1.75rem); }

.masthead-nav a {
  color: var(--blue-deep);
  font-size: .85rem;
  font-weight: 550;
  text-decoration: none;
}

.masthead a:hover { text-decoration: underline; text-underline-offset: .25em; }

.page {
  width: min(100% - 3rem, 72rem);
  display: grid;
  grid-template-columns: var(--contents-width) minmax(0, 1fr);
  gap: var(--article-gutter);
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.contents {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-top: clamp(2rem, 4vw, 3.75rem);
  color: var(--muted);
  font-size: .92rem;
}

.contents summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: .45rem .7rem .45rem 0;
  margin-bottom: .55rem;
  color: var(--blue-deep);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.contents summary::-webkit-details-marker { display: none; }
.contents summary::after {
  content: "";
  width: .47rem;
  height: .47rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.contents details[open] summary::after { transform: rotate(225deg); }
.contents ul { list-style: none; padding: 0; margin: 0; }
.contents details > ul { border-left: 1px solid var(--line); }
.contents a {
  display: block;
  padding: .42rem .7rem;
  line-height: 1.45;
  text-decoration: none;
}
.contents :focus-visible { outline-offset: -1px; }
.contents a:hover { color: var(--blue-deep); text-decoration: underline; text-underline-offset: .23em; }

main { min-width: 0; padding-bottom: clamp(2.75rem, 6vw, 5.5rem); }

.showcase {
  width: min(100% - 3rem, 72rem);
  margin-inline: auto;
  padding: clamp(1.5rem, 3.25vw, 2.9rem) 0 clamp(1.65rem, 3.5vw, 3rem);
}

.article-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  align-items: end;
  gap: var(--gutter);
  margin-bottom: clamp(1.65rem, 3vw, 2.75rem);
}
.article-header h1 {
  margin: 0;
  color: var(--ink);
  font: 460 clamp(2.4rem, 4.55vw, 4.15rem)/1.01 var(--display);
  letter-spacing: -.05em;
}
.title-line { display: block; }
.article-title-name {
  display: flex;
  align-items: center;
  gap: .22em;
  margin-bottom: .65em;
  color: #b80000;
  font: 700 clamp(1.35rem, 2.1vw, 1.8rem)/1 "Instrument Sans", sans-serif;
  letter-spacing: -.055em;
}
.article-title-name::before {
  content: "";
  width: .68em;
  height: .91em;
  background: var(--yellow);
  clip-path: polygon(55% 0, 100% 0, 65% 39%, 95% 39%, 21% 100%, 38% 56%, 0 56%);
}

.article-meta {
  display: grid;
  justify-items: start;
  align-content: end;
  gap: .25rem;
  padding-bottom: .27rem;
}
.article-meta a { text-underline-offset: .22em; text-decoration-color: #96a6b0; }
.article-byline { color: var(--ink); font-size: 1rem; font-weight: 600; text-decoration: none; }
.article-byline:hover { text-decoration: underline; }
.article-repository { color: var(--muted); font-size: .875rem; }

.demo-showcase h2 { font: 500 clamp(1.36rem, 2vw, 1.68rem)/1.1 var(--display); letter-spacing: -.035em; }
.demo-showcase .demo-viewer { margin-top: .9rem; }
.showcase-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .38rem clamp(.9rem, 2.4vw, 2rem);
  padding-top: .95rem;
  border-top: 1px solid var(--line);
}
.showcase-speed {
  color: var(--ink);
  font-size: .88rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.showcase-speed:hover { text-decoration: underline; text-underline-offset: .22em; }
.showcase-speed strong {
  margin-left: .08em;
  box-shadow: inset 0 -.3em var(--speed-yellow);
  font-size: 1.45em;
  line-height: 1;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}
.article { min-width: 0; padding-top: clamp(2rem, 4vw, 3.75rem); }

h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.029em; }
h2 { font-size: clamp(1.55rem, 2.75vw, 2.15rem); font-weight: 730; }
.article h2 { font: 500 clamp(1.85rem, 3.2vw, 2.7rem)/1.13 var(--display); letter-spacing: -.04em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 700; }
h2[id], h3[id], section[id], figure[id], .references-list li[id] { scroll-margin-top: 5.2rem; }
.abstract p, .reading-width, .paper-section p, .paper-figure, .table-scroll, .contributions-list {
  font-size: 1.025rem;
  max-width: 69ch;
}
.abstract p, .reading-width, .paper-section p {
  margin: .78rem 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.real-world, .paper-section {
  margin-top: clamp(2.4rem, 5vw, 4rem);
  padding-top: clamp(1.65rem, 3.5vw, 2.45rem);
  border-top: 1px solid var(--line);
}

.real-world a, .paper-section a { color: var(--blue-deep); text-underline-offset: .18em; }
.paper-section h3:not(:first-child) { margin-top: clamp(1.8rem, 4.5vw, 2.8rem); }
.paper-section code {
  color: var(--blue-deep);
  background: var(--blue-pale);
  border-radius: 3px;
  padding: .08em .25em;
  font-size: .9em;
  overflow-wrap: anywhere;
}
.paper-section .citation { font-size: .86em; }
.citation + .citation { margin-left: .36em; }

.paper-figure {
  margin: 1.35rem 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.paper-figure > a { display: block; padding: clamp(.42rem, 1.75vw, .95rem); }
.paper-figure img { display: block; width: 100%; height: auto; }
.paper-figure figcaption {
  padding: .63rem .85rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.52;
}
.figure-full-size { display: none; }
.paper-figure--portrait { max-width: min(38rem, 69ch); }
.showcase-teaser {
  max-width: calc(100% - var(--contents-width));
  margin: clamp(1.5rem, 3.35vw, 2.65rem) auto 0;
}

.table-scroll {
  margin-top: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.paper-table {
  width: 100%;
  border-spacing: 0;
  color: var(--ink);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.paper-table caption {
  padding: .68rem .85rem;
  font-weight: 700;
  text-align: left;
}
.paper-table th, .paper-table td {
  padding: .52rem .85rem;
  text-align: right;
  border-top: 1px solid var(--line);
}
.paper-table th:first-child { text-align: left; }
.paper-table tbody th { font-weight: 550; }
.paper-table thead { color: var(--blue-deep); background: var(--blue-pale); }
.paper-table tfoot, .paper-result { background: #fbf1d3; }
.paper-table tfoot td, .paper-result td { font-weight: 700; }
.paper-table tbody td, .paper-table tfoot td { white-space: nowrap; }

.paper-list {
  margin: .9rem 0 0;
  max-width: 69ch;
  padding-left: 1.3rem;
  color: var(--muted);
}
.paper-list li + li { margin-top: .45rem; }
.contributions-list { margin: 1rem 0 0; border-top: 1px solid var(--line); }
.contributions-list > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: .2rem 1.1rem;
  padding: .72rem 0;
  border-bottom: 1px solid var(--line);
}
.contributions-list dt { color: var(--blue-deep); font-size: .92rem; font-weight: 700; }
.contributions-list dd { margin: 0; font-size: 1rem; }
.contributions-list dd span { white-space: nowrap; }
.contributions-list sup, .contributor-note sup { color: var(--yellow-deep); font-weight: 700; }
.paper-section .contributor-note { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; font-size: .86rem; }
.references-list li:target { background: var(--yellow-pale); }
.challenge-section { border-top: 0; padding-top: 0; }

.demo-viewer {
  margin-top: 1rem;
  display: grid;
  gap: .9rem;
}

.demo-more {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
}
.demo-viewer:has(> .demo-tabs) > .demo-more { grid-column: 1; grid-row: 3; }
.demo-group { display: grid; gap: .85rem; }
.demo-group-title { color: var(--blue-deep); font-size: .95rem; font-weight: 720; }
.demo-viewer:has(> .demo-tabs) > .demo-clip { grid-column: 1; grid-row: 1; }
.demo-tabs {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  gap: .95rem;
}
.demo-tab-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .68rem;
}
.demo-tab-group .demo-group-title { grid-column: 1 / -1; }
.demo-tab-group + .demo-tab-group { border-top: 1px solid var(--line); padding-top: .85rem; }

.demo-tab {
  display: grid;
  grid-template-columns: clamp(2.6rem, 15vw, 6rem) minmax(0, 1fr);
  gap: .55rem;
  align-items: center;
  min-height: 3.5rem;
  border: 0;
  border-radius: 2px;
  padding: .32rem .4rem;
  color: var(--blue-deep);
  background: transparent;
  cursor: pointer;
  font: 540 .9rem/1.28 "Instrument Sans", system-ui, sans-serif;
  text-align: left;
}

.demo-tab:hover { background: #edf2f5; }

.demo-tab[aria-selected="true"] {
  background: #edf3f7;
  box-shadow: inset 3px 0 var(--selection-blue);
  color: var(--selection-blue);
}
.demo-tab[aria-selected="true"] .demo-tab-label > span { font-weight: 680; }

.demo-clip {
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--paper);
}

.demo-media { position: relative; overflow: hidden; border-radius: 3px; }
.demo-clip:has(video[height="1920"]) { width: min(100%, 24rem, 41svh); margin-inline: auto; }
.demo-playback-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.demo-playback-actions button {
  min-height: 2.5rem;
  padding: .5rem .75rem;
  border: 1px solid #ffffff66;
  border-radius: 3px;
  color: #fff;
  background: #162939eb;
  font: 600 .9rem/1.2 "Instrument Sans", system-ui, sans-serif;
  cursor: pointer;
}
.demo-playback-actions button:hover { background: #162939; }
.demo-playback-actions button:focus-visible { outline: 2px solid var(--speed-yellow); outline-offset: 2px; }
.demo-rate {
  position: absolute;
  top: clamp(.45rem, 1vw, .8rem);
  left: clamp(.45rem, 1vw, .8rem);
  padding: .26em .55em;
  border: 0;
  border-radius: 3px;
  color: var(--ink);
  background: var(--speed-yellow);
  box-shadow: 0 1px 4px #20232729;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  pointer-events: none;
}

.demo-loading:not(:empty) {
  position: absolute;
  bottom: 3.25rem;
  left: .8rem;
  padding: .3em .6em;
  border-radius: 3px;
  background: #162939eb;
  color: #fff;
  font-size: .9rem;
  pointer-events: none;
}

.demo-clip video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: var(--video-bg);
}

.demo-clip video[width="1764"] { aspect-ratio: 49/30; }

.demo-clip video[height="1920"] { aspect-ratio: 9/16; }

.demo-clip figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .65rem 0 0;
  gap: .8rem;
  color: var(--muted);
  background: var(--paper);
  font-size: .91rem;
  line-height: 1.5;
}

.demo-title { display: block; margin-bottom: .21rem; color: var(--ink); }
.demo-clip figcaption p { margin: 0; }
.demo-clip time {
  flex: none;
  color: var(--yellow-deep);
  background: var(--yellow-pale);
  border-radius: 4px;
  padding: .11rem .37rem;
  font-variant-numeric: tabular-nums;
}
.demo-viewer:has(> .demo-tabs) .demo-clip :is(.demo-title, time) { display: none; }

.demo-tab img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 49/30;
  border-radius: 4px;
  background: var(--blue-pale);
  object-fit: cover;
}

.demo-tab-label {
  display: grid;
  gap: .18rem;
  padding-right: .15rem;
  overflow-wrap: anywhere;
}

.demo-tab-label time { color: var(--muted); font-size: .78rem; font-weight: 560; font-variant-numeric: tabular-nums; }

@media (min-width: 761px) {
  .showcase-heading { padding-right: calc(var(--rail) + var(--gutter)); }
  .demo-viewer:has(> .demo-tabs) {
    grid-template-columns: minmax(0, 1fr) var(--rail);
    grid-template-rows: auto 1fr;
    gap: .75rem var(--gutter);
    align-items: start;
  }
  .demo-viewer:has(> .demo-tabs) > .demo-clip { grid-row: 1 / 3; }
  .demo-viewer:has(> .demo-tabs) > .demo-more { grid-column: 2; grid-row: 2; }
  .demo-tabs { grid-column: 2; grid-row: 1; }
  .demo-tab-group { grid-template-columns: minmax(0, 1fr); gap: .37rem; }
  .demo-tab {
    grid-template-columns: clamp(3.1rem, 6vw, 5.1rem) minmax(0, 1fr);
    min-height: 3.25rem;
    font-size: .92rem;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .showcase-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .showcase-heading .demo-playback-actions { grid-column: 2; grid-row: 1; }
  .showcase-heading .showcase-speed { grid-column: 1 / -1; grid-row: 2; }
}

@media (min-width: 761px) and (max-height: 900px) {
  .showcase { padding-top: 1.5rem; }
  .article-header { margin-bottom: 1.45rem; }
  .article-header h1 { font-size: clamp(2.65rem, 3.6vw, 3.35rem); }
  .article-title-name { margin-bottom: .45em; }
  .showcase-heading { padding-top: .7rem; }
  .demo-showcase .demo-viewer { margin-top: .7rem; }
}

@media (max-width: 850px) {
  .showcase-teaser { max-width: 69ch; }
  .page { display: block; }
  .contents { position: static; max-height: none; padding: .2rem 0; border-bottom: 1px solid var(--line); }
  .contents summary { margin-bottom: 0; padding-right: .2rem; }
  .contents a { display: flex; align-items: center; min-height: 2.75rem; padding: .45rem 0; }
  .contents details > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: .95rem;
    padding: .3rem 0 .55rem;
    border: 0;
  }
}

@media (max-width: 760px) {
  .showcase-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .showcase-heading .demo-playback-actions { grid-column: 2; grid-row: 1; }
  .showcase-heading .showcase-speed { grid-column: 1 / -1; grid-row: 2; }
  .paper-figure figcaption {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: end;
  }
  .figure-full-size {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--selection-blue);
    font-size: .85rem;
    font-weight: 600;
    text-underline-offset: .2em;
  }
  .article-header { grid-template-columns: 1fr; gap: .7rem; }
  .article-meta { display: flex; align-items: baseline; gap: 1rem; }
}
@media (max-width: 540px) {
  .masthead-inner, .showcase, .page { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 3.4rem; }
  .masthead-nav a { font-size: .8rem; }
  .article-header { margin-bottom: 1.25rem; }
  .article-header h1 { font-size: clamp(1.95rem, 7.9vw, 2.6rem); }
  .article-meta { column-gap: .85rem; margin: 0; }
  .showcase-heading { grid-template-columns: minmax(0, 1fr) auto; column-gap: .6rem; }
  .showcase-heading .demo-playback-actions { grid-column: 2; grid-row: 1; }
  .showcase-heading .showcase-speed { grid-column: 1 / -1; grid-row: 2; }
  .demo-playback-actions button { padding-inline: .55rem; font-size: .8rem; }
  .showcase-speed { font-size: .77rem; }
  .contributions-list > div { grid-template-columns: minmax(0, 1fr); padding-block: .6rem; }
  .contents { font-size: .87rem; }
  .demo-tab-group { gap: .44rem; }
  .demo-tab { grid-template-columns: clamp(2.2rem, 11vw, 3.4rem) minmax(0,1fr); gap: .45rem; font-size: .8rem; line-height: 1.25; }
  .demo-clip figcaption { padding: .55rem 0 0; }
  .paper-table th, .paper-table td { padding-inline: clamp(.3rem, 1.65vw, .6rem); }
}
