/* GALA project page.
   The look follows the paper's main figure: flat tinted panels, Verdana Bold titles in the section colours
   (host red, basis blue, GALA green), Helvetica Neue text, hairline square caption cells, no shadows. */

:root {
  --ink: #1a1a1a;
  --grey: #4d4d4d;
  --light: #8c8c8c;
  --hair: #c8c8c8;
  --hair-soft: #e6e6e6;

  --host: #b8352c;
  --basis: #2b85c4;
  --gala: #2c9a4f;

  --host-bg: #fbe4e1;
  --basis-bg: #deeff9;
  --gala-bg: #e8f2e5;
  --gala-bg2: #d2efdc;
  --band: #e6e6e6;

  --hud-bg: #2f3237;
  --hud-fg: #46e35a;

  --font-head: Verdana, "DejaVu Sans", "Bitstream Vera Sans", Geneva, Tahoma, sans-serif;
  --font-text: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --font-mono: Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;

  --nav-h: 56px;
  --gutter: 24px;
  /* the overview player is never taller than the window, with its heading and summary above it */
  --player-w: max(520px, calc((100vh - 315px) * 16 / 9));
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--basis); outline-offset: 2px; }

.container { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.nb { white-space: nowrap; }
.c-host { color: var(--host); }
.c-basis { color: var(--basis); }
.c-gala { color: var(--gala); }

/* ------------------------------------------------------------ nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--hair-soft); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: .01em;
  text-decoration: none;
}
.mark { width: 22px; height: 22px; flex: none; }
.nav__links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a {
  padding: 6px 11px; font-size: 15px; font-weight: 500; color: var(--grey);
  text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--ink); border-bottom-color: var(--gala); }

/* ------------------------------------------------------------ caption cells (the figure's square boxes) */
.cells {
  display: inline-flex; flex-wrap: nowrap;
  border: 1.5px solid var(--grey);
  background: rgba(255, 255, 255, .9);
  font-weight: 500; line-height: 1;
}
.cells > * { padding: 9px 16px; white-space: nowrap; }
.cells > * + * { border-left: 1.5px solid var(--grey); }
.cells--meta { font-size: 15px; color: var(--grey); }

.cells--links { border-color: var(--ink); font-size: 16px; font-weight: 700; }
.cells--links > * { padding: 14px 24px; text-decoration: none; border-color: var(--ink) !important; }
.cells--links a { transition: background .15s, color .15s; }
.cells--links a:hover { background: var(--gala-bg2); }
.cells--links a.is-primary { background: var(--ink); color: #fff; }
.cells--links a.is-primary:hover { background: var(--gala); }
.cells--links .is-soon { color: var(--light); font-weight: 500; }
.cells--links .is-soon em { font-style: normal; font-size: 12px; margin-left: 4px; }
/* glyph in front of a link's label; it takes the label's colour */
.ico { display: inline-block; height: 1.15em; width: auto; margin: -.2em 8px -.2em 0; vertical-align: -.04em; fill: currentColor; }

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding-top: var(--nav-h);
  display: flex;
  overflow: hidden;
}
.hero__video, .hero__scrim { position: absolute; inset: var(--nav-h) 0 0 0; }
/* anchored top right, so the demo's own readout in that corner stays whole when the clip is cropped */
.hero__video { width: 100%; height: calc(100% - var(--nav-h)); object-fit: cover; object-position: 100% 0; }
.hero__scrim {
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 26%,
    rgba(255, 255, 255, .88) 56%, rgba(255, 255, 255, .97) 100%);
}
.hero__inner {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 26px 0 clamp(36px, 7vh, 72px);
}
.hero__kicker { margin: 0 0 14px; font-size: 16px; font-weight: 500; color: var(--grey); }
.hero__kicker b { font-family: var(--font-head); color: var(--gala); margin-right: 8px; }
.hero h1 {
  margin: 0;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(31px, 5.3vw, 68px); line-height: 1.08; letter-spacing: -.015em;
}
.hero__sub { margin: 16px 0 0; font-size: clamp(17px, 2.1vw, 27px); font-weight: 500; color: var(--grey); line-height: 1.3; }

