/* CARVid project page — same layout family as the Micro-Edits page,
   recoloured with the paper's palette: decomposition purple, text orange, branding blue, cut red. */
:root {
  color-scheme: light;
  --ink: #333333;
  --muted: #666666;
  --border: #e5e5e5;

  --purple: #5b3fd6;        /* text-safe version of the decomposition purple #5A36CE */
  --purple-dark: #4a30b8;
  --purple-accent: #8b5cf6;
  --purple-tint: #f3effe;

  --orange: #b45309;        /* text-safe version of the text-segment orange */
  --orange-accent: #f0a030;
  --orange-tint: #fff7ea;

  --blue: #2563eb;
  --blue-accent: #3b82f6;
  --blue-tint: #eef4ff;

  --cut: #ec483c;           /* removed columns */
  --serif: "Linux Libertine O", "Libertinus Serif", "Crimson Pro", Georgia, serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body {
  margin: 0; color: var(--ink); background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.6;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--purple-accent); outline-offset: 4px; border-radius: 3px; }
img, video { max-width: 100%; }

.wrap { max-width: 940px; margin-inline: auto; padding-inline: 20px; }
.wide { max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
.skip-link { position: absolute; left: 20px; top: -70px; padding: 10px 20px; background: white; z-index: 5; }
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 28px; padding-bottom: 30px; }
h1 { margin: 0 0 12px; font-size: calc(1rem + 0.9vw); line-height: 1.2; font-weight: bold; }
.venue { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pill {
  display: inline-block; padding: 5px 14px; border: 1px solid #e8e8ea; border-radius: 999px;
  background: #f3f4f6; color: #555; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.authors { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 30px; margin: 4px 0 0; font-size: calc(0.8rem + 0.2vw); color: var(--purple); }
.author { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; }
.author img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.author figcaption { color: var(--purple); font-size: calc(0.8rem + 0.2vw); line-height: 1.3; }
sup { color: var(--purple); font-size: 10px; margin-left: 2px; }
.affiliations { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px; margin: 14px 0 0; font-size: calc(0.8rem + 0.1vw); color: var(--muted); }
.internship { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.resource-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--purple); border-radius: 4px; background: white; color: var(--purple);
  font-size: calc(0.8rem + 0.1vw); font-weight: bold;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.button span { font-size: 15px; }
.button:hover { background: var(--purple-tint); color: var(--purple); text-decoration: none; }
.button.primary { color: white; background: var(--purple); border-color: var(--purple); }
.button.primary:hover { color: white; background: var(--purple-dark); border-color: var(--purple-dark); }
.button.soon { border-color: #cfcfd6; color: #8a8a94; cursor: default; }
.button.soon:hover { background: white; color: #8a8a94; }

/* ---------- Figures ---------- */
figure { margin: 0; }
.teaser svg { display: block; width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: calc(0.8rem + 0.1vw); line-height: 1.5; }
.hero-figure figcaption { padding: 12px 0 0; }
.hero-figure figcaption strong { color: var(--ink); }
.hero-figure figcaption .text { color: var(--orange); }
.hero-figure figcaption .cut { color: #c0362b; }
.hero-figure figcaption .credit { white-space: nowrap; font-size: 11px; }
.media { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--border); background: #f6f5fb; }

/* ---------- Sections ---------- */
.section { padding-block: 24px; }
.section + .section { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 30px; }
h2 { font-size: calc(0.9rem + 0.5vw); color: var(--muted); line-height: 1.3; margin: 0 0 15px; font-weight: bold; }
h3 { font-size: 16px; line-height: 1.4; margin: 0 0 10px; }
p { margin: 0 0 16px; }

.abstract h2 { font-size: calc(1rem + 0.3vw); color: var(--ink); }
.abstract > p:last-child { color: var(--ink); font-size: calc(0.85rem + 0.1vw); line-height: 1.65; margin-bottom: 0; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin-bottom: 12px; }
.text-link { font-size: 13px; font-weight: 600; white-space: nowrap; }
.section-intro { color: var(--muted); font-size: calc(0.85rem + 0.1vw); max-width: 720px; }

/* ---------- Video ---------- */
#video { scroll-margin-top: 12px; }
.video-frame {
  margin-inline: auto; aspect-ratio: 16 / 9; background: #1b1830; overflow: hidden; border-radius: 8px; margin-top: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(91, 63, 214, .14);
}
iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Pipeline cards ---------- */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 24px 0 0; }
.features article { border-top: 3px solid var(--purple-accent); padding-top: 14px; }
.features article.text { border-color: var(--orange-accent); }
.features article.cut { border-color: var(--cut); }
.feature-number { display: block; font-size: 11px; letter-spacing: 1.3px; margin-bottom: 8px; font-weight: 700; color: var(--purple); }
.features article.text .feature-number { color: var(--orange); }
.features article.cut .feature-number { color: #c0362b; }
.features h3 { margin-bottom: 6px; }
.features p { font-size: 14px; color: var(--muted); margin: 0; }
.explainer { margin-top: 30px; }

/* ---------- Footer ---------- */
footer {
  display: flex; justify-content: space-between; gap: 18px; margin-top: 20px; padding-block: 22px 28px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 12px;
}
.footer-divider { color: #c4b8f3; padding-inline: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 600px) {
  .wrap, .wide { padding-inline: 15px; }
  .hero { padding-top: 18px; padding-bottom: 24px; }
  h1 { font-size: 1.5rem; }
  .pill { font-size: 13px; padding: 4px 12px; }
  .authors { gap: 12px 18px; }
  .author img { width: 64px; height: 64px; }
  .affiliations { gap: 4px 18px; font-size: 13px; }
  .resource-links { gap: 6px; }
  .button { justify-content: center; font-size: 12px; padding-inline: 10px; min-height: 36px; }
  .hero-figure figcaption { padding: 10px 0; font-size: 12px; }
  .section { padding-block: 22px; }
  footer { flex-direction: column; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
.hero-figure figcaption .logo { color: #6d43e0; }
.hero-figure figcaption .brand { color: var(--blue); }
/* authors: four across, or a tidy 2 x 2 on narrow screens (never 3 + 1) */
.authors { display: grid; grid-template-columns: repeat(4, auto); justify-content: center; }
@media (max-width: 700px) { .authors { grid-template-columns: repeat(2, auto); } }
/* title on two fixed lines; the font shrinks with the viewport so neither line wraps (~21em wide) */
h1 { font-size: min(1.75rem, calc((100vw - 40px) / 22)); }
h1 span { display: block; white-space: nowrap; }
.author figcaption { display: flex; flex-direction: column; align-items: center; text-align: center; }
.author .aff { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 3px; }
.authors { align-items: start; }

/* ---------- Citation ---------- */
.author figcaption a { color: var(--purple); }
.citation p { color: var(--muted); font-size: 14px; }
pre {
  padding: 20px 24px; margin: 16px 0 0; overflow-x: auto;
  background: #f7f5fe; border: 1px solid #e4defa; border-left: 3px solid var(--purple-accent); border-radius: 8px;
  font-family: var(--mono); font-size: 12px; line-height: 1.8; color: #444;
}
footer a { color: var(--purple); }
@media (max-width: 600px) { pre { padding: 16px; font-size: 11px; } }

/* affiliation logos as superscripts beside each name (title gives the full name on hover) */
.orgs { display: inline-flex; align-items: center; gap: 3px; margin-left: 3px; vertical-align: 0.5em; }  /* superscript */
.orgs img, .author .orgs img { height: 12px; width: auto; display: block; border: 0; border-radius: 0; object-fit: contain; }
.affiliations span { display: inline-flex; align-items: center; gap: 6px; }
.affiliations img { height: 14px; width: auto; display: block; }
.teaser-video { display: block; width: 100%; height: auto; aspect-ratio: 1900 / 1160; background: #fff; }

/* ---------- How it works: recomposition operations ---------- */
.sub-h { margin: 40px 0 6px; font-size: 18px; }
.explainer + .explainer { margin-top: 30px; }
.op-label { display: inline-block; margin-bottom: 8px; font: 600 13px var(--mono); letter-spacing: 0.5px; color: var(--purple); }

/* venue: the UIST 2026 logo instead of a text badge */
.venue-logo { display: block; height: 40px; width: auto; max-width: 100%; }
/* teaser: never taller than a laptop screen (keeps its 1900:1160 shape, centred) */
.teaser-video { width: min(100%, calc((100vh - 96px) * 1900 / 1160)); margin-inline: auto; }
@media (max-width: 600px) { .venue-logo { height: 32px; } }

/* affiliation numbers instead of logos */
.author sup.affn { font-size: 0.68em; margin-left: 2px; color: var(--muted); font-weight: 500; vertical-align: 0.55em; line-height: 0; }
.affiliations sup { font-size: 0.75em; margin-right: 2px; }
.affiliations span { gap: 1px !important; align-items: flex-start !important; }
.affiliations sup { align-self: flex-start; line-height: 1; position: relative; top: 0.05em; margin-right: 1px; }
.venue { align-items: center; gap: 22px; }
.venue-logo.venue-adobe { height: 30px; }
@media (max-width: 600px) { .venue-logo.venue-adobe { height: 24px; } }
.venue-adobe { display: inline-flex; align-items: center; gap: 8px; font: 700 26px/1 var(--sans, "Inter", system-ui, sans-serif); color: #1d1d1f; letter-spacing: -0.01em; }
.venue-adobe img { height: 28px; width: auto; display: block; }
@media (max-width: 600px) { .venue-adobe { font-size: 21px; } .venue-adobe img { height: 23px; } }
.venue-logo.venue-adobe-full { height: 30px; }
@media (max-width: 600px) { .venue-logo.venue-adobe-full { height: 24px; } }
