/* RESET & CUSTOM PROPERTIES */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surface tokens: warm beige / cream palette (academic press feel) */
  --bg:          #faf7f0;
  --bg-alt:      #f2ece0;
  --surface:     #fdfbf6;
  --surface-hi:  #fffefa;

  /* Text tokens: warm toned ladder, not cool gray */
  --text:        #1a1612;
  --text-soft:   #3a3328;
  --text-muted:  #78695a;
  --text-faint:  #b2a390;

  /* Accent: warm terracotta / sienna, harmonized with cream */
  --accent:      #b5552a;
  --accent-rgb:  181, 85, 42;
  --accent-soft: rgba(181, 85, 42, 0.09);
  --accent-line: rgba(181, 85, 42, 0.28);

  /* Borders: warm tinted so they sit naturally on cream */
  --border:      rgba(60, 45, 25, 0.13);
  --border-hi:   rgba(60, 45, 25, 0.22);
  --hairline:    rgba(60, 45, 25, 0.06);

  /* Shadows: soft, cool toned, single direction */
  --shadow-xs:   0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:   0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:   0 8px 24px -8px rgba(15, 23, 42, 0.12), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg:   0 20px 40px -16px rgba(15, 23, 42, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.08);

  /* Layout */
  --max-w:       960px;
  --pad-x:       24px;
  --tab-active:  var(--accent);
  --task-bleed:  0px;
  --video-bleed: 0px;

  /* Motion */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Inter OpenType stylistic sets: ss01 (alt a), cv11 (straight-leg R), calt (contextual alternates) */
  font-feature-settings: "ss01", "cv11", "cv05", "kern", "liga", "calt";
  font-variation-settings: normal;
  overflow-x: clip;
}

::selection {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* LAYOUT */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* Every <section> is the main content column */
section {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 88px var(--pad-x);
}

@media (max-width: 768px) {
  section { padding: 56px var(--pad-x); }
}


/* TYPOGRAPHY */
h1, h2, h3, h4 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h2 {
  font-size: clamp(1.95rem, 3.8vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  margin-bottom: 0.9rem;
  position: relative;
  padding-bottom: 0.7rem;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Unified subsection heading: one size across task subsections, method
 * rows, and benchmark blocks so peer-level titles read at the same weight. */
h3 {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.018em;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

strong { font-weight: 600; color: var(--text); }

/* Inline highlight: subtle accent-tinted wash behind a phrase, like a
   highlighter pen in the site's warm palette. Works inside body text. */
.highlight {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--text);
  font-weight: 500;
  padding: 0 0.28em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Eyebrow label above section titles (two line hierarchy) */
.section-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  width: 14px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

.body-text {
  color: var(--text-soft);
  font-size: 1.125rem;
  max-width: 760px;
  line-height: 1.72;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Section lede paragraph (first .body-text directly under a section) */
section > .body-text { margin-bottom: 2rem; }

/* Numeric precision: tabular figures where they matter */
.tabular { font-variant-numeric: tabular-nums; }

/* STICKY TOC NAV
 * Thin vertical rail with circular markers per section.
 * Inactive: hollow muted dot. Active: filled accent dot with halo.
 */
#toc-nav {
  position: fixed;
  left: 26px;
  top: 50%;
  width: 180px;
  z-index: 100;
  background: transparent;
  transform: translateX(-130%) translateY(-50%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

#toc-nav.visible {
  transform: translateX(0) translateY(-50%);
  pointer-events: auto;
}

/* Vertical rail */
#toc-nav::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--border) 12%,
    var(--border) 88%,
    transparent 100%
  );
}

.toc-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toc-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.55;
  padding: 0 0 14px 20px;
  margin: 0;
}

.toc-link {
  position: relative;
  display: block;
  padding: 7px 8px 7px 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  text-decoration: none;
  white-space: normal;
  line-height: 1.4;
  transition: color 0.22s ease, padding-left 0.22s ease;
}

/* Dot marker (sits on the rail) */
.toc-link::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  transform: translateY(-50%);
  transition: background 0.22s ease, border-color 0.22s ease,
              width 0.22s ease, height 0.22s ease,
              left 0.22s ease, box-shadow 0.22s ease;
}

.toc-link:hover {
  color: var(--text);
}

.toc-link:hover::before {
  border-color: var(--text-muted);
  width: 9px;
  height: 9px;
  left: 0px;
}

.toc-link.active {
  color: var(--text);
  font-weight: 500;
}

.toc-link.active::before {
  background: var(--accent);
  border-color: var(--accent);
  width: 9px;
  height: 9px;
  left: 0px;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

@media (max-width: 1180px) {
  #toc-nav {
    left: 14px;
    width: 162px;
  }
}

/* HERO TITLE CARD */
/* Full-viewport hero: title, authors, institution, tagline, buttons fill
 * the first screen. Next section (#intro-split) starts on the second. */
#hero-title {
  background: var(--bg);
  text-align: center;
  padding: 40px var(--pad-x);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#hero-title .paper-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(2.8rem, 6.8vw, 4.8rem);
  font-weight: 800;
  font-style: normal;
  letter-spacing: -0.042em;
  margin: 0 auto 1.5rem;
  line-height: 1.1;
  color: var(--text);
  max-width: 900px;
  padding: 0.05em 0;
}

