/* Minimal reset (replaces Bulma, of which only the base reset was used). */
*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; font-size: 16px; overflow-x: hidden; overflow-y: scroll; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, p, ol, ul, li, figure, blockquote, h1, h2, h3, h4, h5, h6, pre, hr { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal; }
ol, ul { list-style: none; }
button, input, select, textarea { margin: 0; }
img, video { height: auto; max-width: 100%; }
a { text-decoration: none; cursor: pointer; }
strong { font-weight: 700; }

:root {
  --ink: #1c1c1c;
  --accent: #bf5700;
  --accent-hover: #9a4600;
  --accent-soft: #eab48c;
  --tint: #fcebdd;
  --line: #eadfd6;
  --surface: #fdf7f2;
  --night: #2a2420;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: 'Noto Sans', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
figure { margin: 0; }
code { padding: 0; background: none; color: inherit; font-size: inherit; }
var { font-family: 'Times New Roman', Times, serif; font-size: 1.12em; font-style: italic; line-height: 1; }
.page-container { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }

.publication-header { padding: 44px 0 0; text-align: center; }
.publication-title {
  margin: 0;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.15;
  text-wrap: balance;
}
.publication-subtitle {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.35;
}
.publication-teaser { margin: 28px auto 22px; }
.publication-authors { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 28px; margin-top: 28px; font-size: 20px; line-height: 1.5; }
.publication-authors a { color: #000; }
.publication-affiliation { margin: 4px 0 0; color: #000; font-size: 16px; }
.publication-venue { margin: 0 0 16px; color: var(--accent); font-size: 15px; font-weight: 500; }
.publication-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.resource-link svg { width: 1.05em; height: 1.05em; flex: none; }
.resource-link.is-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.resource-link.is-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.resource-link.is-pending { color: var(--accent); background: var(--surface); }
.resource-status { margin-left: 3px; font-size: 12px; font-weight: 400; }

.paper-section { padding: 58px 0; scroll-margin-top: 24px; }
h2 {
  margin: 0 0 24px;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(1.45rem, 2.6vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}
.lead { max-width: 720px; margin: -8px auto 30px; text-align: center; text-wrap: balance; }
.band-sand { background: #f8f2ec; border-top: 1px solid var(--line); }
.band-peach { background: #fcebdd; }
.experiment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.experiment { min-width: 0; }
.experiment video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--night); }
.experiment figcaption { margin-top: 10px; text-align: center; font-size: 15px; font-weight: 500; }
.site-footer { padding: 24px 24px 32px; border-top: 1px solid var(--line); text-align: center; font-size: 12px; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.skip-link { position: absolute; top: 8px; left: 16px; padding: 8px 16px; background: #fff; transform: translateY(-160%); z-index: 1; }
.skip-link:focus { transform: translateY(0); }

@media (max-width: 640px) {
  .page-container { width: calc(100% - 32px); }
  .publication-header { padding-top: 28px; }
  .publication-teaser { margin: 20px auto 16px; }
  .publication-links { gap: 8px; }
  .resource-link { padding: 8px 12px; font-size: 13px; gap: 6px; }
  .resource-status { font-size: 11px; }
  .paper-section { padding: 40px 0; }
  .experiment-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Construction figure: the semantics of every task FOSA sampled, flowing into PPO's outcome. */
.robot-tabs[hidden], .robot-panel[hidden], .landscape[hidden], .landscape-card[hidden], .landscape-status[hidden] { display: none; }
.flow { margin: 0 auto 26px; }
.flow-grid { display: grid; gap: 14px; }
.flow-dag { display: block; width: 100%; height: auto; font-family: 'Noto Sans', sans-serif; }
.f-head { fill: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.f-link { fill: var(--accent-soft); opacity: .42; transition: opacity .15s; }
.f-link:hover { opacity: .8; }
.f-link.is-main { fill: var(--accent); opacity: .78; }
.f-name { fill: var(--ink); font-size: 12.5px; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.f-node.is-main .f-name { font-weight: 700; }
.f-count { fill: var(--accent); font-weight: 600; }
.r-capability { fill: #3f7f8c; }
.r-goal, .o-frontier { fill: var(--accent); }
.r-environment { fill: #a8577a; }
.r-constraint { fill: #8a6300; }
.o-mastered { fill: #3f7f8c; }
.o-unlearned { fill: #6b4a33; }
.flow-example { width: min(1040px, 100%); margin: 0 auto; padding: 14px 18px 16px; border: 1.5px solid var(--accent-soft); border-radius: 10px; background: #fff8f2; font-size: 13px; line-height: 1.4; text-align: center; }
.flow-example-label { margin-bottom: 10px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.flow-example .flow-edits { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0 20px; margin: 0 0 12px; }
.flow-example .flow-edits li { flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--accent-soft); border-radius: 8px; background: #fff; }
.flow-example .flow-edits li::before { content: none; }
.flow-example .flow-edits li::after { content: "→"; top: 50%; left: auto; right: -16px; transform: translateY(-50%); border: 0; color: var(--accent); font-size: 15px; opacity: 1; }
.flow-example .flow-edits li:last-child::after { content: none; }
.flow-example .flow-edits .edit-start { padding-left: 6px; }
.flow-example .flow-edits .empty-node { margin: 0; }
.flow-example .edit-body { flex-direction: column; align-items: center; gap: 4px; }
.flow-example q { display: block; font-size: 14px; }
.flow.is-running .f-link, .flow.is-running .f-node { animation: rise .6s backwards; animation-delay: var(--d, 0s); }
.flow.is-running .flow-edits li { animation: rise .35s backwards; animation-delay: calc(.8s + var(--i, 0) * 110ms); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .flow.is-running * { animation: none !important; } }
@media (max-width: 860px) {
  .flow-dag { display: none; }
  .flow-example .flow-edits { grid-auto-flow: row; gap: 12px 0; margin: 0 0 12px; }
  .flow-example .flow-edits li, .flow-example .edit-body { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px 6px; }
  .flow-example .flow-edits li { padding: 6px 10px; }
  .flow-example .flow-edits li::after { content: "↓"; top: auto; right: auto; left: 50%; bottom: -14px; transform: translateX(-50%); font-size: 12px; }
}
.edits { margin: 0; padding: 0; list-style: none; }
.edits li { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 5px 0 5px 26px; }
.edits li::before { content: ""; position: absolute; left: 9px; top: -7px; height: calc(100% - 2px); width: calc(1.5px + var(--p, 0) * 9px); transform: translateX(-50%); border-radius: 2px; background: var(--accent); opacity: calc(.35 + var(--p, 0) * .65); }
.edits li::after { content: ""; position: absolute; left: 9px; top: calc(100% - 13px); transform: translateX(-50%); border: 4px solid transparent; border-top: 5px solid var(--accent); opacity: .8; }
.edits .edit-start { padding-left: 0; }
.edits .edit-start::before, .edits .edit-start::after { content: none; }
.edit-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.empty-node { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 5px; border: 1.5px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 12px; line-height: 1; }
.edit-op { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--accent); }
.edit-role { padding: 0 6px; border-radius: 3px; background: var(--tint); color: #7a3800; font-size: 11px; }
.edit-prob { flex: none; margin-left: auto; color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
/* Robot selector shared by the landscape and the held-out tasks. */
.robot-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.robot-tabs button { display: flex; flex-direction: column; align-items: center; padding: 4px 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.4; cursor: pointer; }
.robot-tabs img { display: block; width: 112px; height: 70px; object-fit: cover; border-radius: 3px; margin-bottom: 4px; }
.robot-tabs button[aria-selected="true"] { color: var(--accent); font-weight: 600; background: var(--tint); border-color: var(--accent); }
.robot-tabs button:hover:not([aria-selected="true"]) { border-color: var(--accent-soft); }
.robot-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .robot-tabs { gap: 6px; }
  .robot-tabs button { flex: 1 1 0; min-width: 0; font-size: 12.5px; }
  .robot-tabs img { width: 100%; height: auto; aspect-ratio: 8 / 5; }
}

/* Frontier landscape: a 3D surface of F with FOSA's tasks as dots. */
.landscape-view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: transparent; touch-action: none; cursor: grab; }
.landscape-view:active { cursor: grabbing; }
.landscape-view:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.landscape-view canvas { display: block; width: 100%; height: 100%; }
.landscape-view.is-pointing { cursor: pointer; }
.landscape-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink); font-size: 14px; }
.landscape-card { position: absolute; z-index: 2; width: min(420px, 70%); padding: 6px; border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 8px 26px rgba(80, 50, 20, .22); pointer-events: none; }
.landscape-card video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 5px; background: var(--surface); }
.landscape-card figcaption { padding: 6px 4px 2px; font-size: 12.5px; line-height: 1.45; }
.landscape-legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 12px 0 0; font-size: 14px; text-align: center; }
.legend-scale { width: 90px; height: 10px; border-radius: 5px; background: linear-gradient(to right, #203a43, #4a8793, #c98aa5, #f08a3e, #ffd966); }
@media (max-width: 640px) {
  .landscape-view { aspect-ratio: 1; }
  .landscape-card { width: 62%; }
  .landscape-legend { font-size: 13px; }
}

/* Sim-to-real clips: same grid as the simulation tasks; a lone last clip is centred. */
.real-clip { position: relative; }
.real-grid > .real-clip:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 12px); }
.speed-badge { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 1px 8px; border-radius: 999px; background: rgba(28, 28, 28, .72); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
@media (max-width: 640px) { .real-grid > .real-clip:last-child:nth-child(odd) { width: 100%; } }
