/* Complete3D project page */

:root {
  --ink: #2b2b2b;
  --text: #444;
  --muted: #777;
  --link: hsl(204, 86%, 45%);
  --wash: #f6f7f8;
  --line: #e3e5e8;
  --dark: #333;
  --ok: #2a78d6;
  --fail: #eb6834;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3 { font-family: 'Google Sans', 'Noto Sans', sans-serif; color: var(--ink); }

h2 { font-size: 1.75rem; font-weight: 600; text-align: center; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .4rem; }

/* Side gutters only: a section that is itself a .container keeps its vertical padding. */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.container.narrow { max-width: 860px; }

section { padding: 2.75rem 0; }
.band { background: var(--wash); }
.justify { text-align: justify; }
.intro { text-align: center; color: var(--muted); margin: -.4rem auto 1.4rem; max-width: 760px; }
.note { font-size: .88rem; color: var(--muted); text-align: center; margin: .9rem auto 0; max-width: 820px; }

/* ---------- Title ---------- */
.hero { text-align: center; padding-top: 3rem; padding-bottom: 1rem; }
.title { font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.2; font-weight: 600; margin: 0 0 1.2rem; }
.title .name { font-weight: 700; }

.authors { font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 1.15rem; margin: 0 0 .4rem; }
.author { display: inline-block; margin: 0 .55rem; white-space: nowrap; }
.affiliations { font-size: 1rem; color: var(--text); margin: 0 0 .4rem; }
.affiliations span { display: inline-block; margin: 0 .6rem; }

.links { margin: 1.1rem 0 .4rem; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.1rem; border-radius: 999px;
  background: var(--dark); color: #fff; font-weight: 500; font-size: .98rem;
}
a.button:hover { background: #111; text-decoration: none; }
.button.is-disabled { background: #9aa0a6; cursor: default; }
.button svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.section-nav { margin-top: 1.3rem; display: flex; gap: .3rem 1.1rem; justify-content: center; flex-wrap: wrap; font-size: .93rem; }
.section-nav a { color: var(--muted); }
.section-nav a:hover { color: var(--link); }

/* ---------- Figures ---------- */
.teaser { padding-top: 1rem; }
.figure { margin: 0; position: relative; }
.figure img { width: 100%; border-radius: var(--radius); }
.figure figcaption { font-size: .92rem; color: var(--text); text-align: center; margin-top: .5rem; }
.zoomable img { cursor: zoom-in; }
.tldr { font-size: 1.08rem; text-align: center; max-width: 880px; margin: 1.2rem auto 0; color: var(--ink); }

/* Placeholder shown while an image file is not in the repository yet */
.is-missing img { display: none; }
.is-missing::before {
  content: "Image pending: " attr(data-missing-label);
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: 1rem;
  border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: .9rem; background: #fff;
}

.caption { max-width: 920px; margin: 1.1rem auto 0; font-size: .98rem; text-align: justify; color: var(--text); }

/* ---------- Controls ---------- */
.controls { display: flex; flex-direction: column; gap: .55rem; align-items: center; margin-bottom: 1.1rem; }
.control { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; justify-content: center; }
.control-label { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); min-width: 5.2rem; text-align: right; }
.pills { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.pill {
  font: inherit; font-size: .9rem; line-height: 1.2;
  padding: .38rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { border-color: #b9bec5; }
.pill[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.pill.is-ours[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.pill:focus-visible, .bib-copy:focus-visible, .switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* On / off switch */
.switch {
  display: inline-flex; align-items: center; gap: .6rem;
  font: inherit; font-size: .92rem; color: var(--text);
  background: none; border: 0; padding: .2rem .35rem; border-radius: 8px; cursor: pointer;
}
.switch-track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: #c5cad1; transition: background .15s; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch[aria-checked="true"] .switch-track { background: var(--ok); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); }

/* ---------- Before / after comparison ---------- */
.cmp {
  --pos: 50%;
  position: relative; width: 100%; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  user-select: none; touch-action: pan-y;
}
.cmp.ratio-4x3 { aspect-ratio: 4 / 3; max-width: 960px; }
.cmp img, .cmp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cmp .cmp-a { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.cmp-line span {
  position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35);
}
.cmp-line span::before, .cmp-line span::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px;
  border: 5px solid transparent;
}
.cmp-line span::before { left: 5px; border-right-color: #555; border-left-width: 0; }
.cmp-line span::after { right: 5px; border-left-color: #555; border-right-width: 0; }
.cmp-tag {
  position: absolute; top: 10px; padding: .2rem .6rem; border-radius: 6px;
  font-size: .82rem; font-weight: 600; color: #fff; background: rgba(40,40,40,.78); pointer-events: none;
}
.cmp-tag-a { left: 10px; }
.cmp-tag-b { right: 10px; background: rgba(42,120,214,.9); }
.cmp-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; z-index: 2;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; background: transparent;
}
.cmp-toggle {
  position: absolute; left: 10px; bottom: 10px; z-index: 3;
  font: inherit; font-size: .78rem; font-weight: 600; line-height: 1.2;
  padding: .22rem .65rem; border-radius: 6px; border: 0; cursor: pointer;
  color: #fff; background: rgba(40,40,40,.78);
}
.cmp-toggle:hover { background: rgba(20,20,20,.9); }

/* ---------- Scene carousel (arrows and dots) ---------- */
.carousel { position: relative; max-width: 820px; margin: 0 auto; padding: 0 3.2rem; }
.carousel .cmp { max-width: none; }
.carousel.is-wide { max-width: 1040px; }
.carousel-caption { margin: .45rem 0 0; text-align: center; font-size: .85rem; color: var(--muted); }

/* Single looping video inside a carousel (2:1 canvas) */
.vidbox {
  position: relative; aspect-ratio: 2 / 1;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff;
}
.vidbox video { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.vidbox.is-missing video { visibility: hidden; }
/* Column titles above a two-column video */
.vid-head { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: .5rem; text-align: center; font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.vidbox.is-missing::after {
  content: "Media pending"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: .9rem; color: var(--muted); background: #fff; padding: .2rem .7rem; border-radius: 6px; border: 1px dashed var(--line);
}
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 1.5px solid #ddd; background: #fff; color: #555; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.carousel-arrow:hover { background: var(--dark); color: #fff; border-color: var(--dark); }
.carousel-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }
.carousel-dots { display: flex; justify-content: center; gap: .45rem; margin-top: .8rem; }
.carousel-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #ccc; cursor: pointer; transition: background .15s, transform .15s; }
.carousel-dot[aria-current="true"] { background: var(--dark); transform: scale(1.2); }
.carousel-arrow:focus-visible, .carousel-dot:focus-visible, .cmp-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.cmp.is-missing-a .cmp-a, .cmp.is-missing-b .cmp-b { visibility: hidden; }
.cmp.is-missing-a::after, .cmp.is-missing-b::after {
  content: "Media pending"; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  font-size: .85rem; color: var(--muted); background: #fff; padding: .15rem .6rem; border-radius: 6px; border: 1px dashed var(--line);
}

/* ---------- Side-by-side pair ---------- */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pair .figure img { border: 1px solid var(--line); background: #fff; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .45em; vertical-align: baseline; }
.dot-ok { background: var(--ok); }
.dot-fail { background: var(--fail); }

/* ---------- BibTeX ---------- */
.bib { position: relative; background: var(--wash); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.bib pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .86rem; color: var(--ink); }
.bib-copy { position: absolute; top: .6rem; right: .6rem; font: inherit; font-size: .82rem; padding: .2rem .7rem; border-radius: 6px; border: 1px solid #ccc; background: #fff; cursor: pointer; color: var(--text); }

.footer { padding: 1.6rem 0 2.2rem; text-align: center; font-size: .85rem; color: var(--muted); }

/* ---------- Zoom dialog ---------- */
#zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
#zoom::backdrop { background: rgba(0,0,0,.8); }
#zoom img { max-width: 96vw; max-height: 92vh; width: auto; height: auto; border-radius: 6px; background: #fff; }
#zoom-close { position: fixed; top: 12px; right: 16px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  section { padding: 2rem 0; }
  .caption { text-align: left; }
  .pair { grid-template-columns: 1fr; }
  .carousel { padding: 0 2.7rem; }
  .control { flex-direction: column; gap: .3rem; }
  .control-label { min-width: 0; text-align: center; }
  .authors { font-size: 1.02rem; }
  .justify { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill { transition: none; }
}