.hero-tagline {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-soft);
  max-width: 620px;
  margin: 0.75rem auto 2rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}


#hero-title .authors {
  font-size: 1.2rem;
  color: var(--text-soft);
  font-weight: 450;
  margin-bottom: 0.4rem;
  letter-spacing: -0.005em;
}

#hero-title .authors a {
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: color 0.18s ease;
}

#hero-title .authors a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease-out);
}

#hero-title .authors a:hover {
  color: var(--text);
}

#hero-title .authors a:hover::after {
  transform: scaleX(1);
}

#hero-title .institution {
  font-size: 1.15rem;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-bottom: 1.75rem;
}

.link-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px 10px 20px;
  border: 1px solid var(--border-hi);
  border-radius: 100px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s var(--ease-out),
              background 0.25s var(--ease-out),
              color 0.25s var(--ease-out),
              padding 0.25s var(--ease-out);
}

/* Sliding arrow indicator: slides in from the right on hover */
.btn-link::after {
  content: '→';
  position: absolute;
  right: 16px;
  opacity: 0;
  transform: translateX(-4px);
  font-weight: 400;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.btn-link:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  padding-right: 34px;
  text-decoration: none;
}

.btn-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.btn-link:active {
  background: #2a231b;
}

.btn-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.btn-link:hover svg {
  opacity: 1;
}

/* Brand-mark icons (e.g., HF) keep their own colors and full opacity */
.btn-link .hf-logo,
.btn-link:hover .hf-logo {
  width: 18px;
  height: 18px;
  opacity: 1;
  flex-shrink: 0;
  display: block;
}


/* ABSTRACT (folded into the hero, below the buttons).
 * Left-aligned prose; wider than a typical reading column so the
 * whole hero (title, authors, buttons, abstract) has a chance of
 * fitting in a single viewport. Tighter line-height for the same
 * reason. */
#abstract {
  max-width: 960px;
  margin: 1.6rem auto 0;
  text-align: left;
}

#abstract p {
  margin: 0;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  font-size: 0.96rem;
  color: var(--text-soft);
  line-height: 1.6;
}

#abstract p + p {
  margin-top: 0.6rem;
}

/* FIGURES & MEDIA */
figure { margin: 0; }

/* Every on page video lives inside a <figure>. This rule replaces the
   inline style="width:100%;border-radius:6px;" that used to sit on each. */
figure video {
  width: 100%;
  border-radius: 6px;
  display: block;
}

/* Uniform cell box across comparison grids: source clips vary in native
 * aspect (casting/flinging 4:3, pushing 16:9), which would otherwise make
 * the box shrink/grow per subsection. Lock every cell to 16:9 and cover
 * the frame so all three cross-trial and in-trial grids share one size. */
.video-grid figure video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

