/* ------------------------------------------------------------------
   TaRL project page
   ------------------------------------------------------------------ */
:root {
  --ink: #17191c;
  --ink-2: #3c4045;
  --muted: #6b7078;
  --line: #e6e8eb;
  --surface: #f6f7f9;
  --surface-2: #eef1f4;
  --bg: #ffffff;

  --tactile: #0fa3a0;      /* teal   – tactile reward (matches paper figures) */
  --tactile-ink: #0b7f7c;
  --tactile-soft: #e3f6f5;
  --visual: #f39c12;       /* orange – visual reward */
  --visual-soft: #fff3e0;
  --accent: var(--tactile);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1040px;
  --narrow: 800px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--tactile-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
strong { font-weight: 650; }
sup { font-size: 0.65em; line-height: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--narrow); margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.justify { text-align: justify; hyphens: auto; }

section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
section.tight { padding-top: 24px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h2 { font-size: 2rem; text-align: center; margin-bottom: 0.8em; }
h3 { font-size: 1.45rem; margin-top: 1.6em; }
h4 { font-size: 1.15rem; font-family: var(--sans); font-weight: 650; margin-top: 1.4em; }
.eyebrow {
  display: block; text-align: center; font-family: var(--sans); font-size: 0.8rem; font-weight: 650;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--tactile-ink); margin-bottom: 8px;
}
.lede { font-size: 1.1rem; color: var(--ink-2); text-align: center; max-width: 760px; margin: 0 auto 1.5em; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 24px; text-align: center; }
.hero .venue {
  display: inline-block; font-size: 0.85rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--tactile-ink); background: var(--tactile-soft); border-radius: 999px; padding: 6px 14px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 650; margin: 0 auto 0.5em; max-width: 900px; }
.hero h1 .brand { color: var(--tactile-ink); }
.hero .subtitle { font-size: 1.15rem; color: var(--ink-2); max-width: 760px; margin: 0 auto 1.6em; }
.authors { font-size: 1.12rem; line-height: 1.7; margin-bottom: 0.3em; }
.authors a { color: var(--ink); border-bottom: 1px solid transparent; }
.authors a:hover { color: var(--tactile-ink); text-decoration: none; border-bottom-color: currentColor; }
.author { white-space: nowrap; }
.affils { font-size: 1.02rem; color: var(--ink-2); margin-bottom: 1.6em; }
.affils span { white-space: nowrap; margin: 0 8px; }
.emails { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin-bottom: 1.6em; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 20px;
  font-size: 0.95rem; font-weight: 600; transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: #000; text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.soon { background: var(--surface-2); color: var(--muted); cursor: default; }
.btn.soon:hover { transform: none; background: var(--surface-2); }

/* ---------- Teaser video ---------- */
.teaser { padding: 24px 0 8px; }
.video-frame {
  position: relative; background: #0f1113; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.45);
}
.video-frame video { width: 100%; height: auto; margin: 0 auto; }
.video-frame.hero-video { background: transparent; box-shadow: none; display: flex; justify-content: center; }
.video-frame.hero-video video {
  max-height: 520px; width: auto; max-width: 100%; background: #0f1113;
  border-radius: var(--radius); box-shadow: 0 18px 40px -22px rgba(0,0,0,.45);
}
.caption { font-size: 0.95rem; color: var(--muted); text-align: center; margin: 14px auto 0; max-width: 820px; line-height: 1.55; }
.caption b { color: var(--ink-2); font-weight: 650; }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 36px 0 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 12px 16px; text-align: center; }
.stat .num { font-family: var(--serif); font-size: 2.7rem; font-weight: 650; color: var(--tactile-ink); line-height: 1.05; letter-spacing: -0.02em; white-space: nowrap; }
.stat .num small { font-size: 1rem; color: var(--muted); font-family: var(--sans); font-weight: 500; letter-spacing: 0; }
.stat .num .from { color: var(--muted); font-size: 1.5rem; }
.stat .num .arrow { color: var(--muted); font-size: 1.1rem; margin: 0 5px; font-family: var(--sans); }
.stat .lbl { font-size: 0.84rem; color: var(--ink-2); margin-top: 8px; line-height: 1.35; font-weight: 600; white-space: nowrap; }
.stat .sub { font-size: 0.78rem; color: var(--muted); margin-top: 3px; line-height: 1.35; white-space: nowrap; }

/* ---------- Figures ---------- */
figure { margin: 0; }
figure img { margin: 0 auto; border-radius: 8px; }
figure figcaption { font-size: 0.95rem; color: var(--muted); text-align: center; margin: 14px auto 0; max-width: 860px; line-height: 1.55; }
figure figcaption b { color: var(--ink-2); font-weight: 650; }
.fig-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.fig-card img { border-radius: 8px; }
.fig-w-80 img { width: 80%; }
.fig-w-70 img { width: 70%; }
.fig-w-60 img { width: 60%; }
.fig-w-45 img { width: 45%; }

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 > figure, .grid-3 > figure { min-width: 0; }
.grid-q4 { grid-template-columns: 2.2fr 1fr; }
.grid-2.cmp { grid-template-columns: 0.7fr 1fr; gap: 40px; align-items: center; max-width: 720px; margin: 28px auto 0; }
.grid-2.cmp figure img { width: 100%; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; font-size: 0.98rem; color: var(--ink-2); }
.note p { margin: 0 0 0.8em; }
.note p:last-child { margin-bottom: 0; }

