/* ReQuest — ECCV 2026 project page
   Palette: quiet paper + ink, with the method's own routing semantics
   (green = confident, amber = rethink) reserved for the loop diagram. */

:root {
  --paper: #fafaf5;
  --card: #ffffff;
  --ink: #1b2430;
  --soft: #545e6c;
  --faint: #8a93a0;
  --line: #e0e0d4;
  --green: #177e5b;
  --amber: #b36a00;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: "Spectral", Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0; }

a { color: inherit; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 22px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 250, 245, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; gap: 20px;
  height: 56px;
}
.wordmark {
  font-family: "Spectral", Georgia, serif;
  font-weight: 700; font-size: 19px; text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-links {
  margin-left: auto;
  display: flex; gap: 18px;
  overflow-x: auto; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--soft);
  text-decoration: none; white-space: nowrap; padding: 4px 0;
}
.nav-links a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 30px; text-align: center; }

.venue {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 13.5px; font-weight: 500;
}

.hero h1 {
  margin: 22px auto 8px;
  font-size: clamp(30px, 4.6vw, 50px);
  max-width: 860px;
}

.hero .subline {
  margin: 14px auto 0;
  max-width: 640px;
  color: var(--soft);
  font-size: 17px;
}

/* loop diagram */
.loop { margin: 34px auto 6px; max-width: 720px; }
.loop svg { width: 100%; height: auto; display: block; }
.loop-mobile { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .loop .frame { opacity: 0; animation: rise 0.55s ease forwards; }
  .loop .f1 { animation-delay: 0.05s; }
  .loop .f2 { animation-delay: 0.30s; }
  .loop .f3 { animation-delay: 0.55s; }
  .loop .flow { stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw 0.45s ease forwards; }
  .loop .a1 { animation-delay: 0.25s; }
  .loop .a2 { animation-delay: 0.50s; }
  .loop .exit { animation-delay: 0.80s; }
  .loop .ret { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.1s ease 0.85s forwards; }
  .loop .lbl { opacity: 0; animation: rise 0.5s ease forwards; animation-delay: 1.0s; }
}
@keyframes rise { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* authors */
.authors { margin-top: 30px; font-size: 16.5px; }
.authors .row { max-width: 760px; margin: 0 auto; }
.authors a { text-decoration: none; border-bottom: 1px solid var(--line); }
.authors a:hover { border-bottom-color: var(--ink); }
sup { font-size: 11px; color: var(--soft); }
.affils { margin-top: 8px; font-size: 14.5px; color: var(--soft); }
.marks { margin-top: 4px; font-size: 13px; color: var(--faint); }

/* buttons */
.btn-row { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 9px 20px;
  font-size: 15px; font-weight: 500; text-decoration: none;
}
.btn:hover { background: #2b3646; border-color: #2b3646; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: #efefe6; }

/* ---------- sections ---------- */
section { padding: 46px 0 10px; scroll-margin-top: 72px; }
section h2 { font-size: 29px; margin-bottom: 16px; text-align: center; }
.prose { max-width: 720px; margin: 0 auto; }
.prose p { margin: 0 0 16px; }
.prose b, .prose strong { font-weight: 600; }

/* the three steps really are a sequence */
ol.steps { max-width: 680px; margin: 22px auto; padding: 0; list-style: none; counter-reset: s; }
ol.steps li {
  counter-increment: s;
  position: relative;
  padding: 6px 0 6px 46px;
  margin-bottom: 8px;
}
ol.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 7px;
  width: 28px; height: 28px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Spectral", Georgia, serif; font-weight: 600; font-size: 15px;
}
ol.steps li b { font-weight: 600; }

/* figures */
figure {
  margin: 26px auto;
  max-width: 940px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
figure img { display: block; width: 100%; border-radius: 6px; }
figcaption {
  padding: 10px 6px 4px;
  font-size: 14px; color: var(--soft); line-height: 1.55;
}
figcaption b { color: var(--ink); font-weight: 600; }

/* poster */
.poster-link { display: block; max-width: 940px; margin: 26px auto 14px; }
.poster-link img {
  display: block; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 8px;
}
.poster-actions { text-align: center; margin-bottom: 8px; }

/* bibtex */
.bib {
  position: relative;
  max-width: 760px; margin: 22px auto;
  background: #f1f1e8;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px;
}
.bib pre {
  margin: 0; overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.6; color: var(--ink);
}
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 12px; font-size: 13px; font-weight: 500;
  color: var(--soft); cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--ink); }

