/* Nerfies base styles, as on the Mopedipulator page, plus the two charts. The page uses Michigan's brand colors;
   the charts keep the paper figures' series colors (mups-sampling experiment/paper_style.py). */

:root {
  --um-blue: #00274c;
  --um-maize: #ffcb05;
  --paper-aqua: #1baf7a;     /* FlowRRT in every paper figure */
  --paper-orange: #eb6834;
  --paper-blue: #2a78d6;
  --paper-slate: #7f92a8;
  --paper-sand: #c2a06b;
  --paper-plum: #9a5b88;     /* RL-RRT */
  --muted: #5f6368;
  --line: #e2e2e2;
}

body { font-family: 'Noto Sans', sans-serif; background: #fff; }
/* one column width for the whole page, a little wider than Bulma's 960 px so the playground's view is not small */
@media screen and (min-width: 1216px) {
  .container.is-max-desktop { max-width: 1088px; }
}
/* tighter than Bulma's 3rem: the sections are short, and the frameless videos already carry their own white */
.section { padding: 2rem 1.5rem; }
.section .title.is-3 { margin-bottom: 1rem; }

.footer .icon-link { font-size: 25px; color: #000; }
.link-block a { margin-top: 5px; margin-bottom: 5px; }

.publication-title { font-family: 'Google Sans', sans-serif; }
.publication-authors { font-family: 'Google Sans', sans-serif; }
.publication-authors a { color: hsl(204, 86%, 53%) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; }
.publication-links { margin-top: .5rem; }
.button.is-pending { opacity: .55; cursor: default; }
.title { font-family: 'Google Sans', sans-serif; }

.org-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 .75rem;
}
.org-logo { height: 44px; width: auto; }
.arcad-logo { height: 52px; }

.publication-video {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px !important;
  line-height: 0;
}
.publication-video video, .publication-video iframe { width: 100%; height: auto; display: block; }
/* the Blender videos render on the page's own white: no frame, so the blocks and robot sit straight on the page */
.publication-video.frameless { border-radius: 0 !important; background: #fff; }
.publication-video.frameless video { background: #fff; }

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

/* the key-insight figure keeps its full column width so its labels stay readable; the three points sit centred beside it */
.insight-columns .content p:not(:last-child) { margin-bottom: 2em; }

.method-tree { max-width: 760px; margin: .6rem auto 1.4rem; }
.hero-caption { font-size: .88rem; color: var(--muted); text-align: center; max-width: 760px; margin: .6rem auto 0; line-height: 1.45; }

/* a short in-text reference, linked to its DOI */
.cite { font-size: .85em; white-space: nowrap; }
/* the steering solver's key insight, boxed above its reasons */
.key-insight {
  border: 1px solid rgba(0, 39, 76, .25);
  border-radius: 10px;
  background: rgba(0, 39, 76, .04);
  padding: .9rem 1.2rem;
  margin: 0 auto 1.6rem;
  max-width: 820px;
  font-size: 1.02rem;
  line-height: 1.5;
  color: #222;
}
/* the sampler's network, folded under the steering solver */
.arch-details { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.arch-details > summary { cursor: pointer; font: 600 .95rem 'Google Sans', sans-serif; color: var(--um-blue); width: fit-content; }
.arch-details > summary:focus-visible { outline: 2px solid var(--um-maize); outline-offset: 2px; }
.arch-details[open] > summary { margin-bottom: .8rem; }
.arch-details .content { font-size: .92rem; }
.key-insight-label { font: 600 .95rem 'Google Sans', sans-serif; color: var(--um-blue); margin-bottom: .25rem; }

/* the method's three spaces side by side, then the steps of one iteration */
.space-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin-bottom: 1.4rem; }
.space-card { border: 1px solid var(--line); border-radius: 10px; padding: .8rem .95rem; font-size: .9rem; line-height: 1.45; color: #333; }
.space-card p + p { margin-top: .4rem; }
.space-card .space-name { font: 600 .95rem 'Google Sans', sans-serif; color: var(--um-blue); }
.space-card .space-symbol { font-family: 'Castoro', serif; font-size: 1.08rem; color: #222; }
@media (max-width: 768px) {
  .space-cards { grid-template-columns: 1fr; }
}

/* ───────── charts ───────── */
/* the three terrain previews side by side; the selected one picks the benchmark chart's terrain */
.terrain-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 0; }
.terrain-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: .76rem;
  line-height: 1.35;
  color: #333;
  text-align: left;
  cursor: pointer;
}
.terrain-card img { display: block; width: 100%; height: auto; border-radius: 6px; }
.terrain-note { font-size: .8rem; color: var(--muted); text-align: center; margin: .5rem 0 0; }
.terrain-card[aria-selected="true"] { border-color: var(--um-blue); box-shadow: 0 0 0 1px var(--um-blue); }
.terrain-card:focus-visible { outline: 2px solid var(--um-maize); outline-offset: 2px; }
@media (max-width: 768px) {
  .terrain-cards { grid-template-columns: 1fr; gap: .5rem; }
  /* on a phone each card is one short row: the preview beside its description */
  .terrain-card { flex-direction: row; align-items: center; gap: .6rem; }
  .terrain-card img { flex: 0 0 45%; width: 45%; }
  /* justified lines on a narrow column open wide gaps between words */
  .has-text-justified, .compare-text, .space-card p { text-align: left !important; }
}
.compare-columns { margin-top: 1rem; }
.compare-text { font-size: .92rem; color: #333; margin-bottom: .8rem; text-align: justify; }
/* both columns share one set of rows (title, text, legend, chart, slider), so the two charts line up whatever each
   column's text and legend take */
@media screen and (min-width: 769px) {
  .columns.compare-columns { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: repeat(5, auto); column-gap: 2rem; margin: 1rem 0 0; }
  .columns.compare-columns > .column { display: grid; grid-row: span 5; grid-template-rows: subgrid; width: auto; min-width: 0; padding: 0; }
  .compare-columns .chart-body { min-width: 0; }
  .compare-columns .chart-block { display: contents; }
  .compare-columns .chart-head { align-self: end; }
}
.ablation-text { font-size: .88rem; color: #333; margin-bottom: .6rem; text-align: justify; }
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.toggle { display: inline-flex; flex-wrap: wrap; }
.toggle button {
  border: 1px solid var(--um-blue);
  background: #fff;
  color: var(--um-blue);
  padding: .3rem .9rem;
  font: 600 .85rem 'Google Sans', sans-serif;
  cursor: pointer;
  min-height: 32px;
}
.toggle button + button { border-left: 0; }
.toggle button:first-child { border-radius: 999px 0 0 999px; }
.toggle button:last-child { border-radius: 0 999px 999px 0; }
.toggle button[aria-selected="true"] { background: var(--um-blue); color: #fff; }
.toggle button:focus-visible { outline: 2px solid var(--um-maize); outline-offset: 2px; }

.chart-body { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart-svg text { font-family: 'Noto Sans', sans-serif; fill: var(--muted); font-size: 12px; }
.chart-svg .axis line { stroke: #cfcfcf; }
.chart-svg .grid line { stroke: #f0f0f0; }
.chart-svg .cursor { stroke: var(--um-blue); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .hit { fill: transparent; cursor: ew-resize; }
.chart-svg .bar-label { fill: #222; font-size: 11.5px; font-weight: 600; }
.chart-svg .group-label { fill: #222; font-size: 13px; font-weight: 600; }

.readout, .legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  font-size: .85rem;
  color: var(--muted);
}
.readout .item, .legend .item { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.readout .swatch { width: 14px; height: 3px; border-radius: 2px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 2px; }
.readout .val { color: #222; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.2ch; }

.chart-foot {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: .4rem;
  font-size: .85rem;
  color: var(--muted);
}
.chart-foot input[type="range"] { flex: 1; accent-color: var(--um-blue); }
.chart-foot output { font-variant-numeric: tabular-nums; color: #222; font-weight: 600; min-width: 5ch; text-align: right; }

/* the method video: its step caption, kept in the page rather than burnt into the frames, and the marks' legend */
.video-caption { font: 600 .9rem 'Google Sans', sans-serif; color: #333; text-align: center; margin-top: .4rem;
  min-height: 1.4em; }
.mark-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--muted); }
.mark-legend > span { display: inline-flex; align-items: center; gap: .35rem; }

/* ───────── playground ───────── */
.playground { margin-bottom: 2rem; }
.pg-hint { font-size: .9rem; color: var(--muted); margin-bottom: .6rem; }
.pg-stage-wrap { position: relative; }
/* the loop's phases, top left over the view; never in the way of a drag */
.pg-hud {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  font: 600 .72rem 'Google Sans', sans-serif;
  z-index: 3;
}
.pg-hud span {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #dcdcdc;
  background: rgba(255, 255, 255, .9);
  color: #9a9a9a;
}
.pg-hud span + span::before { content: "→ "; color: #c4c4c4; font-weight: 400; }
.pg-hud span.on { background: var(--um-blue); border-color: var(--um-blue); color: #fff; }
.pg-hud span.on::before { color: rgba(255, 255, 255, .6); }
.pg-hud-detail { font-style: normal; font-weight: 400; color: #555; margin-left: 4px; }
@media (max-width: 768px) {
  /* the view is too short on a phone for the loop's pills to sit on it, so they follow below */
  .pg-hud { position: static; margin-top: .35rem; font-size: .62rem; }
  .pg-hud span { padding: 1px 6px; }
  .pg-hud-detail { display: none; }
}
/* one window: MuJoCo (three.js) below, the search replay and the editor's handles on top; aspect set from the frame */
.pg-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 6.7 / 1.75;   /* FRAME in playground.js; stage.js sets it from there */
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.pg-stage:focus-visible { box-shadow: 0 0 0 2px var(--um-maize); }
.pg-stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.pg-tip {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--um-blue);
  color: #fff;
  font: 600 .78rem 'Google Sans', sans-serif;
  padding: .2rem .5rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.pg-tip[hidden] { display: none; }
.pg-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1rem;
  margin-top: .5rem;
}
.pg-buttons { display: flex; gap: .5rem; }
/* the course switch above the view: the editable course or a classic one */
.pg-courses { display: inline-flex; margin: 0 0 .5rem; border: 1px solid var(--um-blue); border-radius: 999px; overflow: hidden; }
.pg-course {
  padding: .25rem .9rem;
  border: 0;
  background: #fff;
  font: 500 .85rem 'Google Sans', sans-serif;
  color: var(--um-blue);
  cursor: pointer;
}
.pg-course + .pg-course { border-left: 1px solid var(--um-blue); }
.pg-course.is-selected { background: var(--um-blue); color: #fff; }
.pg-course:focus-visible { outline: 2px solid var(--um-maize); outline-offset: -2px; }
.pg-buttons .button { border-color: var(--um-blue); color: var(--um-blue); }
.pg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.1rem;
  font-size: .82rem;
  color: var(--muted);
}
.pg-legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.pg-swatch { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.pg-status, .pg-track-status { font-size: .9rem; color: #333; margin-top: .4rem; min-height: 1.4em; }

/* ───────── bibtex ───────── */
.bib-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bib-head .title { margin-bottom: 0 !important; }

@media (max-width: 768px) {
  .section { padding: 1.5rem 1rem; }
  .publication-title.is-2 { font-size: 1.6rem; }
  .org-logo { height: 34px; }
  .arcad-logo { height: 40px; }
}
