/* 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; }

.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; }
/* the two sampling clips differ in aspect; letterbox both to one height so their captions line up */
.sampling-video { aspect-ratio: 2.5; object-fit: contain; background: #fff; }

.paper-figure { display: block; width: 100%; height: auto; }
.overview-figure { max-width: 520px; margin: 0 auto; }

/* ───────── charts ───────── */
.terrain-toggle { margin-bottom: .75rem; }
.terrain-caption { font-size: .92rem; color: #333; margin: .6rem 0 1rem; min-height: 1.4em; }
.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; }

/* ───────── 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) {
  .pg-hud { top: 4px; left: 6px; 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; }
.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: 2.5rem 1rem; }
  .publication-title.is-2 { font-size: 1.6rem; }
  .org-logo { height: 34px; }
  .arcad-logo { height: 40px; }
}
