/* Steer2Grasp — project page.
   Layout follows the standard academic project-page template (Bulma).
   Anonymous submission: no author or affiliation information anywhere. */

:root {
  color-scheme: light;
}

html,
body {
  background-color: #ffffff;
  color: #363636;
}

body {
  font-family: 'Noto Sans', sans-serif;
}

.footer .icon-link {
  font-size: 25px;
  color: #000;
}

.link-block a {
  margin-top: 5px;
  margin-bottom: 5px;
}

.publication-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(2.5rem, 6.5vw, 4rem);
  line-height: 1.1;
}

.publication-subtitle {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  color: #4a4a4a;
  font-weight: 400;
  max-width: 760px;
  margin: 0 auto;
}

.publication-venue {
  color: #7a7a7a;
  font-size: 0.95rem;
  margin-top: 1.25rem;
}

.publication-links {
  margin-top: 1.75rem;
}

.title.is-3,
.title.is-4 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

.hero.teaser {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

.hero.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 3rem;
}

.section.is-light {
  background-color: #fafafa;
}

.content p {
  line-height: 1.7;
}

/* Figures ---------------------------------------------------------------- */
figure.figure {
  margin: 0;
}

/* The teaser reads fine well below the column width. */
figure.teaser-figure {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.teaser .figure-caption {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

figure.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure-caption {
  font-size: 0.9rem;
  color: #5a5a5a;
  line-height: 1.6;
  margin-top: 0.85rem;
}

.figure-caption strong {
  color: #363636;
}

/* Equations -------------------------------------------------------------- */
.equation {
  margin: 1.25rem 0;
  overflow-x: auto;
}

/* Videos ----------------------------------------------------------------- */
.video-grid {
  display: grid;
  gap: 1.25rem;
}

.video-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.video-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

@media screen and (max-width: 768px) {
  .video-grid.cols-2,
  .video-grid.cols-3 { grid-template-columns: 1fr; }
}

.video-item video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #f0f0f0;
}

.video-item .video-label {
  font-size: 0.88rem;
  color: #4a4a4a;
  margin-top: 0.5rem;
}

.video-item .video-label strong {
  color: #363636;
}

.main-video video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

/* Chapter list under the main video -------------------------------------- */
.chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.chapters button {
  cursor: pointer;
  border: 1px solid #dbdbdb;
  background: #fff;
  color: #4a4a4a;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-family: inherit;
}

.chapters button:hover {
  border-color: #b5b5b5;
  background: #f5f5f5;
}

.chapters button.is-active {
  border-color: #363636;
  background: #363636;
  color: #fff;
}

.chapters button .t {
  font-variant-numeric: tabular-nums;
  color: #7a7a7a;
  margin-right: 0.4rem;
}

.chapters button.is-active .t {
  color: #dbdbdb;
}

/* Tabs ------------------------------------------------------------------- */
.pill-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.pill-tabs button {
  cursor: pointer;
  border: 1px solid #dbdbdb;
  background: #fff;
  color: #4a4a4a;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
}

.pill-tabs button:hover { background: #f5f5f5; }

.pill-tabs button.is-active {
  border-color: #363636;
  background: #363636;
  color: #fff;
}

/* Tables ----------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
}

table.results {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

table.results thead th {
  font-weight: 600;
  color: #4a4a4a;
  padding: 0.5rem 0.6rem;
  text-align: right;
  border-bottom: 1px solid #363636;
  white-space: nowrap;
}

table.results thead th:first-child { text-align: left; }
table.results thead th.group { text-align: center; }

table.results tbody td {
  padding: 0.45rem 0.6rem;
  text-align: right;
  border-bottom: 1px solid #ededed;
}

table.results tbody td:first-child { text-align: left; }

table.results tbody tr.section-row td {
  font-weight: 600;
  color: #363636;
  background: #f5f5f5;
  text-align: left;
}

table.results tbody tr.ours td { font-weight: 600; }
table.results tbody tr.ours td:first-child { color: #1f6f43; }

table.results td.best { color: #1f6f43; font-weight: 700; }
table.results td.second { color: #9a6b00; }

.table-note {
  font-size: 0.82rem;
  color: #5a5a5a;
  line-height: 1.6;
  margin-top: 0.75rem;
}

/* BibTeX ----------------------------------------------------------------- */
pre.bibtex {
  background: #f5f5f5;
  border: 1px solid #ededed;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Long display equations stay inside the column on narrow screens. */
@media screen and (max-width: 600px) {
  .equation mjx-container { font-size: 88% !important; }
}

/* "2x" marker on the sped-up real-world clips. */
.video-item {
  position: relative;
}

.speed-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* Accent colour for the project. */
a { color: #4285f5; }
a:hover { color: #2b6fd6; }

.chapters button.is-active {
  border-color: #4285f5;
  background: #4285f5;
  color: #ffffff;
}

.chapters button.is-active .t { color: #d6e6ff; }

.pill-tabs button.is-active {
  border-color: #4285f5;
  background: #4285f5;
  color: #ffffff;
}

/* Qualitative comparisons: a horizontal carousel, one failure mode per slide. */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  padding: 0 3.25rem;
}

.carousel-pair {
  display: grid;
  gap: 0.6rem;
}

.carousel-pair video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #f0f0f0;
}

.row-caption {
  margin-top: 0.9rem;
  font-size: 1.08rem;
  line-height: 1.5;
  color: #363636;
  text-align: center;
}

.carousel-count {
  margin-top: 0.45rem;
  text-align: center;
  font-size: 0.85rem;
  color: #7a7a7a;
  font-variant-numeric: tabular-nums;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #4285f5;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.2);
  transition: background 0.15s ease;
}

.carousel-nav svg {
  width: 20px;
  height: 20px;
}

.carousel-nav:hover:not(:disabled) {
  background: #2b6fd6;
}

.carousel-nav:disabled {
  background: #d5dbe4;
  box-shadow: none;
  cursor: default;
}

.carousel-nav.prev { left: 0; }
.carousel-nav.next { right: 0; }

@media screen and (max-width: 768px) {
  .carousel-slide { padding: 0 2.25rem; }
  .carousel-nav { width: 38px; height: 38px; }
  .carousel-nav svg { width: 16px; height: 16px; }
}

/* ---------------------------------------------------------------------------
   Real World Experiments on narrow screens.

   Stacking six full-width clips makes the section enormous on a phone, so each
   object's three difficulties become a swipeable strip instead. The next clip
   peeks in at the edge, which is what signals that the row scrolls.
   --------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  #real-world .video-grid.cols-3 {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* bleed to the screen edges so the peeking clip is not clipped by padding */
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding: 0 0.75rem 0.2rem;
  }

  #real-world .video-grid.cols-3::-webkit-scrollbar {
    display: none;
  }

  #real-world .video-grid.cols-3 > .video-item {
    flex: 0 0 82%;
    scroll-snap-align: center;
  }

  #real-world .title.is-5 {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
  }

  #real-world .video-item .video-label {
    font-size: 0.82rem;
  }

  #real-world .speed-badge {
    top: 6px;
    right: 6px;
    font-size: 0.68rem;
    padding: 3px 5px;
  }
}

