:root {
  color-scheme: light;
  --ink: #183e54;
  --text: #24323b;
  --muted: #53616a;
  --rule: #d4dde3;
  --accent: #286f99;
  --belt: #2c3439;
  --early: #2b7bba;
  --late: #e4572e;
  --other: #8c8c8c;
  --success: #e6e6e6;
}

html { font-size: 17px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-size: 1rem; font-variant-numeric: tabular-nums; }
img, video { display: block; max-width: 100%; height: auto; }
/* Bulma's reset gives article and other elements display: block, which beats the hidden attribute. */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.title { color: var(--ink); }
.section { padding: 2.5rem 1.5rem; }
.title.is-3 { margin-bottom: 1.25rem !important; padding-bottom: 0; }
.title.is-5 { margin-bottom: 0.5rem !important; }
sub, sup { font-size: 0.72em; }
/* Bulma's .container centers itself with auto margins; inside the flex-column .hero that sizes it to its content,
   and a carousel's fixed-width slides then widen it past a phone screen. Full width keeps it at the screen (or
   Bulma's max-width on desktops). */
.hero > .container { width: 100%; }
.container.is-max-desktop { max-width: 1040px; }
.slider { min-width: 0; }

/* ---------------------------------------------------------------- hero */
#top .hero-body { padding: 3rem 1.5rem 5rem; }
.hero-mosaic { position: relative; overflow: hidden; background: var(--belt); min-height: min(37.5vw, 66vh); justify-content: center; }
.hero-mosaic .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hero-mosaic::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 55% at center, rgba(10, 18, 24, 0.72), rgba(10, 18, 24, 0.18));
}
.hero-mosaic .hero-body { position: relative; z-index: 1; flex-grow: 0; }
.hero-mosaic .publication-title { color: #fff !important; }
.hero-mosaic .publication-subtitle, .hero-mosaic .publication-authors { color: rgba(255, 255, 255, 0.86); }
.hero-mosaic .publication-authors a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); }
.hero-mosaic .publication-affiliations { color: rgba(255, 255, 255, 0.75); margin-bottom: 1rem; }
.publication-authors .author-block, .publication-affiliations .author-block { white-space: nowrap; }
.publication-affiliations .author-block + .author-block { margin-left: 0.9rem; }
/* template.css sets the dark button's colours with !important. */
.hero-mosaic .publication-links .button.is-dark { background: rgba(255, 255, 255, 0.94) !important; color: var(--ink) !important; }
.hero-mosaic .publication-links .button.is-dark:hover { background: #fff !important; }
/* The belt-speed bar along the video's bottom edge. Below 769 px the video is cropped at the sides, so the ends say
   slower / faster instead of the outer columns' speeds. */
.hero-scale {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; margin: 0; padding: 2.2rem 1.25rem 0.9rem;
  display: flex; align-items: center; gap: 1.25rem; color: #fff; font-size: 1.15rem; font-weight: 700;
  background: linear-gradient(rgba(10, 18, 24, 0), rgba(10, 18, 24, 0.8)); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.hero-scale .word { display: none; }
.hero-scale .track {
  position: relative; flex: 1; height: 6px; margin-right: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--early), var(--late));
}
.hero-scale .track::after {
  content: ""; position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  border-left: 16px solid var(--late); border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}
.hero-scale .track span {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); white-space: nowrap;
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em;
}
@media (max-width: 768px) {
  .hero-scale { font-size: 0.95rem; gap: 0.75rem; padding: 1.9rem 0.75rem 0.6rem; }
  .hero-scale .num { display: none; }
  .hero-scale .word { display: inline; }
  .hero-scale .track span { font-size: 0.8rem; }
}
.publication-title { margin-bottom: 0.5rem !important; letter-spacing: -0.02em; color: var(--ink) !important; }
.publication-subtitle { color: var(--muted); margin-bottom: 0.75rem; }
.publication-authors { margin-bottom: 0.75rem; color: var(--muted); }
.publication-links { display: flex; flex-wrap: wrap; justify-content: center; }
.publication-links .icon svg { width: 1.1em; height: 1.1em; }

