/* ShelfChange3D project page — layout inspired by the Nerfies / SceneDiff templates */

:root {
  --text: #1f2933;
  --muted: #5f6b7a;
  --faint: #9aa5b1;
  --line: #e4e8ee;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --accent: #1a7f5a;        /* green, matches the ICRA deck */
  --accent-soft: #e6f4ee;
  --removed: #e0492f;       /* red = removed */
  --added: #2f80ed;         /* blue = added */
  --dark: #363636;
  --radius: 10px;
  --maxw: 1100px;
  --font: "Google Sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
sub { font-size: 0.7em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: 2rem; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 1.05rem; }
.section-title + .body, .section-sub + .body { margin-top: 20px; }
.body { text-align: justify; }
h3.sub-title { font-size: 1.35rem; margin: 36px 0 12px; }
h3.sub-title:first-child { margin-top: 0; }
.center { text-align: center; }
.caption { font-size: 0.92rem; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.5; }
.caption b { color: var(--text); }
.tag-removed { color: var(--removed); font-weight: 700; }
.tag-added { color: var(--added); font-weight: 700; }
.tag-gt { color: #2fb04a; font-weight: 700; }
.tag-teal { color: #2a9d8f; font-weight: 700; }
.figure { margin: 0; }
.figure img { border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.figure.plain img { box-shadow: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav .brand { font-family: var(--font); font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 26px; font-family: var(--font); font-size: .92rem; font-weight: 600; }
.nav-links a { color: var(--muted); text-decoration: none; transition: color .15s; }
.nav-links a:hover { color: var(--accent); }
section[id], header[id] { scroll-margin-top: 64px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 36px; text-align: center; }
.hero .venue {
  display: inline-block; font-family: var(--font); font-size: .85rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 2.5rem; max-width: 1000px; margin: 0 auto 22px; }
.hero h1 .name { color: var(--accent); }
.hero .subtitle { font-size: 1.6rem; font-weight: 400; color: var(--muted); margin-bottom: 22px; font-family: var(--font); }
.authors { font-size: 1.15rem; margin-bottom: 6px; }
.authors .author { display: inline-block; margin: 0 4px; }
.authors a { color: var(--accent); }
.authors sup { font-size: .7em; color: var(--muted); }
.affils { color: var(--muted); font-size: 1rem; margin-bottom: 26px; }
.affils sup { font-size: .75em; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; align-items: flex-start; }
.btn-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.soon { font-size: .78rem; color: var(--muted); font-family: var(--font); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--dark); color: #fff !important; font-family: var(--font); font-weight: 600;
  font-size: .95rem; padding: 10px 20px; border-radius: 999px; text-decoration: none !important;
  transition: background .15s, transform .15s;
}
.btn:hover { background: #111; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.disabled { background: #a3adb8; cursor: default; pointer-events: none; }

/* ---------- teaser ---------- */
.teaser { padding: 12px 0 56px; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.strip .cell { position: relative; }
.strip .cell img { border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.1); width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.strip .label {
  position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); color: var(--text);
  font-family: var(--font); font-weight: 600; font-size: .82rem; padding: 3px 9px; border-radius: 6px;
}
.strip .label.pred { background: rgba(224,73,47,.92); color: #fff; }
.strip .label.done { background: rgba(26,127,90,.92); color: #fff; }
.strip .under { text-align: center; font-size: .9rem; color: var(--muted); margin-top: 8px; }
.strip.arrows .cell:not(:last-child)::after {
  content: "\203A"; position: absolute; right: -15px; top: 36%; font-size: 30px; color: var(--faint); line-height: 1;
}

/* ---------- video ---------- */
.video-wrap { border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.video-wrap video { width: 100%; }

/* ---------- method cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card .num { font-family: var(--font); font-weight: 700; color: var(--accent); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.card h4 { font-size: 1.1rem; margin: 4px 0 8px; }
.card p { font-size: .95rem; color: var(--muted); text-align: left; }

/* ---------- method flow ---------- */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; margin-top: 26px; }
.flow-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; }
.flow-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--font); font-weight: 700; font-size: .9rem; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.flow-step h4 { font-size: 1rem; margin-bottom: 6px; }
.flow-step p { font-size: .88rem; color: var(--muted); line-height: 1.45; }
.flow-arrow { display: flex; align-items: center; color: var(--faint); font-size: 26px; }

/* ---------- robot demos ---------- */
.demo { margin-top: 32px; }
.demo:first-of-type { margin-top: 0; }
.demo-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.demo-head h3 { font-size: 1.35rem; margin: 0; }
.demo-head .pill { font-size: .8rem; font-family: var(--font); font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.demo-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.demo-videos .video-wrap { position: relative; }
.demo-videos .vlabel {
  position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-family: var(--font);
  font-size: .8rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; pointer-events: none;
}
.demo-videos video { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.demo-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.demo-steps .step { font-size: .88rem; color: var(--muted); line-height: 1.45; }
.demo-steps .step b { display: block; color: var(--text); font-family: var(--font); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0 26px; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; text-align: center; }
.stat .v { font-family: var(--font); font-size: 2.1rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat .k { font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---------- benchmark ---------- */
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; margin-top: 8px; }
.ds-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.ds-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.ds-num { font-family: var(--font); font-weight: 700; font-size: 2.2rem; color: var(--accent); line-height: 1; min-width: 96px; }
.ds-name { font-family: var(--font); font-weight: 700; font-size: 1.05rem; }
.ds-desc { font-size: .88rem; color: var(--muted); line-height: 1.4; }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.pair-col { font-family: var(--font); font-weight: 600; font-size: .85rem; color: var(--muted); text-align: center; }
.ds-card .caption { margin-top: 12px; }
h3.sub-title.center { text-align: center; margin-top: 44px; }
.gen-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.gen-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.gen-step img { border-radius: 6px; }
.gen-tag { font-family: var(--font); font-weight: 700; font-size: .85rem; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.gen-step .caption { margin-top: 8px; }

/* ---------- two-column blocks ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.cols.wide-left { grid-template-columns: 5fr 6fr; }
.cols .body { font-size: 1rem; }

/* ---------- tabs ---------- */
.tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  font-family: var(--font); font-weight: 600; font-size: .95rem; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 18px 0 8px; }
table.results { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
table.results th, table.results td { padding: 7px 10px; text-align: right; white-space: nowrap; }
table.results th:first-child, table.results td:first-child { text-align: left; }
table.results thead th { border-bottom: 2px solid var(--text); font-family: var(--font); font-weight: 600; }
table.results thead tr.group th { border-bottom: 1px solid var(--line); font-weight: 700; text-align: center; }
table.results tbody tr { border-bottom: 1px solid var(--line); }
table.results tbody tr.sep td { border-top: 1px solid var(--faint); }
table.results tbody tr.ours td { background: var(--accent-soft); }
table.results td.best { font-weight: 700; color: var(--accent); }
table.results .note { font-size: .8rem; color: var(--muted); text-align: left; white-space: normal; }
.check { color: var(--accent); font-weight: 700; }
.cross { color: var(--faint); }

/* ---------- bibtex ---------- */
pre.bibtex {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; font-size: .88rem; overflow-x: auto; line-height: 1.5; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bib-box { position: relative; }
.copy-btn {
  position: absolute; top: 10px; right: 10px; font-family: var(--font); font-size: .8rem; font-weight: 600; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- footer ---------- */
body::after { content: ""; display: block; height: 40px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero h1 { font-size: 2rem; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-arrow { display: none; }
  .hero .subtitle { font-size: 1.25rem; }
  .cards, .stats, .cols, .cols.wide-left { grid-template-columns: 1fr 1fr; }
  .strip.arrows .cell::after { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }
  .section-title { font-size: 1.6rem; }
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: 1.65rem; }
  .strip, .demo-steps { grid-template-columns: 1fr 1fr; }
  .cards, .stats, .stats.two, .cols, .cols.wide-left, .demo-videos, .flow, .ds-grid, .gen-flow { grid-template-columns: 1fr; }
  .nav-inner { height: auto; flex-wrap: wrap; padding: 8px 16px; row-gap: 4px; }
  .nav .brand { font-size: 1rem; }
  .nav-links { width: 100%; justify-content: space-between; gap: 10px; font-size: .8rem; overflow-x: auto; }
  .nav-links a { white-space: nowrap; }
  section[id], header[id] { scroll-margin-top: 80px; }
  .body { text-align: left; }
}