/* ---------------------------------------------------------------------------
   Results: KPI tiles + the feasibility/collision scatter.
   Emphasis encoding — ours in the accent, baselines in de-emphasis gray.
   --------------------------------------------------------------------------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 1.75rem 0 2rem;
}

@media screen and (max-width: 768px) {
  .kpi-row { grid-template-columns: 1fr; gap: 0.6rem; }
}

.stat-tile {
  border: 1px solid #e6e9ee;
  border-radius: 6px;
  padding: 0.85rem 1rem 0.95rem;
  background: #fff;
}

.stat-label {
  display: block;
  font-size: 0.83rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: #363636;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.stat-unit {
  font-size: 1.1rem;
  font-weight: 500;
  color: #6b7280;
  margin-left: 1px;
}

.stat-delta {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.stat-delta.up { color: #1f7a4d; }

/* The four panels are a labelled matrix: arm setting across the columns,
   question down the rows, so neither label has to repeat per chart. */
.chart-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.25rem;
  align-items: start;
}

.col-head {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: #363636;
  text-align: center;
  padding-bottom: 0.5rem;
}

.col-head span {
  font-weight: 400;
  color: #6b7280;
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.row-head {
  grid-column: 1 / -1;
  border-top: 1px solid #e6e9ee;
  padding: 0.9rem 0 0.2rem;
}

.row-head h4 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #363636;
  margin: 0;
}

