/* The original photographs and render files stay unchanged.
   Only the render is masked over the fixed near-black backdrop. */
:root { --comparison-backdrop: rgb(34, 34, 32); }
.comparison-pair figure { position: relative; isolation: isolate; }
.comparison-pair figcaption {
  position: absolute;
  bottom: 18px;
  left: 20px;
  z-index: 1;
  display: block;
  padding: 0;
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .8);
  pointer-events: none;
}
.compare-image img { aspect-ratio: 4 / 3; object-fit: contain; }
.comparison-pair[data-scan-mode="detail"] .compare-image img {
  transform: translateY(var(--scan-offset, 40%)) scale(var(--scan-scale, 1.8));
  transform-origin: center;
  will-change: transform;
}
.scan-caption { display: flex; justify-content: space-between; gap: 20px; align-items: center; color: var(--muted);  margin-top: 15px; }
.scan-track { display: block; width: 100px; height: 2px; background: #d7dad7; flex-shrink: 0; }
.scan-track > span { display: block; height: 100%; width: 100%; background: #66706b; transform: scaleX(0); transform-origin: left; }
.scan-caption:has(#scan-description[data-mode="full"]) .scan-track { visibility: hidden; }
#comparison-pair[data-backdrop="neutral"] [data-comparison="render"] { background: var(--comparison-backdrop); }
#comparison-pair[data-backdrop="neutral"] #render-image {
  -webkit-mask-image: var(--foreground-mask);
  mask-image: var(--foreground-mask);
  mask-mode: luminance;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
@media (max-width: 760px) {
  .comparison-pair figcaption { bottom: 12px; left: 12px; }
  .compare-image img { aspect-ratio: 3 / 4; object-fit: cover; }
  .scan-caption {  gap: 12px; }
  .scan-track { width: 55px; }
  #comparison-pair[data-backdrop="neutral"] #render-image {
    -webkit-mask-size: cover;
    mask-size: cover;
  }
}
@media (prefers-reduced-motion: reduce) {
  .comparison-pair[data-scan-mode="detail"] .compare-image img { will-change: auto; }
}