figcaption {
  font-size: 0.86rem;
  font-style: normal;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.85rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

/* Inline math color helpers used in figure captions */
.math-gray { color: var(--text-muted); font-style: normal; }
.math-blue { color: #0062FF; font-style: normal; }

/* Centered full-width figures (architecture, gating diagram, robomimic chart) */
.fig-centered {
  max-width: 600px;
  margin: 0 auto 1rem;
}

.fig-centered img { width: 100%; }

#attention {
  padding-bottom: 48px;
}

#attention .tab-panel figure {
  max-width: 720px;
  margin: 0 auto 1rem;
}

/* VIDEO GRIDS: .three-col is the standard 3 policy comparison row. */
.video-grid {
  display: grid;
  gap: 14px;
}

.video-grid.three-col { grid-template-columns: 1fr 1fr 1fr; }

.video-col {
  display: flex;
  flex-direction: column;
  min-width: 0; /* allow grid items to shrink below min-content width */
}

/* Column label above each video ("Ours", "Long-History DP", etc.) */
.col-header {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.col-header.ours {
  font-weight: 600;
}

/* TASK HEADER: title + description beside the success rate chart.
 * Video rows sit below at full width. */
.task-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.task-header-text {
  flex: 1;
  min-width: 0;
}

.task-chart {
  flex-shrink: 0;
  width: 240px;
}

.task-chart .col-header {
  text-align: center;
  margin-bottom: 6px;
}

.task-chart img {
  width: 100%;
  display: block;
}

.task-chart figcaption {
  font-size: 0.76rem;
  text-align: center;
  margin-top: 6px;
  line-height: 1.4;
}

/* Video rows: negative margins on both sides push the block wider than its parent */
.task-videos-full {
  margin-left:  calc(var(--video-bleed) / -2);
  margin-right: calc(var(--video-bleed) / -2);
}

/* Tab bar and overlay snap back to column width by reversing the margin bleed */
.task-videos-full .tab-bar,
.task-videos-full .overlay-details {
  margin-left:  calc(var(--video-bleed) / 2);
  margin-right: calc(var(--video-bleed) / 2);
}

@media (max-width: 640px) {
  .task-header { flex-direction: column; }
  .task-chart  { width: 100%; }
  .task-videos-full { margin-left: 0; margin-right: 0; }
  .task-videos-full .tab-bar,
  .task-videos-full .overlay-details { margin-left: 0; margin-right: 0; }
}

/* SUBSECTIONS (Pushing, Casting, Flinging, Cup, etc.) */
.subsection {
  width: 100%;
  padding-top: 36px;
}

.subsection + .subsection {
  position: relative;
  margin-top: 24px;
  padding-top: 48px;
}

.subsection + .subsection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.subsection h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 0.5rem;
}

.subsection-intro {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  max-width: 760px;
  line-height: 1.65;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* TAB BAR (editorial underline).
 * Horizontal row with a hairline separator. The active tab shows a 2px
 * accent bar that slides in via scaleX. No pill chrome, no fill. */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 0;
  margin-bottom: 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  position: relative;
  padding: 11px 18px 13px;
  margin-bottom: -1px; /* align bar ::after with bar's border */
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.22s var(--ease-out);
}

/* Sliding 2px accent bar: scales in from center when active */
.tab-btn::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--text);
  font-weight: 600;
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tab-panel         { display: none; }
.tab-panel.active  { display: block; width: 100%; max-width: 100%; }

/* INITIAL POSITION ACCORDION (Cup task).
 * Pure <details>/<summary>, no JS. */
.overlay-details {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.overlay-details summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  -webkit-appearance: none;
  appearance: none;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 0;
  border: none;
  background: none;
  transition: color 0.15s;
}

.overlay-details summary::-webkit-details-marker { display: none; }
.overlay-details summary::marker { display: none; }

.overlay-details summary:hover { color: var(--text); }

.overlay-details summary::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6358' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.overlay-details[open] summary::after { transform: rotate(180deg); }

.overlay-details figure { margin-top: 0.85rem; width: 100%; }
.overlay-details figure img { width: 100%; display: block; }

.overlay-single {
  margin-top: 0.85rem;
  max-width: 280px;
}