.row-head p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

/* the cue belongs beside the question it applies to, not off at the margin */
.row-head .dir {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  background: #e8edf5;
  color: #55607a;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.cell {
  min-width: 0;
  border-radius: 7px;
  padding: 0.5rem 0.55rem 0.35rem;
}

/* A neutral band separates the two settings down the whole column. It stays
   neutral on purpose: blue already means "ours" in the marks, so a hued tint
   would read as a second data encoding. */
.col-head[data-arm],
.cell[data-arm] {
  background: #f2f5fa;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Hovering anywhere in a column brings the whole column forward and names it
   in the accent, so the two settings stay distinguishable without permanently
   banding one of them darker than the other. */
.chart-matrix:has([data-arm="single"]:hover) [data-arm="single"],
.chart-matrix:has([data-arm="dual"]:hover) [data-arm="dual"] {
  background: #e4eaf4;
}

.chart-matrix:has([data-arm="single"]:hover) .col-head[data-arm="single"],
.chart-matrix:has([data-arm="dual"]:hover) .col-head[data-arm="dual"],
.chart-matrix:has([data-arm="single"]:hover) .cell[data-arm="single"] .cell-label,
.chart-matrix:has([data-arm="dual"]:hover) .cell[data-arm="dual"] .cell-label {
  color: #4285f5;
}

.col-head {
  border-radius: 7px 7px 0 0;
  padding: 0.55rem 0.55rem 0.5rem;
  margin-bottom: 0;
}

.cell-label {
  display: none;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #4a4a4a;
  margin-bottom: 0.2rem;
}

@media screen and (max-width: 768px) {
  /* stacked, so the columns need vertical separation the column-gap cannot give */
  .chart-matrix {
    grid-template-columns: 1fr;
    row-gap: 0.85rem;
  }

  .col-head { display: none; }
  .cell-label { display: block; }
  .row-head { padding-top: 0.5rem; }
}

svg.scatter {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

svg.scatter .ax {
  font-size: 11px;
  fill: #6b7280;
  font-variant-numeric: tabular-nums;
}

svg.scatter .axtitle { font-size: 11.5px; fill: #6b7280; }
svg.scatter .plab { font-size: 11.5px; fill: #4a4a4a; }
svg.scatter .plab.ours { fill: #363636; font-weight: 600; }
svg.scatter .better { font-size: 10.5px; fill: #aab1bd; }

.chart-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: #4a4a4a;
}

.chart-legend .key { display: inline-flex; align-items: center; gap: 0.4rem; }

.chart-legend .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.chart-legend .dot.ours { background: #4285f5; }
.chart-legend .dot.base { background: #6b7280; }
.chart-legend .key-note { color: #8a919e; font-style: italic; }

.chart-tooltip {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.11);
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  min-width: 170px;
}

.chart-tooltip .tt-name {
  font-weight: 600;
  color: #363636;
  margin-bottom: 0.3rem;
}

.chart-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  line-height: 1.6;
}

.chart-tooltip .tt-key { color: #6b7280; }
.chart-tooltip .tt-row strong { color: #363636; font-variant-numeric: tabular-nums; }

.table-view { margin-top: 1.75rem; text-align: center; }

.table-toggle {
  border: 1px solid #dbdbdb;
  background: #fff;
  color: #4a4a4a;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-size: 0.87rem;
  font-family: inherit;
  cursor: pointer;
}

.table-toggle:hover { background: #f5f5f5; border-color: #b5b5b5; }
.table-view > div { margin-top: 1rem; text-align: left; }

/* the composite metric leads in the tooltip, above a hairline */
.chart-tooltip .tt-row.tt-lead {
  border-top: 1px solid #edeff3;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}


