:root {
  --blue: #3b76a6;
  --blue-bg: #edf4fb;
  --amber: #b8792a;
  --amber-bg: #fdf3e4;
  --teal: #3c8f80;
  --teal-bg: #eaf5f2;
  --red: #c0584a;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e3e6ec;
}

body {
  font-family: 'Noto Sans', sans-serif;
  color: var(--ink);
  background: #fff;
}

.publication-title,
.publication-authors,
.teaser,
.grad-title,
.chip,
.seg button {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

.publication-title { line-height: 1.2 !important; }

.cap-name {
  background: linear-gradient(90deg, var(--blue), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.publication-authors { margin-top: .6rem; color: #333; }
.publication-venue-line { color: var(--muted); margin-top: .2rem; }
.author-block { display: inline-block; }

.publication-links { margin-top: 1.2rem; }
.link-block a { margin: 5px 3px; }
.link-block .icon svg {
  width: 1.05em; height: 1.05em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.button.is-soon { cursor: default; opacity: .9; }
.button.is-soon:hover { background-color: #363636; }
.soon {
  margin-left: .45em;
  padding: 0 .45em;
  font-size: .68em;
  line-height: 1.6;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.grad-title {
  background: linear-gradient(90deg, #1f4e79, #3b76a6, #b8792a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.4 !important;
  display: inline-block;
}

.method-sub { color: var(--muted) !important; margin-top: -.6rem !important; margin-bottom: 1.2rem !important; }

.hero > .container, .section > .container { width: 100%; }

/* teaser */
.teaser .hero-body { padding-top: 0; padding-bottom: 2.5rem; }
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.teaser-grid figure { position: relative; margin: 0; }
.teaser-grid video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #eee;
}
.teaser-grid figcaption {
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  margin-top: .3rem;
}
.teaser-caption { margin-top: 1.2rem !important; font-size: 1.15rem !important; }

.stat-row {
  display: flex;
  justify-content: center;
  gap: 2.2rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 170px; }
.stat-num { font-family: 'Google Sans', sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--amber); line-height: 1.1; }
.stat-top { display: flex; align-items: baseline; gap: .3rem; }
.stat-den { font-size: 1rem; color: var(--ink); font-weight: 600; }
.stat-label { font-size: .8rem; color: var(--muted); max-width: 200px; text-align: center; margin-top: .15rem; }

/* architecture */
.arch-toggle { margin-bottom: .6rem !important; }
.arch-toggle li.is-active a { background: var(--blue) !important; border-color: var(--blue) !important; }
.arch-wrap { max-width: 1080px; margin: 0 auto; }
#arch { width: 100%; height: auto; display: block; }
#arch text { font-family: 'Noto Sans', sans-serif; }
.col-heads text { font-family: 'Castoro', serif !important; font-size: 22px; font-weight: 700; text-anchor: middle; fill: var(--ink); }
.col-heads line { stroke: #d7dbe2; stroke-width: 1.5; }
#arch .lbl { font-size: 15px; text-anchor: middle; fill: var(--ink); }
#arch .lbl.sm { font-size: 13px; }
#arch .lbl.big { font-size: 18px; }
#arch .lbl.b { font-weight: 700; }
#arch .lbl.it, #arch .math-lbl { font-family: 'Castoro', serif; font-style: italic; }
#arch .math-lbl { font-size: 16px; fill: var(--ink); }
#arch .sub, #arch .sup { font-size: 70%; }
#arch .sub2 { font-size: 55%; }
#arch .or { font-size: 16px; text-anchor: middle; fill: var(--muted); font-style: italic; }
.blue-t { fill: var(--blue) !important; }
.amber-t { fill: #8c5a17 !important; }
.teal-t { fill: #256a5e !important; }
.gray-t { fill: #4a4f57 !important; }
#arch .lbl-bg { fill: #fff; }
#arch tspan.it { font-family: 'Castoro', serif; font-style: italic; }
#arch text.amber-t.sm { paint-order: stroke; stroke: #fff; stroke-width: 8px; }

#arch .panel { stroke-width: 2; }
#arch .panel.blue { fill: var(--blue-bg); stroke: var(--blue); }
#arch .panel.amber { fill: var(--amber-bg); stroke: var(--amber); }
#arch .panel-title { font-family: 'Castoro', serif; font-weight: 700; font-size: 20px; fill: var(--blue); }
#arch .panel-tag { font-size: 13px; fill: var(--muted); text-anchor: end; }
#arch .box { stroke-width: 1.8; }
#arch .box.white { fill: #fff; stroke: var(--blue); }
#arch .box.gray { fill: #f4f5f7; stroke: #9aa1ab; }
#arch .box.teal { fill: var(--teal-bg); stroke: var(--teal); }
#arch .frame { fill: none; stroke: #9aa1ab; stroke-width: 1.5; }
#arch .latent { fill: #cfe0ef; stroke: var(--blue); stroke-width: 1.5; transition: fill .25s; }
#arch .latent.on { fill: var(--blue); }
#arch .sep { stroke: #e6cfa9; stroke-width: 1.5; }
#arch .mlp line { stroke: #a9c3da; stroke-width: 1; }
#arch .mlp circle { fill: #fff; stroke: var(--blue); stroke-width: 1.6; }

#arch .flow { fill: none; stroke: var(--blue); stroke-width: 2; }
#arch .flow.thin { stroke-width: 1.5; }
#arch .flow.amber { stroke: var(--amber); }
#arch .flow.teal { stroke: var(--teal); }
#arch .flow.gray { stroke: #4a4f57; }
#arch .flow.dashed { stroke-dasharray: 7 6; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -26; } }

#arch .mini-box { fill: #f1d7ab; stroke: var(--amber); stroke-width: 2; transition: all .6s ease; }
#arch .mini-prop { fill: #fff; stroke: var(--ink); stroke-width: 2.2; }
#arch .mini-exec { fill: var(--amber); }
#arch .mini-link { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 4 3; }

#arch .node { transition: opacity .35s, filter .35s; }
#arch .node.hot > rect.box,
#arch .node.hot > polygon.box,
#arch .node.hot > rect.panel,
#arch .node.hot > rect.frame { filter: drop-shadow(0 0 6px rgba(59, 118, 166, .55)); }
#arch #n-cap.hot > rect.panel { filter: drop-shadow(0 0 8px rgba(184, 121, 42, .6)); }

#arch.mode-ppo .only-wm,
#arch.mode-ppo .only-wm-panel { opacity: .38; }
#arch.mode-wm .only-ppo,
#arch.mode-wm .only-ppo-panel { opacity: .38; }
#arch .only-wm, #arch .only-ppo, #arch .only-wm-panel, #arch .only-ppo-panel { transition: opacity .4s; }

.pulse { fill: #fff; stroke-width: 3; }
.pulse.blue { stroke: var(--blue); }
.pulse.amber { stroke: var(--amber); }
.pulse.gray { stroke: #4a4f57; }
.pulse.teal { stroke: var(--teal); }

.arch-legend, .res-legend {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 1.4rem;
  font-size: .85rem; color: var(--muted); margin-top: .6rem;
}
.lg { display: inline-block; vertical-align: middle; margin-right: .4rem; }
.lg-blue { width: 22px; height: 13px; border: 2px solid var(--blue); background: var(--blue-bg); border-radius: 3px; }
.lg-amber { width: 22px; height: 13px; border: 2px solid var(--amber); background: var(--amber-bg); border-radius: 3px; }
.lg-line { width: 26px; height: 0; border-top: 2px solid var(--blue); }
.lg-dash { width: 26px; height: 0; border-top: 2px dashed var(--amber); }
.lg-sr { width: 22px; height: 11px; background: #b7bec8; border-radius: 2px; }
.lg-ssr { width: 22px; height: 11px; background: #4f5763; border-radius: 2px; }
.lg-ours { width: 22px; height: 11px; background: var(--amber); border-radius: 2px; }

/* theory */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 1rem;
}
.eq-card {
  position: relative;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1rem .8rem;
  text-align: center;
}
.eq-step {
  position: absolute; top: -12px; left: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--amber); color: #fff; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.eq-title { font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: .95rem; }
.katex { -webkit-text-stroke: .3px currentColor; }
.eq { font-size: .92rem; }
.eq .katex-display { margin: .7em 0; }
.eq-card-wide { grid-column: 1 / -1; }
.eq-narrow { display: none; }
.eq-grid { max-width: 1000px; margin-left: auto; margin-right: auto; row-gap: 22px; }
.eq-note { font-size: .8rem; color: var(--muted); }
.guarantee {
  margin: 1.2rem auto 0;
  max-width: 640px;
  background: var(--amber-bg);
  border: 1.5px solid var(--amber);
  border-radius: 12px;
  padding: .1rem 1rem;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 1.4rem;
}
.viz { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.viz canvas { width: 100%; height: 260px; display: block; }
.viz figcaption { font-size: .82rem; color: var(--muted); margin-top: .3rem; text-align: center; }
.viz-note { font-size: .8rem; color: var(--muted); margin-top: .6rem; }

/* videos */
.seg {
  display: inline-flex;
  border: 1px solid #cfd4db;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.seg button {
  border: 0;
  background: transparent;
  padding: .38rem .95rem;
  font-size: .88rem;
  color: #3a3f47;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.seg button + button { border-left: 1px solid #e1e4e9; }
.seg button.is-active { background: var(--ink); color: #fff; }
.seg-center { margin-bottom: 1rem; }
.vid-controls { display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.vid-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vid-pair.is-square { max-width: 820px; margin: 0 auto; }
.vid-card { margin: 0; }
.vid-card video { width: 100%; border-radius: 10px; display: block; background: #111; }
.vid-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.chip { font-weight: 700; font-size: .85rem; padding: .15rem .7rem; border-radius: 999px; }
.chip-base { background: #eceef1; color: #3a3f47; }
.chip-ours { background: var(--amber); color: #fff; }
.vid-sub { font-size: .82rem; color: var(--muted); }

/* results */
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.res-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem .8rem; }
.res-card h4 { font-family: 'Google Sans', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: .6rem; text-align: center; }
.res-row { display: grid; grid-template-columns: 150px 1fr 76px; align-items: center; gap: 8px; margin: 5px 0; font-size: .8rem; }
.res-row .name { text-align: right; color: #3a3f47; white-space: nowrap; }
.res-row.ours .name { font-weight: 700; color: #8c5a17; }
.res-row .track { position: relative; height: 14px; background: #fff; box-shadow: inset 0 0 0 1px #e1e4e9; border-radius: 3px; overflow: hidden; }
.res-row .sr, .res-row .ssr {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  transition: width .9s cubic-bezier(.2, .7, .2, 1);
}
.res-row .sr { background: #b7bec8; }
.res-row .ssr { background: #4f5763; }
.res-row.ours .sr { background: #e6bd7c; }
.res-row.ours .ssr { background: var(--amber); }
.res-row .val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-row .val b { font-weight: 700; }
.res-row .val .sr-v { color: #8a909a; }
.res-head { display: grid; grid-template-columns: 150px 1fr 76px; gap: 8px; font-size: .72rem; color: var(--muted); }
.res-head span:last-child { white-space: nowrap; }
.res-row.ours .val { color: #8c5a17; }

#BibTeX pre { background: #f5f5f5; border-radius: 8px; }

@media (max-width: 1023px) {
  .viz-grid, .res-grid { grid-template-columns: minmax(0, 1fr); }
  .viz canvas { height: 240px; }
}
@media (max-width: 480px) {
  .eq { font-size: .74rem; }
  .guarantee { font-size: .8rem; padding: .1rem .5rem; }
}
@media (max-width: 768px) {
  .teaser-grid { grid-template-columns: 1fr; }
  .vid-pair { grid-template-columns: minmax(0, 1fr); }
  .content.has-text-justified { text-align: left !important; }
  .eq-grid { grid-template-columns: minmax(0, 1fr); }
  .eq-wide { display: none; }
  .eq-narrow { display: block; }
  .publication-title { font-size: 1.9rem !important; }
  .stat-row { gap: 1rem; }
  .seg button { padding: .35rem .6rem; font-size: .8rem; }
  .res-row, .res-head { grid-template-columns: 128px 1fr 76px; font-size: .74rem; }
}

#arch .lbl.it, #arch .math-lbl, #arch tspan.it { stroke: #1f2430; stroke-width: .35px; }
#arch .lbl.it.amber-t, #arch .math-lbl.amber-t { stroke: #8c5a17; }
#arch text.amber-t tspan.it { stroke: none; }

.zoomable { position: relative; cursor: zoom-in; }
.zoomable::after {
  content: '';
  position: absolute; right: 8px; bottom: 8px;
  width: 30px; height: 30px; border-radius: 6px;
  background: rgba(20, 22, 28, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.teaser-grid .zoomable::after { bottom: 34px; }
.zoomable:hover::after { opacity: 1; }
@media (hover: none) { .zoomable::after { opacity: .8; } }

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 12, 16, .92);
  display: none; align-items: center; justify-content: center;
  padding: 3vh 2vw;
}
.lightbox.is-open { display: flex; }
.lb-close {
  position: absolute; top: 10px; right: 16px;
  background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; opacity: .85;
}
.lb-close:hover { opacity: 1; }
.lb-body { display: flex; gap: 14px; max-width: 100%; max-height: 100%; }
.lb-body figure { margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lb-body video { display: block; border-radius: 8px; background: #000; max-width: 100%; }
.lb-body.stack { flex-direction: column; }
.lb-body .vid-head { align-self: flex-start; }
.lb-body .vid-sub { color: #b9bec7; }
@media (max-width: 768px) {
  .lb-body.side { flex-direction: column; }
  .lb-body.side video { width: min(96vw, 40vh) !important; }
}

.speed {
  display: inline-block;
  margin-left: .35rem;
  padding: 0 .4rem;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
  color: #4a4f57;
  border: 1px solid #cfd4db;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.vid-head .speed { margin-left: auto; }
.lb-body .speed { color: #d6dae0; border-color: #6b7280; }
.lb-body .vid-head { align-self: stretch; }
