/* AngularFM project page
   Plain CSS, no build step. Colours and type are defined once as custom properties. */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-greek-wght-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;

  --bg: #090c12;
  --bg-2: #0d1118;
  --surface: #121722;
  --surface-2: #171e2b;
  --surface-3: #1e2635;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --ink: #eaeef6;
  --ink-2: #c1c9d8;
  --muted: #8b95a8;
  --faint: #5d6678;

  /* The three formulations keep one colour each across the whole page. */
  --a: #ff6b6b; /* raw scalar */
  --b: #5aa2ff; /* sine-cosine + Euclidean flow matching */
  --c: #3ddc97; /* AngularFM */
  --o: #ffb454; /* atan2 decoding */
  --n: #8e99ad; /* neutral baselines */

  --a-soft: rgba(255, 107, 107, 0.13);
  --b-soft: rgba(90, 162, 255, 0.13);
  --c-soft: rgba(61, 220, 151, 0.13);
  --o-soft: rgba(255, 180, 84, 0.14);

  --glow-1: rgba(61, 220, 151, 0.16);
  --glow-2: rgba(90, 162, 255, 0.13);
  --grid-dot: rgba(255, 255, 255, 0.055);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(9, 12, 18, 0.72);

  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 20px;
  --radius-sm: 12px;
  --gutter: clamp(18px, 4vw, 40px);
  --section: clamp(72px, 9vw, 132px);
  --nav-h: 60px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f6f1;
  --bg-2: #efefe8;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --surface-3: #eceee9;
  --line: rgba(15, 23, 42, 0.1);
  --line-2: rgba(15, 23, 42, 0.18);
  --ink: #121722;
  --ink-2: #333b4b;
  --muted: #5f6878;
  --faint: #98a0ae;

  --a: #e0454a;
  --b: #2b6be0;
  --c: #0b9966;
  --o: #d5741f;
  --n: #7b8496;

  --a-soft: rgba(224, 69, 74, 0.1);
  --b-soft: rgba(43, 107, 224, 0.1);
  --c-soft: rgba(11, 153, 102, 0.1);
  --o-soft: rgba(213, 116, 31, 0.12);

  --glow-1: rgba(11, 153, 102, 0.13);
  --glow-2: rgba(43, 107, 224, 0.1);
  --grid-dot: rgba(15, 23, 42, 0.07);
  --shadow: 0 24px 60px rgba(30, 41, 59, 0.12);
  --shadow-sm: 0 6px 20px rgba(30, 41, 59, 0.08);
  --nav-bg: rgba(246, 246, 241, 0.78);
}

/* ------------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--c);
  color: #05130d;
}

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

.mono {
  font-family: var(--font-mono);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* KaTeX sits slightly large next to Inter. */
.katex {
  font-size: 1.06em;
}
/* Keeps a formula and the punctuation after it on one line. */
.nb {
  white-space: nowrap;
}
.katex-display {
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

/* --------------------------------------------------------------- progress */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--a), var(--b) 50%, var(--c));
}

