/* ===================== Tokens ===================== */
/* Palette follows the title: KakaoTalk-style yellow -> amber -> brown.
   --slow / --fast / --green stay as in the paper figures (speed colormap, highlights). */
:root {
  --bg: #ffffff;
  --bg-alt: #fbf8ef;
  --surface: #ffffff;
  --text: #2b2220;
  --text-2: #5a4d45;
  --muted: #8a7d72;
  --border: #ece5d5;
  --accent: #8b5228;          /* brown (readable on white) */
  --accent-soft: #fdf3c4;     /* soft yellow */
  --on-accent: #ffffff;
  --slow: #3f5bd8;            /* speed colormap ends, as in the paper figures */
  --fast: #d2433a;
  --green: #6aa121;
  --what: #8b5228;            /* content tokens: brown */
  --when: #e0a00e;            /* pacing tokens: amber */
  --when-ink: #a86f00;        /* amber text on light tints */
  --on-when: #3c1e1e;
  --btn-bg: #3c1e1e;
  --btn-text: #ffffff;
  --venue-bg: #fee500;
  --venue-text: #3c1e1e;
  --row-ours: #fff6d1;
  --shadow: 0 1px 2px rgba(60, 30, 30, .05), 0 6px 24px rgba(60, 30, 30, .07);
  --title-1: #fad000;
  --title-2: #e29e12;
  --title-3: #8b5228;
  --title-4: #3c1e1e;
  --title-shadow: rgba(60, 30, 30, .16);
  --radius: 14px;
  --nav-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130f;
    --bg-alt: #1d1913;
    --surface: #231e17;
    --text: #f1ebe2;
    --text-2: #cfc4b6;
    --muted: #9a8f82;
    --border: #372e24;
    --accent: #f5b52e;
    --accent-soft: #3a2c12;
    --on-accent: #2a1a0e;
    --slow: #6f86f0;
    --fast: #ef6b61;
    --green: #92c84a;
    --what: #d9935a;
    --when: #fee500;
    --when-ink: #fee500;
    --on-when: #3c1e1e;
    --btn-bg: #fee500;
    --btn-text: #3c1e1e;
    --venue-bg: #3a2c12;
    --venue-text: #fee500;
    --row-ours: #33280f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    --title-1: #fee500; --title-2: #f5b52e; --title-3: #d9935a; --title-4: #c99a7a;
    --title-shadow: rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #16130f; --bg-alt: #1d1913; --surface: #231e17; --text: #f1ebe2; --text-2: #cfc4b6;
  --muted: #9a8f82; --border: #372e24; --accent: #f5b52e; --accent-soft: #3a2c12; --on-accent: #2a1a0e;
  --slow: #6f86f0; --fast: #ef6b61; --green: #92c84a;
  --what: #d9935a; --when: #fee500; --when-ink: #fee500; --on-when: #3c1e1e;
  --btn-bg: #fee500; --btn-text: #3c1e1e; --venue-bg: #3a2c12; --venue-text: #fee500; --row-ours: #33280f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  --title-1: #fee500; --title-2: #f5b52e; --title-3: #d9935a; --title-4: #c99a7a;
  --title-shadow: rgba(0, 0, 0, .35);
}

/* ===================== Base ===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: 'Google Sans', 'Noto Sans', sans-serif; line-height: 1.25; margin: 0; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 880px; }
.container.wide { max-width: 1280px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.slow { color: var(--slow); font-weight: 600; }
.fast { color: var(--fast); font-weight: 600; }
.green { color: var(--green); font-weight: 600; }

.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
.section-title {
  font-size: 2rem; font-weight: 500; text-align: center; margin-bottom: 28px;
}
.section-title .title-sub { display: block; font-size: 1.05rem; color: var(--muted); font-weight: 400; margin-top: 6px; }
.sub-title { font-size: 1.3rem; font-weight: 500; margin: 8px 0 14px; }
.sub-title.center { margin-top: 56px; }
.lead { color: var(--text-2); max-width: 780px; margin: -8px auto 32px; font-size: 1.05rem; }
.prose p { margin: 0 0 1em; color: var(--text-2); }
.prose.justify p { text-align: justify; hyphens: auto; }

/* ===================== Nav ===================== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topnav.scrolled { border-bottom-color: var(--border); }
.topnav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 16px; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-k { color: var(--title-1); text-shadow: 1px 1px 0 var(--title-shadow); }   /* yellow */
.brand-a { color: var(--title-3); }                                              /* brown */
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 6px 12px; border-radius: 999px; color: var(--text-2);
  font-size: .92rem; font-family: 'Google Sans', sans-serif;
}
.nav-links a:hover, .nav-links a.active { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: .95rem; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.theme-toggle:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.2rem; padding: 8px; cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .topnav-inner .brand { margin-right: auto; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg); padding: 8px 16px 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
}

