:root {
  --ink: #1d2a2e;
  --muted: #5d6b70;
  --line: #dfe5e4;
  --paper: #ffffff;
  --wash: #f4f7f6;
  --teal: #1f6b6b;
  --teal-soft: #e5efee;
  --rust: #a0665c;
  --ochre: #9a6a1c;
  --radius: 12px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

a { color: var(--teal); }

img, video { display: block; max-width: 100%; height: auto; }

code {
  font: 500 0.88em var(--mono);
  background: var(--teal-soft);
  color: var(--teal);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 64px 0 28px;
  background: linear-gradient(180deg, var(--wash), var(--paper));
}

.venue {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 14px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 auto 22px;
  max-width: 980px;
  font: 700 clamp(28px, 4vw, 42px)/1.18 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 span { color: var(--teal); text-wrap: balance; }

.authors {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 500;
}

.author {
  display: inline-block;
  margin: 0 10px;
  white-space: nowrap;
}

.authors a {
  color: var(--ink);
  text-decoration: none;
}

.author sup { margin-left: 2px; }

.authors a:hover { color: var(--teal); text-decoration: underline; }

sup { font-size: 0.65em; color: var(--muted); }

.affiliations {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15px;
}

.affiliations span { margin: 0 10px; display: inline-block; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover { background: var(--teal); transform: translateY(-1px); }

.btn.soon {
  background: var(--wash);
  color: var(--muted);
  border: 1px dashed var(--line);
  cursor: default;
}

.btn.soon:hover { background: var(--wash); transform: none; }

.btn.soon small { font-size: 12px; font-weight: 500; }

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sections: one rhythm between all top-level sections */
main > section + section { margin-top: 72px; }
main > .teaser { margin-top: 8px; }
main > .stats { margin-top: 36px; }

[id] { scroll-margin-top: 24px; }

h2 {
  margin: 0 0 18px;
  font: 700 30px/1.25 var(--serif);
  text-align: center;
}

h3 { margin: 0 0 8px; font-size: 18px; }

h3.sub {
  margin: 48px 0 8px;
  font: 700 22px/1.3 var(--serif);
  color: var(--teal);
}

.prose p, .lede { text-align: justify; hyphens: auto; }

.lede { color: var(--muted); }

.card {
  margin: 18px 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(29, 42, 46, 0.04), 0 8px 24px rgba(29, 42, 46, 0.05);
}

figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.tldr {
  margin: 8px auto 0;
  max-width: 860px;
  padding: 14px 20px;
  border-left: 4px solid var(--teal);
  background: var(--wash);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.tldr strong { color: var(--teal); margin-right: 6px; }

/* Stats */
.stats-label {
  margin: 0 0 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px;
  background: var(--teal-soft);
  border-radius: var(--radius);
  text-align: center;
}

.stat .num {
  font: 700 30px/1.15 var(--serif);
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.stat .lbl { margin-top: 4px; color: var(--muted); font-size: 14px; }

/* Method */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.pillars article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
}

.pillars p { margin: 0; font-size: 15.5px; }

.tag {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.obs { background: var(--teal-soft); color: var(--teal); }
.tag.inf { background: #f6ecdc; color: var(--ochre); }
.tag.una { background: #f4e6e3; color: var(--rust); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 20px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

thead th {
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

table.num td:nth-child(n+3), table.num th:nth-child(n+3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.num tr.full td:nth-child(n+2) { text-align: right; }
table.num tr.full td:first-child { text-align: left; }
table.num tr.full { background: var(--teal-soft); }
table.num tr.full td:first-child { color: var(--teal); font-weight: 600; }
/* Bold only the cells where geometric abstraction does better. */
table.num td.best { font-weight: 600; }
table.num td[rowspan] { vertical-align: middle; font-weight: 600; background: #fff; }

/* Videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.video-grid figure { margin: 0; }

.video-grid video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f1416;
  border-radius: var(--radius);
}

.video-grid figcaption { text-align: center; margin-top: 8px; }

/* Discussion */
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 10px; }

/* Citation */
.bibtex {
  position: relative;
  background: #1b2427;
  border-radius: var(--radius);
}

.bibtex pre {
  margin: 0;
  padding: 22px 20px;
  overflow-x: auto;
}

.bibtex code {
  background: none;
  color: #e3ece9;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border: 1px solid #3c4a4e;
  border-radius: 6px;
  background: #263236;
  color: #e3ece9;
  font: 500 13px var(--sans);
  cursor: pointer;
}

.copy:hover { background: var(--teal); border-color: var(--teal); }

footer {
  margin-top: 48px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

footer p { margin: 0; }

/* Logos */
.corl-logo {
  width: 120px;
  margin: 0 auto 14px;
}

.logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin: -8px 0 26px;
}

.logos img { height: 40px; width: auto; }

/* Tasks */
.group-label {
  margin: 26px 0 10px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.task {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task .pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.task img { border-radius: 6px; }

.task .arrow { color: var(--muted); font-size: 18px; }

.task figcaption {
  margin-top: 8px;
  text-align: center;
  color: var(--ink);
  font-weight: 600;
}

.task figcaption span { color: var(--muted); font-weight: 400; }

.task figcaption small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

/* Timeline */
.timeline-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.legend span { display: inline-flex; align-items: center; gap: 8px; }

/* Poster-style lanes: a rail per agent ending at its mean completion time,
   with one pill per LLM request (filled = image attached, hollow = text only). */
.tl {
  --base: #3d6aa0;
  --full: #c0673a;
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  row-gap: 18px;
  column-gap: 16px;
}

.legend .pill { position: static; transform: none; background: var(--ink); }
.legend .pill.txt { background: #fff; border: 2px solid var(--ink); }

.tl-label { grid-column: 1; font-weight: 600; line-height: 1.2; }
.tl-label.base { color: var(--base); }
.tl-label.full { color: var(--full); }

.tl-plot { grid-column: 2; position: relative; height: 30px; }

.rail {
  position: absolute;
  left: 0;
  top: 50%;
  height: 6px;
  border-radius: 3px;
  background: #d5dbe0;
  transform: translateY(-50%);
}

.pill {
  position: absolute;
  top: 50%;
  display: inline-block;
  width: 10px;
  height: 24px;
  border-radius: 5px;
  transform: translateY(-50%);
}

.legend .pill { height: 18px; width: 8px; }

.tl-plot.base .pill.img { background: var(--base); }
.tl-plot.full .pill.img { background: var(--full); }
.tl-plot .pill.txt { background: #fff; border: 2px solid; }
.tl-plot.base .pill.txt { border-color: var(--base); }
.tl-plot.full .pill.txt { border-color: var(--full); }

.end { position: absolute; top: -2px; bottom: -2px; width: 2px; }
.tl-plot.base .end { background: var(--base); }
.tl-plot.full .end { background: var(--full); }

.end-label {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  padding-left: 10px;
  line-height: 1.2;
  white-space: nowrap;
  transform: translateY(-50%);
  font-variant-numeric: tabular-nums;
}

.tl-plot.base .end-label b { color: var(--base); }
.tl-plot.full .end-label b { color: var(--full); }
.end-label span { color: var(--muted); font-size: 12px; }

.tl-axis {
  grid-column: 2;
  position: relative;
  height: 22px;
  border-top: 1px solid var(--muted);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tl-axis span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tl-axis span::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 1px;
  height: 5px;
  background: var(--muted);
}

/* Floating table of contents */
/* Wide screens: sits in the gutter, 40px left of the 1000px content column */
.toc {
  position: fixed;
  top: 18vh;
  right: calc(50% + 540px);
  z-index: 20;
  width: 160px;
  font-size: 14px;
}

.toc-toggle { display: none; }

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line);
}

.toc li.sub a { padding-left: 26px; font-size: 13px; }

.toc a {
  display: block;
  margin-left: -2px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.toc a:hover { color: var(--ink); }

.toc a.active {
  color: var(--teal);
  font-weight: 600;
  border-left-color: var(--teal);
}

/* Not enough side room for a fixed list: collapse to an edge tab */
@media (max-width: 1399px) {
  .toc { top: 50%; right: auto; left: 0; width: auto; transform: translateY(-50%); }

  .toc-toggle {
    display: block;
    padding: 12px 8px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #fff;
    box-shadow: 0 4px 16px rgba(29, 42, 46, 0.1);
    color: var(--teal);
    font: 600 13px var(--sans);
    letter-spacing: 0.06em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    cursor: pointer;
  }

  .toc-panel {
    position: absolute;
    top: 50%;
    left: 0;
    display: none;
    padding: 14px 18px 14px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 0 8px 28px rgba(29, 42, 46, 0.14);
    transform: translateY(-50%);
  }

  .toc.open .toc-panel { display: block; }
  .toc.open .toc-toggle { visibility: hidden; }
}

/* Phones: a corner pill instead of an edge tab that would cover content */
@media (max-width: 820px) {
  .toc { top: auto; bottom: 16px; left: 16px; transform: none; }

  .toc-toggle {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .toc-panel {
    top: auto;
    bottom: 0;
    border-left: 1px solid var(--line);
    border-radius: var(--radius);
    transform: none;
  }
}

@media print { .toc { display: none; } }

/* Responsive */
@media (max-width: 820px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .task-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .tl { grid-template-columns: 1fr 96px; row-gap: 6px; }
  .tl-label { grid-column: 1 / -1; }
  .tl-label br { display: none; }
  .tl-plot, .tl-axis { grid-column: 1; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  main > section + section { margin-top: 56px; }
  h2 { font-size: 25px; }
  .card { padding: 10px; }
  .stat .num { font-size: 24px; }
  .video-grid { grid-template-columns: 1fr; }
  .prose p, .lede { text-align: left; }
  .affiliations span { display: block; }
  .logos img { height: 30px; }
}
