/* RoboSimStudio: the project page.
   The title and authors; then the workflow as one stage with four steps (the input clip, the coding agent at work,
   the simulation it produced, and that simulation live to drive); the gallery; the footer with the license and
   the citation. Monochrome: ink on paper, one blue for links, green for "live". */
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Bold.ttf") format("truetype"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --ink: #17191e; --muted: #626673; --line: #e4e4e8; --bg: #ffffff; --card: #ffffff; --stage: #ececef;
  --link: #1a56db; --hot: #ea580c; --shade: rgba(20, 22, 30, 0.10);
  --dark: #15161b; --dark-line: #2b2d36; --dark-ink: #eef0f5; --green: #8fd694;
  --display: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --page: 1040px;
  color-scheme: light; /* always white, also at night */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.62 var(--display); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a { color: var(--link); }
img, video { max-width: 100%; }
h1, h2 { font-family: var(--display); letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; margin-bottom: 16px; }
p { margin: 0 0 14px; }
sup { font-size: 0.68em; line-height: 0; }
.mono { font-family: var(--mono); }
.wrap, .wide { width: min(var(--page), calc(100% - 32px)); margin-left: auto; margin-right: auto; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.card { padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.card video { display: block; width: 100%; border-radius: 8px; background: var(--stage); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font: 700 15px/1.2 var(--display);
  color: var(--ink); background: var(--card); border: 1px solid var(--line); text-decoration: none; cursor: pointer;
}
.pill:hover { border-color: var(--ink); }
.pill.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill.primary:hover { filter: brightness(1.15); }
.pill svg { width: 16px; height: 16px; }

/* ---- title, authors */
/* the first view: its own screen; the workflow starts a full scroll below */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-content: center; padding: 40px 0 72px; }
.hero > .wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 18px 40px; align-items: center; }
.hero .words { display: grid; justify-items: start; gap: 10px; text-align: left; }
.hero .down { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; color: var(--muted); font: 600 13px/1 var(--display); text-decoration: none; }
.hero .down svg { width: 22px; height: 22px; animation: bob 1.6s ease-in-out infinite; }
.hero .down:hover { color: var(--ink); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.hero .logos { margin: 8px 0 0; }
.logos { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.logos a { display: block; line-height: 0; }
.logos img { display: block; width: auto; }
.logos .autolab { height: 33px; } .logos .berkeley { height: 41px; } .logos .nvidia { height: 31px; }
.hero h1 { font-size: clamp(40px, 4.8vw, 72px); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; }
.subtitle { font: 700 clamp(17px, 1.5vw, 24px)/1.35 var(--display); color: var(--ink); margin: 0 0 2px; max-width: 44ch; letter-spacing: -0.01em; }
.hero .teaser { width: 100%; }
.hero .teaser video { aspect-ratio: 16 / 9; }
.authors { margin: 0; font-size: clamp(15px, 1vw, 17px); line-height: 1.6; max-width: 70ch; }
.authors span { white-space: nowrap; }
.authors sup { color: var(--muted); }
.affils { color: var(--muted); font-size: clamp(13.5px, 0.9vw, 15.5px); margin: 0; }
.affils span { white-space: nowrap; }
.links { grid-column: 1 / -1; display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.links .pill { padding: 13px 24px; font-size: 16px; }
.links .pill svg { width: 18px; height: 18px; }

/* ---- the workflow: a tall section; its content sticks while the page scrolls through the four steps */
.flow { position: relative; height: 540vh; }
.flow .sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
.hero .wide, .flow .wide, .gallery .wide, footer .wide { width: min(1320px, calc(100% - 32px)); }
@media (min-width: 1400px) {
  .hero > .wide { width: min(1800px, calc(100% - 48px)); grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 22px 44px; }
  .hero h1 { font-size: clamp(56px, 4.4vw, 80px); }
  .links { margin-top: 14px; }
  .hero .logos { gap: clamp(14px, 1.3vw, 22px); }
  .hero .logos .autolab { height: clamp(30px, 2.2vw, 40px); } .hero .logos .berkeley { height: clamp(37px, 2.75vw, 50px); } .hero .logos .nvidia { height: clamp(28px, 2.05vw, 37px); }
  .links .pill { padding: 14px 26px; font-size: 17px; }
}

/* the lead: one sentence for the step, above the board */
.lead { grid-column: 2; grid-row: 1; min-height: 54px; margin-bottom: 12px; }
.lead p { margin: 0; font-size: 16.5px; line-height: 1.5; color: var(--ink); display: none; }
.lead p b { font-weight: 800; }
.flow[data-step="1"] .lead > [data-step="1"], .flow[data-step="2"] .lead > [data-step="2"], .flow[data-step="3"] .lead > [data-step="3"], .flow[data-step="4"] .lead > [data-step="4"], .flow[data-step="5"] .lead > [data-step="5"] { display: block; }

/* the rail: five numbered steps down the left, joined by a line; the current one filled, the ones passed ticked; */
.rail { list-style: none; margin: 0; padding: 4px 0 0; display: flex; flex-direction: column; gap: 26px; grid-column: 1; grid-row: 1 / span 3; }
.rail li { position: relative; }
.rail li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: -24px; width: 2px; background: var(--line); }
.rail li.done::after { background: var(--ink); }
.rail button {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none;
  color: var(--muted); font: 500 15px/1.25 var(--display); cursor: pointer; text-align: left;
}
.rail button i {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font: 700 14px/1 var(--display); font-style: normal; color: var(--muted); background: var(--bg); border: 2px solid var(--line); transition: all 0.2s;
}
.rail button b { color: var(--ink); font-weight: 700; }
.rail button:hover i { border-color: var(--ink); color: var(--ink); }
.rail button[aria-current] i { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.rail li.done button i { border-color: var(--ink); color: var(--ink); }
.rail li.done button i::before { content: "✓"; }
.rail li.done button i span { display: none; }
.flow[data-step="5"] .next { display: none; }

/* the board: the rail down the left, the stage with its row of tools under it; on step 4 the task snapshots beside it */
.board { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0 22px; align-items: start; }
.thumbs { display: none; flex-direction: column; gap: 10px; grid-column: 3; grid-row: 2; }
.flow[data-step="4"] .thumbs { display: flex; }
.thumbs button { display: grid; gap: 6px; padding: 5px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--muted); font: 700 13.5px/1.2 var(--display); cursor: pointer; text-align: left; }
.thumbs button img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.thumbs button span { padding: 0 4px 3px; }
.thumbs button:hover { border-color: var(--muted); color: var(--ink); }
.thumbs button[aria-selected="true"] { border-color: var(--hot); color: var(--ink); }

/* the stage: the panel of the current step shows, the others wait behind it; it keeps 16:9 and fits the window's height */
.stage { position: relative; grid-column: 2; grid-row: 2; width: min(100%, calc((100svh - 200px) * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--stage); border: 1px solid var(--line); }
.panel { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s 0.35s; }
.panel.on { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.panel > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel.fit { background: #fff; }
.panel.fit > video { object-fit: contain; }  /* the agent's recording whole, its timer in the corner */
/* step 3: the multiphysics view lies over the path-traced one, clipped at --x; a full-size range input takes the drag */
.panel.cmp .over { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x)); }
.panel.cmp .over video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel.cmp .handle { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); pointer-events: none; }
.panel.cmp .handle i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink); font: 700 20px/40px var(--display); text-align: center; box-shadow: 0 4px 14px var(--shade); }
.panel.cmp .slide { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.panel.cmp .corner.right { left: auto; right: 12px; }
.corner {
  position: absolute; z-index: 2; top: 12px; left: 12px; font: 500 12px/1 var(--mono); letter-spacing: 1px; padding: 6px 10px; border-radius: 8px;
  background: rgba(14, 17, 22, 0.82); border: 1px solid #39424e; color: #e6edf5;
}
.corner.at { letter-spacing: 0; }

/* the prompt, along the input clip's bottom */
.prompt {
  position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(14, 17, 22, 0.85); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--dark-ink); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.prompt .chip { flex: none; font: 500 11px/1 var(--mono); letter-spacing: 1.5px; padding: 5px 8px; border-radius: 7px; color: var(--green); border: 1px solid #3c6b3f; background: #16241a; }
.ptext { font-size: 13.5px; line-height: 1.5; }
.ptext a { color: #cfe3f7; text-decoration: underline; text-decoration-color: rgba(207, 227, 247, 0.4); text-underline-offset: 3px; }
.ptext a:hover { text-decoration-color: #cfe3f7; }
.at {
  font-family: var(--mono); font-weight: 500; padding: 1px 7px; border-radius: 6px; white-space: nowrap;
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.12); transition: background 0.15s, border-color 0.15s;
}
.at.hot, .at:hover { background: rgba(255, 255, 255, 0.3); border-color: #fff; }
.cursor { display: inline-block; width: 8px; height: 1.2em; margin-left: 2px; background: var(--green); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
.prompt.done .cursor { animation: none; opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }

/* under the stage: the 3D block's bar (step 4) and the Next button */
.flow[data-step="4"] .board { grid-template-columns: 180px minmax(0, 1fr) 190px; }  /* the task snapshots */
.under { grid-column: 2; grid-row: 3; display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 12px; min-height: 44px; }
.under > [data-step] { display: none; }
.flow[data-step="4"] .under > .tools { display: flex; }
.next { flex: none; padding: 12px 22px; font-size: 15.5px; }

/* the 3D block, step 4 */
.live .screen { position: absolute; inset: 0; overflow: hidden; background: var(--stage); }
.screen > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; opacity: 0; transition: opacity 0.4s ease; }
.live.ready .screen iframe { opacity: 1; }
.gate { position: absolute; inset: 0; z-index: 3; cursor: grab; }
.live.active .gate { display: none; }
.live .corner { z-index: 4; pointer-events: none; transition: opacity 0.3s ease; }
.live.active .corner { opacity: 0; }
.load {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: min(320px, calc(100% - 32px));
  padding: 14px 16px; border-radius: 12px; background: var(--card); box-shadow: 0 10px 30px var(--shade); text-align: center;
  transition: opacity 0.35s ease; pointer-events: none;
}
.live:not(.connecting) .load { opacity: 0; }
.load .lmsg { margin: 0; font-size: 14px; color: var(--muted); }
/* the 3D block's bar: in the row under the stage, as wide as it allows; in full screen along the window's bottom */
.tools { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex: 1; min-width: 0; }
.scrub { position: relative; flex: 1; height: 18px; cursor: pointer; touch-action: none; }
.scrub::before, .scrub i { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 999px; pointer-events: none; transition: height 0.15s ease, margin 0.15s ease; }
.scrub::before { content: ""; right: 0; background: var(--line); }
.scrub i { width: 0; background: var(--ink); }
.scrub:hover::before, .scrub:hover i { height: 6px; margin-top: -3px; }
.tools button {
  font: inherit; font-weight: 700; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; text-decoration: none;
}
.tools button:hover { border-color: var(--ink); }
.close { display: none; }
/* full screen (a phone): the screen covers the window, Close at its top right and the bar along its bottom */
.live.full .screen { position: fixed; inset: 0; z-index: 1000; border-radius: 0; border: 0; }
.flow:has(.live.full) .close { display: inline-block; position: fixed; z-index: 1001; right: 10px; top: calc(10px + env(safe-area-inset-top)); box-shadow: 0 6px 20px var(--shade); }
.flow:has(.live.full) .scrub { position: fixed; z-index: 1001; left: 24px; right: 24px; bottom: calc(18px + env(safe-area-inset-bottom)); height: 28px; }
.flow:has(.live.full) .scrub::before { background: rgba(255, 255, 255, 0.7); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }

/* ---- gallery */
.gallery { padding: 56px 0 64px; }
.gallery video { aspect-ratio: 16 / 9; }

/* ---- footer: license, citation */
footer { padding: 36px 0 56px; color: var(--muted); font-size: 14.5px; text-align: center; border-top: 1px solid var(--line); }
footer p { margin: 0 0 18px; }
.cite { text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.cite-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); font-size: 13.5px; }
.cite .copy { font: 700 13px/1 var(--display); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.cite .copy:hover { border-color: var(--ink); }
.cite pre { margin: 0; padding: 14px 16px; font: 500 13px/1.6 var(--mono); color: var(--ink); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .hero { min-height: 0; padding: 24px 0 68px; }
  .hero > .wide { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hero .words { justify-items: center; text-align: center; }
  .links { gap: 10px; }
  .links .pill { padding: 11px 18px; font-size: 15px; }
  .logos { justify-content: center; }
  .logos { gap: 20px; }
  .logos .autolab { height: 22px; } .logos .berkeley { height: 27px; } .logos .nvidia { height: 21px; }
  .subtitle br { display: none; }
  .authors { font-size: 15px; }
  .card { padding: 6px; }
  .flow { height: 520vh; }
  .lead { grid-column: 1; grid-row: 2; min-height: 0; margin-bottom: 8px; }  /* under the rail: the tabs sit on the stage */
  .lead p { font-size: 14px; }
  .board, .flow[data-step="4"] .board { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .rail { grid-column: 1; grid-row: 1; flex-direction: row; gap: 0; padding: 0; margin-bottom: 2px; }
  .rail li { flex: 1; }
  .rail li:not(:last-child)::after { top: 13px; bottom: auto; left: calc(50% + 18px); right: calc(-50% + 18px); width: auto; height: 2px; }
  .rail button { display: grid; justify-items: center; gap: 0; width: 100%; font-size: 12px; padding: 0 2px; text-align: center; }
  .rail button i { width: 28px; height: 28px; font-size: 13px; margin-bottom: 6px; }
  .stage { grid-row: 3; grid-column: 1; width: 100%; }
  .under { grid-column: 1; grid-row: 5; }
  .thumbs { grid-column: 1; grid-row: 4; flex-direction: row; }
  .thumbs button { flex: 1; font-size: 12px; padding: 4px; gap: 4px; }
  .prompt { left: 6px; right: 6px; bottom: 6px; padding: 8px 10px; gap: 8px; }
  .prompt .chip { display: none; }
  .ptext { font-size: 11.5px; line-height: 1.4; }
  .panel.cmp .corner { font-size: 10px; padding: 4px 7px; }
  .panel.cmp .handle i { width: 32px; height: 32px; font-size: 16px; line-height: 32px; }
  .under { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 10px; }
  .next { justify-content: center; }
  .gallery { padding-bottom: 44px; }
}
/* a phone or a touch screen: the block is the clip and the button; the 3D replay opens full screen */
@media (pointer: coarse), (max-width: 760px) {
  .live:not(.full) .screen iframe, .live:not(.full) .load { display: none; }
  .flow:not(:has(.live.full)) .tools .scrub { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
kbd { display: inline-block; min-width: 1.5em; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--card); font: 600 0.85em/1.3 var(--mono); text-align: center; }