/* ===================== Hero ===================== */
.hero { padding: 56px 0 24px; }
.venue {
  display: inline-block; font-family: 'Google Sans', sans-serif; font-weight: 500;
  font-size: .95rem; color: var(--venue-text); background: var(--venue-bg);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 18px;
}
.venue-sub { opacity: .75; font-weight: 400; }
.title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 500; letter-spacing: -.01em; margin-bottom: 22px; }
.title-brand {
  font-weight: 700;
  background: linear-gradient(90deg, var(--title-1), var(--title-2) 35%, var(--title-3) 70%, var(--title-4));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(1px 2px 0 var(--title-shadow));   /* keeps the light yellow end legible */
}
.title-colon { font-weight: 700; color: var(--title-4); }
.title-line2 { display: block; font-size: .6em; font-weight: 500; color: var(--text); margin-top: .25em; }
.authors { font-size: 1.12rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.author { color: var(--accent); }
.author sup { color: var(--text-2); margin-left: 1px; line-height: 0; }
.authors { align-items: baseline; }
.equal-contrib { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.affils { color: var(--text-2); margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; font-size: .98rem; }
.link-buttons { margin: 22px 0 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--btn-bg); color: var(--btn-text);
  padding: 9px 20px; border-radius: 999px; font-family: 'Google Sans', sans-serif;
  font-size: .98rem; transition: transform .15s, opacity .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); opacity: .9; }
