@font-face {
  font-family: Sora;
  src: url('../assets/fonts/sora-regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url('../assets/fonts/inter-variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #161616;
  --line: #333;
  --text: #fff;
  --body: #ccc;
  --muted: #8c8c8c;
  --reference: #777;
  --accent: #b6a2fa;
  --v1: #ee837c;
  --v2: #9bcab0;
  --v3: #dbc47f;
  --sans: Inter, sans-serif;
  --font-heading: Sora, sans-serif;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  scrollbar-width: none;
}
*, *::before, *::after { box-sizing: border-box; }
::-webkit-scrollbar { display: none; }
body, h2, p, figure { margin: 0; }
.experiment {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.figure-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 17px 26px;
  border-bottom: 1px solid var(--line);
}
.figure-header h2,
.response-heading,
.metric-header h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.4;
}
.figure-header h2 { font-size: 18px; }
.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--body);
  font-size: 12px;
  line-height: 1.4;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.legend li::before {
  content: '';
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--trace);
}
.legend strong { color: var(--trace); font-weight: 600; }
.comparison {
  display: grid;
  grid-template-columns: minmax(0, 2.7fr) minmax(183px, 1fr) minmax(190px, 1fr);
  grid-template-areas: "video responses plots";
  gap: 14px;
  padding: 26px;
}
.reference-video {
  grid-area: video;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #d6dbdf;
}
.reference-video video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.responses { grid-area: responses; }
.metric-plots { grid-area: plots; }
.responses, .metric-plots {
  display: grid;
  grid-template-rows: repeat(3, minmax(90px, 1fr));
  gap: 8px;
  min-width: 0;
}
.response {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-block: 5px;
  padding-inline: 18px 10px;
}
.response, .metric-plot {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.response-heading {
  display: block;
  color: var(--trace);
  font-size: 21px;
}
.canvas-frame { position: relative; min-width: 0; min-height: 0; }
.response .canvas-frame { align-self: stretch; }
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.deviation {
  display: block;
  margin-top: 7px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.deviation strong { color: var(--text); font-weight: 500; }
.metric-plot {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  padding: 8px 8px 3px;
}
.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.metric-header h2 { font-size: 12px; }
.metric-header p { color: var(--muted); font-size: 10px; white-space: nowrap; }
.metric-chart { cursor: crosshair; }
.playback {
  position: absolute;
  inset: auto auto 10px 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  background: #0a0a0a99;
  color: white;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}
.reference-video:hover .playback,
.reference-video.has-touch-controls .playback,
.playback:focus-visible { opacity: 1; pointer-events: auto; }
.playback:hover { background: #0a0a0acc; }
.playback::before {
  content: '';
  width: 13px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(12% 0, 100% 50%, 12% 100%);
}
.playback[data-playing="true"]::before {
  width: 12px;
  background: linear-gradient(to right, currentColor 4px, transparent 4px 8px, currentColor 8px);
  clip-path: none;
}
.playback:focus { outline: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 960px) {
  .comparison {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "video video"
      "responses plots";
  }
  .responses, .metric-plots { grid-template-rows: repeat(3, minmax(112px, 1fr)); }
}
@media (max-width: 720px) {
  .figure-header { padding: 12px 13px; }
  .figure-header h2 { font-size: 15px; }
  .legend { font-size: 11px; gap: 6px 10px; }
  .legend li { gap: 4px; }
  .legend li::before { width: 10px; }
  .comparison {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "video" "responses" "plots";
    gap: 10px;
    padding: 13px;
  }
  .responses { gap: 6px; }
  .response { grid-template-columns: 65px minmax(0, 158px); justify-content: center; }
  .response-heading { font-size: 17px; }
  .deviation { font-size: 11px; }
}
[data-variant="v1"] { --trace: var(--v1); }
[data-variant="v2"] { --trace: var(--v2); }
[data-variant="v3"] { --trace: var(--v3); }
