/* ===================== VARIABLES ===================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0ea5e9;
  --text-dark: #1e293b;
  --text-mid: #475569;
  --text-light: #94a3b8;
  --bg-light: #f8fafc;
  --bg-alt: #f1f5f9;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 6px;
  --radius-lg: 8px;
}

/* ===================== BASE ===================== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
}

.section {
  padding: 3rem 1.5rem;
}

.section.is-light {
  background: var(--bg-light);
}

/* ===================== HERO ===================== */
.publication-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.publication-subtitle {
  font-weight: 400;
  color: var(--text-mid);
}

.author-block {
  margin-top: 0.8rem;
  font-size: 1.1rem;
}

.author {
  margin: 0 0.3rem;
}

/* ===================== TEASER ===================== */
.teaser-section {
  background: #fff;
  padding: 0.75rem 0 0.2rem;
}

.teaser-section .hero-body {
  padding-top: 1rem;
  padding-bottom: 0.35rem;
}

.teaser-box {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.15rem 0.7rem;
  box-shadow: var(--shadow-sm);
}
.teaser-image {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

#abstract.section {
  padding-top: 2rem;
}

/* ===================== COMPARISON TABLE ===================== */
.comparison-table {
  font-size: 0.85rem;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table.comparison-table thead th {
  background: #1e293b !important;
  color: #ffffff !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-color: #334155 !important;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.comparison-table td {
  text-align: left;
  vertical-align: middle;
  border-color: var(--border);
}

.comparison-table td:nth-child(2),
.comparison-table thead th:nth-child(2) {
  min-width: 14em;
}

.comparison-table td:first-child {
  font-weight: 500;
  white-space: nowrap;
}

.comparison-table td:nth-last-child(-n+2) {
  text-align: center;
  white-space: nowrap;
}

.related-work-table td:nth-last-child(4),
.related-work-table td:nth-last-child(3) {
  text-align: center;
  white-space: nowrap;
}

.comparison-table tbody tr:last-child {
  background: #eff6ff !important;
  border-left: 3px solid var(--primary);
}

.comparison-table tbody tr:last-child td {
  border-color: #bfdbfe;
  color: #1e293b;
}

.comparison-table tbody tr:last-child td.cell-yes {
  color: #16a34a !important;
}

.comparison-table .cell-yes {
  color: #16a34a;
  font-weight: 600;
}

.comparison-table .cell-no {
  color: #b0b8c4;
}

.comparison-table .cell-partial {
  color: #d97706;
  font-weight: 500;
}

/* ===================== PIPELINE ===================== */
.method-intro {
  margin-bottom: 1.4rem;
}

.method-intro-lead {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 auto 0.45rem;
  padding: 0.7rem 1.05rem;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.method-intro-lead i {
  color: var(--primary);
}

.method-intro-sub {
  margin: 0;
  color: var(--text-mid);
  font-size: 0.95rem;
}

.pipeline-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pipeline-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 1.5rem 1.05rem;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 110px;
  user-select: none;
}

.pipeline-stage:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pipeline-stage:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.pipeline-stage.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.pipeline-stage.active .stage-icon,
.pipeline-stage.active .stage-label,
.pipeline-stage.active .stage-click-indicator {
  color: #fff;
}

.stage-icon {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  transition: color 0.25s ease;
}

.stage-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-dark);
  transition: color 0.25s ease;
}

.stage-click-indicator {
  margin-top: 0.5rem;
  color: var(--text-light);
  font-size: 0.8rem;
  transition: color 0.25s ease, transform 0.25s ease;
}

.pipeline-stage:hover .stage-click-indicator,
.pipeline-stage:focus-visible .stage-click-indicator {
  color: var(--primary);
  transform: translateY(2px);
}

.pipeline-stage.active .stage-click-indicator {
  transform: rotate(180deg);
}

.pipeline-arrow {
  color: var(--text-light);
  font-size: 1.2rem;
  padding: 0 0.6rem;
}

