/* RoboAda project page. One light column read top to bottom; the palette is Figure 1's:
   gray for the frozen policy, cream for hindsight labels, blue for RoboAda. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #1e2530;
  --muted: #5b6472;
  --faint: #8b939e;
  --rule: #e3e7ed;
  --panel: #f4f5f7;
  --panel-blue: #f3f7fd;
  --fill-blue: #d9e7fa;
  --stroke-blue: #7091c0;
  --cream: #fef1cc;
  --cream-stroke: #d6b95c;
  --label: #b07e10;
  --ours: #4c72b0;
  --ours-deep: #34558f;
  --frozen: #b4b4b4;
  --frozen-ink: #7d848d;
  --h0: #c4c4c4;
  --h1: #f1d58a;
  --h2: #4c72b0;
  --fail: #d6453f;
  --ok: #3c9a76;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wide: 1040px;
  --measure: var(--wide);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  font-optical-sizing: auto;
  padding: 0 16px;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ours); outline-offset: 3px; }
sup { font-size: 0.62em; line-height: 0; }
sub { font-size: 0.7em; line-height: 0; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ hero */
.hero { max-width: var(--wide); margin: 0 auto; padding: clamp(64px, 11vw, 128px) 0 clamp(40px, 6vw, 64px); text-align: center; }
h1 {
  font-weight: 500;
  font-size: clamp(64px, 10vw, 124px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-variation-settings: "opsz" 72;
}
.title {
  font-size: clamp(23px, 2.9vw, 34px);
  line-height: 1.25;
  max-width: none;
  margin: 0 auto 34px;
  text-wrap: balance;
}
.authors, .affil { font-family: var(--sans); margin: 0 auto; max-width: var(--wide); }
h1 .ada { color: var(--ours); }
.authors { font-size: 18px; line-height: 1.8; }
.authors span, .affil span { white-space: nowrap; margin: 0 0.45em; }
.affil { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; font-family: var(--sans); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 550; line-height: 1;
  padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--ink); text-decoration: none; background: var(--bg);
}
a.pill:hover { border-color: var(--ink); }
.pill.main { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.main:hover { background: var(--ours-deep); border-color: var(--ours-deep); }
.pill.off { color: var(--faint); border-style: dashed; }

/* ------------------------------------------------------------ column */
main section { margin: clamp(72px, 10vw, 120px) auto 0; }
.wide { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.text { max-width: var(--measure); margin-left: auto; margin-right: auto; }
section > .text + .wide, section > .wide + .text { margin-top: 28px; }
h2 {
  font-weight: 500;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}
p { margin: 0 0 16px; }
figure { margin: 0; }
figcaption { font-family: var(--sans); font-size: 14.5px; color: var(--muted); line-height: 1.55; margin-top: 12px; }
figcaption b { color: var(--ink); font-weight: 600; }
.teaser img { width: 100%; height: auto; }

.wide img { width: 100%; height: auto; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 14.5px/1 var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule); border-radius: 999px;
  padding: 9px 15px; cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn.icon { padding: 9px; }

/* ------------------------------------------------------------ demo */
.lab-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-family: var(--sans); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 15px/1 var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule); border-radius: 10px;
  padding: 10px 14px; cursor: pointer;
}
.seg button .ic { width: 1.3em; height: 1.3em; color: var(--muted); }
.seg button:hover { border-color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg button[aria-checked="true"] .ic { color: #fff; }
.lab canvas { width: 100%; height: auto; }

/* ------------------------------------------------------------ method animation */
.anim-stage svg { display: block; width: 100%; height: auto; font-family: var(--sans); overflow: visible; }
.player { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; font-family: var(--sans); }
.scrub { flex: 1; min-width: 0; }
.scrub input { width: 100%; margin: 10px 0 4px; accent-color: var(--ours); }
.phases { list-style: none; display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 0; font-size: 13.5px; color: var(--faint); }
.phases li { white-space: nowrap; }
.phases li.on { color: var(--ink); font-weight: 600; }
.anim figcaption { min-height: 3.2em; font-size: 15.5px; color: var(--ink); }
.anim figcaption .k { color: var(--muted); }

/* ------------------------------------------------------------ results */
.chart-block { font-family: var(--sans); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tabs button {
  position: relative; overflow: hidden;
  font: 500 14.5px/1 var(--sans); color: var(--muted);
  background: var(--bg); border: 1px solid var(--rule); border-radius: 999px; padding: 9px 14px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); border-color: var(--ink); }
.tabs button[aria-selected="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.tabs button .timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--h1); }
.tabs button .timer.run { animation: tabtimer var(--dur, 4s) linear forwards; }
@keyframes tabtimer { to { width: 100%; } }

.bars { display: grid; gap: 14px; }
.brow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; align-items: center; column-gap: 16px; }
.brow .nm { font-size: 15.5px; line-height: 1.25; }
.brow .nm small { display: block; color: var(--faint); font-size: 12.5px; }
.brow.mean { border-top: 1px solid var(--rule); padding-top: 14px; }
.brow.mean .nm { font-weight: 650; }
.track { position: relative; height: 16px; margin: 3px 0; }
.track + .track { margin-top: 2px; }
.trackbox { background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 25% 100%; padding: 2px 0; }
.bar { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 0 2px 2px 0; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.bar.fz { background: var(--frozen); }
.bar.ra { background: var(--ours); }
.val { position: absolute; top: 50%; transform: translate(6px, -50%); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; transition: left 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.val.fz { color: var(--frozen-ink); }
.val.ra { color: var(--ours); font-weight: 650; }
.delta { font-size: 15px; font-weight: 650; color: var(--ours); font-variant-numeric: tabular-nums; text-align: right; }
.axis { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; column-gap: 16px; font-size: 12.5px; color: var(--faint); }
.axis div { display: flex; justify-content: space-between; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.rank { position: relative; }
.rrow { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; column-gap: 16px; align-items: center; height: 34px; transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.rrow .nm { font-size: 15px; text-align: right; }
.rrow.ours .nm { color: var(--ours); font-weight: 650; }
.rrow .track { height: 20px; }
.rrow .bar { background: #d6d6d6; }
.rrow.frozen .bar { background: #8c8c8c; }
.rrow.ours .bar { background: var(--ours); }
.rrow .val { color: var(--muted); }
.rrow.ours .val { color: var(--ours); font-weight: 650; }

/* ------------------------------------------------------------ identification */
.ident { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; font-family: var(--sans); }
.ident svg { width: 100%; height: auto; display: block; overflow: visible; }
.ident h3 { font: 600 15.5px/1.35 var(--sans); margin: 0 0 6px; }
.ident .leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.ident .leg i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.ident-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-family: var(--sans); font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------ media */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 26px; }
.clip video { width: 100%; aspect-ratio: 518 / 284; border-radius: 4px; background: #000; }
.clip p { font-family: var(--sans); font-size: 14px; line-height: 1.5; margin: 9px 0 0; color: var(--muted); }
.clip p b { color: var(--ink); font-weight: 600; }
.clip .task { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); margin-top: 3px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; }
.tile video { width: 100%; aspect-ratio: 1; border-radius: 4px; background: #000; }
.tile p { font-family: var(--sans); font-size: 14px; margin: 8px 0 0; line-height: 1.4; }
.tile span { color: var(--muted); display: block; }

/* ------------------------------------------------------------ code and citation */
pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  font: 14px/1.6 var(--mono);
  margin: 18px 0;
}
#bibtex { white-space: pre-wrap; overflow-wrap: anywhere; }
.ink { font-family: var(--sans); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ours); }

footer { max-width: var(--wide); margin: clamp(72px, 10vw, 112px) auto 0; padding: 22px 0 40px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 14px; color: var(--muted); }

@media (max-width: 900px) { .wide-br { display: none; } }
@media (max-width: 860px) {
  body { font-size: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .ident { grid-template-columns: minmax(0, 1fr); }
  .brow, .axis { grid-template-columns: 112px minmax(0, 1fr) 54px; column-gap: 10px; }
  .rrow { grid-template-columns: 128px minmax(0, 1fr) 0; column-gap: 10px; }
  .brow .nm, .rrow .nm { font-size: 14px; }
  .rrow .nm { font-size: 13px; white-space: nowrap; }
}
@media (max-width: 620px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .seg button { justify-content: center; font-size: 14px; padding: 10px 8px; gap: 6px; white-space: nowrap; }
  .phases { font-size: 12px; }
  .authors span, .affil span { margin: 0 0.3em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar, .val, .rrow { transition: none; }
}
