/* TeamField project page. Plain CSS, no framework. */

:root {
  --ink: #14213D;          /* navy of the paper figures: headings */
  --text: #262B36;
  --muted: #576074;
  --faint: #8A93A3;
  --line: #E3E6EC;
  --soft: #F5F6F8;
  --bg: #FFFFFF;

  /* method colours, from the paper figures (green and blue a little more saturated for charts) */
  --pre: #A2A8B3;
  --teamhoi: #4E9F6D;
  --hpf: #8A74B8;
  --hotice: #CF8A55;
  --tf: #4F7FBF;
  --tf-ink: #2F5A93;       /* TeamField blue dark enough for text and links */
  --tf-wash: #EEF3FA;

  --contact: #E3262D;
  --success: #39A562;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 10px 28px rgba(20, 33, 61, .08);
  --wide: 1120px;
  --text-w: 780px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--tf-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(79, 127, 191, .55); outline-offset: 2px; border-radius: 6px; }

.container { width: min(var(--wide), 100% - 40px); margin-inline: auto; }
.prose { max-width: var(--text-w); margin-inline: auto; }
.prose p { margin: 0 0 1em; }

section { padding: 76px 0; }
section.alt { background: var(--soft); }
.section-title {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.section-lead { text-align: center; color: var(--muted); max-width: 780px; margin: 0 auto 36px; }
.sub-title { color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 56px 0 10px; }
.sub-title:first-child { margin-top: 0; }
.sub-lead { color: var(--muted); margin: 0 0 22px; max-width: 860px; }

/* ---------- top navigation (appears after the title) ---------- */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .25s ease;
}
.topnav.show { transform: none; }
.topnav .container { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }
.topnav .brand { font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.topnav .brand span { color: var(--tf); }
.navlinks { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a { color: var(--muted); font-size: 14.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.navlinks a:hover { color: var(--ink); background: var(--soft); text-decoration: none; }
.navlinks a.active { color: var(--ink); background: var(--tf-wash); }

/* ---------- title block ---------- */
.hero { padding: 84px 0 28px; text-align: center; }
.hero h1 {
  text-wrap: balance;
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 auto 26px;
  max-width: 1000px;
}
.hero h1 .name { color: var(--tf); }
.venue { font-size: 20px; font-weight: 700; color: var(--ink); margin: -6px 0 18px; }
.authors { font-size: 19px; margin: 0 0 6px; line-height: 1.6; }
.authors .author { white-space: nowrap; margin: 0 8px; }
.authors sup, .affils sup, .footnote sup { font-size: 12px; margin-left: 1px; }
.affils { color: var(--muted); font-size: 16px; margin: 0; }
.affils span { margin: 0 10px; white-space: nowrap; }
.footnote { color: var(--faint); font-size: 14px; margin: 4px 0 0; }

/* max-width splits the seven buttons into rows of four and three instead of leaving one or two alone */
.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 860px; margin: 28px auto 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-weight: 650; font-size: 15px; line-height: 1;
  border: 0; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .15s;
}
.btn:hover { background: #24375E; text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.btn.is-soon { background: #EDEFF3; color: var(--muted); cursor: default; transform: none; }
.btn .soon {
  font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em;
  background: #fff; color: var(--faint); border-radius: 999px; padding: 3px 7px;
}

/* ---------- figures ---------- */
figure { margin: 0; }
.figure img { width: 100%; height: auto; border-radius: 8px; }
.figure figcaption { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 14px auto 0; max-width: 920px; }
.figure figcaption strong { color: var(--text); }
.figure.framed img { border: 1px solid var(--line); background: #fff; padding: 10px; border-radius: 12px; }
.teaser { padding-top: 24px; }

/* ---------- abstract ---------- */
.abstract p { font-size: 17.5px; text-align: justify; hyphens: auto; }

/* ---------- videos ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 14px; }
.tab {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 15px; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.tab:hover { border-color: #C9CFDA; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .count { color: var(--faint); font-weight: 500; margin-left: 5px; }
.tab[aria-selected="true"] .count { color: #B9C3D6; }
.tab-desc { text-align: center; color: var(--muted); font-size: 15px; margin: 0 0 14px; min-height: 1.6em; }
@media (max-width: 600px) {
  .tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -20px; padding: 2px 20px 6px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; font-size: 14px; padding: 7px 13px; }
  .hero h1 { font-size: 28px; }
  section { padding: 56px 0; }
}

.legend-row { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; align-items: center; font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.key i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.pill { color: #fff; font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 999px; line-height: 1.5; }
.pill.contact { background: var(--contact); }
.pill.success { background: var(--success); }

.player {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: #11151E; box-shadow: var(--shadow);
}
.player video { width: 100%; height: 100%; object-fit: contain; background: #11151E; cursor: pointer; }

/* time bar under the player: drag to move the four panels through time; marks = first contacts and TeamField's arrival */
.timeline { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.tl-btn {
  flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.tl-btn:hover { border-color: #C9CFDA; }
.tl-btn svg { width: 18px; height: 18px; fill: currentColor; }
.tl-btn .i-pause, .tl-btn.is-playing .i-play { display: none; }
.tl-btn.is-playing .i-pause { display: block; }
.tl-track { position: relative; flex: 1; min-width: 0; height: 48px; }
.tl-track input[type=range] {
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
  position: absolute; left: 0; right: 0; bottom: 4px; width: 100%; height: 20px; margin: 0; --p: 0%;
}
.tl-track input[type=range]:focus { outline: none; }
.tl-track input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--ink) var(--p), #DCE1E9 var(--p));
}
.tl-track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%;
  background: var(--ink); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(20, 33, 61, .3), 0 1px 3px rgba(20, 33, 61, .25);
}
.tl-track input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(79, 127, 191, .45); }
.tl-track input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: #DCE1E9; }
.tl-track input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--ink); }
.tl-track input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(20, 33, 61, .3);
}
.tl-marks { position: absolute; left: 8px; right: 8px; bottom: 14px; height: 0; }
.tl-mark {
  position: absolute; bottom: 10px; width: 12px; height: 12px; padding: 0; transform: translateX(-50%);
  border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(20, 33, 61, .2); cursor: pointer;
}
.tl-mark.success { border-radius: 3px; }
.tl-mark.row1 { bottom: 25px; }
.tl-mark::before { content: ""; position: absolute; inset: -7px; }
.tl-mark::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; margin-left: -1px; height: 7px;
  background: var(--c); opacity: .6;
}
.tl-mark.row1::after { height: 22px; }
.tl-mark:hover, .tl-mark:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(79, 127, 191, .45); }
.tl-time { flex: none; width: 58px; text-align: right; font-size: 14.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-hint { margin: 2px 0 0; text-align: center; font-size: 13.5px; color: var(--faint); }
.viewer:fullscreen {
  background: #0B0F17; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px;
}
.viewer:fullscreen .player, .viewer:fullscreen .timeline { width: min(100%, calc((100vh - 110px) * 16 / 9)); }
.viewer:fullscreen .player { box-shadow: none; border-radius: 8px; }
.viewer:fullscreen .tl-hint { display: none; }
.viewer:fullscreen .tl-time { color: #C3CAD6; }
.viewer:fullscreen .tl-btn { background: #1A2232; border-color: #2B3548; color: #fff; }
.viewer:fullscreen .tl-track input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #fff var(--p), #3A4458 var(--p));
}
.viewer:fullscreen .tl-mark { border-color: #0B0F17; }
@media (max-width: 600px) { .timeline { gap: 8px; } .tl-time { width: 50px; font-size: 13.5px; } }
.video-caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 14px 2px 0; }
.video-caption .vtitle { font-weight: 750; color: var(--ink); font-size: 18px; }
.video-caption .vtag { font-size: 12.5px; font-weight: 700; color: var(--tf-ink); background: var(--tf-wash); padding: 2px 9px; border-radius: 999px; }
.video-caption .vdesc { color: var(--muted); font-size: 15.5px; flex-basis: 100%; }

.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
@media (max-width: 860px) { .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.thumb {
  position: relative; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #11151E;
  outline: 3px solid transparent; outline-offset: 2px;
  transition: outline-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .3s, opacity .3s; }
.thumb:hover img { transform: scale(1.035); opacity: 1; }
.thumb .tlabel {
  position: absolute; left: 7px; bottom: 7px;
  background: rgba(20, 33, 61, .84); color: #fff;
  font-size: 12.5px; font-weight: 650; line-height: 1.3;
  padding: 3px 8px; border-radius: 6px; text-align: left;
}
.thumb[aria-current="true"] { outline-color: var(--tf); }
.thumb[aria-current="true"] img { opacity: 1; }

.note {
  font-size: 14px; line-height: 1.6; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin: 22px auto 0; max-width: 900px;
}
.note strong { color: var(--text); }

/* ---------- method ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: center; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; gap: 24px; } }
.split .figure img { max-width: 560px; margin-inline: auto; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 30px; }
@media (max-width: 920px) { .steps { grid-template-columns: 1fr; } }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 16px; }
.step .num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--tf); color: #fff; font-weight: 750; font-size: 15px;
  display: grid; place-items: center;
}
.step .when { float: right; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.step h4 { margin: 12px 0 8px; color: var(--ink); font-size: 18px; line-height: 1.3; }
.step p { font-size: 15.5px; margin: 0 0 10px; }
.eq { position: relative; overflow-x: auto; overflow-y: hidden; padding: 4px 0; margin: 6px 0 8px; font-size: 15.5px; }
.eq .katex-display { margin: 0.4em 0; }

.stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
@media (max-width: 820px) { .stages { grid-template-columns: 1fr; } }
.stage { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.stage h4 { margin: 0 0 6px; color: var(--ink); font-size: 17.5px; }
.stage p { margin: 0; font-size: 15.5px; }
.stage .tag { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--tf-ink); background: var(--tf-wash); border-radius: 999px; padding: 2px 9px; margin-bottom: 8px; }

/* ---------- CarryBench ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 30px 0 34px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat .value { font-size: 30px; font-weight: 750; color: var(--ink); line-height: 1.1; letter-spacing: -0.01em; }
.stat .label { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* ---------- results: charts and tables ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; }
.chart-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 26px; }
@media (max-width: 980px) { .chart-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .chart-grid, .chart-grid.four { grid-template-columns: 1fr; } }
.chart h5 { margin: 0 0 2px; font-size: 15px; color: var(--ink); font-weight: 700; }
.chart .csub { margin: 0 0 6px; font-size: 13px; color: var(--faint); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart svg text { font-family: inherit; }
.chart .row:focus { outline: none; }
.chart .row:focus .hit, .chart .row:hover .hit { fill: rgba(20, 33, 61, .045); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.chart-legend .key i { border-radius: 3px; width: 12px; height: 12px; }

.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 11px; font-size: 13px; line-height: 1.4; color: var(--muted);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip .tv { display: block; color: var(--ink); font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.tooltip .tk { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }

.toggle-table {
  margin-top: 14px; background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.toggle-table:hover { color: var(--ink); border-color: #C9CFDA; }

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 18px; }
table.results { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.results caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: 13.5px; padding: 10px 14px 12px; line-height: 1.55; }
table.results th, table.results td { padding: 9px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.results th:first-child, table.results td:first-child { text-align: left; }
table.results .tl { text-align: left; }
table.results.center th, table.results.center td { text-align: center; }
table.results thead th { color: var(--muted); font-weight: 650; font-size: 13px; background: #FAFBFC; line-height: 1.35; }
table.results thead tr.group th { border-bottom: 1px solid var(--line); color: var(--ink); }
table.results tbody tr:last-child td { border-bottom: 0; }
table.results tr.ours td { background: var(--tf-wash); }
table.results td.best { font-weight: 750; color: var(--ink); }
table.results .pm { color: var(--faint); font-weight: 400; font-size: 12.5px; margin-left: 2px; }
table.results .sep { border-left: 1px solid var(--line); }
.mdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.check { color: var(--ink); font-weight: 700; }
.dash { color: #C3C8D1; }

.two-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-top: 34px; }
@media (max-width: 860px) { .two-figs { grid-template-columns: 1fr; } }

/* ---------- BibTeX ---------- */
.bibtex-wrap { position: relative; max-width: 860px; margin: 0 auto; }
pre.bibtex {
  margin: 0; background: #0F172A; color: #E2E8F0;
  border-radius: 12px; padding: 22px 24px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6;
}
.copy {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255, 255, 255, .1); color: #E2E8F0; border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px; padding: 6px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, .18); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--faint); font-size: 14px; text-align: center; }
footer p { margin: 4px 0; }