/* IN THE WILD: own chapter, banner-style grid video.
 * Compact vertical padding + compact labels so section-label + h2 + lede
 * + labels + full-bleed grid fit in a typical laptop viewport. */
#in-the-wild {
  padding-top: 48px !important;
  padding-bottom: 48px !important;
}

#in-the-wild .full-bleed {
  margin-top: 0;
}

/* Two equal-width titles above the full-bleed grid; each mirrors its half
 * of the 8-column grid (left 4 cols = no-pert, right 4 cols = pert).
 * Eyebrow (accent, uppercase, monospace) matches .section-label; title
 * underneath uses the site's Inter heading treatment. */
.wild-labels {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 1.6rem;
  margin-bottom: 0.9rem;
  display: flex;
}
.wild-label {
  flex: 1;
  text-align: center;
  padding: 0 1.5rem;
}
.wild-label-eyebrow {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.wild-label-title {
  display: block;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.018em;
}

/* FULL BLEED MEDIA
 * Breaks an element out of the content column so it spans the full
 * viewport width. Negative margins cancel the container's centering. */
.full-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: block;
  border-radius: 0;
}

/* TEAM SECTION */
.team-grid {
  display: flex;
  gap: 28px 40px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 140px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.28s var(--ease-out);
}

a.author-card:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.author-photo {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.28s var(--ease-out);
}

a.author-card:hover .author-photo {
  border-color: var(--accent);
}

.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-photo svg {
  width: 44px;
  height: 44px;
  color: var(--text-faint);
}

.author-name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.corresponding {
  font-size: 0.75em;
  color: var(--accent);
  vertical-align: super;
  line-height: 0;
  cursor: help;
}

.author-affil {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* FOOTER */
#footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--hairline);
  padding: 72px var(--pad-x) 56px;
  margin-top: 48px;
}

#footer .container {
  max-width: var(--max-w);
}