/* ---------- Method cards ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0 8px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 16px; }
.step .k {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 0.9rem; margin-bottom: 12px;
}
.step h4 { margin: 0 0 8px; font-size: 1.05rem; }
.step p { font-size: 0.95rem; color: var(--ink-2); margin: 0; }
.formula {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 22px auto; text-align: center; font-size: 1.05rem; overflow-x: auto;
}
.formula .legend { font-size: 0.9rem; color: var(--muted); margin-top: 8px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.82rem; font-weight: 650; vertical-align: middle; }
.tag.tactile { background: var(--tactile-soft); color: var(--tactile-ink); }
.tag.visual { background: var(--visual-soft); color: #b36b00; }

/* ---------- Task cards ---------- */
.tasks-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; align-items: start; }
.tasks-grid .gh { margin: 0 0 -2px; text-align: center; font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); align-self: end; }
.tasks-grid .gh-sim { grid-column: 1 / 5; grid-row: 1; }
.tasks-grid .gh-real { grid-column: 5 / 7; grid-row: 1; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.task img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0; }
.task .name { font-size: 0.9rem; font-weight: 600; text-align: center; padding: 9px 8px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Result blocks ---------- */
.q { margin-top: 44px; }
.q:first-of-type { margin-top: 0; }
.q h3 { display: flex; align-items: baseline; gap: 12px; margin-top: 0; }
.q h3 .n { font-family: var(--sans); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; color: var(--tactile-ink); background: var(--tactile-soft); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.takeaway {
  border-left: 3px solid var(--tactile); background: var(--tactile-soft); border-radius: 0 10px 10px 0;
  padding: 12px 16px; margin: 18px 0; font-size: 1rem;
}
.takeaway b { color: var(--tactile-ink); }

/* ---------- Video grid ---------- */
.videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.videos .item .video-frame { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.videos .item video { width: 100%; height: 100%; object-fit: cover; }
.videos .item .lbl { text-align: center; font-size: 0.98rem; font-weight: 600; margin-top: 10px; }
.videos .item .sub { text-align: center; font-size: 0.86rem; color: var(--muted); }
.videos.two { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- Plot grids (per-task result panels) ---------- */
.plots { display: grid; gap: 16px; margin-top: 8px; }
.plots.four { grid-template-columns: repeat(4, 1fr); }
.plots.three { grid-template-columns: repeat(3, 1fr); }
.plots.two { grid-template-columns: repeat(2, 1fr); gap: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }
.plot { min-width: 0; }
.plots.plots-sm { max-width: 820px; margin-left: auto; margin-right: auto; }
.plot img { width: 100%; border-radius: 8px; }
.plot .lbl { text-align: center; font-family: var(--serif); font-size: 1.05rem; color: var(--ink-2); margin-top: 6px; }
.plots + figure figcaption { margin-top: 10px; }
.c-tactile { color: var(--tactile-ink); font-weight: 600; }
.c-visual { color: #d98a00; font-weight: 600; }

/* ---------- Video rows ---------- */
.row-label { text-align: center; font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; }
.videos.three { grid-template-columns: repeat(3, 1fr); max-width: 900px; margin-left: auto; margin-right: auto; }
.videos .item.portrait .video-frame { aspect-ratio: 448 / 710; }
.videos .item.wide .video-frame { aspect-ratio: 16 / 9; }
.videos.wide-pair { max-width: 100%; }

/* ---------- BibTeX ---------- */
pre.bib {
  background: #0f1113; color: #e8eaed; border-radius: var(--radius); padding: 20px 22px; overflow-x: auto;
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; margin: 0;
}
.bib-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 6px 10px; font-size: 0.8rem; font-family: var(--sans); cursor: pointer;
}
.copy-btn:hover { background: rgba(255,255,255,.2); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 0.9rem; color: var(--muted); text-align: center; }
footer a { color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .plots.four { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .tasks-grid { grid-template-columns: repeat(2, 1fr); }
  .tasks-grid .gh-sim, .tasks-grid .gh-real { grid-column: 1 / -1; grid-row: auto; margin-top: 10px; }
  .videos { grid-template-columns: repeat(2, 1fr); }
  .fig-w-80 img, .fig-w-70 img, .fig-w-60 img { width: 100%; }
  .fig-w-45 img { width: 70%; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  section { padding: 40px 0; }
  h2 { font-size: 1.65rem; }
  .grid-2, .grid-q4, .grid-2.cmp { grid-template-columns: 1fr; }
  .plots.three { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
  .plots.two { grid-template-columns: 1fr; max-width: 360px; }
  .videos.three { grid-template-columns: 1fr; max-width: 300px; }
  .formula { font-size: 0.85rem; padding: 14px 12px; }
  .videos, .videos.two { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .num { font-size: 2rem; }
  .stat .lbl, .stat .sub { white-space: normal; }
  .hero { padding-top: 40px; }
  .q h3 { flex-direction: column; gap: 6px; }
}
