/* Research stages scroll naturally, with sticky title bars and click navigation. */
html.snap-page { scroll-snap-type:none; }

.research-v { --hs:52px; --n:3; --gutter:1.5rem; --pad:max(var(--gutter),calc((100% - 960px) / 2)); position:relative; background:white; border-top:1px solid #dfe3ea; }

/* Sticky title bars. Bar i sits in slot i from the top once reached, and in slot (n-1-i) from the
   bottom before that. Bars have a fixed height so the stacking offsets stay exact. */
.v-bar { position:sticky; z-index:2; top:calc(var(--i) * var(--hs)); bottom:calc((var(--n) - 1 - var(--i)) * var(--hs)); height:var(--hs); background:rgba(255,255,255,.96); backdrop-filter:blur(8px); border-bottom:1px solid #dfe3ea; }
.v-bar button { display:flex; align-items:center; gap:1.25rem; width:100%; height:100%; padding:0 var(--pad); border:0; background:none; font:inherit; text-align:left; cursor:pointer; }
.v-bar .stage-number { font-size:1rem; font-weight:700; color:#6b7280; min-width:2.6ch; transition:color .3s; }
.v-bar-title { font-size:1.05rem; font-weight:600; color:var(--text-secondary); transition:color .3s; }
.v-bar button:hover .stage-number,.v-bar button:hover .v-bar-title { color:#447ddf; }
.v-bar.is-active .stage-number { color:#447ddf; }
.v-bar.is-active .v-bar-title { color:var(--text-primary); }
.v-bar-progress { position:absolute; left:0; right:0; bottom:-1px; height:2px; background:#72A3FE; transform-origin:left; transform:scaleX(var(--p,0)); opacity:0; transition:opacity .3s; }
.v-bar.is-active .v-bar-progress { opacity:1; }

/* Stage spacing and offsets for explicit title-bar navigation. */
.v-body { padding:clamp(1.5rem,4vh,2.5rem) var(--pad) 0; scroll-margin-top:calc((var(--i) + 1) * var(--hs)); }
.v-end { display:block; height:0; scroll-margin-bottom:calc((var(--n) - 1 - var(--i)) * var(--hs)); }

/* Figures and result panels share the column width and keep their natural height. */
.v-cards { display:flex; flex-direction:column; gap:clamp(2.5rem,7vh,4.5rem); margin-bottom:clamp(2.5rem,7vh,4.5rem); }
/* scroll-snap-align:none overrides the main page's per-card snapping, which would add extra stops mid-stage. */
.research-v .research-card { display:flex; flex-direction:column; align-items:flex-start; width:100%; margin:0; scroll-snap-align:none; }
.research-v .research-card>h3 { font-size:1.2rem; font-weight:700; margin:0 0 .85rem; }
.research-v .research-card>a { display:block; width:100%; box-sizing:border-box; line-height:0; border:1px solid #e4e7ee; border-radius:12px; overflow:hidden; background:white; }
.research-v .research-card img { display:block; width:100%; height:auto; max-width:100%; max-height:none; }
.research-v .research-card>figcaption,.research-v .research-card>p { max-width:70ch; margin:.85rem 0 0; font-size:1rem; line-height:1.6; color:var(--text-secondary); text-align:left; }
.research-v .retargeting-result { display:flex; flex-direction:column; justify-content:center; width:100%; padding:2rem 2.25rem; border-left:4px solid #72A3FE; background:#f6f7fb; border-radius:12px; }
.research-v .retargeting-result strong { font-size:clamp(2.75rem,6vw,4.25rem); line-height:1.1; color:#283c5b; }
.research-v .retargeting-result p { margin-top:.75rem; color:var(--text-secondary); line-height:1.6; }
.research-v .training-flow { list-style:none; display:flex; flex-direction:column; gap:.6rem; width:100%; margin:0; padding:0; counter-reset:flow; }
.research-v .training-flow li { counter-increment:flow; display:flex; align-items:center; gap:.75rem; padding:.95rem 1rem; background:#f6f7fb; border-left:3px solid #44aa99; border-radius:8px; font-weight:600; }
.research-v .training-flow li::before { content:counter(flow); display:grid; place-items:center; width:1.6rem; height:1.6rem; border-radius:50%; background:white; color:#283c5b; font-size:.85rem; }
.research-v .training-flow li:last-child { border-color:#72A3FE; background:#edf3ff; }
.research-v .policy-results { width:100%; max-width:none; margin:0; }
.research-v .policy-results>div { grid-template-columns:150px 1fr 60px; gap:.75rem; margin:1rem 0; }
.research-v .results-note { text-align:left; margin:.75rem 0 0; }

/* Stage videos from the supplementary video, and the interactive panels placed inside each stage. */
.research-v .stage-frame,.research-v .stage-clip video { width:100%; border:1px solid #e4e7ee; border-radius:12px; overflow:hidden; background:white; line-height:0; }
.research-v .stage-video { display:block; width:100%; height:auto; background:#eceef2; }
.research-v .stage-clip video { display:block; height:auto; }
.research-v .stage-clips { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; width:100%; align-items:end; }
/* VR collection: the real-world view on one side, the two simulated views on the other, each in a labelled box. */
.research-v .vr-views { display:grid; grid-template-columns:514fr 1234fr; gap:1rem; width:100%; align-items:stretch; }
.research-v .vr-group { min-width:0; padding:.75rem; border-radius:14px; border:1.5px solid; }
.research-v .vr-group.is-real { background:#f4f2ef; border-color:#d9d3ca; }
.research-v .vr-group.is-sim { background:#eef4ff; border-color:#b9d0fb; }
.research-v .vr-group-label { display:inline-block; margin:0 0 .65rem; padding:.2rem .65rem; border-radius:999px; font-size:.8rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:white; }
.research-v .is-real .vr-group-label { background:#5b534a; }
.research-v .is-sim .vr-group-label { background:#447ddf; }
.research-v .vr-group .stage-clips { gap:.6rem; }
.research-v .is-real .stage-clips { grid-template-columns:minmax(0,1fr); }
.research-v .is-sim .stage-clips { grid-template-columns:514fr 720fr; }
/* Rows of two compact cards. */
.research-v .card-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.5rem; align-items:start; }
/* Each card spans the row's two tracks (heading, media) through a subgrid, so the media line up even when one heading wraps. */
.research-v .card-row:not(.composition-row) { grid-template-rows:auto auto; row-gap:0; }
.research-v .card-row:not(.composition-row)>.research-card { display:grid; grid-row:span 2; grid-template-rows:subgrid; align-items:end; }
.research-v .card-row:not(.composition-row)>.research-card>h3 { align-self:end; }
.research-v .card-row .research-card>h3 { font-size:1.05rem; }
.research-v .composition-row { grid-template-columns:1109fr 967fr; align-items:start; }
.research-v .tasks-figure>a { max-width:760px; }
.research-v .stage-clip { margin:0; min-width:0; }
.research-v .stage-clip figcaption { margin:0 0 .4rem; font-size:.9rem; font-weight:600; line-height:1.4; color:var(--text-primary); text-align:left; }
.research-v .panel-card { scroll-margin-top:calc(var(--n) * var(--hs) + .5rem); }
.research-v .panel-card>.demo-panel,.research-v .panel-card>.retargeting-panel,.research-v .panel-card>.dataset-browser { width:100%; }
.research-v .panel-card>.grasp-panel { margin-top:0; }

/* Row/column labels around a grid video, and a key under a video with an unlabelled timeline. */
.research-v .labelled-grid { display:grid; grid-template-columns:auto minmax(0,1fr); grid-template-rows:auto auto; gap:.35rem .5rem; width:100%; }
.research-v .lg-cols { grid-column:2; display:grid; grid-template-columns:repeat(4,1fr); }
.research-v .lg-rows { grid-column:1; grid-row:2; display:grid; grid-template-rows:repeat(3,1fr); }
.research-v .labelled-grid>.stage-frame { grid-column:2; grid-row:2; }
.research-v .lg-cols span,.research-v .lg-rows span { font-size:.85rem; font-weight:600; color:var(--text-primary); }
.research-v .lg-cols span { text-align:center; }
.research-v .lg-rows span { writing-mode:vertical-rl; transform:rotate(180deg); text-align:center; }
.research-v .speed-badge { display:inline-block; margin-left:.4rem; padding:.1rem .5rem; border-radius:999px; background:#edf3ff; color:#283c5b; font-size:.8rem; font-weight:600; vertical-align:middle; }
.research-v .media-key { display:flex; flex-wrap:wrap; gap:.4rem 1.25rem; margin:.65rem 0 0; padding:0; list-style:none; font-size:.85rem; color:var(--text-secondary); }
.research-v .media-key li { display:flex; align-items:center; gap:.45rem; }
.research-v .media-key i { display:inline-block; flex:none; }
.research-v .k-bar { width:28px; height:8px; border-radius:2px; background:var(--c); }
.research-v .k-bar.is-short { width:14px; }
.research-v .k-ticks { width:28px; height:10px; background:repeating-linear-gradient(90deg,#6C7278 0 1px,transparent 1px 9px); }
.research-v .k-dot { width:10px; height:10px; border-radius:50%; background:#1B4290; box-shadow:0 0 0 2px white,0 0 0 3px #1B4290; }

@media(max-width:768px) {
  .research-v .lg-cols span,.research-v .lg-rows span { font-size:.7rem; }
  .research-v .card-row { grid-template-columns:minmax(0,1fr); row-gap:2rem; }
  .research-v .card-row:not(.composition-row)>.research-card { grid-row:auto; grid-template-rows:auto auto; }
  .research-v { --gutter:1.25rem; }
}

@media(max-width:600px) {
  .research-v { --hs:46px; }
  .v-bar button { gap:.85rem; }
  .research-v .policy-results>div { grid-template-columns:1fr 55px; }
  .research-v .policy-results span { grid-column:1/-1; }
  .research-v .stage-clips.quad { grid-template-columns:minmax(0,1fr); }
  .research-v .vr-views { grid-template-columns:minmax(0,1fr); }
  .research-v .vr-views .is-real .stage-clip { max-width:60%; }
  .research-v .card-row,.research-v .composition-row { grid-template-columns:minmax(0,1fr); }
}

/* Card rows with a caption under each video: heading, media and caption tracks. */
.research-v .card-row.has-captions { grid-template-rows:auto auto auto; }
.research-v .card-row.has-captions>.research-card { grid-row:span 3; }
.research-v .card-row.has-captions>.research-card>figcaption { align-self:start; }
@media(max-width:768px) {
  .research-v .card-row.has-captions>.research-card { grid-row:auto; grid-template-rows:auto auto auto; }
}
/* A full-width card inside a captioned row, e.g. "Contact on the hand". */
.research-v .card-row.has-captions>.research-card.is-wide { grid-column:1 / -1; margin-top:2rem; }
@media(max-width:768px) { .research-v .card-row.has-captions>.research-card.is-wide { margin-top:0; } }

/* Policy learning: the headline card (as the dataset's) and the training steps in a row above the fine-tuning clips. */
#policy-feature.dataset-feature { padding:1.5rem 1.5rem 1.25rem; border:1px solid #d4e2ff; border-radius:16px; background:linear-gradient(180deg,#f3f7ff 0,white 14rem); }
#policy-feature .dataset-browser-title .speed-badge { font-size:.75rem; vertical-align:middle; }
.research-v .training-flow.is-row { flex-direction:row; margin:0 0 .9rem; }
.research-v .training-flow.is-row li { flex:1 1 0; min-width:0; }
@media(max-width:600px) { #policy-feature.dataset-feature { padding:1.1rem .9rem 1rem; } .research-v .training-flow.is-row { flex-direction:column; } }

/* Policy learning, as slide 20: the behavior cloning prior, then RL fine-tuning with either reward (the two side by
   side in one box), then the fine-tuned policy. */
#policy-feature .dataset-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
.research-v .rl-flow { display:grid; grid-template-columns:minmax(0,1fr) 1.25rem minmax(0,1fr) 1.25rem minmax(0,1fr); align-items:center; gap:.4rem; width:100%; }
.research-v .rl-col .stage-clip { margin:0; }
.research-v .rl-rewards { display:flex; flex-direction:column; gap:.6rem; padding:.6rem; border:1px solid #c8d9f7; border-radius:12px; background:#f6f9ff; }
.research-v .rl-arrow { position:relative; height:2px; background:#8a9097; }
.research-v .rl-arrow::after { content:""; position:absolute; right:-1px; top:-4px; border:5px solid transparent; border-left:7px solid #8a9097; border-right:0; }
@media(max-width:760px) {
  #policy-feature .dataset-stats { grid-template-columns:minmax(0,1fr); }
  .research-v .rl-flow { grid-template-columns:minmax(0,1fr); }
  .research-v .rl-arrow { width:2px; height:1.1rem; justify-self:center; }
  .research-v .rl-arrow::after { right:-4px; top:auto; bottom:-1px; border:5px solid transparent; border-top:7px solid #8a9097; border-bottom:0; }
}

/* Wide screens: the stage tabs move to a sticky rail on the left, so they take no vertical space while scrolling, and
   the stages use the freed width (up to about 1240 px of content). The stacked sticky bars remain below 1100 px. */
.v-rail { display:none; }
@media(min-width:1100px) {
  .research-v { --rail:200px; display:grid; grid-template-columns:var(--rail) minmax(0,1fr); column-gap:clamp(1.5rem,3vw,3rem);
    padding:0 max(1.5rem,calc((100% - 1500px) / 2)); }
  .research-v>.v-bar,.research-v>.v-body { grid-column:2; }
  .v-rail { display:block; grid-column:1; grid-row:1 / span 6; align-self:start; position:sticky; top:0; padding:2.5rem 0 1rem; }
  .v-rail ol { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:.15rem; }
  .v-rail button { position:relative; display:grid; grid-template-columns:2.4ch minmax(0,1fr); gap:.6rem; align-items:baseline; width:100%;
    padding:.65rem .75rem .65rem .9rem; border:0; border-left:2px solid #dfe3ea; background:none; font:inherit; text-align:left; cursor:pointer; border-radius:0 8px 8px 0; }
  .v-rail .stage-number { font-size:.85rem; font-weight:700; color:#6b7280; }
  .v-rail-title { font-size:.95rem; font-weight:600; line-height:1.35; color:var(--text-secondary); }
  .v-rail button:hover { background:#f6f7fb; }
  .v-rail button:hover .stage-number,.v-rail button:hover .v-rail-title { color:#447ddf; }
  .v-rail button[aria-current="step"] { background:#f3f7ff; }
  .v-rail button[aria-current="step"] .stage-number { color:#447ddf; }
  .v-rail button[aria-current="step"] .v-rail-title { color:var(--text-primary); }
  .v-rail-progress { position:absolute; left:-2px; top:0; width:2px; height:100%; background:#72A3FE; transform-origin:top; transform:scaleY(var(--p,0)); }
  /* the stage titles become ordinary headings at the top of each stage */
  .v-bar { position:static; height:auto; background:none; backdrop-filter:none; border:0; margin-top:clamp(2rem,5vh,3rem); scroll-margin-top:1.25rem; }
  .v-bar button { padding:0; gap:1rem; cursor:default; }
  .v-bar .stage-number { font-size:1.1rem; color:#447ddf; }
  .v-bar-title { font-size:1.45rem; font-weight:700; color:var(--text-primary); }
  .v-bar button:hover .stage-number { color:#447ddf; }
  .v-bar button:hover .v-bar-title { color:var(--text-primary); }
  .v-bar-progress { display:none; }
  .v-body { padding:1.25rem 0 0; scroll-margin-top:4.5rem; }
  .research-v .panel-card { scroll-margin-top:1rem; }
}

/* Wide screens: the retargeting and policy headline cards stack like the dataset's (title, pitch, results, videos);
   the retargeting card's four videos (human and the three robots) sit in one row so the card fits one screen. */
@media(min-width:1100px) {
  #retargeting-videos .retargeting-panel>.demo-toolbar,#retargeting-videos .retargeting-grid { max-width:960px; margin-left:auto; margin-right:auto; box-sizing:border-box; }
  #policy-feature>.labelled-grid { max-width:920px; margin:0 auto; }
}
/* The headline result (ImPress itself) stands out among the stat tiles. */
.dataset-stats>div.is-key { border-color:#9fc0ff; background:#edf3ff; }
.dataset-stats>div.is-key dd { color:#1B4290; }