/* footer */
footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 26px 0 44px;
  font-size: 14px; color: var(--soft);
  text-align: center;
}
footer a { color: var(--soft); }
footer a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hero { padding-top: 44px; }
  .loop svg { display: none; }
  .loop-mobile {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-family: "Spectral", Georgia, serif; font-weight: 600; font-size: 19px;
  }
  .loop-mobile .chip {
    border: 1.5px solid var(--ink); border-radius: 10px;
    padding: 8px 22px; background: var(--card);
  }
  .loop-mobile .chip.doubt { border-color: var(--amber); color: var(--amber); }
  .loop-mobile .down { color: var(--faint); font-family: "Public Sans", sans-serif; font-size: 15px; }
  .loop-mobile .note {
    font-family: "Public Sans", sans-serif; font-weight: 400;
    font-size: 13.5px; color: var(--soft); margin-top: 6px;
  }
  .loop-mobile .note .g { color: var(--green); }
  .loop-mobile .note .a { color: var(--amber); }
  section h2 { font-size: 25px; }
}

/* ---------- interactive qualitative explorer ---------- */
:root { --red: #bf4136; --tick-uniform: #9aa2ad; --tick-sim: #c2543f; }

.explorer {
  max-width: 940px; margin: 26px auto;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}

.qa-card { margin-bottom: 18px; }
.qa-card .q {
  font-family: "Spectral", Georgia, serif;
  font-size: 19px; font-weight: 600; line-height: 1.4;
  margin-bottom: 12px;
}
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  border: 1.5px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 14.5px; line-height: 1.45;
  transition: border-color 0.15s, background 0.15s;
}
.opt .key { font-weight: 600; margin-right: 6px; }
.opt.gt { border-style: dashed; border-color: var(--green); }
.opt.picked-right { border-style: solid; border-color: var(--green); background: #eef6f1; }
.opt.picked-wrong { border-color: var(--red); background: #f9efed; }

.method-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 16px; }
.mtab {
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent;
  padding: 7px 18px; font-size: 14.5px; font-weight: 500; color: var(--soft);
  cursor: pointer; font-family: inherit;
}
.mtab:hover { border-color: var(--ink); color: var(--ink); }
.mtab.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.timeline { margin: 6px 2px 16px; }
.tl-bar {
  position: relative; height: 12px;
  background: #eeeee6; border: 1px solid var(--line); border-radius: 999px;
}
.tl-bar .tick {
  position: absolute; top: -4px; bottom: -4px; width: 3px;
  border-radius: 2px; transform: translateX(-50%);
}
.tl-ends {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--faint); margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.frames { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.thumb { flex: 0 0 180px; }
.thumb img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumb .t {
  font-size: 12.5px; color: var(--soft); margin-top: 4px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.verdict { margin-top: 14px; font-size: 15px; line-height: 1.6; }
.verdict .route {
  display: inline-block; margin-bottom: 6px;
  color: var(--amber); font-size: 14px;
}
.verdict .ans { font-weight: 600; }
.verdict .ok { color: var(--green); }
.verdict .no { color: var(--red); }
.verdict .why { color: var(--soft); font-size: 14px; }

.tiny-note {
  max-width: 940px; margin: 8px auto 0;
  font-size: 13px; color: var(--faint); text-align: center;
}

@media (max-width: 640px) {
  .explorer { padding: 16px; }
  .opts { grid-template-columns: 1fr; }
  .thumb { flex-basis: 150px; }
}

/* ---------- results tables ---------- */
h3.tbl-title {
  font-size: 20px; max-width: 960px;
  margin: 30px auto 0; padding: 0 2px;
}
.tables-wrap {
  max-width: 960px; margin: 14px auto 0;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 14px; overflow-x: auto;
}
table.res { border-collapse: collapse; width: 100%; min-width: 700px; font-size: 14px; font-variant-numeric: tabular-nums; }
.res th, .res td { padding: 7px 10px; text-align: right; white-space: nowrap; }
.res th:first-child, .res td:first-child,
.res th:nth-child(2), .res td:nth-child(2),
.res th:nth-child(3), .res td:nth-child(3) { text-align: left; }
.res thead th { font-weight: 600; font-size: 13.5px; color: var(--soft); border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.res thead th.grp { text-align: center; border-bottom: 1px solid var(--line); color: var(--ink); }
.res tbody td { border-bottom: 1px solid #ecece2; }
.res tbody tr:last-child td { border-bottom: none; }
.res tr.ours { background: #eef6f1; }
.res tr.ours td:first-child { font-weight: 600; color: var(--green); }
.res tr.group td { background: #f1f1e8; text-align: center; font-weight: 600; font-size: 13px; color: var(--soft); }
.res .up { color: var(--green); font-size: 11px; margin-left: 4px; }
.up-legend { color: var(--green); font-size: 12px; }
.res th.sortable { cursor: pointer; }
.res th.sortable:hover { color: var(--ink); }
.res th.sorted-desc::after { content: " ▾"; }
.res th.sorted-asc::after { content: " ▴"; }

.bib-soon { text-align: center; color: var(--soft); }
