:root {
  --ink: #292929;
  --muted: #67786d;
  --accent: #28744f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 21px/1.8 "Times New Roman", Times, serif;
}
a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.container { max-width: 1120px; margin: auto; padding: 0 28px 70px; }
.hero { padding: 65px 0 35px; text-align: center; }
h1 {
  max-width: 1030px;
  margin: 0 auto 25px;
  font-size: clamp(27px, 3.5vw, 42px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.025em;
}
h1 span { color: var(--accent); }
.authors { margin: 0 0 8px; font-size: 24px; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.affiliations { margin: 0; font-size: 21px; }
.author-notes { margin: 10px 0 0; color: var(--muted); font-size: 18px; }
.resource-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.resource-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  padding: 10px 23px;
  border: 0;
  border-radius: 24px;
  background: #314b3c;
  color: #fff;
  font: inherit;
  font-size: 20px;
  line-height: 1.5;
}
.resource-button:disabled { opacity: 1; cursor: default; }
.resource-button[href]:hover { background: #235f44; }
.resource-button span { color: #dce8df; font-size: 18px; }
sup { font-size: .65em; }
.section { padding-top: 34px; padding-bottom: 18px; }
h2 { margin: 0 0 24px; text-align: center; font-size: 32px; line-height: 1.3; }
.abstract { max-width: 1060px; margin: auto; }
.abstract p { margin: 0; text-align: justify; color: #292929; }
figure { margin: 0 0 28px; }
figure a { display: block; }
img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
}
figcaption { margin-top: 12px; color: var(--muted); font-size: 18px; text-align: center; }
.real-chart { max-width: 1000px; margin: 35px auto 0; }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.video-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f6f3;
  border: 1px dashed #bccdc1;
  border-radius: 5px;
  color: var(--muted);
  font-size: 18px;
}
video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
@media (max-width: 700px) {
  .container { padding: 0 18px 40px; }
  .hero { padding-top: 40px; }
  .authors { font-size: 21px; }
  .affiliations { font-size: 19px; }
  .section { padding-top: 28px; }
  h2 { font-size: 29px; }
  .video-grid { grid-template-columns: 1fr; }
}

.performance-subsection { margin-top: 30px; }
h3 { margin: 0 0 26px; font-size: 28px; text-align: center; }
h4 { margin: 32px 0 18px; font-size: 24px; text-align: center; }
.benchmark { margin-bottom: 36px; }
#real-world { padding-top: 30px; border-top: 1px solid #e0e9e2; }

.video-examples { margin-top: 24px; }
.single-video { max-width: 740px; margin-left: auto; margin-right: auto; }

.libero-gallery {
  margin: 30px 0 45px;
}
.suite-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.suite-tabs button {
  border: 1px solid #d1dfd5;
  border-radius: 7px;
  padding: 9px 25px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}
.suite-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.suite-tabs button:focus-visible,
.suite-panel:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.suite-panel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 22px) / 2);
  gap: 22px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  /* Reserve room for entry motion so translated cards never create a Y scrollbar. */
  padding: 24px 0;
  scrollbar-color: #91b79e #edf4ee;
  scrollbar-width: auto;
}
.suite-panel > .task-video { scroll-snap-align: start; }
.suite-panel[hidden] { display: none; }
.task-video { margin: 0; min-width: 0; }
.task-video video { aspect-ratio: 3 / 2; height: auto; border-radius: 5px; }
.task-video figcaption { margin-top: 10px; line-height: 1.5; color: var(--ink); }
@media (max-width: 700px) {
  .suite-panel { grid-auto-columns: 100%; }
  .suite-tabs { gap: 8px; }
  .suite-tabs button { padding: 8px 17px; }
}

.rmbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 22px;
}
.rmbench-grid video { aspect-ratio: 5 / 2; }
@media (max-width: 700px) {
  .rmbench-grid { grid-template-columns: 1fr; }
}

#real-world-tasks > .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tidy-video-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.real-world-video { min-width: 0; }
.real-world-video video { aspect-ratio: 4 / 3; height: auto; border-radius: 5px; }
@media (max-width: 700px) {
  #real-world-tasks > .video-grid { grid-template-columns: 1fr; }
  .tidy-video-grid { grid-template-columns: 1fr; }
}

.real-world-task-group { grid-column: 1 / -1; min-width: 0; }
.real-world-task-group h5 { margin: 0 0 20px; text-align: center; font-size: 24px; }
.real-world-montage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 700px) {
  .real-world-montage-grid { grid-template-columns: 1fr; }
}

/* Video descriptions use the same bold serif family as the on-video labels. */
.task-video figcaption,
.real-world-video figcaption,
.video-examples figcaption {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
}

.generalization-video-groups,
.real-world-gallery {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1740px, calc(100vw - 48px));
  margin-top: 32px;
}
@media (max-width: 700px) {
  .generalization-video-groups,
  .real-world-gallery { left: auto; transform: none; width: 100%; }
}
.real-world-task-group[hidden] { display: none; }
.generalization-video-groups > .real-world-task-group {
  grid-column: 1;
  width: 100%;
}