.teaser { padding: 0 1.5rem; }
.teaser .hero-body { padding: 0.5rem 0 2rem; }
.teaser-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.teaser-cell { position: relative; background: var(--belt); border-radius: 8px; overflow: hidden; }
.teaser-cell video { width: 100%; aspect-ratio: 480 / 342; object-fit: cover; }
.speed-tag {
  position: absolute; left: 0.4rem; top: 0.4rem; background: rgba(24, 62, 84, 0.86); color: #fff;
  font-size: 0.85rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 4px;
}
.teaser figcaption { margin-top: 0.75rem; color: var(--muted); }
/* ---------------------------------------------------------------- text */
.tldr { font-size: 1.1rem; line-height: 1.65; color: var(--text); margin-bottom: 1.75rem; }
.content.has-text-justified { font-size: 1.02rem; line-height: 1.7; color: var(--text); }
.finding { line-height: 1.65; color: var(--text); margin-bottom: 1rem; }
.rule, .caption, .count, figcaption { color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.caption { margin: 0.5rem 0 0.75rem; }
.note { font-size: 0.86rem; color: var(--muted); border-left: 3px solid var(--rule); padding-left: 0.75rem; margin-top: 0.75rem; }
.media-figure { margin: 1.25rem 0 1.5rem; }
.media-figure figcaption { margin-top: 0.4rem; }
.bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0.25rem 0 0.5rem; }
.bar .rule { flex: 1 1 22rem; margin: 0; }
.bar .buttons { margin-bottom: 0 !important; }
.bar .buttons .button { margin-bottom: 0; }