/* -------------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.35s ease;
}
.nav.is-stuck {
  border-bottom-color: var(--line);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex: none;
}
.brand__mark {
  width: 26px;
  height: 26px;
  flex: none;
}
.brand__mark .ring {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 2.4;
}
.brand__mark .arc {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.brand__mark .dot {
  fill: var(--c);
}
.brand__mark .orbit {
  transform-origin: 16px 16px;
  animation: orbit 9s linear infinite;
}
@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.nav__links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__links::-webkit-scrollbar {
  display: none;
}
.nav__links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav__links a:hover {
  color: var(--ink);
}
.nav__links a.is-active {
  color: var(--ink);
  background: var(--surface-2);
}

.theme-toggle {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--line-2);
  transform: rotate(18deg);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun {
  display: none;
}
[data-theme="light"] .theme-toggle .sun {
  display: block;
}
[data-theme="light"] .theme-toggle .moon {
  display: none;
}

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: clamp(36px, 6vw, 84px) 0 clamp(44px, 6vw, 80px);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: calc(-1 * var(--nav-h)) 0 0 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 78% 30%, var(--glow-1), transparent 70%),
    radial-gradient(45% 50% at 8% 8%, var(--glow-2), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 1.5px) 0 0 / 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 4px var(--c-soft);
}
.hero__title {
  margin-top: 22px;
  font-size: clamp(54px, 9.2vw, 118px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.grad {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 38%, var(--c) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtitle {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.7vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  text-wrap: balance;
}
.hero__authors {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  font-size: 16.5px;
  color: var(--ink);
  line-height: 1.7;
}
.hero__authors a {
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
}
.hero__authors a:hover {
  border-bottom-color: currentColor;
}
.hero__authors sup {
  font-size: 0.68em;
  color: var(--muted);
  margin-left: 1px;
}
.hero__affil {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  font-size: 14.5px;
  color: var(--muted);
}
.hero__affil sup {
  font-size: 0.72em;
  margin-right: 2px;
}
.hero__affil:empty,
.hero__authors:empty {
  display: none;
}
.hero__tagline {
  margin-top: 22px;
  max-width: 34em;
  font-size: clamp(16.5px, 1.5vw, 18.5px);
  color: var(--ink-2);
}
.hero__actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn.is-soon {
  cursor: default;
  color: var(--muted);
  border-style: dashed;
  background: transparent;
}
.btn.is-soon:hover {
  transform: none;
  border-color: var(--line-2);
  box-shadow: none;
}
.btn .soon {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}

.hero__viz {
  position: relative;
  min-width: 0;
}
.stage {
  position: relative;
  width: 100%;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.stage--hero {
  aspect-ratio: 1 / 0.9;
}
.hero__caption {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

.stats {
  margin: clamp(36px, 5vw, 64px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.stat {
  padding: clamp(18px, 2.4vw, 28px);
  border-left: 1px solid var(--line);
}
.stat:first-child {
  border-left: 0;
}
.stat__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat__num {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__num small {
  font-size: 0.48em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 3px;
}
.stat__desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

/* --------------------------------------------------------------- sections */
.section {
  padding: var(--section) 0;
  position: relative;
}
.section--tint {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}
.section__head {
  max-width: 860px;
  margin-bottom: clamp(32px, 4.5vw, 56px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow b {
  font-weight: 600;
  color: var(--c);
}
.eyebrow::after {
  content: "";
  flex: 0 0 56px;
  height: 1px;
  background: var(--line-2);
}
.section__head h2 {
  margin-top: 18px;
  font-size: clamp(31px, 4.5vw, 54px);
}
.lede {
  margin-top: 20px;
  font-size: clamp(17px, 1.55vw, 19.5px);
  color: var(--ink-2);
  max-width: 44em;
}
.lede + .lede {
  margin-top: 14px;
}

.reveal {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(22px);
}

/* --------------------------------------------------------------- abstract */
.abstract {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: start;
}
.abstract h2 {
  font-size: clamp(26px, 3vw, 36px);
}
.abstract__body {
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.75;
  color: var(--ink-2);
}
.abstract__body strong {
  color: var(--ink);
  font-weight: 600;
}
.hl-a,
.hl-b,
.hl-c {
  font-weight: 600;
  white-space: nowrap;
}
.hl-a {
  color: var(--a);
}
.hl-b {
  color: var(--b);
}
.hl-c {
  color: var(--c);
}

/* --------------------------------------------------------------- criteria */
.criteria {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: crit;
}
.criterion {
  position: relative;
  padding: 24px 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.criterion__icon {
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
  background: radial-gradient(120% 120% at 30% 20%, var(--c-soft), transparent 75%), var(--surface-2);
}
.criterion__icon * {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.criterion__icon .t {
  stroke: var(--line-2);
  stroke-width: 2.2;
}
.criterion__icon .g {
  stroke: var(--c);
  stroke-width: 3;
}
.criterion__icon .gf {
  fill: var(--c);
  stroke: none;
}
.criterion__icon .kf {
  fill: var(--ink);
  stroke: var(--surface-2);
  stroke-width: 1.4;
}
.criterion__icon .sf {
  fill: var(--surface-2);
  stroke: var(--ink);
  stroke-width: 2;
}
/* 1: a phase that keeps turning, with no seam on the way */
.criterion__icon .spin {
  transform-origin: 32px 32px;
  animation: orbit 7s linear infinite;
}
/* 2: two neighbouring phases stay neighbours all the way round */
.criterion__icon .sway {
  transform-origin: 32px 32px;
  animation: sway 5.5s ease-in-out infinite alternate;
}
@keyframes sway {
  from {
    transform: rotate(-150deg);
  }
  to {
    transform: rotate(150deg);
  }
}
/* 3: a sample travels from its source to its target along the circle */
.criterion__icon .trace {
  stroke-dasharray: 1 3;
  stroke-dashoffset: 0;
  animation: trace 3.8s var(--ease) infinite;
}
.criterion__icon .mover {
  transform-origin: 32px 32px;
  transform: rotate(165deg);
  animation: mover 3.8s var(--ease) infinite;
}
@keyframes trace {
  0%,
  10% {
    stroke-dashoffset: 1.001;
    opacity: 1;
  }
  64%,
  88% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}
@keyframes mover {
  0% {
    transform: rotate(0deg);
    opacity: 0;
  }
  10% {
    transform: rotate(0deg);
    opacity: 1;
  }
  64%,
  88% {
    transform: rotate(165deg);
    opacity: 1;
  }
  100% {
    transform: rotate(165deg);
    opacity: 0;
  }
}
.criterion h3 {
  font-size: 20.5px;
}
.criterion h3 span {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.criterion p {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------- panels */
.panels {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}
.panel {
  --accent: var(--c);
  --accent-soft: var(--c-soft);
  position: relative;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 85%);
}
.panel--a {
  --accent: var(--a);
  --accent-soft: var(--a-soft);
}
.panel--b {
  --accent: var(--b);
  --accent-soft: var(--b-soft);
}
.panel--c {
  --accent: var(--c);
  --accent-soft: var(--c-soft);
}
.panel__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}
.panel__copy {
  padding: clamp(22px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.panel__viz {
  min-width: 0;
  padding: clamp(12px, 1.6vw, 20px);
  border-left: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 62%),
    var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Panel variant with the text on top and the figures across the full width. */
.panel--stack .panel__grid {
  grid-template-columns: minmax(0, 1fr);
}
.copy__cols {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px clamp(24px, 4vw, 56px);
  font-size: 16px;
  color: var(--ink-2);
}
.verdict.verdict--row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
}
.panel--stack .panel__viz {
  border-left: 0;
  border-top: 1px solid var(--line);
}
.cell__foot {
  display: grid;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
}
.cell__foot .controls {
  padding: 0;
}
.ministats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.ministats div {
  min-width: 0;
}
.ministats span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ministats b {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: color 0.25s ease;
}
.ministats .is-warn b {
  color: var(--o);
}
.ministats .is-bad b {
  color: var(--a);
}

.tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.panel h3 {
  margin-top: 18px;
  font-size: clamp(23px, 2.5vw, 31px);
}
.panel__copy > p {
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink-2);
}
.verdict {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.verdict li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.4;
}
.mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.mark--no {
  background: var(--a-soft);
  color: var(--a);
}
.mark--yes {
  background: var(--c-soft);
  color: var(--c);
}
.mark--na {
  background: var(--surface-3);
  color: var(--muted);
}

.readouts {
  margin-top: auto;
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.readout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.readout > span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
}
.readout b {
  display: block;
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.readout b small {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}
.readout.is-bad {
  border-color: var(--a);
  background: var(--a-soft);
}
.readout.is-bad b {
  color: var(--a);
}
.readout.is-warn b {
  color: var(--o);
}
.readout.is-good b {
  color: var(--c);
}

.demo {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
/* Beside a taller text column the figure grows to the full height of the panel;
   its aspect ratio then acts as the minimum height. */
.panel__viz > .demo {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.panel__viz > .demo > .stage {
  flex: 1 1 auto;
}
.stage--a {
  aspect-ratio: 16 / 10.4;
}
.stage--b1 {
  aspect-ratio: 1 / 0.86;
}
.stage--b2 {
  aspect-ratio: 1 / 0.86;
}
.stage--c {
  aspect-ratio: 16 / 9.6;
}
.demo__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.demo__cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  overflow: hidden;
}
.demo__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.demo__title em {
  font-style: normal;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 4px 6px 2px;
  font-size: 13.5px;
  color: var(--muted);
}
.controls label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.controls output {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  min-width: 4.2em;
  font-variant-numeric: tabular-nums;
}
.controls .hint {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--faint);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.icon-btn:hover {
  border-color: var(--accent, var(--ink));
}
.icon-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.icon-btn .i-play,
.icon-btn.is-paused .i-pause {
  display: none;
}
.icon-btn.is-paused .i-play {
  display: block;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(110px, 16vw, 180px);
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent, var(--c)) var(--fill, 50%), var(--line-2) var(--fill, 50%));
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--line-2);
}
input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--accent, var(--c));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent, var(--c));
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--accent, var(--c));
  background: var(--surface);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  padding: 5px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.seg button:hover {
  color: var(--ink);
}
.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--faint);
}