/* ===================== STAGE PANELS ===================== */
.stage-panels {
  position: relative;
}

.stage-panels-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem 1.2rem;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  color: var(--text-mid);
  box-shadow: var(--shadow-sm);
}

.stage-panels-empty i {
  color: var(--primary);
}

.stage-panels-empty p {
  margin: 0;
}

.stage-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.stage-panel[hidden] {
  display: none !important;
}

.stage-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== CODE BLOCKS ===================== */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.code-block code {
  color: #e2e8f0;
  background: none;
}

/* ===================== DEMO LAUNCHER ===================== */
.demo-launcher {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 1rem 0 0.5rem;
}

.demo-launcher-desktop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.demo-launcher-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.demo-launcher h6 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.demo-launcher p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
  max-width: 400px;
}

.demo-launcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  background: #3b82f6;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.demo-launcher-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.demo-launcher-btn:active {
  transform: translateY(0);
}

.demo-launcher-mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}

.demo-launcher-mobile i {
  font-size: 1.6rem;
  color: #475569;
}

.demo-launcher-mobile p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

@media (max-width: 768px) {
  .demo-launcher-desktop { display: none; }
  .demo-launcher-mobile  { display: flex; }
  .demo-launcher { padding: 1.5rem 1rem; }
}

/* ===================== FULLSCREEN VIEWER ===================== */
.embedded-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b0f14;
}

.embedded-viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

.fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}

.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.embedded-viewer:fullscreen,
.embedded-viewer:-webkit-full-screen {
  border-radius: 0;
  border: none;
}

.embedded-viewer:fullscreen iframe,
.embedded-viewer:-webkit-full-screen iframe {
  width: 100%;
  height: 100%;
}