.footer-section-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-section-label::before {
  content: '';
  width: 14px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

.citation-block {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.bibtex-wrapper {
  position: relative;
  margin-bottom: 3rem;
}

.bibtex-wrapper pre {
  background: #111111;
  color: #d4d4d4;
  padding: 1.35rem 1.6rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #d4d4d4;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.18s var(--ease-out),
              border-color 0.18s var(--ease-out);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
}

.copy-btn.copied {
  background: rgba(80, 200, 120, 0.2);
  border-color: rgba(80, 200, 120, 0.4);
  color: #a7f3d0;
}

.footer-ack {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-copyright a {
  color: var(--text-soft);
}

/* SECTION SLIDE IN
 * JS adds .section-reveal to each top level section, then flips .is-visible
 * when the section enters the viewport. The whole section slides up as one
 * block so the next chapter feels like it glides in from below. */
.section-reveal {
  opacity: 0;
  transform: translateY(90px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section-reveal,
  .section-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* MAJOR SECTIONS
 * Extra vertical padding on top level sections gives the eye breathing
 * room between chapters. */
#cross-trial,
#in-trial,
#in-the-wild,
#method,
#attention,
#benchmark,
#faq,
#team,
#acknowledgments {
  padding-top: 140px;
  padding-bottom: 140px;
}

/* Team + Acknowledgments share a single viewport: collapse the gap
 * between them and shorten their outer padding so both fit above the
 * footer without scroll on ~900px+ displays. */
#team { padding-bottom: 56px; }
#acknowledgments { padding-top: 0; padding-bottom: 88px; }

@media (max-width: 768px) {
  #cross-trial,
  #in-trial,
  #in-the-wild,
  #method,
  #attention,
  #benchmark,
  #faq,
  #team,
  #acknowledgments {
    padding-top: 88px;
    padding-bottom: 88px;
  }
  #team { padding-bottom: 40px; }
  #acknowledgments { padding-top: 0; padding-bottom: 64px; }
}

/* Acknowledgments: prose spans the full section column so the block
 * balances with the Team grid above it. Smaller type since the reading
 * measure is wider than the site's standard 760px lede column. */
#acknowledgments .body-text {
  max-width: none;
  font-size: 0.95rem;
  line-height: 1.68;
  margin-bottom: 1rem;
}
#acknowledgments .body-text:last-child { margin-bottom: 0; }

/* FOCUS STATES (keyboard accessibility, branded) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn-link:focus-visible,
.tab-btn:focus-visible,
.copy-btn:focus-visible {
  outline-offset: 2px;
}

.toc-link:focus-visible {
  outline-offset: 0;
  outline-width: 1.5px;
}


/* METHOD
 * Zigzag layout: figure on one side, caption on the other, alternating
 * per row, vertically centered. */
.method-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin-top: 90px;
}

.method-row:first-of-type { margin-top: 1rem; }

/* Flipped row: image on right, caption on left (reverse order) */
.method-row-flip .method-img {
  grid-column: 2;
  grid-row: 1;
}
.method-row-flip .method-caption {
  grid-column: 1;
  grid-row: 1;
}

.method-img {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.method-img img {
  width: 100%;
  height: auto;
  display: block;
}

.method-caption {
  min-width: 0;
}

.method-caption h3 {
  color: var(--text);
  margin: 0 0 0.6rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.method-caption p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.68;
  color: var(--text-soft);
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

@media (max-width: 768px) {
  .method-row,
  .method-row-flip {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }
  .method-img { min-height: auto; }
  /* On mobile, caption always below image regardless of flip */
  .method-row-flip .method-img { grid-column: 1; grid-row: 1; }
  .method-row-flip .method-caption { grid-column: 1; grid-row: 2; }
  .method-row .method-img { grid-row: 1; }
  .method-row .method-caption { grid-row: 2; }
}

/* BENCHMARK: two stacked horizontal blocks (RoboMimic, Mikasa) */
.benchmark-block {
  margin-top: 40px;
}

.benchmark-block:first-of-type {
  margin-top: 1.25rem;
}

.benchmark-block h3 {
  color: var(--text);
  margin: 0 0 1rem;
}

.benchmark-chart {
  margin: 0 0 1.25rem;
}

.benchmark-chart img {
  width: 100%;
  display: block;
}

.benchmark-caption {
  font-size: 0.92rem;
  line-height: 1.68;
  color: var(--text-soft);
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  margin: 0;
  max-width: none;
}

/* FAQ: flat accordion with a chevron indicator */
.faq-list {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 22px 44px 22px 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.02rem;
  font-weight: 550;
  letter-spacing: -0.012em;
  color: var(--text);
  transition: color 0.2s var(--ease-out);
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }

.faq-item summary:hover {
  color: var(--accent);
}

/* Chevron indicator that rotates when item is open */
.faq-item summary::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 4px;
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.28s var(--ease-out),
              border-color 0.2s var(--ease-out);
}

.faq-item summary:hover::after {
  border-color: var(--accent);
}

.faq-item[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
  border-color: var(--accent);
}

.faq-item[open] summary {
  color: var(--accent);
}

.faq-answer {
  padding: 0 44px 24px 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.68;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  animation: faq-fade 0.32s var(--ease-out);
}

.faq-answer p { margin-bottom: 0.75rem; }
.faq-answer p:last-child { margin-bottom: 0; }

@keyframes faq-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* TASK CHART: transparent frame so charts blend with page bg */
.task-chart {
  padding: 10px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  transition: border-color 0.22s var(--ease-out);
}

.task-chart:hover {
  border-color: var(--accent-line);
}

/* RESPONSIVE: stack grids to one column on mobile */
@media (max-width: 640px) {
  .video-grid.three-col { grid-template-columns: 1fr; }

  .link-buttons { flex-direction: column; align-items: center; }

  section { padding: 40px var(--pad-x); }

  #hero-title { padding: var(--pad-x); }
  #intro-split {
    gap: 24px;
    padding: 36px var(--pad-x);
  }
  #hero-video { border-radius: 8px; }

  .team-grid { gap: 28px 24px; }
  .author-card { width: 100px; }
  .author-photo { width: 68px; height: 68px; }

  #toc-nav { display: none; }
}