/* ----------------------------------------------------------------- matrix */
.matrix {
  margin-top: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  overflow: hidden;
}
.matrix__scroll {
  overflow-x: auto;
}
.matrix table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
.matrix th,
.matrix td {
  padding: 18px clamp(14px, 2vw, 26px);
  text-align: center;
  border-top: 1px solid var(--line);
}
.matrix thead th {
  border-top: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: bottom;
}
.matrix tbody th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.matrix tbody th small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.matrix tbody th::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--row);
  vertical-align: 2px;
}
.matrix tr.is-ours {
  background: linear-gradient(90deg, var(--c-soft), transparent);
}
.matrix .mark {
  width: 30px;
  height: 30px;
  font-size: 15px;
  margin: 0;
}
.matrix caption {
  caption-side: bottom;
  padding: 14px clamp(14px, 2vw, 26px) 18px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 13.5px;
  color: var(--muted);
}

.callout {
  margin-top: clamp(20px, 3vw, 32px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  padding: clamp(22px, 3vw, 34px) clamp(22px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(80% 140% at 0% 50%, var(--b-soft), transparent 60%),
    radial-gradient(80% 140% at 100% 50%, var(--c-soft), transparent 60%),
    var(--surface);
}
.callout__num {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--b);
}
.callout__num small {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.callout h3 {
  font-size: clamp(20px, 2.1vw, 26px);
}
.callout > div > p {
  margin-top: 8px;
  font-size: 15.5px;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------- method */
.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.step {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(14px, 2vw, 26px);
  align-items: center;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.step:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.step .stage {
  aspect-ratio: 1;
}
.step__n {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--c);
}
.step h3 {
  margin-top: 8px;
  font-size: 21px;
}
.step p {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.step .eq {
  margin-top: 13px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 15px;
  overflow-x: auto;
  overflow-y: hidden;
}
.method__foot {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.fact {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink-2);
}
.fact svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  fill: none;
  stroke: var(--c);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fact b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------------------------- results */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 16px;
  align-items: stretch;
}
.grid-2--even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-2 + .grid-2,
.card + .grid-2,
.grid-2 + .card {
  margin-top: 16px;
}
.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card__head {
  display: grid;
  gap: 16px;
  justify-items: start;
}
.card h3 {
  font-size: clamp(21px, 2.1vw, 26px);
}
.card__sub {
  margin-top: 8px;
  max-width: 58em;
  font-size: 15px;
  color: var(--ink-2);
}
.card__sub b {
  color: var(--ink);
  font-weight: 600;
}
/* The note sits at the bottom edge, so that neighbouring cards end on the same line. */
.card__note {
  margin-top: auto;
  padding-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.bars {
  margin-top: 20px;
  display: grid;
  gap: 5px;
}
.bar {
  display: grid;
  grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.2;
}
.bar__name {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar__track {
  position: relative;
  height: 16px;
  border-radius: 5px;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / var(--ticks, 5)));
  overflow: hidden;
}
.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v, 0) * 100%);
  border-radius: 5px;
  background: var(--n);
  opacity: 0.55;
  transform-origin: 0 50%;
  transition: width 0.9s var(--ease);
}
.bar__val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-align: right;
}
.bar.is-base .bar__fill {
  background: var(--a);
  opacity: 0.8;
}
.bar.is-ours .bar__name,
.bar.is-ours .bar__val {
  color: var(--ink);
  font-weight: 700;
}
.bar.is-ours .bar__fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, transparent), var(--c));
  opacity: 1;
}
.bars__axis {
  display: grid;
  grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) 54px;
  gap: 12px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}