.authors { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 24px 0 0 -8px; }
/* the whole card is the link: photo, name and affiliation */
.authors a {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 16px 7px 7px;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.authors a:hover, .authors a:focus-visible { background: rgba(255, 255, 255, .92); border-color: var(--ink); }
.authors a:hover b { color: var(--gala); }
.authors img { width: 54px; height: 54px; object-fit: cover; border: 1px solid var(--hair); }
.authors b { display: block; font-size: 16.5px; line-height: 1.25; transition: color .15s; }
.authors i { display: block; font-style: normal; font-size: 15px; color: var(--grey); line-height: 1.3; }

.hero .cells--links { margin-top: 30px; }

/* ------------------------------------------------------------ sections and type */
.section { padding: clamp(64px, 9vw, 112px) 0 0; }
.section--last { padding-bottom: clamp(64px, 9vw, 112px); }

.h2 {
  position: relative;
  margin: 0 0 28px; padding-left: 26px;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(21px, 2.7vw, 33px); line-height: 1.2; letter-spacing: -.01em;
}
/* a matrix cell of the figure, in the section's colour */
.h2::before {
  content: ""; position: absolute; left: 0; top: .32em;
  width: 13px; height: 13px; background: currentColor;
}
.h2--host { color: var(--host); }
.h2--basis { color: var(--basis); }
.h2--gala { color: var(--gala); }

.h3 { margin: clamp(48px, 7vw, 80px) 0 18px; font-family: var(--font-head); font-weight: 700; font-size: clamp(17px, 1.9vw, 23px); line-height: 1.25; }
.h3--plain { margin-top: 0; }
.h3--host { color: var(--host); margin-top: 0; }
.h3--basis { color: var(--basis); }
.h3--gala { color: var(--gala); }

.lead { max-width: 780px; color: var(--grey); font-size: 18px; margin-bottom: 30px; }
.lead--after { margin-top: 34px; }
.lead--tight { margin-bottom: 16px; }
.note { margin: 14px 0 0; max-width: 900px; font-size: 15px; line-height: 1.5; color: var(--light); }
.note a { color: var(--grey); }
.note--refs { margin-top: 6px; }

.linkbtn {
  margin-left: 6px; padding: 2px 9px;
  background: none; border: 1px solid var(--hair); color: var(--grey);
  font-size: 14px; cursor: pointer;
}
.linkbtn:hover { border-color: var(--ink); color: var(--ink); }

.frame { border: 1px solid var(--hair-soft); background: #fff; }
.frame video { width: 100%; }
/* never taller than the window: the whole player stays in view */
.frame--video { background: #000; border-color: var(--hair); max-width: var(--player-w); }
.frame--video video { aspect-ratio: 16 / 9; }

/* the nav link lands with the heading right under the bar, so heading, summary and player fit in one window */
#video { scroll-margin-top: calc(8px - clamp(64px, 9vw, 112px)); }

/* the one-paragraph summary above the player: a dark tag cell on a GALA-green panel, as wide as the player */
.tldr {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  max-width: var(--player-w); margin: 0 0 22px;
  background: var(--gala-bg);
}
.tldr__tag {
  display: flex; align-items: center; padding: 0 20px;
  background: var(--ink); color: #fff;
  font-family: var(--font-head); font-size: 16px; letter-spacing: .02em; white-space: nowrap;
}
.tldr span { padding: 16px 22px 17px; font-size: clamp(17px, 1.55vw, 20px); font-weight: 500; line-height: 1.5; text-wrap: pretty; }

/* ------------------------------------------------------------ abstract */
.about { margin-top: clamp(32px, 5vw, 52px); }
/* four facts in a row, then the abstract, which opens on demand */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(16px, 3vw, 40px); }
.facts li { padding: 15px 0 16px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.facts b { display: block; font-family: var(--font-head); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -.01em; }
.facts span { display: block; margin-top: 4px; font-size: 16px; color: var(--grey); line-height: 1.35; }

.abstract { max-width: 900px; margin-top: clamp(32px, 5vw, 48px); }
.abstract .h3 { margin-bottom: 12px; }
.abstract p { margin: 0; font-size: 17.5px; line-height: 1.68; color: #2b2b2b; }
/* collapsed only when the script runs; the button sits where the text stops */
.abstract__toggle { display: none; }
.js .abstract__toggle {
  display: inline-block; margin-left: 4px; padding: 0 12px 3px;
  background: #fff; border: 1.5px solid var(--grey); color: var(--ink);
  font-size: 18px; font-weight: 700; line-height: 1.1; letter-spacing: .08em; cursor: pointer; vertical-align: baseline;
  transition: background .15s;
}
.js .abstract__toggle:hover { background: var(--gala-bg2); border-color: var(--ink); }
.js .abstract:not(.is-open) .abstract__rest { display: none; }
.js .abstract.is-open .abstract__toggle { display: none; }
.abstract__less { display: none; margin: 10px 0 0; }
.js .abstract.is-open .abstract__less { display: inline-block; }

/* ------------------------------------------------------------ problem */
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.split__text { color: var(--grey); font-size: clamp(19px, 2vw, 24px); line-height: 1.45; }
.split__text b { color: var(--ink); }
.split__text b.c-host { color: var(--host); }
.split__small { font-size: 15px; color: var(--light); }
.under { display: grid; margin-top: 10px; font-size: 16px; color: var(--light); text-align: center; }
.under p { margin: 0; }
.under b { color: var(--grey); margin-right: 6px; }
.under b.c-host { color: var(--host); }
.under--speed { grid-template-columns: 47.34% 47.34%; column-gap: 5.32%; }

/* ------------------------------------------------------------ speed race (the teaser's host -> GALA rows) */
.race {
  display: grid;
  grid-template-columns: minmax(0, 5fr) clamp(36px, 7vw, 92px) minmax(0, 2.9fr) clamp(8px, 1.6vw, 20px) minmax(0, 2.5fr);
  grid-template-rows: 54px repeat(3, minmax(128px, auto)) 14px;
}
.race__panel { grid-row: 1 / -1; padding: 14px 20px; }
.race__panel--host { grid-column: 1; background: var(--host-bg); }
.race__panel--gala { grid-column: 3; background: var(--gala-bg2); }
.race__panel--speed { grid-column: 5; background: var(--band); }
.panel__title { font-family: var(--font-head); font-weight: 700; font-size: 19px; line-height: 1.3; margin: 0; }

.race__row { display: contents; }
.race__row > * { grid-row: var(--r); align-self: center; z-index: 1; }
.race__host { grid-column: 1; display: flex; align-items: center; gap: clamp(8px, 2vw, 28px); padding: 10px 18px; }
.race__host figure { flex: 0 0 clamp(92px, 15vw, 170px); min-width: 0; text-align: center; }
.race__host figure img { margin: 0 auto; width: 100%; }
.race__host figure img[alt="AGORA"] { width: 100%; }
/* one line, centred under the glyph even where it is wider than the glyph */
.race__host figcaption { display: flex; justify-content: center; margin-top: 6px; font-size: 15px; line-height: 1.25; color: var(--host); font-weight: 500; white-space: nowrap; }
.race__gala { grid-column: 3; padding: 10px 8px; }
.race__speed { grid-column: 5; text-align: center; padding: 10px 6px; }
.race__num { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.race__num b, .race__speed b { font-size: clamp(22px, 3.3vw, 40px); font-weight: 700; line-height: 1.1; white-space: nowrap; }
.race__speed b { color: var(--ink); }

.hud {
  display: inline-block; padding: 4px 11px;
  background: var(--hud-bg); color: var(--hud-fg);
  font-family: var(--font-mono); font-size: 16px; line-height: 1.4; white-space: nowrap;
}
.hud i { font-style: normal; font-variant-numeric: tabular-nums; }
.race__bar { display: block; width: min(150px, 80%); height: 4px; background: rgba(184, 53, 44, .2); }
.race__bar i { display: block; height: 100%; width: 0; background: var(--host); }

.race__arrow { grid-column: 2; position: relative; height: 5px; margin: 0 clamp(4px, 1vw, 14px); background: var(--grey); }
.race__arrow::after {
  content: ""; position: absolute; right: -2px; top: 50%; transform: translate(40%, -50%);
  border-left: 15px solid var(--grey); border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}

/* ------------------------------------------------------------ finding */
.finding { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px clamp(24px, 5vw, 72px); }
/* the two formulas sit on one line, whatever the length of the sentences above them */
.finding__step { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; }
.finding__step p { margin: 0 0 16px; color: var(--grey); font-size: 18px; max-width: 30em; }
.eq { height: clamp(34px, 3.6vw, 46px); width: auto; max-width: 100%; }
.finding__legend { grid-column: 1 / -1; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px 44px; font-size: 17px; }
.finding__legend div { display: flex; gap: 10px; align-items: baseline; }
.finding__legend dt { font-weight: 700; }
.finding__legend dd { margin: 0; color: var(--grey); }

/* unseen identity: four portraits, a label over each (the clip's columns are 512 px with 42 px gaps in 2174 px) */
.unseen { max-width: 1060px; }
.unseen video { width: 100%; aspect-ratio: 2174 / 512; background: #fff; }
.quad { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 1.93%; margin-bottom: 10px; }
.quad p { margin: 0; line-height: 1.3; }
.quad b { display: block; font-size: 17px; }
.quad b i { font-style: normal; }
.quad span { display: block; font-size: 15px; color: var(--light); }

/* blendshape scrubber: column headers, row labels, the clip, the slider */
.blend {
  --lab: clamp(64px, 10vw, 130px);
  display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); column-gap: 14px;
  max-width: 980px;
}
.blend__head { grid-column: 2; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: .86%; margin-bottom: 8px; }
.blend__head span { text-align: center; font-size: 16px; font-weight: 700; color: var(--grey); }
.blend__rows { grid-column: 1; grid-row: 2; position: relative; }
.blend__rows p {
  position: absolute; left: 0; right: 0; top: var(--y0); height: calc(var(--y1) - var(--y0));
  margin: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.25;
}
.blend__rows b { font-family: var(--font-head); font-size: clamp(14px, 1.7vw, 20px); }
.blend__rows span { font-size: 15px; color: var(--grey); }
.blend__video { grid-column: 2; grid-row: 2; width: 100%; aspect-ratio: 1396 / 930; background: #fff; }
.blend__ctrl { grid-column: 2; display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.blend__end { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--basis); width: 16px; text-align: center; }

input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; margin: 0; background: transparent; cursor: grab; touch-action: pan-y; }
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--basis-bg); border: 0; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--basis-bg); border: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; background: var(--basis); border: 0; border-radius: 0; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; background: var(--basis); border: 0; border-radius: 0; }

/* ------------------------------------------------------------ tabs (joined cells) */
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 22px; }
.tab {
  --c: var(--ink); --bg: var(--band);
  position: relative; margin: 0 -1.5px -1.5px 0; padding: 11px 18px;
  background: #fff; border: 1.5px solid var(--hair); color: var(--grey);
  font-size: 16.5px; font-weight: 700; line-height: 1.2; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.tab span { display: block; margin-top: 2px; font-size: 14px; font-weight: 500; color: var(--light); }
.tab--host { --c: var(--host); --bg: var(--host-bg); }
.tab--basis { --c: var(--basis); --bg: var(--basis-bg); }
.tab--gala { --c: var(--gala); --bg: var(--gala-bg2); }
.tab:hover { color: var(--c); }
.tab.is-active { background: var(--bg); color: var(--c); border-color: var(--c); z-index: 1; }
.tab.is-active span { color: var(--grey); }

/* ------------------------------------------------------------ method */
.stages__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stages__fig { position: relative; min-width: 760px; }
.stages__fig img { width: 100%; }
.veil { position: absolute; background: #fff; opacity: 0; transition: opacity .35s; pointer-events: none; }
.veil--host { left: 0; top: 0; width: 25.5%; height: 100%; }
.veil--basis { left: 25.5%; top: 0; width: 34.45%; height: 100%; }
.veil--distill { left: 59.95%; top: 0; width: 40.05%; height: 39.9%; }
.veil--inference { left: 59.95%; top: 39.9%; width: 40.05%; height: 60.1%; }
.stages[data-stage="host"] .veil:not(.veil--host),
.stages[data-stage="basis"] .veil:not(.veil--host):not(.veil--basis),
.stages[data-stage="distill"] .veil:not(.veil--distill),
.stages[data-stage="inference"] .veil:not(.veil--inference) { opacity: .84; }

.stages__text { margin-top: 26px; min-height: 150px; }
.stage { display: none; max-width: 820px; }
.stage.is-active { display: block; animation: rise .35s ease both; }
.stage p { color: var(--grey); font-size: 18px; }

.compare { display: inline-flex; align-items: flex-end; gap: 22px; margin-top: 6px; }
.compare div { display: flex; flex-direction: column; line-height: 1.25; }
.compare div:first-child { padding-right: 22px; border-right: 1px solid var(--hair); }
.compare b { font-size: 21px; }
.compare div:first-child b { font-size: 16px; color: var(--grey); }
.compare span { font-size: 15.5px; color: var(--light); }
.compare div:first-child span { order: 2; }
.compare .c-basis span { color: var(--basis); font-weight: 700; }
.compare__arrow { position: relative; width: 34px; height: 2px; margin-bottom: 12px; background: var(--light); }
.compare__arrow::after { content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%); border-left: 8px solid var(--light); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }

.eqrow { display: flex; align-items: flex-start; gap: 14px; margin-top: 8px; }
.eqrow img { height: clamp(38px, 4.2vw, 54px); width: auto; }
.eqrow__term { display: flex; flex-direction: column; align-items: center; text-align: center; }
.eqrow__term img { padding-bottom: 8px; border-bottom: 2px solid currentColor; }
.eqrow__term b { margin-top: 8px; font-size: 16px; line-height: 1.2; }
.eqrow__term span { font-size: 15px; color: var(--grey); }
.eqrow__term--host { color: var(--host); }
.eqrow__term--gala { color: var(--gala); }

/* ------------------------------------------------------------ results */
.result { display: none; max-width: 1000px; }
.result.is-active { display: block; animation: rise .35s ease both; }
.result video { width: 100%; background: #fff; }
.triple { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 2.6%; font-weight: 700; font-size: 17px; }
.result--dyna .triple { column-gap: 3%; }
.triple--head { margin-bottom: 8px; color: var(--grey); }
.triple--foot { margin-top: 10px; font-weight: 500; font-size: 17.5px; }
.colorbar { display: flex; align-items: center; gap: 10px; color: var(--grey); font-size: 15px; }
.colorbar img { width: 62%; height: 9px; }
.colorbar i { font-style: normal; white-space: nowrap; }

/* state-of-the-art panels */
.panel { padding: 16px 20px 20px; }
.panel--gala { background: var(--gala-bg); }
.ranks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.ranks h4 { margin: 0; font-size: 18px; }
.ranks__bench { margin: 8px 0 0; font-size: 16px; color: var(--grey); }
.ranks__big { margin: 10px 0 0; font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; line-height: 1.1; }
.ranks__sub { margin: 4px 0 16px; font-size: 16px; font-weight: 500; color: var(--grey); }
.ranks__cells { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.ranks__gap { width: 6px; }
.ranks__vs { margin: 14px 0 0; font-size: 14.5px; color: var(--grey); }
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 36px; padding: 0 8px;
  font-size: 13px; font-weight: 700; font-style: normal; line-height: 1;
}
.rank--b { background: var(--gala); color: #fff; }
.rank--s { background: #fff; color: var(--gala); box-shadow: inset 0 0 0 2px var(--gala); }
.rank--o { background: #fff; color: var(--light); box-shadow: inset 0 0 0 1px var(--hair); font-weight: 500; }
.note--legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; max-width: none; color: var(--grey); }
.note--legend span { display: inline-flex; align-items: center; gap: 8px; }
.note--legend .rank { min-width: 26px; width: 26px; height: 18px; padding: 0; }
.note__right { margin-left: auto; color: var(--light); }

/* Pareto */
.pareto { max-width: 1060px; }
.pareto__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pareto video { width: 100%; aspect-ratio: 1704 / 590; background: #fff; }
.pareto__calls { position: relative; height: 132px; margin-top: 4px; }
.pareto__calls p { position: absolute; left: var(--x); top: 0; width: 26%; margin: 0; transform: translateX(-50%); text-align: center; line-height: 1.3; }
.pareto__calls b { display: block; font-size: clamp(19px, 2.3vw, 27px); }
.pareto__calls span { display: block; font-size: 15px; color: var(--grey); }
.pareto__calls small { display: block; margin-top: 3px; font-size: 13.5px; color: var(--light); }

/* ------------------------------------------------------------ on device */
.device__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.device__head .h2 { margin-bottom: 0; }
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 3vw, 44px); max-width: 940px; margin-inline: auto; }
.phones figcaption { margin-bottom: 10px; text-align: center; font-size: 17px; font-weight: 500; }
.phones figcaption b { margin-right: 6px; }
.phones video { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--band); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 36px); margin-top: clamp(40px, 6vw, 64px); }
.duo .h3 { margin-top: 0; }
.duo video { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--band); }
.duo .cells { margin-top: 12px; }

/* ------------------------------------------------------------ bibtex + footer */
.bib { position: relative; max-width: 900px; border: 1.5px solid var(--hair); }
.bib pre { margin: 0; padding: 20px 22px; overflow-x: auto; font-family: var(--font-mono); font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.bib__copy { position: absolute; top: 10px; right: 10px; background: #fff; }

.footer { border-top: 1px solid var(--hair-soft); padding: 26px 0 34px; font-size: 15px; color: var(--grey); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; color: var(--ink); }

/* ------------------------------------------------------------ motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* only when the script runs (it sets .js on <html>), so the page is complete without it */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .stage.is-active, .result.is-active { animation: none; }
  .veil { transition: none; }
}

/* ------------------------------------------------------------ narrow or upright screens */
/* the crowd clip in full above the title, instead of a cropped backdrop behind it */
@media (max-width: 640px), (max-aspect-ratio: 11/10) {
  .hero { display: block; min-height: 0; }
  .hero__video { position: relative; inset: auto; height: auto; aspect-ratio: 16 / 9; object-position: 50% 0; }
  .hero__scrim { display: none; }
  .hero__inner { padding: 14px 0 8px; }
  .hero__title { margin-top: 26px; }
}

/* short windows: the player is narrow there, so the summary above it takes a smaller size */
@media (max-height: 780px) and (min-width: 641px) {
  .tldr span { padding: 13px 20px 14px; font-size: 17.5px; }
}

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li:nth-child(n + 3) { border-top: 0; }
  .split { grid-template-columns: 1fr; }
  .finding { grid-template-columns: 1fr; }
  .ranks { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .note__right { margin-left: 0; }
  .pareto__calls { height: auto; display: grid; gap: 14px; margin-top: 16px; }
  .pareto__calls p { position: static; width: auto; transform: none; text-align: left; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  body { font-size: 16px; }
  .nav__links a { padding: 6px 8px; font-size: 13.5px; }
  .cells--meta { font-size: 12.5px; }
  .cells--meta > * { padding: 7px 9px; }
  .authors { gap: 2px 8px; margin-top: 16px; }
  .authors img { width: 46px; height: 46px; }
  .cells--links { font-size: 14.5px; }
  .cells--links > * { padding: 12px 10px; }
  .ico { margin-right: 6px; }
  .lead, .stage p, .finding__step p { font-size: 16.5px; }
  .abstract p { font-size: 16px; }
  .facts span { font-size: 14.5px; }
  .tldr { grid-template-columns: 1fr; }
  .tldr__tag { justify-self: start; padding: 7px 14px; font-size: 14px; }
  .tldr span { padding: 12px 14px 14px; font-size: 16.5px; }
  .duo { gap: 40px; }

  .race { grid-template-rows: 40px repeat(3, minmax(120px, auto)); }
  .race__panel { padding: 11px 8px; }
  .race .panel__title { font-size: 11.5px; white-space: nowrap; }
  .race__host { flex-direction: column; gap: 6px; padding: 10px 6px; }
  .race__host figure { flex-basis: auto; width: 84px; }
  .race__host figcaption { display: none; }
  .hud { font-size: 11.5px; padding: 2px 5px; }
  .blend__head span { font-size: 12.5px; white-space: nowrap; }
  .blend__rows span { font-size: 11.5px; }
  .quad b { font-size: 12px; }
  .quad span { font-size: 10.5px; }
  .race__gala { padding: 10px 2px; }
  .race { grid-template-rows: 40px repeat(3, minmax(120px, auto)) 10px; }
  .race__arrow { height: 3px; }
  .race__arrow::after { border-left-width: 9px; border-top-width: 6px; border-bottom-width: 6px; }

  .tab { padding: 9px 12px; font-size: 14.5px; }
  .tab span { display: none; }
  .triple { font-size: 13.5px; }
  .triple--foot { font-size: 13.5px; }
  .colorbar i { display: none; }
  .phones figcaption { font-size: 12.5px; }
  .phones figcaption b { display: block; margin: 0; }
  .eqrow { gap: 8px; }
  .compare { flex-wrap: wrap; gap: 10px 16px; }
  .compare div:first-child { flex: 0 0 100%; padding: 0; border-right: 0; }
  .pareto__scroll video { min-width: 720px; }
  .bib pre { font-size: 11.5px; padding-top: 44px; }
}

/* the smallest phones: the link cells still fit on one row */
@media (max-width: 380px) {
  .cells--links { font-size: 13.5px; }
  .cells--links > * { padding: 11px 8px; }
  .ico { margin-right: 5px; }
}