.btn .hf-icon { width: 1.15em; height: 1.15em; padding: 3px; flex: none; box-sizing: content-box; background: #2a1a0e; border-radius: 50%; margin: -3px 0 -3px -4px; }
.btn .soon { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; opacity: .7; border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* ===================== Figures ===================== */
.card-figure {
  margin: 0; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--border);
}
.card-figure img { width: 100%; height: auto; border-radius: 6px; }
.card-figure figcaption {
  color: #4b5163; font-size: .95rem; margin-top: 14px; line-height: 1.6;
  padding: 0 4px;
}
.card-figure figcaption .slow { color: #3f5bd8; }
.card-figure figcaption .fast { color: #d2433a; }
.card-figure figcaption .green { color: #6aa121; }
.zoomable img { cursor: zoom-in; }
.teaser { margin-top: 4px; }
/* qualitative comparison: 4-method strips (figure card stays white in both themes) */
.qual { overflow-x: auto; }
.qual-inner { min-width: 720px; }
.qual-head {
  display: grid; grid-template-columns: repeat(4, 1fr); text-align: center;
  font-family: 'Castoro', 'Times New Roman', serif; font-weight: 700; font-size: 1.08rem; color: #1f2330;
  border-top: 2px solid #1f2330; border-bottom: 1.5px solid #1f2330; padding: 6px 0;
}
.qual-head .ours { color: #4f7f15; }
.qual-row + .qual-row { border-top: 1px solid #e5e3ef; }
.qual-prompt {
  margin: 10px 0 6px; text-align: center; color: #1f2330;
  font-family: 'Castoro', 'Times New Roman', serif; font-style: italic; font-size: 1.02rem;
}
.qual-prompt .hl { color: #6aa121; font-weight: 700; }
.qual-video { position: relative; margin-bottom: 10px; }
.qual-video video { display: block; width: 100%; height: auto; }
.qual-video::after {             /* dividers between the four panels */
  content: ""; position: absolute; inset: 6% 0; pointer-events: none;
  background: linear-gradient(to right, transparent calc(25% - .5px), rgba(31,35,48,.12) calc(25% - .5px) calc(25% + .5px), transparent calc(25% + .5px) calc(50% - .5px), rgba(31,35,48,.12) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px) calc(75% - .5px), rgba(31,35,48,.12) calc(75% - .5px) calc(75% + .5px), transparent calc(75% + .5px));
}
.qual-ours-box {
  position: absolute; top: 2px; bottom: 2px; left: calc(75% + 3px); right: 2px;
  border: 2.5px dashed #8fd14f; border-radius: 10px; pointer-events: none;
}
.qual-head.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pace-inner { min-width: 600px; max-width: 860px; margin: 0 auto; }
.qual-video.cols-3::after {
  background: linear-gradient(to right, transparent calc(33.333% - .5px), rgba(31,35,48,.12) calc(33.333% - .5px) calc(33.333% + .5px), transparent calc(33.333% + .5px) calc(66.667% - .5px), rgba(31,35,48,.12) calc(66.667% - .5px) calc(66.667% + .5px), transparent calc(66.667% + .5px));
}
.qual-video.cols-3 .qual-ours-box { left: calc(66.667% + 3px); }
/* retiming: per-panel duration label + progress bar, scaled to the longest clip */
.pace-bars { position: absolute; left: 0; right: 0; bottom: 10px; display: grid; grid-template-columns: repeat(3, 1fr); pointer-events: none; }
.pace-bar { padding: 0 18px; }
.pb-label { display: block; font-family: 'Castoro', 'Times New Roman', serif; font-style: italic; font-size: .95rem; color: #1f2330;
  text-shadow: 0 0 4px #fff, 0 0 8px #fff; margin-bottom: 3px; }
.pb-track { display: block; height: 6px; border-radius: 3px; background: rgba(31,35,48,.12); overflow: hidden; }
.pb-track i { display: block; height: 100%; width: 0; border-radius: 3px; }
.pb-native i { background: #8a8f9c; }
.pb-warp i { background: #3f5bd8; }
.pb-ours i { background: #6aa121; }

/* inpainting: (a) | (b), two clips each, with a live timeline */
.inp { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.inp-group { padding: 0 14px; }
.inp-group + .inp-group { border-left: 2px dashed #d5d3df; }
.inp-tag { font-family: 'Castoro', 'Times New Roman', serif; font-size: 1.05rem; color: #1f2330; margin: 2px 0 8px; }
.inp-items { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inp-item { display: flex; flex-direction: column; }
.inp-ctx, .inp-gen {
  margin: 0; text-align: center; font-family: 'Castoro', 'Times New Roman', serif; font-style: italic;
  font-size: .98rem; line-height: 1.3; transition: opacity .25s;
}
.inp-ctx { color: #5f636c; min-height: 2.6em; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.inp-gen { color: #2f8fa3; margin-top: 6px; }
.inp-gen b { font-weight: 700; }
.inp-item.live.in-gen .inp-ctx { opacity: .4; }
.inp-item.live:not(.in-gen) .inp-gen { opacity: .45; }
.inp-video { border-radius: 8px; overflow: hidden; background: #f4f4f6; aspect-ratio: 550 / 500; }
.inp-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.it { margin-top: 8px; }
.it-track { position: relative; height: 8px; border-radius: 4px; background: #a3a7aa; }
.it-gen { position: absolute; top: 0; bottom: 0; background: #4fa3b8; }
.it-head { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; border: 2.5px solid #1f2330; box-sizing: border-box; }
.it-labels { display: flex; justify-content: space-between; font-size: .78rem; color: #7c8295; margin-top: 3px; }
.it-range { color: #2f8fa3; font-weight: 600; }
@media (max-width: 980px) {
  .inp { grid-template-columns: 1fr; gap: 22px; }
  .inp-group + .inp-group { border-left: 0; border-top: 2px dashed #d5d3df; padding-top: 18px; }
}
@media (max-width: 520px) { .inp-items { grid-template-columns: 1fr; } }
.teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.teaser-item { display: flex; flex-direction: column; }
.teaser-prompt {                  /* grows so the three videos line up at the bottom */
  flex: 1; display: flex; align-items: center; justify-content: center;
  margin: 0 0 8px; text-align: center; color: #1f2330;   /* figure card stays white in both themes */
  font-family: 'Castoro', 'Times New Roman', serif; font-style: italic; font-size: 1.02rem; line-height: 1.35;
}
.teaser-prompt .blank { display: inline-block; width: 2.6em; border-bottom: 1.5px solid #1f2330; margin: 0 .25em; transform: translateY(-.2em); }
.teaser-video { position: relative; border-radius: 8px; overflow: hidden; background: #f4f4f6; aspect-ratio: 1120 / 490; }
.teaser-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.teaser-video::after {           /* fast | slow divider */
  content: ""; position: absolute; top: 8%; bottom: 8%; left: 50%; width: 1px; background: rgba(31, 35, 48, .12);
}
.tv-label {
  position: absolute; bottom: 6px; font-family: 'Castoro', 'Times New Roman', serif; font-style: italic; font-weight: 700;
  font-size: .98rem; pointer-events: none;
  text-shadow: 0 0 4px #fff, 0 0 8px #fff, 0 0 2px #fff;
}
.tv-fast { left: 10px; color: #d2433a; }
.tv-slow { left: calc(50% + 10px); color: #3f5bd8; }
@media (max-width: 900px) {
  .teaser-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* ===================== TL;DR + stats ===================== */
.tldr-section { padding-top: 32px; padding-bottom: 24px; }
.tldr {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 22px 26px 18px; box-shadow: var(--shadow);
}
.tldr-tag {
  position: absolute; top: -12px; left: 20px; background: var(--accent); color: var(--on-accent);
  font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: .8rem;
  padding: 2px 12px; border-radius: 999px; letter-spacing: .06em;
}
.tldr p { margin: 0; color: var(--text-2); font-size: 1.04rem; }
.pill { display: inline-block; padding: 0 9px; border-radius: 999px; font-weight: 600; font-size: .92em; }
.pill-what { background: color-mix(in srgb, var(--what) 16%, transparent); color: var(--what); }
.pill-when { background: color-mix(in srgb, var(--when) 16%, transparent); color: var(--when-ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; text-align: center;
}
.stat-num {
  font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: 2rem; line-height: 1.1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.stat-num small { font-size: .55em; }
.stat-label { font-size: .86rem; color: var(--text-2); margin-top: 6px; line-height: 1.4; }
.stat-label .muted { font-size: .8rem; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ===================== Demo ===================== */
.demo {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.demo-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 16px; }
.demo-controls-label { font-family: 'Google Sans', sans-serif; color: var(--muted); font-size: .9rem; margin-right: 4px; }
.chip {
  font: inherit; font-size: .88rem; font-family: 'Google Sans', sans-serif;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-2);
  padding: 5px 14px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.icon { width: 34px; padding: 5px 0; }
.demo-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .demo-panels { grid-template-columns: 1fr; } }
.demo-panel { background: var(--bg-alt); border-radius: 10px; padding: 14px 14px 10px; }
.demo-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-badge { font-family: 'Google Sans', sans-serif; font-weight: 500; font-size: .9rem; padding: 2px 10px; border-radius: 999px; }
.demo-badge.bad { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--text-2); }
.demo-badge.good { background: var(--accent-soft); color: var(--accent); }
.demo-readout { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-readout b.ok { color: var(--green); }
.demo-readout b.no { color: var(--fast); }
.demo svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.demo-caption { font-size: .88rem; color: var(--text-2); margin: 6px 2px 4px; line-height: 1.5; }
.demo svg text { font-family: 'Google Sans', sans-serif; fill: var(--muted); font-size: 12px; }

/* ===================== Contributions / method ===================== */
.contrib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .contrib-grid { grid-template-columns: 1fr; } }
.contrib {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: relative;
}
.contrib-num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: 'Google Sans', sans-serif; font-weight: 700; margin-bottom: 12px;
}
.contrib h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 8px; }
.contrib p { margin: 0; color: var(--text-2); font-size: .95rem; }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
@media (max-width: 980px) { .method-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .method-grid { grid-template-columns: 1fr; } }
.method-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; border-top: 3px solid var(--accent);
}
.method-card.what { border-top-color: var(--what); }
.method-card.when { border-top-color: var(--when); }
.method-icon { color: var(--accent); font-size: 1.15rem; margin-bottom: 8px; }
.method-card.when .method-icon { color: var(--when-ink); }
.method-card h3 { font-size: 1.02rem; font-weight: 500; margin-bottom: 6px; }
.method-card p { margin: 0; font-size: .9rem; color: var(--text-2); line-height: 1.55; }
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; vertical-align: middle; margin-left: 4px; }
.what .tag { background: color-mix(in srgb, var(--what) 16%, transparent); color: var(--what); }
.when .tag { background: color-mix(in srgb, var(--when) 16%, transparent); color: var(--when-ink); }

/* ===================== Tables ===================== */
.table-block { margin-top: 32px; }
.table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.table-head h3 { font-size: 1.15rem; font-weight: 500; }
.tabs { display: inline-flex; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.section.alt .tabs { background: var(--surface); }
.tab {
  font: inherit; font-family: 'Google Sans', sans-serif; font-size: .88rem;
  border: 0; background: none; color: var(--text-2); padding: 5px 14px; border-radius: 999px; cursor: pointer;
}
.tab.active { background: var(--accent); color: var(--on-accent); }
.table-wrap {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); -webkit-overflow-scrolling: touch;
}
table.results { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.results th, table.results td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--border); }
table.results th { font-family: 'Google Sans', sans-serif; font-weight: 500; color: var(--text-2); background: var(--bg-alt); font-size: .85rem; }
table.results th.group { border-bottom: 1px solid var(--border); }
table.results td:first-child, table.results th:first-child { text-align: left; padding-left: 16px; }
table.results tbody tr:last-child td { border-bottom: 0; }
table.results tr.real td { color: var(--muted); }
table.results tr.ours td { background: var(--row-ours); font-weight: 500; }
table.results td .pm { color: var(--muted); font-size: .72em; margin-left: 1px; }
table.results td b { color: var(--text); font-weight: 700; }
table.results td u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
table.results tr.sub td:first-child { padding-left: 30px; }
table.results tr.sep td { border-top: 2px solid var(--border); }
table.results .delta { color: var(--slow); font-size: .75em; margin-left: 4px; }
table.results.compact td, table.results.compact th { padding: 8px 10px; }
table.heat td.heatcell { position: relative; }
.table-note { font-size: .82rem; color: var(--muted); margin: 8px 4px 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.two-col.align-center { align-items: center; margin-top: 12px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ===================== Inpainting legend ===================== */
.legend { display: flex; justify-content: center; gap: 22px; margin: -14px 0 18px; font-size: .9rem; color: var(--text-2); }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.sw-input { background: #a3a7aa; }
.sw-gen { background: #4fa3b8; }

/* ===================== Gallery ===================== */
.gallery { max-width: 960px; margin: 0 auto; outline: none; }
.gal-stage { position: relative; }
.gal-viewport {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--border); aspect-ratio: 16 / 9;
}
.gal-viewport video { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.gal-viewport video.fading { opacity: 0; }
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.gal-nav:hover { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.gal-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gal-prev { left: -22px; }
.gal-next { right: -22px; }
.gal-caption { text-align: center; margin: 16px auto 0; max-width: 780px; }
.gal-prompt {
  margin: 0; font-family: 'Castoro', 'Times New Roman', serif; font-style: italic; font-size: 1.15rem;
  color: var(--text); min-height: 3em; display: flex; align-items: center; justify-content: center;
}
.gal-meta { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.gal-tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-weight: 500; }
.gal-count { font-variant-numeric: tabular-nums; }
.gal-thumbs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 16px; }
.gal-thumb {
  padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #fff;
  cursor: pointer; opacity: .6; transition: opacity .15s, border-color .15s;
}
.gal-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gal-thumb:hover { opacity: .9; }
.gal-thumb.active { opacity: 1; border-color: var(--accent); }
.gal-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1040px) { .gal-prev { left: 8px; } .gal-next { right: 8px; } }
@media (max-width: 640px) {
  .gal-thumbs { grid-template-columns: repeat(4, 1fr); }
  .gal-nav { width: 36px; height: 36px; }
  .gal-prompt { font-size: 1.02rem; }
}

/* ===================== Footer ===================== */
.footer { padding: 32px 0 40px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); }
.footer p { margin: 0; }

/* ===================== Lightbox ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 16, .88);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 8px; }
.lightbox-close { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* grid children must be allowed to shrink so wide tables scroll inside .table-wrap */
.two-col > *, .demo-panels > *, .contrib-grid > *, .method-grid > * { min-width: 0; }
@media (max-width: 640px) {
  .prose.justify p { text-align: left; }
  .section { padding: 52px 0; }
  .section-title { font-size: 1.6rem; }
  .card-figure { padding: 10px; }
}

/* ===================== pacing tokens (paper Fig. 3) ===================== */
.pacing-figure { max-width: 920px; margin-left: auto; margin-right: auto; }
.pacing-figure img { display: block; width: 100%; height: auto; }
.pace-steps { list-style: none; margin: 24px auto 0; padding: 0; max-width: 920px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pace-steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); }
.pace-steps .step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .9rem; }
.pace-steps h3 { margin: 2px 0 6px; font-size: 1.02rem; }
.pace-steps p { margin: 0; font-size: .95rem; line-height: 1.5; }
@media (max-width: 900px) { .pace-steps { grid-template-columns: 1fr; } }