.bars__axis div {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
}
.js .bars:not(.is-in) .bar__fill {
  width: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--k);
}

.vchart {
  --h: 250px;
  margin-top: 26px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0 8px;
}
.vchart__axis {
  position: relative;
  height: var(--h);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}
.vchart__axis span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  bottom: calc(var(--p) * 100%);
}
.vchart__plot {
  position: relative;
  height: var(--h);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(10px, 2.4vw, 34px);
  border-bottom: 1px solid var(--line-2);
  background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px calc(100% / var(--ticks, 4)));
}
.vgroup {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2px, 0.5vw, 6px);
  height: 100%;
}
.vbar {
  position: relative;
  flex: 1 1 0;
  max-width: 46px;
  height: calc(var(--v) * 100%);
  border-radius: 6px 6px 0 0;
  background: var(--k);
  transform-origin: 50% 100%;
  transition: transform 0.9s var(--ease);
}
.js .vchart:not(.is-in) .vbar {
  transform: scaleY(0);
}
.vbar b {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: opacity 0.5s ease 0.5s;
}
.js .vchart:not(.is-in) .vbar b {
  opacity: 0;
}
.vbar.is-ours b {
  color: var(--ink);
  font-weight: 700;
}
.vbar .err {
  position: absolute;
  left: 50%;
  width: 0;
  border-left: 1.5px solid var(--ink);
  bottom: calc(100% - var(--e) / var(--v) * 100%);
  height: calc(2 * var(--e) / var(--v) * 100%);
  opacity: 0.75;
}
.vbar .err::before,
.vbar .err::after {
  content: "";
  position: absolute;
  left: -4.5px;
  width: 8px;
  border-top: 1.5px solid var(--ink);
}
.vbar .err::before {
  top: 0;
}
.vbar .err::after {
  bottom: 0;
}
.vbar.has-err b {
  bottom: calc(100% + var(--e) / var(--v) * 100% + 5px);
}
.vchart__labels {
  grid-column: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(10px, 2.4vw, 34px);
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: center;
  color: var(--ink-2);
}
.vchart__labels small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.linechart {
  margin-top: 22px;
}
.linechart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.linechart .gridline {
  stroke: var(--line);
  stroke-width: 1;
}
.linechart .axis {
  fill: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}
