:root {
  --ink: #1c2740;
  --text: #2b3344;
  --muted: #6b7280;
  --line: #e3e6eb;
  --panel: #f6f7f9;
  --orange: #e8842a;
  --orange-soft: #fdf1e4;
  --blue: #3f78b5;
  --gray: #8a8f98;
  --red: #d64541;
  --green: #2e8b57;
  --road: #dcebdd;
  --road-edge: #3c7a4a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main, .hero { max-width: 960px; margin: 0 auto; padding: 0 20px; }
section { margin: 64px 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); margin: 0 0 18px; }
h2 { font-size: 1.7rem; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
h3 { font-size: 1.15rem; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 6px; }
/* no single word on the last line of a text block */
p, li, figcaption, summary, .tldr, .question { text-wrap: pretty; }
.stats span, .facts span, .takeaways div, .dn-label small { text-wrap: balance; }
img, video, svg { max-width: 100%; display: block; }
figure { margin: 22px 0; }
figure img, figure video { width: 100%; border-radius: 6px; }
figure video { border: 1px solid var(--line); background: #fff; }
figcaption, .caption, .note { font-size: 0.9rem; color: var(--muted); margin-top: 8px; }
.accent { color: var(--orange); }

/* ---------- header ---------- */
.hero { text-align: center; padding-top: 56px; }
.method-name { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); margin-bottom: 8px; }
.authors { font-size: 1.1rem; margin-bottom: 6px; }
.authors span, .affiliations span { display: inline-block; white-space: nowrap; margin: 0 9px; }
.authors a { color: var(--blue); text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.affiliations { font-size: 0.98rem; color: var(--text); margin-bottom: 6px; }
.hero sup { font-size: 0.7em; }
/* affiliation logos in two lines */
.logos { --k: 1; margin: 24px auto 22px; display: grid; gap: calc(38px * var(--k)); justify-items: center; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: calc(60px * var(--k)); }
.logo-row.second { gap: calc(64px * var(--k)); }
.logo-row a { display: block; text-decoration: none; }
.logos img { display: block; height: calc(var(--h) * 1px * var(--k)); width: auto; max-width: none; }
/* the full name under the BOLD logo, in the colors of bold-lab.ai */
.logos a.named { position: relative; }
.logos a.named span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: calc(-6px * var(--k)); white-space: nowrap; font-size: calc(9.8px * var(--k)); font-weight: 800; color: #038dd3; }
.logos a.named span b { font-weight: 800; color: #01417c; }
.hero .venue { font-size: 0.88rem; }
.venue { color: var(--muted); }
.links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--ink);
  background: #fff; color: var(--ink); font: inherit; font-size: 0.95rem; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.soon { color: var(--muted); border-color: var(--line); cursor: default; }
.btn.soon:hover { background: #fff; }

.tldr { background: var(--orange-soft); border-left: 4px solid var(--orange); border-radius: 6px; padding: 16px 20px; font-size: 1.05rem; }
.tldr strong { color: var(--orange); margin-right: 6px; }
#tldr { margin-top: 40px; }
#tldr .stats { margin: 16px 0 0; }
.teaser { margin: 22px 0 26px; }
.teaser figcaption { text-align: center; font-size: 0.95rem; color: var(--text); }

/* ---------- overlay on the top video ---------- */
.video-overlay { position: relative; container-type: inline-size; }
.video-overlay video, #video-player { cursor: pointer; }
.vo-strip, .vo-legend { position: absolute; left: 0; background: #fff; pointer-events: none; }
.vo-strip { top: 3.8%; width: 99.8%; height: 3.5%; }                 /* covers the old legend row */
.vo-legend {                                                          /* covers the old title, not the clock */
  top: 0.1%; width: 86%; height: 7.2%; border-top-left-radius: 6px;
  display: flex; align-items: center; justify-content: center; gap: 3.5cqw;
  font-size: 1.45cqw; line-height: 1; color: #333; white-space: nowrap;
}
.vo-legend b { margin-right: 0.6cqw; }
.vo-gray { color: #777; border-color: #777; }
.vo-orange { color: #e8842a; border-color: #e8842a; }
.vo-line { display: inline-block; width: 2.6cqw; border-top: 0.28cqw solid; vertical-align: middle; margin: 0 0.3cqw 0 0.9cqw; }
.vo-line.dashed { border-top-style: dashed; }
.vo-fail {
  position: absolute; top: 71.3%; transform: translateX(-50%); pointer-events: none;
  font-size: 1.2cqw; line-height: 1.6; color: #b0281c; white-space: nowrap;
}

.vbar { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.vbar button { width: 38px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 0.8rem; cursor: pointer; }
.vbar button:hover { background: var(--panel); }
.vbar input { flex: 1; }
.vbar span { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- shared pieces ---------- */
.card { border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin: 22px 0; background: #fff; }
.card h3 { margin-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin: 22px 0; }
.two-col h3 { margin-top: 0; }
.question { font-size: 1.35rem; font-weight: 700; color: var(--ink); text-align: center; margin: 30px 0; padding: 18px; background: var(--panel); border-radius: 10px; text-wrap: balance; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; }
.legend .spacer { flex: 1; }
.key { display: inline-block; width: 16px; height: 12px; border-radius: 3px; margin-left: 10px; }
.key:first-child { margin-left: 0; }
.key.executed { background: var(--ink); }
.key.action { background: var(--orange-soft); border: 1px solid var(--orange); border-radius: 2px; }
.key.frozen { background: #eef2f7; border: 1px solid #c5d0de; border-radius: 2px; }
.key.replaced { background: #c3c8d0; }
.key.outline { background: none; border: 1.5px solid var(--ink); border-radius: 1px; }
.key.scale { width: 46px; background: linear-gradient(to right, #c3c8d0, var(--ink)); border-radius: 2px; }
.key.line-base { height: 0; border-top: 3px dashed var(--gray); border-radius: 0; width: 22px; }
.key.line-nudged { height: 0; border-top: 3px solid var(--orange); border-radius: 0; width: 22px; }
.key.box-ghost { background: none; border: 2px solid var(--orange); }
.key.ped { background: #f5a04a; border: 1px solid #c9731c; width: 11px; height: 11px; transform: rotate(45deg); border-radius: 1px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tabs button { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer; }
.tabs button:hover { border-color: var(--gray); }
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

input[type="range"] { width: 100%; accent-color: var(--orange); }

.handles li { margin-bottom: 12px; }
.handles li > b { color: var(--ink); }

/* a figure beside a short column of facts, a figure of medium width, and a row of short takeaways */
.fig-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; margin: 18px 0; }
.fig-row figure { margin: 0; }
.facts { display: grid; gap: 14px; }
.facts div { background: var(--panel); border-radius: 10px; padding: 14px 18px; }
.facts b { display: block; font-size: 2rem; line-height: 1.2; color: var(--ink); }
.facts span { font-size: 0.92rem; line-height: 1.45; color: var(--muted); display: block; }
.facts em { font-style: normal; font-weight: 600; color: var(--text); }
.fig-mid { max-width: 640px; margin: 20px auto; }
.takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0 8px; }
.takeaways div { background: var(--panel); border-radius: 10px; padding: 14px 16px; font-size: 0.95rem; line-height: 1.5; }
.takeaways b { display: block; color: var(--ink); margin-bottom: 4px; }
#results h3 { margin-top: 40px; }

/* additional information that the reader can open */
.fold { margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 8px; padding: 0 16px; background: #fff; }
.fold summary { padding: 10px 0; cursor: pointer; font-size: 0.95rem; font-weight: 600; color: var(--blue); }
.fold summary:hover { text-decoration: underline; }
.fold[open] { padding-bottom: 12px; }
.fold[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.fold .note { margin: 0; }
.facts.pair { grid-template-columns: 1fr 1fr; margin: 14px 0; }

/* ---------- difficulty 1 ---------- */
.dn { margin: 14px 0 10px; }
.dn-row { display: grid; grid-template-columns: 215px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dn-label { font-weight: 600; color: var(--ink); }
.dn-label small { display: block; font-weight: 400; color: var(--muted); }
.dn-label small.space { display: inline-block; margin: 3px 0; padding: 1px 7px; border-radius: 3px; background: #ffe9a8; color: var(--ink); font-weight: 700; font-size: 0.85rem; }
.dn-boxes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
/* diagram cells, not buttons: square corners, light fill, thin border */
.dn-box { min-width: 30px; padding: 3px 6px; border-radius: 2px; font-size: 0.8rem; text-align: center; white-space: nowrap; cursor: default; }
.dn-box.action { background: var(--orange-soft); border: 1px solid var(--orange); color: #a85a12; }
.dn-box.frozen { background: #eef2f7; border: 1px solid #c5d0de; color: #6b7a90; }
.dn-frozen { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px dashed var(--blue); border-radius: 2px; }
.dn-total { margin: 0; }
.dn-list { margin: 4px 0 10px; }
.dn-list li { margin-bottom: 2px; }

/* ---------- difficulty 2 ---------- */
.scene { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #f3f4f6; }
#horizon-scene { background: #fff; }
.h-road { fill: none; stroke: #e9ecef; stroke-width: 7; stroke-linecap: round; }
.h-plan { fill: none; stroke: var(--gray); stroke-width: 0.45; stroke-dasharray: 1.2 0.9; }
.h-old { fill: none; stroke: #c9cdd3; stroke-width: 0.3; stroke-dasharray: 1.2 0.9; }
.h-driven { fill: none; stroke: #4b5563; stroke-width: 0.7; stroke-linecap: round; }
.h-count { font-size: 1.7px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.h-executed { fill: none; stroke: var(--ink); stroke-width: 0.9; stroke-linecap: round; }
.cells { display: grid; grid-template-columns: repeat(80, 1fr); grid-template-rows: repeat(3, 8px); grid-auto-flow: column; gap: 1px; margin: 4px; }
.cells:not(.two), .cells .pair { outline: 1.5px solid var(--ink); outline-offset: 3px; border-radius: 1px; }
.cells .pair { grid-column: 1; grid-row: 1 / span 2; display: grid; grid-template-rows: repeat(2, 8px); gap: 1px; }
.cells span { background: #c3c8d0; border-radius: 1px; }
.cells span.executed { background: var(--ink); }
.cells.two { grid-template-rows: repeat(2, 8px); }

/* ---------- widget ---------- */
.w-road { fill: var(--road); }
.w-edge { stroke: var(--road-edge); stroke-width: 0.14; }
.w-divider { stroke: #fff; stroke-width: 0.16; stroke-dasharray: 2 2; }
.w-base { fill: none; stroke: #6b7280; stroke-width: 0.26; stroke-dasharray: 0.7 0.5; }
.w-nudged { fill: none; stroke: var(--orange); stroke-width: 0.3; stroke-linejoin: round; }
.w-dot { fill: var(--orange); }
.w-ped { fill: #f5a04a; stroke: #c9731c; stroke-width: 0.08; }
.w-ego { fill: #fdc400; stroke: #1c1c1c; stroke-width: 0.12; }
.w-ego-arrow { fill: #1c1c1c; }
.w-ghost, .w-ghost-base { fill: none; stroke-width: 0.13; }
.w-ghost { stroke: var(--orange); }
.w-ghost-base { stroke: var(--gray); stroke-dasharray: 0.4 0.3; }
.w-ghost.hit, .w-ghost-base.hit { stroke: var(--red); }
.w-ghost.hit { fill: rgba(214, 69, 65, 0.12); }
.w-labels text { font-size: 0.8px; fill: #6b7280; }
.w-labels .w-ped-label { fill: #b5651a; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 18px; }
.control label { display: flex; justify-content: space-between; font-weight: 600; color: var(--ink); }
.control output { font-variant-numeric: tabular-nums; color: var(--orange); }
.range-ends { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.chart { width: 100%; margin-top: 10px; }
.chart-title { font-size: 0.8rem; color: var(--muted); text-align: center; margin: 0; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-tick { font-size: 10px; fill: var(--muted); }
.c-band { fill: var(--orange-soft); }
.c-band-label { font-size: 9px; fill: #b5651a; }
.c-base { fill: none; stroke: var(--gray); stroke-width: 1.5; stroke-dasharray: 4 3; }
.c-nudged { fill: none; stroke: var(--orange); stroke-width: 2; }

.readout { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 16px; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.status { padding: 4px 12px; border-radius: 999px; font-weight: 600; color: #fff; }
.status.bad { background: var(--red); }
.status.warn { background: #c98a12; }
.status.good { background: var(--green); }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- method ---------- */
.step-text { min-height: 3.2em; background: var(--panel); border-radius: 8px; padding: 14px 16px; }
.figure-overlay { position: relative; }
#method-highlight {
  position: absolute; border: 3px solid var(--orange); border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 4000px rgba(255, 255, 255, 0.55); transition: all 0.3s ease;
}
.figure-overlay { overflow: hidden; border-radius: 6px; }

/* ---------- results ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.stats div { background: var(--panel); border-radius: 10px; padding: 20px 18px 18px; text-align: center; }
.stats em { display: block; font-style: normal; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.stats b { display: block; font-size: clamp(2.6rem, 6vw, 3.6rem); color: var(--orange); line-height: 1.15; margin: 4px 0 6px; white-space: nowrap; }
.stats span { display: block; font-size: 0.9rem; line-height: 1.45; color: var(--muted); }
/* the right 39 % of the results figure of the paper holds the sample-efficiency curve */
.crop-curve {
  width: 100%; max-width: 620px; margin: 0 auto; aspect-ratio: 193.7 / 84.76;
  background: url("../assets/figs/results_v2.svg") right center / auto 100% no-repeat;
}
.table-wrap { overflow-x: auto; margin-top: 26px; }
table { border-collapse: collapse; width: 100%; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 5px; text-align: center; white-space: nowrap; }
thead tr:first-child th:nth-child(-n+2), td[rowspan], td[rowspan] + td, tr.muted td:nth-child(-n+2), tbody tr:not(.group):not(.muted) td:first-child { white-space: normal; }
td[rowspan] { max-width: 90px; }
thead tr:first-child th:nth-child(-n+2), td[rowspan], td[rowspan] + td, tr.muted td:nth-child(-n+2), tbody tr:not(.group):not(.muted) td:first-child { text-align: left; }
thead tr:first-child th { border-top: 2px solid var(--ink); }
thead tr:last-child th { border-bottom: 1px solid var(--ink); }
tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
tr.group td { border-top: 1px solid var(--gray); }
tr.muted td { color: var(--muted); }
tr.ours td { background: var(--orange-soft); }
td small { color: var(--muted); font-size: 0.75em; margin-left: 2px; }
td i { display: block; font-style: normal; font-size: 0.8em; color: var(--muted); }
td i.up { color: var(--blue); }
td i.down { color: var(--red); }

table.small-table thead tr th:nth-child(n+2) { text-align: center; }
table.small-table { font-size: 0.9rem; }
table.small-table tbody tr td:first-child { text-align: left; }
.two-col.top { align-items: start; margin-top: 34px; }

pre { background: var(--panel); border-radius: 8px; padding: 16px; overflow-x: auto; font-size: 0.85rem; }
footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 30px 20px 50px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .authors br { display: none; }
  .affiliations span { white-space: normal; }
  .logos { --k: 0.5; }
  .two-col, .controls, .stats, .fig-row, .takeaways, .facts.pair { grid-template-columns: 1fr; }
  .dn-row { grid-template-columns: 1fr; }
  section { margin: 44px 0; }
}