/* Soft section backgrounds and restrained color accents. */
:root {
  --ink: #292929;
  --muted: #63786a;
  --accent: #2b7652;
  --soft-accent: #edf6ef;
  --soft-green: #f1f7f2;
  --line: #dce8df;
}
body { overflow-x: hidden; }
.hero,
#method,
#real-world { position: relative; isolation: isolate; }
.hero::before,
#method::before,
#real-world::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}
.hero { min-height: max(560px, 28vw); padding-top: 72px; padding-bottom: 48px; }
.hero::before {
  background:
    linear-gradient(rgba(245, 250, 246, .78), rgba(245, 250, 246, .78)),
    url("../images/svawam/hero-real-world.webp") center 60% / 100% auto no-repeat;
  background-color: var(--soft-accent);
  border-top: 6px solid var(--accent);
}
.hero h1 { color: #242424; }
.hero h1 span { color: var(--accent); }
.authors { color: #3b6950; }
.affiliations { color: var(--muted); }
#abstract { padding-top: 46px; padding-bottom: 46px; }
#method { padding-top: 42px; padding-bottom: 26px; margin-bottom: 30px; }
#method::before { background: #f5f8f3; }
#real-world { margin-top: 48px; padding-top: 42px; padding-bottom: 24px; border-top: 0; }
#real-world::before { background: var(--soft-green); }
h2 { color: #292929; }
h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin: 14px auto 0;
  background: #9dc6aa;
  border-radius: 2px;
}
h3 { color: #3b6d51; }
h4 {
  display: table;
  margin-left: auto;
  margin-right: auto;
  padding: 6px 20px;
  border-radius: 6px;
  background: var(--soft-accent);
  color: #35694d;
}
#real-world h3,
#real-world .real-world-task-group h5 { color: #326c4c; }
#real-world h4 { background: #e1eee3; color: #326c4c; }
.resource-button { background: var(--accent); border: 1px solid var(--accent); }
.resource-button + .resource-button { background: #fff; color: var(--accent); }
.resource-button span { color: #5f7665; }
.suite-tabs button { border-color: #c9dfcf; color: #3c6b50; border-radius: 20px; font-weight: 700; }
.suite-tabs button:hover:not([aria-selected="true"]) { background: var(--soft-accent); }
.task-video,
.real-world-video {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(32, 75, 48, .04);
}
.task-video figcaption,
.real-world-video figcaption { color: #456b52; }
#real-world .real-world-video figcaption { color: #466f54; }
#method > figure,
.benchmark > figure {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
@media (max-width: 700px) {
  .hero { padding-top: 44px; padding-bottom: 34px; }
  #abstract { padding-top: 34px; padding-bottom: 34px; }
  #method,
  #real-world { padding-top: 32px; }
  .task-video,
  .real-world-video { padding: 8px; }
  #method > figure,
  .benchmark > figure { padding: 8px; }
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: -10px 0 16px;
}
.carousel-controls button {
  padding: 5px 16px;
  border: 1px solid #c9dfcf;
  border-radius: 18px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.carousel-controls button:disabled { opacity: .4; cursor: default; }
.carousel-controls button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Navigation floats in the left margin without reserving content width. */
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
.page-shell { display: block; width: 100%; margin: 0; padding: 0; }
.page-shell > .container { width: 100%; max-width: 1280px; min-width: 0; }
.page-sidebar { position: fixed; left: 16px; top: 16px; width: 48px; margin: 0; z-index: 30; }
.page-toc { position: relative; }
.page-toc summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 12px;
  list-style: none;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(32, 75, 48, .08);
  cursor: pointer;
}
.page-toc summary::-webkit-details-marker { display: none; }
.page-toc summary:hover,
.page-toc[open] summary { background: var(--soft-accent); }
.toc-menu-icon { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.toc-menu-icon > span { display: block; width: 100%; height: 2px; background: currentColor; border-radius: 2px; }
.page-toc nav {
  position: absolute;
  top: 58px;
  left: 0;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 14px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(32, 75, 48, .12);
}
.page-toc a {
  display: block;
  padding: 7px 10px;
  margin: 2px 0;
  border-radius: 6px;
  color: #496b56;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.toc-heading {
  padding: 2px 10px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 21px;
  font-weight: 700;
}
.page-toc ul { list-style: none; padding: 0; margin: 0; }
.page-toc a { border-left: 3px solid transparent; }
.page-toc .toc-performance { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.page-toc a.toc-major { color: #245f43; }
.page-toc .toc-subsections { padding-left: 8px; }
.page-toc .toc-subsection { margin-top: 10px; }
.page-toc a.toc-level-2 { padding: 6px 10px; color: #3b6d51; font-size: 17px; }
.page-toc .toc-children {
  margin: 3px 0 5px 16px;
  padding-left: 10px;
  border-left: 1px solid #ccdfd1;
}
.page-toc .toc-children > li { position: relative; }
.page-toc .toc-children > li::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 10px;
  border-top: 1px solid #ccdfd1;
}
.page-toc a.toc-level-3 { padding: 6px 10px; font-size: 16px; font-weight: 400; }
.page-toc a:hover { background: #f1f7f2; }
.page-toc a[aria-current="location"] { background: #e4f2e8; color: #245f43; border-left-color: var(--accent); font-weight: 700; }
.page-toc summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 700px) {
  html { scroll-padding-top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

#rmbench > figure { max-width: 1000px; margin-left: auto; margin-right: auto; }

.method-svg-ready .method-animation-native { display: none; }
.method-animation { position: relative; width: 100%; aspect-ratio: 1800 / 1150; }
.method-animation-svg,
.method-animation-poster { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
#method > figure.method-figure { background: transparent; border: 0; }

.performance-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 26px;
  padding: 0;
  margin: 4px 0 8px;
  list-style: none;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}
.performance-chart-legend li { display: flex; align-items: center; gap: 8px; }
.performance-chart-legend sub { font-size: .7em; }
.chart-legend-swatch { width: 15px; height: 15px; flex: 0 0 15px; border-radius: 2px; }
.performance-chart { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.performance-chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.performance-chart + .performance-chart { margin-top: 12px; }
.performance-chart-svg {
  display: block;
  width: 100%;
  min-width: var(--chart-min-width);
  height: auto;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
}
.chart-gridline { stroke: #e3e9e5; stroke-width: 1; }
.chart-axis { stroke: #58685d; stroke-width: 1.4; fill: none; }
.chart-tick { fill: #58665d; font-size: 18px; }
.chart-axis-title { fill: #303c34; font-size: 21px; font-weight: 700; }
.chart-category { fill: #303c34; font-size: 20px; font-weight: 700; }
.chart-bar-value { fill: #303c34; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .performance-chart-legend { font-size: 17px; gap: 6px 17px; }
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(var(--reveal-offset, 20px));
  transition: none;
}
.scroll-reveal.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 620ms cubic-bezier(.22, 1, .36, 1), transform 620ms cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.scroll-reveal:focus-within { opacity: 1; transform: none; transition: none; }
/* Move video contents within a fixed card when browsing horizontally. Keeping
   the card itself still prevents new scroll overflow or a vertical bounce. */
.suite-panel > .task-video[data-reveal-axis="x"] { transform: none; overflow: hidden; }
.suite-panel > .task-video[data-reveal-axis="x"] > video,
.suite-panel > .task-video[data-reveal-axis="x"] > figcaption {
  transform: translateX(var(--reveal-offset-x, 24px));
  transition: none;
}
.suite-panel > .task-video.is-revealed[data-reveal-axis="x"] > video,
.suite-panel > .task-video.is-revealed[data-reveal-axis="x"] > figcaption {
  transform: none;
  transition: transform 620ms cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.suite-panel > .task-video[data-reveal-axis="x"]:focus-within > video,
.suite-panel > .task-video[data-reveal-axis="x"]:focus-within > figcaption { transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal.is-revealed { opacity: 1; transform: none; transition: none; }
  .suite-panel > .task-video[data-reveal-axis="x"] > video,
  .suite-panel > .task-video[data-reveal-axis="x"] > figcaption { transform: none !important; transition: none !important; }
}

.citation { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line); }
.bibtex-block {
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f5f8f3;
  color: #304237;
  font: 16px/1.7 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
@media (max-width: 700px) {
  .bibtex-block { padding: 18px; }
}

.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: #91b79e #edf4ee; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-scroll-hint { display: none; }

@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 18px; }
  .hero { min-height: 440px; padding: 78px 0 36px; }
  .hero::before {
    background: linear-gradient(rgba(245, 250, 246, .76), rgba(245, 250, 246, .76)),
      url('../images/svawam/hero-wordmark.svg') center 54% / 100% 100% no-repeat;
    background-color: #edf6ef;
  }
  .hero h1 { font-size: clamp(25px, 6.8vw, 29px); line-height: 1.22; text-wrap: balance; }
  .authors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; font-size: 18px; line-height: 1.5; }
  .affiliations { font-size: 17px; line-height: 1.5; }
  .author-notes { font-size: 15px; line-height: 1.6; }
  .resource-buttons { gap: 10px; margin-top: 20px; }
  .resource-button { padding: 9px 18px; font-size: 18px; }
  .resource-button span { font-size: 16px; }
  #abstract p { text-align: justify; text-align-last: left; text-justify: inter-word; word-spacing: normal; letter-spacing: normal; font-size: 17px; line-height: 1.6; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3; }
  h3 { font-size: 25px; line-height: 1.3; }
  .result-table .table-scroll > a { width: max-content; }
  .result-table .table-scroll img { width: var(--table-mobile-width); max-width: none; }
  .table-scroll-hint { display: block; margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
  .suite-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .suite-tabs button { min-width: 0; padding: 9px 8px; font-size: 18px; line-height: 1.35; }
  #libero-plus .suite-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #libero-plus .suite-tabs button { grid-column: span 2; }
  #libero-plus .suite-tabs button:nth-child(n+4) { grid-column: span 3; }
  .real-world-gallery .suite-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .real-world-gallery .suite-tabs button { font-size: 16px; }
}