.linechart .xlab {
  fill: var(--ink-2);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
}
.linechart .xsub {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 11.5px;
}
.linechart .line {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.linechart .area {
  fill: url(#kappaFill);
}
.linechart .pt {
  fill: var(--surface);
  stroke: var(--c);
  stroke-width: 2.4;
}
.linechart .pt.is-uniform {
  stroke: var(--n);
}
.linechart .val {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
}
.linechart .seg-uniform {
  stroke: var(--n);
  stroke-dasharray: 4 5;
}
.js .linechart:not(.is-in) .line {
  stroke-dashoffset: var(--len);
}
.linechart .line {
  stroke-dasharray: var(--len);
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.4s var(--ease);
}
.linechart .pt,
.linechart .val,
.linechart .area {
  transition: opacity 0.6s ease 0.7s;
}
.js .linechart:not(.is-in) .pt,
.js .linechart:not(.is-in) .val,
.js .linechart:not(.is-in) .area {
  opacity: 0;
}

.kv__label {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.kv {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.kv__label + .kv {
  margin-top: 10px;
}
.kv div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.kv dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.kv dd {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- real world */
.robot {
  margin-top: clamp(28px, 4vw, 48px);
}
.robot__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.robot__head h3 {
  font-size: clamp(22px, 2.4vw, 29px);
}
.robot__head p {
  font-size: 14.5px;
  color: var(--muted);
}
.robot__head .score {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
}
.robot__head .score b {
  color: var(--c);
  font-weight: 700;
}
.vgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.vcard {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s var(--ease), box-shadow 0.3s ease;
}
.vcard:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}
.vcard__media {
  position: relative;
  background: #05070a;
  cursor: zoom-in;
  overflow: hidden;
}
.vcard__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vcard__badges {
  position: absolute;
  inset: 10px 10px auto 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(6, 9, 14, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f3f6fb;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge--ok::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc97;
}
.vcard__play {
  position: absolute;
  inset: auto 10px 10px auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(6, 9, 14, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f3f6fb;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.vcard__play svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vcard:hover .vcard__play,
.vcard__play:focus-visible {
  opacity: 1;
}
.vcard__bar {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.vcard__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: #3ddc97;
}
.vcard {
  display: flex;
  flex-direction: column;
}
.vcard figcaption {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
}
.vcard__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.vcard h4 {
  font-size: 19px;
}
.vcard__score {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.vcard__score b {
  color: var(--c);
  font-weight: 700;
}
.vcard__desc {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.joints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.joints span {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--jc, var(--c)) 45%, transparent);
  background: color-mix(in srgb, var(--jc, var(--c)) 12%, transparent);
  color: var(--jc, var(--c));
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.vcard__layouts {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.rw-stack {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  gap: 16px;
}
.rw-split {
  margin-top: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr);
  gap: clamp(22px, 3.4vw, 48px);
  align-items: stretch;
}
.rw-summary {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.rw-summary .kv__label {
  margin-top: auto;
  padding-top: 22px;
}
.rw-summary__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.rw-summary__num {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 62px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}
.rw-summary__num small {
  margin-left: 6px;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.rw-summary__desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.rw-summary .bars {
  margin-top: 20px;
  gap: 9px;
}
.rw-summary .bar {
  grid-template-columns: 92px minmax(0, 1fr) 26px;
  gap: 10px;
}
.rw-summary .bar__fill {
  background: var(--k);
  opacity: 0.85;
}
.rw-summary .kv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rw-summary .kv div {
  background: var(--surface);
}
.rw-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 14px;
}
.rw-table th,
.rw-table td {
  padding: 9px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.rw-table thead th {
  border-top: 0;
  padding-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  vertical-align: bottom;
  line-height: 1.35;
  white-space: nowrap;
}
.rw-table thead th:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.rw-table thead th i {
  display: block;
  width: 18px;
  height: 3px;
  margin-bottom: 7px;
  border-radius: 2px;
  background: var(--k);
}
.rw-table tbody th {
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.rw-table tbody th small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
.rw-table tr.is-first th,
.rw-table tr.is-first td {
  border-top-color: var(--line-2);
}
.dots {
  display: grid;
  grid-template-columns: repeat(5, 7px);
  gap: 3px;
}
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background-color 0.35s ease, transform 0.35s var(--ease);
  transition-delay: calc(var(--i) * 28ms);
}
.dots i.on {
  background: var(--k);
}
.js .rw-table:not(.is-in) .dots i.on {
  background: var(--line-2);
  transform: scale(0.6);
}
.cell {
  display: flex;
  align-items: center;
  gap: 9px;
}
.cell b {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cell.is-best b {
  color: var(--ink);
  font-weight: 700;
}
.rw-table tfoot th,
.rw-table tfoot td {
  border-top: 1px solid var(--line-2);
  padding-top: 13px;
  font-weight: 600;
}
.rw-table tfoot td {
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.rw-table tfoot td.is-ours {
  color: var(--c);
}

.figure {
  margin: 0;
}
.figure figcaption {
  max-width: 62em;
}
.figure__frame {
  margin-top: 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f4f6f8;
  border: 1px solid var(--line);
}
.figure__frame img {
  width: 100%;
  height: auto;
}
.figure__hint {
  display: none;
  margin-top: 10px;
}

/* ----------------------------------------------------------------- footer */
.footer {
  padding: clamp(40px, 6vw, 72px) 0 44px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
}
.footer h2 {
  font-size: 22px;
}
.footer p {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 40em;
}
.bibtex {
  position: relative;
  margin: 14px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
}
.bibtex.is-soon {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}
.copy-btn {
  margin-top: 10px;
}
.footer__meta {
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--faint);
}
[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------- lightbox */
.lightbox {
  width: min(94vw, 760px);
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(4, 6, 10, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  animation: pop 0.28s var(--ease);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.lightbox__bar h2 {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox__bar small {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 8px;
}
.lightbox__close {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
}
.lightbox__close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.lightbox video {
  width: 100%;
  max-height: calc(94vh - 62px);
  background: #000;
  object-fit: contain;
}

/* ------------------------------------------------------------- responsive */
/* Two narrow columns of method cards: slightly smaller formulas stay inside their boxes. */
@media (min-width: 1081px) and (max-width: 1180px) {
  .step .eq {
    padding: 11px 10px;
    font-size: 13.5px;
  }
}

@media (max-width: 1080px) {
  .panel__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel__viz {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .readouts {
    margin-top: 0;
  }
  .copy__cols {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Title above its note in both cells, so that the two canvases start on the same line. */
  .demo__title {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .matrix th,
  .matrix td {
    padding-left: 10px;
    padding-right: 10px;
  }
  .matrix tbody th {
    padding-left: clamp(14px, 2vw, 26px);
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-2,
  .grid-2--even,
  .rw-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tablet widths: fixed columns, so that the three criteria share the width evenly. */
@media (min-width: 641px) and (max-width: 1080px) {
  .matrix table {
    min-width: 0;
    table-layout: fixed;
  }
  .matrix thead th:first-child {
    width: 34%;
  }
  .matrix thead th {
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  .matrix th,
  .matrix td {
    padding-left: 6px;
    padding-right: 6px;
  }
  .matrix tbody th {
    padding-left: clamp(14px, 2vw, 26px);
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage--hero {
    aspect-ratio: 1 / 0.82;
    max-width: 560px;
    margin-inline: auto;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .abstract {
    grid-template-columns: minmax(0, 1fr);
  }
  .criteria {
    grid-template-columns: minmax(0, 1fr);
  }
  .criterion {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
  }
  .criterion__icon {
    grid-row: span 2;
    margin: 0;
  }
  .callout {
    grid-template-columns: minmax(0, 1fr);
  }
  .method__foot,
  .footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .vgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  :root {
    --nav-h: 54px;
  }
  .brand span {
    display: none;
  }
  .nav__inner {
    gap: 6px;
  }
  .nav__links {
    gap: 0;
  }
  .nav__links a {
    padding: 7px clamp(4px, 1.5vw, 9px);
    font-size: clamp(11.5px, 3.2vw, 13.5px);
  }
  .theme-toggle {
    width: 34px;
    height: 34px;
  }
  .seg button {
    padding: 5px 9px;
    font-size: 12.5px;
  }
  .kicker {
    font-size: clamp(10px, 3vw, 12px);
  }
  .matrix table {
    min-width: 0;
  }
  .matrix th,
  .matrix td {
    padding: 13px 4px;
  }
  .matrix thead th {
    font-family: var(--font-body);
    font-size: 10.5px;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.3;
  }
  .matrix tbody th {
    padding-left: 12px;
    font-size: 14px;
  }
  .matrix tbody th small {
    display: none;
  }
  .matrix tbody th::before {
    width: 8px;
    height: 8px;
    margin-right: 7px;
    vertical-align: 1px;
  }
  .matrix .mark {
    width: 26px;
    height: 26px;
  }
  .step .eq {
    font-size: 13px;
    padding: 10px 10px;
  }
  .stage--a {
    aspect-ratio: 1 / 1.4;
  }
  .stage--c {
    aspect-ratio: 1 / 1.34;
  }
  .demo__pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .step {
    grid-template-columns: minmax(0, 1fr);
  }
  .step .stage {
    max-width: 200px;
    margin-inline: auto;
  }
  .bar,
  .bars__axis {
    grid-template-columns: minmax(84px, 112px) minmax(0, 1fr) 42px;
    gap: 8px;
  }
  .bar {
    font-size: 12.5px;
  }
  .bar__val {
    font-size: 12.5px;
  }
  .kv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vchart {
    --h: 210px;
    grid-template-columns: 28px minmax(0, 1fr);
  }
  /* Narrow bars: the values are set vertically so that neighbours do not collide. */
  .vbar b {
    font-size: 10px;
    writing-mode: vertical-rl;
    transform: translateX(-50%) rotate(180deg);
  }
  .vchart {
    margin-top: 40px;
  }
  .vchart__labels {
    font-size: 12px;
  }
  .linechart .xlab {
    font-size: 11.5px;
  }
  .linechart .xsub {
    font-size: 10.5px;
  }
  .figure__frame {
    overflow-x: auto;
  }
  .figure__frame img {
    width: 760px;
    max-width: none;
  }
  .figure__hint {
    display: block;
  }
  .vgrid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 420px;
    margin-inline: auto;
  }
  .rw-table {
    font-size: 13px;
  }
  .rw-table th,
  .rw-table td {
    padding: 8px 3px;
  }
  .rw-table thead th {
    font-size: 10.5px;
    white-space: normal;
  }
  .rw-table tbody th {
    white-space: normal;
    line-height: 1.3;
  }
  .rw-table tbody th small {
    font-size: 9.5px;
  }
  .dots {
    grid-template-columns: repeat(5, 4px);
    gap: 2px;
  }
  .dots i {
    width: 4px;
    height: 4px;
  }
  .cell {
    gap: 4px;
  }
  .cell b {
    font-size: 11.5px;
  }
  .rw-table tfoot td {
    font-size: 12px;
    white-space: nowrap;
  }
  .rw-table tfoot .of {
    font-size: 9.5px;
    word-spacing: -0.35em;
    opacity: 0.75;
  }
  .controls .hint {
    margin-left: 0;
    flex-basis: 100%;
  }
  .robot__head .score {
    margin-left: 0;
  }
}

/* Very small phones: the last things that would otherwise scroll sideways. */
@media (max-width: 380px) {
  .seg button {
    padding: 5px 7px;
    font-size: 11.5px;
  }
}
@media (max-width: 340px) {
  .brand {
    display: none;
  }
  .kicker {
    gap: 8px;
    padding: 5px 10px 5px 8px;
    font-size: 9.5px;
  }
  .matrix thead th {
    font-size: 9.5px;
  }
  .matrix tbody th {
    padding-left: 10px;
    font-size: 12.5px;
  }
  .matrix .mark {
    width: 22px;
    height: 22px;
  }
  .step .eq {
    font-size: 12px;
    padding: 9px 8px;
  }
  .rw-table .dots {
    display: none;
  }
  .rw-table .cell b {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .criterion__icon *,
  .brand__mark .orbit {
    animation: none !important;
  }
  .js .reveal:not(.is-in) {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .nav,
  .progress,
  .controls,
  .lightbox {
    display: none !important;
  }
  .js .reveal:not(.is-in) {
    opacity: 1;
    transform: none;
  }
}