/* ---------------------------------------------------------------- task carousel and list */
.carousel, .slider { overflow: hidden; }
.slider-pagination { position: static; padding: 0.25rem 1rem 0; }
.results-carousel { padding: 0.25rem 0 0.25rem; }
.results-carousel .item { margin: 0.5rem; padding: 0.75rem; font-size: 0.9rem; }
.item .frame, .gallery-card .frame { position: relative; background: var(--belt); aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.item video, .gallery-card video, .cell video { width: 100%; height: 100%; object-fit: cover; }
.item h4, .gallery-card h4 { margin: 0.5rem 0 0; font-weight: 600; color: var(--ink); font-size: 0.98rem; }
.item .meta, .gallery-card .meta { font-size: 0.78rem; color: var(--muted); margin: 0; }
.item .instr, .gallery-card .instr { font-size: 0.85rem; margin: 0.15rem 0 0; }
.slider-navigation-previous, .slider-navigation-next { box-shadow: 0 2px 5px rgba(24, 62, 84, 0.25); }
.all-tasks { margin-top: 0.5rem; }
.all-tasks > summary { list-style: none; }
.all-tasks > summary::-webkit-details-marker { display: none; }
.all-tasks[open] > summary { margin-bottom: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0; }
.chips .button { margin: 0; }
.chips .button .n { margin-left: 0.3rem; opacity: 0.7; font-size: 0.85em; }
.chips .sw { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.35rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.25rem 0.9rem; }

/* ---------------------------------------------------------------- chart */
.chart-figure { margin: 0.5rem 0 1.5rem; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; display: block; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .axis text, .chart .axis-title { fill: var(--muted); font-size: 12px; }
.chart .series path.line { fill: none; stroke-width: 2.2; }
.chart .series path.band { opacity: 0.13; stroke: none; }
.chart .series.orig path.line { stroke-dasharray: 6 4; stroke-width: 1.8; }
.chart .series circle { stroke-width: 1.4; }
.chart .series.orig circle { fill: #fff; }
.chart .cursor { stroke: var(--ink); stroke-width: 1; opacity: 0.35; }
.chart .tip {
  position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.45rem 0.6rem; font-size: 0.8rem; line-height: 1.35; box-shadow: 0 2px 6px rgba(24, 62, 84, 0.12); min-width: 11rem;
}
.chart .tip b { color: var(--ink); }
.chart .tip .row { display: flex; justify-content: space-between; gap: 0.8rem; }
.chart .tip .sw { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 2px; margin-right: 0.3rem; }
.findings { margin-top: 1.5rem; }
.finding-block + .finding-block { margin-top: 2rem; }
.findings img { display: block; margin: 0.25rem auto 0.75rem; }

/* ---------------------------------------------------------------- failures */
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.25rem 1rem; margin: 0.25rem 0 0.75rem; font-size: 0.8rem; color: var(--muted); }
.legend > div { display: flex; gap: 0.4rem; align-items: baseline; }
.legend dt { flex: none; }
.legend dd { margin: 0; line-height: 1.35; }
.label { display: inline-block; font-size: 0.72rem; line-height: 1.35; padding: 0.02rem 0.4rem; border-radius: 3px; color: #fff; white-space: nowrap; }
.label.success { background: var(--success); color: var(--text); }
.label.early { background: var(--early); }
.label.late { background: var(--late); }
.label.other { background: var(--other); }
.label.failure { background: var(--late); }

.matrix { display: grid; grid-template-columns: 4.5rem repeat(var(--cols, 8), minmax(0, 1fr)); gap: 0.35rem; align-items: start; }
.matrix .colhead { font-size: 0.8rem; font-weight: 600; color: var(--ink); text-align: center; align-self: end; line-height: 1.25; }
.matrix .rowhead { font-size: 0.82rem; font-weight: 600; color: var(--ink); align-self: center; }
.cell { margin: 0; text-align: center; }
.cell .frame { position: relative; background: var(--belt); aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.cell .label { margin-top: 0.2rem; white-space: normal; }
.cell .rerender { display: block; font-size: 0.68rem; color: var(--muted); }
.lead { font-size: 1.1rem; line-height: 1.6; color: var(--text); }
/* An extra viewer below the main one: a divider, then a heading that opens it, aligned like the rest. */
.more { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.more > summary {
  display: flex; align-items: center; gap: 0.6rem; cursor: pointer; list-style: none;
  font-size: 1.05rem; font-weight: 600; color: var(--ink);
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before {
  content: ""; flex: none; width: 0.5rem; height: 0.5rem; margin-left: 0.15rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
  transition: transform 0.15s;
}
.more[open] > summary::before { transform: rotate(45deg); }
.more > summary:hover { color: var(--accent); }
.more[open] > summary { margin-bottom: 0.75rem; }
.matrix .colhead .sub { display: block; font-weight: 400; color: var(--muted); }
@media (max-width: 768px) {
  .matrix { grid-template-columns: 6.5rem repeat(var(--cols, 3), minmax(0, 1fr)); }
  .matrix.collapse { grid-template-columns: 2.8rem repeat(var(--cols, 4), minmax(0, 1fr)); }
  .matrix.collapse .colhead { font-size: 0.64rem; overflow-wrap: anywhere; }
}

/* ---------------------------------------------------------------- real robot */
#real-figure { max-width: 40rem; margin: 0 auto; }
.real-row { margin: 0.75rem 0 1rem; }
.real-row h4 { font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.real-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.real-pair .cell { text-align: left; }
.real-pair .frame { aspect-ratio: 224 / 168; border-radius: 6px; }
.real-pair .who { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-top: 0.25rem; }
.real-pair .fig-note { display: block; font-size: 0.85rem; color: var(--muted); }
.close-tag {
  position: absolute; right: 0.4rem; top: 1.9rem; font-size: 0.75rem; font-weight: 600; color: #1e293b;
  background: #ffd400; padding: 0.05rem 0.45rem; border-radius: 4px;
}
.input-tag {
  position: absolute; left: 0.4rem; top: 0.4rem; font-size: 0.75rem; font-weight: 600; color: #fff; white-space: nowrap;
  background: rgba(24, 62, 84, 0.86); padding: 0.05rem 0.45rem; border-radius: 4px;
}
.input-tag .short { display: none; }
@media (max-width: 1023px) {
  .input-tag .long { display: none; }
  .input-tag .short { display: inline; }
}

@media (max-width: 560px) {
  .teaser .hero-body { padding: 0.25rem 0 1.5rem; }
  .speed-tag { font-size: 0.7rem; left: 0.2rem; top: 0.2rem; padding: 0 0.3rem; }
  .input-tag { font-size: 0.7rem; left: 0.2rem; top: 0.2rem; padding: 0 0.3rem; }
  .close-tag { top: 1.5rem; right: 0.2rem; font-size: 0.7rem; padding: 0 0.3rem; }
  .tldr { font-size: 1.02rem; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.6rem; }
}

@media (min-width: 769px) {
  html { font-size: 18px; }
  .hero-mosaic .publication-title { font-size: 3.5rem; }
  .hero-mosaic .publication-links .button { font-size: 1.1rem; }
}