/* ===================== PROMPT STRUCTURE ===================== */
.prompt-structure {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.prompt-block {
  padding: 0.7rem 1rem;
  border-left: 4px solid;
  position: relative;
}

.prompt-block + .prompt-block {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.prompt-block h6 {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.prompt-block p {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin: 0;
}

.system-prompt {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.user-prompt {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.optional-prompt {
  background: #f5f3ff;
  border-left-color: #8b5cf6;
  opacity: 0.85;
}

.output-prompt {
  background: #ecfdf5;
  border-left-color: #10b981;
}

/* ===================== SHARED: STAGE SUBTITLES ===================== */
.stage-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 1.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stage-subtitle i {
  color: var(--primary);
  font-size: 0.9rem;
}

/* ===================== SHARED: CARD GRID ===================== */
.card-grid {
  display: grid;
  gap: 0.75rem;
}

.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .card-grid.cols-2,
  .card-grid.cols-3 { grid-template-columns: 1fr; }
}

/* ===================== SHARED: INFO CARDS ===================== */
.info-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.info-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.info-card h6 {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.info-card h6 i {
  color: var(--primary);
  font-size: 0.8rem;
}

.info-card p {
  font-size: 0.82rem;
  color: var(--text-mid);
  margin: 0;
  line-height: 1.5;
}

/* numbered variant */
.numbered-card {
  position: relative;
  padding-left: 3rem;
}

.card-number {
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== SHARED: STAGE NOTE ===================== */
.stage-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-top: 1.25rem;
}

.stage-note > i {
  color: #3b82f6;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* ===================== SHARED: PROMPT TAG ===================== */
.prompt-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  padding: 0.15em 0.45em;
  border-radius: 3px;
  vertical-align: middle;
}

/* ===================== INPUT: JSON PAIR ===================== */
.json-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.json-pair-block {
  min-width: 0;
}

.json-pair-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.json-pair-block .code-block {
  font-size: 0.8rem;
  padding: 0.75rem 1rem;
  margin: 0;
}

@media (max-width: 768px) {
  .json-pair { grid-template-columns: 1fr; }
}

/* ===================== INPUT: RIG RENDER ROW ===================== */
.rig-render-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
  max-width: 500px;
}

.rig-render-row figure {
  margin: 0;
  text-align: center;
}

.rig-render-row img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f8fafc;
}

.rig-render-row figcaption {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.35rem;
}

@media (max-width: 768px) {
  .rig-render-row { grid-template-columns: 1fr; max-width: 320px; }
}

/* ===================== USD DIAGRAM ===================== */
.usd-diagram {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.usd-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  min-width: 150px;
  flex: 1;
  max-width: 200px;
  text-align: left;
  overflow: hidden;
}

.usd-block-header {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.8rem;
  color: #fff;
}

.source-header { background: #3b82f6; }
.anim-header   { background: #10b981; }
.output-header { background: #8b5cf6; }

.usd-block ul {
  list-style: none;
  padding: 0.5rem 0.8rem 0.65rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-mid);
}

.usd-block ul li {
  padding: 0.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.usd-block ul li i {
  width: 16px;
  text-align: center;
  font-size: 0.75rem;
}

.source-block li i { color: #3b82f6; }
.anim-block li i   { color: #10b981; }
.output-block li i { color: #8b5cf6; }

.usd-arrow {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  color: var(--text-light);
  flex-shrink: 0;
}


/* ===================== RESULTS ===================== */
.results-desc {
  margin-bottom: 1.5rem;
}

.human-eval-box {
  margin: 1.75rem 0 1.5rem;
  padding: 1.35rem 1.35rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.human-eval-formula {
  margin-bottom: 1.25rem;
  padding: 1rem 1.2rem 0.25rem;
  border-radius: var(--radius);
  background: #f8fafc;
  border-left: 4px solid var(--primary);
}

.human-eval-formula-title {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.human-eval-table-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.results-rate-table {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  width: 100%;
  table-layout: fixed;
}

.results-rate-table td,
.results-rate-table thead th {
  text-align: center;
  vertical-align: middle;
}

.results-rate-table td:first-child,
.results-rate-table thead th:first-child {
  text-align: left !important;
  white-space: normal;
  width: 38%;
}

.comparison-table.results-rate-table td:nth-child(2),
.comparison-table.results-rate-table thead th:nth-child(2) {
  min-width: 0;
  width: 10%;
}

.results-rate-table td:nth-child(2),
.results-rate-table td:nth-child(3),
.results-rate-table td:nth-child(4),
.results-rate-table td:nth-child(5),
.results-rate-table td:nth-child(6),
.results-rate-table thead th:nth-child(2),
.results-rate-table thead th:nth-child(3),
.results-rate-table thead th:nth-child(4),
.results-rate-table thead th:nth-child(5),
.results-rate-table thead th:nth-child(6) {
  text-align: center !important;
  white-space: nowrap;
}

.results-rate-table td:nth-child(3),
.results-rate-table td:nth-child(4),
.results-rate-table td:nth-child(5),
.results-rate-table thead th:nth-child(3),
.results-rate-table thead th:nth-child(4),
.results-rate-table thead th:nth-child(5) {
  width: 10%;
}

.results-rate-table td:nth-child(6),
.results-rate-table thead th:nth-child(6) {
  width: 22%;
}

.results-rate-table .overall-row td {
  background: #eff6ff !important;
  border-color: #bfdbfe;
  color: #1e293b;
  font-weight: 700;
}

.runtime-table {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.runtime-table td,
.runtime-table thead th {
  vertical-align: middle;
}

.runtime-table td:nth-child(2),
.runtime-table thead th:nth-child(2) {
  min-width: 0;
  white-space: normal;
}

.runtime-table td:nth-child(3),
.runtime-table td:nth-child(4),
.runtime-table thead th:nth-child(3),
.runtime-table thead th:nth-child(4) {
  text-align: center;
  white-space: nowrap;
}

.runtime-detail {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--text-mid);
  font-size: 0.86rem;
}

.results-footnote {
  font-size: 0.94rem;
  color: var(--text-mid);
}

.results-placeholder-link {
  color: var(--primary);
  font-weight: 600;
}

.results-placeholder-link[aria-disabled="true"] {
  cursor: default;
  text-decoration: none;
}

.results-placeholder-link[aria-disabled="true"]:hover {
  text-decoration: underline;
}

.animation-subsection-title {
  margin-bottom: 0.9rem !important;
  color: var(--text-dark);
}

.comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.comparison-row {
  text-align: center;
}

.comparison-pair {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.video-cell {
  flex: 1;
  max-width: 480px;
  min-width: 0;
}

.video-cell video {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  background: #f1f5f9;
}

.video-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.video-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-light);
  border: 2px dashed var(--border);
  margin-bottom: 0.5rem;
}

.prompt-text {
  font-size: 0.9rem;
  color: var(--text-mid);
  font-style: italic;
  margin-top: 0.5rem;
  width: 100%;
}

.prompt-clampable {
  line-height: 1.5;
}

.prompt-clamped {
  max-height: calc(3 * 1.5em);
  overflow: hidden;
}

.prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-style: normal;
  color: var(--primary);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  white-space: nowrap;
}

.prompt-toggle:hover {
  text-decoration: underline;
}

/* ===================== REFINEMENT CAROUSEL ===================== */
.refinement-carousel {
  position: relative;
  max-width: 960px;
  margin: 0 auto 2.5rem;
  padding: 0 3rem;
}

.refinement-carousel:last-child {
  margin-bottom: 0;
}

.refinement-viewport {
  overflow: hidden;
}

.refinement-track {
  display: flex;
  transition: transform 0.4s ease;
}

.refinement-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.refinement-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 0 0.75rem;
  align-items: start;
}

.refinement-step {
  text-align: center;
}

.refinement-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.refinement-video {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  background: #f1f5f9;
}

.refinement-prompt {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-mid);
  margin-top: 0.4rem;
  font-style: italic;
  text-align: center;
}

.refinement-arrow-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
  align-self: center;
  padding-top: 1.2rem;
}

.refinement-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-mid);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}

.refinement-nav:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.refinement-nav:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.refinement-nav.prev {
  left: 0;
}

.refinement-nav.next {
  right: 0;
}

/* ===================== GALLERY ===================== */
.examples-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.example-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-video {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  background: #f1f5f9;
  flex-shrink: 0;
}

/* ===================== EXAMPLE TAGS ===================== */
.example-tags {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  min-height: 1.5rem;
}

.example-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.tag-refined {
  background: #dbeafe;
  color: #1d4ed8;
}

.tag-first-try {
  background: #d1fae5;
  color: #047857;
}

.tag-no-examples {
  background: #fef3c7;
  color: #b45309;
}

/* ===================== FOOTER ===================== */
.footer {
  padding: 2rem;
  background: var(--bg-alt);
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-mid);
}

/* ===================== RESPONSIVE ===================== */
@media screen and (max-width: 768px) {
  .pipeline-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .method-intro-lead {
    display: flex;
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-lg);
    text-align: center;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
    padding: 0.3rem 0;
  }

  .pipeline-stage {
    width: 100%;
    flex-direction: row;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
  }

  .stage-icon {
    margin-bottom: 0;
    font-size: 1.3rem;
  }

  .stage-click-indicator {
    margin-top: 0;
    margin-left: auto;
  }

  .comparison-pair {
    flex-direction: column;
    align-items: center;
  }

  .video-cell {
    max-width: 100%;
  }

  .refinement-carousel {
    padding: 0 2.5rem;
  }

  .examples-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .usd-diagram {
    flex-direction: column;
    align-items: center;
  }

  .usd-block {
    max-width: 220px;
    width: 100%;
  }

  .usd-arrow {
    transform: rotate(90deg);
  }

}

@media screen and (max-width: 480px) {
  .examples-gallery {
    grid-template-columns: 1fr;
  }

  .publication-title {
    font-size: 1.8rem;
  }
}

/* ===================== KATEX OVERRIDES ===================== */
.katex-display {
  margin: 0.8rem 0;
}
