/* TAP3R project page. Layout after the Nerfies template (https://github.com/nerfies/nerfies.github.io, CC BY-SA 4.0)
   and the TTT3R page (https://rover-xingyu.github.io/TTT3R/). */
:root {
  --c-tap3r: #009E73; --c-slow: #D55E00; --c-cut3r: #7C8088; --c-ttt3r: #0072B2; --c-reject: #E11E1E;
  --ink: #222; --muted: #666; --rule: #e6e6e6; --panel: #f5f5f5;
}
body { font-family: 'Noto Sans', sans-serif; color: var(--ink); background: #fff; }
.publication-title, .title, .subtitle { font-family: 'Google Sans', 'Noto Sans', sans-serif !important; }
.publication-title { font-weight: 600; letter-spacing: -0.01em; }
.publication-title .ours { color: var(--c-tap3r); }
.publication-authors { font-family: 'Google Sans', sans-serif; }
.publication-authors a { color: hsl(204, 86%, 53%) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; margin: 0 0.35em; }
.publication-venue { color: var(--muted); font-weight: 600; margin-top: 0.4rem; }
.publication-links { margin-top: 0.9rem; }
.link-block { display: inline-block; margin: 0.2rem 0.15rem; }
.link-block a.button.is-disabled { opacity: 0.55; pointer-events: none; }
.button.is-dark.is-rounded { background: #363636; }
.tldr { font-size: 1.12rem; max-width: 880px; margin: 0 auto 1rem; text-align: center; }
.tldr b { color: var(--c-tap3r); }

.hero.teaser .hero-body { padding-top: 0; padding-bottom: 2rem; }
.teaser video, .media-block video { width: 100%; border-radius: 6px; display: block; background: #fff; }
.caption { color: var(--muted); font-size: 0.92rem; margin-top: 0.6rem; line-height: 1.45; }
.caption b { color: var(--ink); }
.section { padding: 2.6rem 1.5rem; }
.section .title.is-3 { font-size: 2.45rem; margin-bottom: 1.2rem; }
.section .title.is-5 { font-size: 1.6rem; margin-bottom: 0.9rem; }
@media (max-width: 768px) { .section .title.is-3 { font-size: 1.9rem; } .section .title.is-5 { font-size: 1.3rem; } }
.content p { line-height: 1.6; }
.figure-img { width: 100%; border-radius: 4px; border: 1px solid var(--rule); background: #fff; }
.figure-img.no-border { border: none; border-radius: 0; }
.key { font-weight: 600; }
.key.tap3r { color: var(--c-tap3r); } .key.ttt3r { color: var(--c-ttt3r); } .key.cut3r { color: var(--c-cut3r); } .key.slow { color: var(--c-slow); } .key.reject { color: var(--c-reject); }

/* scene selector (as the thumbnails of TTT3R's result sections) */
.scene-tabs { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.9rem; }
.scene-tab { border: 2px solid transparent; border-radius: 8px; padding: 0; background: none; cursor: pointer; width: 150px; text-align: center; }
.scene-tab img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; display: block; }
.scene-tab span { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }
.scene-tab.is-active { border-color: var(--c-tap3r); }
.scene-tab.is-active span { color: var(--ink); font-weight: 600; }

/* update-rule tabs */
.rule-tabs { display: flex; justify-content: center; gap: 0.5rem; margin: 1rem 0 0.8rem; flex-wrap: wrap; }
/* method rules shown side by side (no tabs): CUT3R | TTT3R on one row, TAP3R full width below; stacked on narrow screens */
.rule-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin-top: 1.2rem; }
.rule-grid .rule-panel { display: block; background: #fff; border: 1px solid var(--rule); }
.rule-grid .rule-wide { grid-column: 1 / -1; }
.rule-head { display: inline-block; margin: 0 0 0.5rem !important; padding: 0.2rem 1rem; border-radius: 999px; color: #fff; font-family: 'Google Sans', sans-serif; font-weight: 600; font-size: 1rem; }
.rule-panel[data-k="cut3r"] .rule-head { background: var(--c-cut3r); }
.rule-panel[data-k="ttt3r"] .rule-head { background: var(--c-ttt3r); }
.rule-panel[data-k="tap3r"] .rule-head { background: var(--c-tap3r); }
.rule-panel .eq-note { text-align: center; color: var(--muted); margin: -0.3rem 0 0.7rem; }
.rule-panel .eq:has(+ .eq) .katex-display { margin-bottom: 0.2em; } .rule-panel .eq + .eq .katex-display { margin-top: 0.2em; }
@media (max-width: 768px) { .rule-grid { grid-template-columns: minmax(0, 1fr); } }
.rule-tab { border: 1px solid #ccc; background: #fff; border-radius: 999px; padding: 0.35rem 1.1rem; cursor: pointer; font-family: 'Google Sans', sans-serif; font-weight: 600; }
.rule-tab[data-k="cut3r"].is-active { background: var(--c-cut3r); border-color: var(--c-cut3r); color: #fff; }
.rule-tab[data-k="ttt3r"].is-active { background: var(--c-ttt3r); border-color: var(--c-ttt3r); color: #fff; }
.rule-tab[data-k="tap3r"].is-active { background: var(--c-tap3r); border-color: var(--c-tap3r); color: #fff; }
.rule-panel { display: none; background: var(--panel); border-radius: 8px; padding: 1.1rem 1.3rem; }
.rule-panel.is-active { display: block; }
.rule-panel .eq { overflow-x: auto; position: relative; padding: 0.3rem 0; }
.rule-panel ul { margin-top: 0.4rem; }
.params { font-size: 0.9rem; color: var(--muted); }

/* charts */
.chart-wrap { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 0.8rem 0.8rem 0.4rem; }
.chart-wrap svg, .chart-wrap canvas { width: 100%; display: block; }
.chart-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-content: center; margin: 0.6rem 0 0.2rem; font-size: 0.92rem; }
.chart-controls .buttons { margin-bottom: 0; }
.chart-controls .button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.chart-legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 0.35rem; border-radius: 2px; }
.chart-legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px) !important; height: 2px; }
.readout { font-family: 'Noto Sans Mono', ui-monospace, monospace; font-size: 0.86rem; text-align: center; color: var(--ink); min-height: 1.4em; margin-top: 0.3rem; }
.readout .closed { color: var(--c-reject); font-weight: 700; }
.ratevis { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1rem; align-items: center; }
@media (max-width: 768px) { .ratevis { grid-template-columns: 1fr; } .scene-tab { width: 120px; } .scene-tab img { height: 76px; } }

/* results table: ATE and ARE side by side */
.results-table { font-size: 0.95rem; }
.results-table th, .results-table td { text-align: right !important; padding: 0.38em 0.55em !important; white-space: nowrap; }
.results-table th.method, .results-table td:first-child { text-align: left !important; }
.results-table th.method { vertical-align: bottom; }
.results-table th.grp { text-align: center !important; font-weight: 600; border-bottom: 2px solid #bbb; }
.results-table .g2 { border-left: 2px solid #ddd; }
.results-table tr.sep td { border-top: 2px solid #ccc; }
.results-table tr.ours td { font-weight: 700; color: var(--c-tap3r); }
.results-table .best { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.table-wrap { overflow-x: auto; position: relative; }
.related a { color: hsl(204, 86%, 45%); }
pre.bibtex { background: var(--panel); border-radius: 6px; font-size: 0.85rem; white-space: pre-wrap; }
.footer { padding: 2rem 1.5rem 3rem; background: #fafafa; }
.footer p { font-size: 0.85rem; color: var(--muted); }
.draft-banner { background: #fff7e0; color: #7a5a00; text-align: center; font-size: 0.85rem; padding: 0.4rem 1rem; }

/* method rules as one three-column comparison table: same row = same question, TAP3R column tinted */
.cmp3-wrap { overflow-x: auto; position: relative; margin-top: 1.2rem; background: #fff; border: 1px solid var(--rule); border-radius: 8px; }
.cmp3 { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.cmp3 col.ours, .cmp3 .ours { background: #eef8f4; }
.cmp3 th { padding: 0.9rem 0.8rem 0.4rem; text-align: center; vertical-align: middle; }
.cmp3 td { padding: 0.2rem 0.9rem 0.7rem; vertical-align: top; font-size: 0.95rem; line-height: 1.45; }
.cmp3 td p { margin: 0.2rem 0 0.3rem; }
.cmp3 td .katex-display { margin: 0.45em 0; font-size: 0.92em; overflow-x: auto; overflow-y: hidden; position: relative; }
.cmp3 tr.rowlab td { padding: 0.55rem 0.9rem 0.1rem; font-size: 0.8rem; font-weight: 600; color: var(--ink); border-top: 1px solid var(--rule); background: transparent; }
.cmp3 .rule-head { margin: 0 !important; }
.rule-head[data-k="cut3r"] { background: var(--c-cut3r); } .rule-head[data-k="ttt3r"] { background: var(--c-ttt3r); } .rule-head[data-k="tap3r"] { background: var(--c-tap3r); }
.cmp3-wrap + .params { margin-top: 0.7rem; }
/* KaTeX keeps a hidden, absolutely positioned MathML copy of each formula; a formula scrolled off to the side inside an
   overflow box escapes that box unless the box is a positioning context, and widens the whole page on phones */
.katex-display { overflow-x: auto; overflow-y: hidden; position: relative; }

/* phones: the three-column method table becomes one stacked list per row (row label, then CUT3R / TTT3R / TAP3R) */
@media (max-width: 768px) {
  .cmp3 { min-width: 0; table-layout: auto; }
  .cmp3 colgroup, .cmp3 thead { display: none; }
  .cmp3, .cmp3 tbody, .cmp3 tr, .cmp3 td { display: block; width: 100%; }
  .cmp3 tr.rowlab td { padding: 0.6rem 0.9rem 0.3rem; font-size: 0.9rem; color: var(--ink, #333); background: #f5f5f5; }
  .cmp3 tr.rowlab:first-child td { border-top: 0; }
  .cmp3 td[data-m] { padding: 0.55rem 0.9rem 0.5rem; border-top: 1px solid #eee; }
  .cmp3 td[data-m]::before { content: attr(data-m); display: inline-block; color: #fff; font-size: 0.75rem; font-weight: 700;
    padding: 0.08rem 0.6rem; border-radius: 999px; margin-bottom: 0.15rem; }
  .cmp3 td[data-k="cut3r"]::before { background: var(--c-cut3r); }
  .cmp3 td[data-k="ttt3r"]::before { background: var(--c-ttt3r); }
  .cmp3 td[data-k="tap3r"]::before { background: var(--c-tap3r); }
}

/* method table: each method's column tinted in its own colour (desktop via <col>, phones via the cells) */
.cmp3 col.m-cut3r, .cmp3 td[data-k="cut3r"] { background: #f3f4f5; }
.cmp3 col.m-ttt3r, .cmp3 td[data-k="ttt3r"] { background: #eaf3fa; }
.cmp3 col.ours, .cmp3 td[data-k="tap3r"] { background: #eef8f4; }

/* method figure with numbered pins + the four cards below it (layout as on the SynOphsis page) */
.mhint { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0 0.8rem; }
.mfig { position: relative; margin: 0; background: #fff; border-radius: 8px; }
.mfig img { display: block; width: 100%; height: auto; }
.mfig .hl { position: absolute; border: 2.5px solid var(--c-tap3r); border-radius: 6px; box-shadow: 0 0 0 4px rgba(0, 158, 115, .18); opacity: 0; transition: all .45s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.mfig .hl.on { opacity: 1; }
.mfig .pin { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--c-tap3r); color: #fff; font: 700 0.8rem 'Noto Sans', sans-serif; display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .2s, background .2s; }
.mfig .pin.on, .mfig .pin:hover, .mfig .pin:focus-visible { background: var(--ink); transform: translate(-50%, -50%) scale(1.15); outline: none; }
.novel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 1rem; }
.nv { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 11px 14px 10px; cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s; }
.nv.on, .nv:focus-visible { border-color: var(--c-tap3r); box-shadow: 0 0 0 3px rgba(0, 158, 115, .15); outline: none; }
.nv h4 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.nv p { margin: 0; font-size: 0.86rem; color: #444; line-height: 1.5; }
.nv .ne { font-size: 1.05rem; margin-right: 5px; }
.nv .nb { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c-tap3r); color: #fff; font: 700 0.7rem 'Noto Sans', sans-serif; margin-right: 6px; vertical-align: 1px; transition: background .2s; }
.nv.on .nb { background: var(--ink); }
@media (max-width: 900px) { .novel { grid-template-columns: repeat(2, 1fr); } .mfig .pin { width: 18px; height: 18px; font-size: 0.62rem; border-width: 1.5px; } }
@media (max-width: 560px) { .novel { grid-template-columns: 1fr; } }

/* interactive stream-length chart (layout after a collaborator's project page) */
.lchart { margin: 0.4rem 0 1.6rem; }
.lchart .chart-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.lchart .chart-head h3 { margin-bottom: 0.3rem !important; }
.lchart .lc-take { margin: 0; font-size: 0.95rem; color: #444; max-width: 560px; }
.lchart .ctl-row { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.seg2 { display: inline-flex; border: 1px solid #d1d5db; border-radius: 8px; padding: 2px; background: #fff; }
.seg2 button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; font-size: 0.84rem; cursor: pointer; color: #555; font-family: inherit; }
.seg2 button.on { background: var(--ink); color: #fff; }
.lchart .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.86rem; margin: 6px 0 8px; }
.lchart .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lchart .lines svg { display: block; overflow: visible; }
.lchart .gl2 { stroke: #ececec; stroke-width: 1; }
.lchart .ax { font: 12px 'Noto Sans', sans-serif; fill: #666; }
.lchart .endlab { font: 600 12px 'Noto Sans', sans-serif; }
.lchart .endlab.ours { font-size: 13px; }
.lchart .cross { stroke: #111; stroke-width: 1; opacity: 0; } .lchart .cross.on { opacity: .35; }
.ctip { position: fixed; z-index: 50; pointer-events: none; background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px; font-size: 0.82rem; line-height: 1.5; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); opacity: 0; transition: opacity .12s; }
.ctip.on { opacity: 1; } .ctip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
details.numbers { margin-top: 4px; font-size: 0.86rem; }
details.numbers summary { cursor: pointer; color: var(--c-tap3r); }
details.numbers table { border-collapse: collapse; margin-top: 8px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
details.numbers th, details.numbers td { border-bottom: 1px solid #eee; padding: 4px 10px; text-align: right; }
details.numbers th:first-child, details.numbers td:first-child { text-align: left; }
details.numbers td.ours { font-weight: 700; color: #E0457B; }
@media (max-width: 700px) { .lchart .ctl-row { align-items: flex-start; } }
/* stream-length chart: readout row above the chart, cursor dots, sideways drag on touch screens */
.lchart .lc-read { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; min-height: 2.2em; font-size: 0.86rem; font-variant-numeric: tabular-nums; padding: 6px 10px; background: #fafafa; border: 1px solid #eee; border-radius: 8px; margin-bottom: 6px; }
.lchart .lc-read b { margin-right: 4px; }
.lchart .lc-read span.ours { font-weight: 700; color: #E0457B; }
.lchart .lc-read i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.lchart .lines svg .hit { touch-action: pan-y; cursor: ew-resize; }
.lchart .lines svg { touch-action: pan-y; }
.lchart .cdot { pointer-events: none; }
.lchart .cross { pointer-events: none; }
/* two panels side by side: ATE and rotation error of the chosen dataset; stacked on narrow screens */
.lchart .lc-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lchart .lc-panel { min-width: 0; }
.lchart .lc-ptitle { font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.lchart .lc-panel .lc-read { font-size: 0.78rem; gap: 2px 10px; min-height: 3.6em; align-content: flex-start; }
.lchart .lines svg .ax { font-size: 11px; }
@media (max-width: 860px) { .lchart .lc-panels { grid-template-columns: 1fr; } .lchart .lc-panel .lc-read { min-height: 0; } }
details.numbers .tbl { overflow-x: auto; }
