/* DEAL project page. Layout from the Nerfies template (Bulma), colors from the paper's figures:
   blue = spatial modality A, coral = query modality B, mauve = DEAL. */
:root {
  --a: #88CCEE;
  --b: #E8665B;
  --deal: #CC88AE;
  --deal-ink: #A14F7E;
  --ink: #1F2328;
  --mute: #6B7280;
  --line: #E5E7EB;
  --tint: #FAF6F8;
  --night: #0B0F14;
}

html { scroll-behavior: smooth; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); }
.title, .subtitle { font-family: inherit; color: var(--ink); }
.title.is-3 { font-weight: 700; letter-spacing: -0.01em; }
.title.is-5 { font-weight: 700; margin-bottom: 0.75rem; }
a { color: var(--deal-ink); }
.deal { font-variant-caps: small-caps; letter-spacing: 0.06em; font-weight: 600; }
.section.tint { background: var(--tint); }
.section-lead { max-width: 720px; margin: 0 auto 2rem; text-align: center; color: #3F4650; font-size: 1.05rem; }

/* ---------- title block ---------- */
.hero-body { padding-bottom: 1.5rem; }
.tokenstrip { display: flex; justify-content: center; align-items: center; gap: 5px; margin-bottom: 1.4rem; }
.ts { width: 13px; height: 13px; border-radius: 2px; }
.ts.a { background: var(--a); } .ts.b { background: var(--b); } .ts.d { background: var(--deal); }
.ts-plus { color: #9CA3AF; font-size: 15px; margin: 0 5px; line-height: 1; }
.publication-title .deal { display: block; font-size: 4.5rem; line-height: 1; font-weight: 800; letter-spacing: 0.1em; font-variant-caps: normal; margin-right: -0.1em; }
.publication-subtitle { display: block; font-size: 1.75rem; font-weight: 600; line-height: 1.25; margin-top: 0.8rem; }
.publication-subtitle u { text-decoration-color: var(--deal); text-decoration-thickness: 4px; text-underline-offset: 6px; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.4rem; margin: 2.2rem 0 1rem; }
.author img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 0.5rem; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--deal); }
.author figcaption { font-weight: 600; font-size: 1.05rem; }
.authors sup, .affiliations sup { color: var(--deal-ink); font-weight: 700; margin-left: 1px; }
.affiliations { color: var(--mute); font-size: 0.95rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem 1.3rem; }
.publication-links { margin-top: 1.6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.publication-links .icon svg { width: 18px; height: 18px; fill: currentColor; }
.publication-links .button.soon { background: #fff; color: var(--ink); border: 1.5px dashed #9CA3AF; pointer-events: none; }
.soon-tag { margin-left: 0.55em; padding: 0.15em 0.65em; border-radius: 999px; background: var(--deal); color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- query chips ---------- */
.chip { display: inline-block; font: 500 0.95rem/1.2 Inter, sans-serif; padding: 0.42em 0.9em; border-radius: 999px; background: #fff; color: var(--ink); border: 1.5px solid var(--b); cursor: pointer; transition: background .15s, color .15s; }
.chip:hover { background: #FDEDEB; }
.chip.on { background: var(--b); color: #fff; }
.chip.plain { border-color: #C9CED6; }
.chip.plain.on { background: var(--ink); border-color: var(--ink); }
.chip.is-static { cursor: default; padding: 0.15em 0.7em; font-size: 0.9em; background: #FDEDEB; }
.chip:focus-visible, .seg button:focus-visible, .thumb:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }

/* ---------- explorer: one image, many queries ---------- */
.explorer { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem 2.2rem; align-items: start; }
.ex-stage { position: relative; border-radius: 10px; overflow: hidden; background: #111; }
.ex-stage.light { background: #fff; border: 1px solid var(--line); }
.ex-stage::before { content: ""; display: block; padding-top: var(--ratio, 100%); }
.ex-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s; }
.ex-img.show { opacity: 1; }
.ex-badge { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; align-items: center; gap: 0.6rem; background: rgba(255,255,255,.95); color: var(--ink); border-radius: 8px; padding: 0.55rem 0.8rem; font-size: 0.92rem; font-weight: 500; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.ex-badge[hidden] { display: none; }
.ex-badge svg { width: 26px; height: 26px; flex: none; }
.ex-side .title { margin-bottom: 0.6rem; }
.ex-lead { color: #3F4650; margin-bottom: 1.1rem; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ex-chips.photos .chip { padding: 3px; border-radius: 8px; border-width: 2px; border-color: transparent; background: none; }
.ex-chips.photos .chip img { display: block; width: 104px; height: 78px; object-fit: cover; border-radius: 5px; }
.ex-chips.photos .chip.on { border-color: var(--b); }
.ex-note { margin-top: 1.1rem; color: var(--mute); font-size: 0.95rem; min-height: 3em; }
.ex-thumbs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.thumb { width: 84px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; opacity: .6; transition: opacity .15s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: 1; }
.thumb.on { opacity: 1; border-color: var(--deal); }

/* ---------- tokens ---------- */
.tok { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 820px; margin: 0 auto; }
.tok canvas { width: 100%; height: auto; display: block; border-radius: 8px; cursor: crosshair; }
.tok-cap { text-align: center; font-weight: 600; margin-top: 0.5rem; }
.seg { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin: 1.4rem auto 0; width: fit-content; max-width: 100%; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { font: 500 0.95rem Inter, sans-serif; padding: 0.5em 1.1em; background: #fff; color: var(--ink); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid #D1D5DB; }
.seg button.on { background: var(--ink); color: #fff; }
.tok-query { text-align: center; margin-top: 1rem; transition: opacity .3s; }
.tok-query.off { opacity: .25; }
.tok-note { max-width: 680px; margin: 0.9rem auto 0; text-align: center; color: #3F4650; min-height: 4.5em; }

/* ---------- method ---------- */
.questions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; max-width: 820px; margin: 0 auto 2.2rem; }
.q { border: 1.5px solid var(--deal); border-radius: 12px; padding: 1.1rem 1.3rem; background: #fff; }
.q h3 { font-size: 1.2rem; font-weight: 700; display: inline; }
.q p { margin-top: 0.4rem; color: #3F4650; }
.q-n { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--deal); color: #fff; font-weight: 700; margin-right: 0.5rem; }
.paperfig img { width: 100%; display: block; }
.paperfig figcaption, .vid figcaption { color: var(--mute); font-size: 0.95rem; margin-top: 0.7rem; }
.cinema { background: var(--night); padding: 3rem 1.5rem; }
.cinema video { width: 100%; display: block; border-radius: 6px; aspect-ratio: 16 / 9; background: #000; }
.cinema p { color: #8A93A0; font-size: 0.95rem; margin-top: 0.8rem; text-align: center; }

/* ---------- comparison slider ---------- */
.cmp.narrow { max-width: 400px; margin: 0 auto; }
.cmp.mid { max-width: 720px; margin: 0 auto; }
.cmp-groups { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.cmp-stage { position: relative; border-radius: 10px; overflow: hidden; background: #111; user-select: none; touch-action: pan-y; }
.cmp-stage.light { background: #fff; border: 1px solid var(--line); }
.cmp-stage::before { content: ""; display: block; padding-top: var(--ratio, 50%); }
.cmp-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cmp-stage img.l { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px; background: var(--deal); box-shadow: 0 0 0 1px rgba(255,255,255,.9); pointer-events: none; }
.cmp-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--deal); color: #fff; font: 700 16px/40px Inter, sans-serif; text-align: center; box-shadow: 0 1px 6px rgba(0,0,0,.35); border: 2px solid #fff; box-sizing: border-box; line-height: 36px; }
.cmp-tag { position: absolute; top: 10px; padding: 0.2em 0.7em; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: rgba(255,255,255,.94); color: var(--ink); pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.cmp-tag.l { left: 10px; } .cmp-tag.r { right: 10px; background: var(--deal); color: #fff; }
.cmp-stage input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp-lefts { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; font-size: 0.92rem; color: var(--mute); }
.cmp-note { color: var(--mute); font-size: 0.95rem; margin-top: 0.7rem; min-height: 1.5em; }

/* ---------- videos ---------- */
.vid { margin: 0 auto 2.2rem; }
.vid video { width: 100%; display: block; border-radius: 8px; background: #000; }

/* ---------- tables ---------- */
.table { font-size: 0.86rem; font-variant-numeric: tabular-nums; margin: 0 auto; background: transparent; }
.table th, .table td { text-align: right; white-space: nowrap; border: 0; padding: 0.22em 0.6em; }
.table td:not(.l), .table th:not(.l) { text-align: right; }
.table th.l, .table td.l { text-align: left; }
.table thead tr:first-child th { border-top: 1.5px solid var(--ink); }
.table thead tr:last-child th { border-bottom: 1px solid var(--ink); }
.table tbody tr:last-child td { border-bottom: 1.5px solid var(--ink); }
.table tr.sep td { border-top: 1px solid #9CA3AF; }
.table tr.ours td { background: rgba(204,136,174,.14); }
.table td.b1 { font-weight: 700; }
.table td.b2 { text-decoration: underline; }
.table-note { font-size: 0.85rem; color: var(--mute); text-align: center; margin: 0.4rem 0 0.9rem; }

/* ---------- footer ---------- */
pre { border-radius: 8px; background: #F6F7F9; }
.footer { background: #fff; border-top: 1px solid var(--line); padding: 2.5rem 1.5rem 3rem; }
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.6rem 2.6rem; }
.logos img { height: 38px; width: auto; }
.logos img.tall { height: 64px; }
.credit { text-align: center; color: #9CA3AF; font-size: 0.82rem; margin-top: 2rem; }

@media (max-width: 768px) {
  .publication-title .deal { font-size: 3.2rem; }
  .publication-subtitle { font-size: 1.3rem; }
  .author img { width: 72px; height: 72px; }
  .authors { gap: 1rem 1.2rem; }
  .explorer { grid-template-columns: minmax(0, 1fr); }
  .questions { grid-template-columns: 1fr; }
  .tok { gap: 0.6rem; }
  .seg { border-radius: 14px; }
  .seg button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .ex-img, .tok-query { transition: none; } html { scroll-behavior: auto; } }

/* headings above the result tables */
#results h3.title { text-align: center; }

/* logos under the affiliations */
.hero .logos { margin-top: 1.6rem; gap: 1.2rem 2.4rem; }
.hero .logos img { height: 34px; }
.hero .logos img.tall { height: 56px; }
.footer { padding: 1.5rem 1.5rem 2rem; }
.footer .credit { margin-top: 0; }

/* author names link to their home pages */
.author a { color: var(--ink); display: block; }
.author a:hover figcaption { text-decoration: underline; text-decoration-color: var(--deal); text-underline-offset: 4px; }
.author a:hover img { box-shadow: 0 0 0 3px var(--deal); }
