/* V23: isolated before/after component. Other site styles are unchanged. */
.comparison {
  width: min(calc(100% - 40px), 1120px);
  margin: 0 auto;
}
.comparison-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  isolation: isolate;
  background: #171719;
  cursor: ew-resize;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.comparison-layer,
.comparison-layer img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.comparison-layer img {
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}
.comparison-layer--before { z-index: 0; }
.comparison-layer--after {
  z-index: 1;
  -webkit-clip-path: inset(0 calc(100% - var(--reveal)) 0 0);
  clip-path: inset(0 calc(100% - var(--reveal)) 0 0);
}
.comparison-label {
  position: absolute;
  top: clamp(12px, 2vw, 24px);
  padding: 9px 15px;
  color: #fff;
  background: rgba(5, 5, 7, .87);
  font-family: var(--body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.3;
  pointer-events: none;
}
.comparison-label--before { right: clamp(12px, 2vw, 24px); }
.comparison-label--after { left: clamp(12px, 2vw, 24px); }
.comparison-divider {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: var(--reveal);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, .3);
  transform: translateX(-50%);
  pointer-events: none;
}
.comparison-handle {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: clamp(27px, var(--reveal), calc(100% - 27px));
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: rgba(12, 12, 15, .82);
  box-shadow: 0 2px 20px rgba(0, 0, 0, .3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: background 160ms ease;
}
.comparison-stage:hover .comparison-handle,
.comparison-stage.is-dragging .comparison-handle {
  background: #111114;
}
.comparison-stage:focus-within .comparison-handle {
  outline: 3px solid var(--magenta);
  outline-offset: 4px;
}
/* A real range input supplies keyboard and assistive-technology behavior. */
.comparison-range {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.comparison-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.comparison-endpoint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
  color: var(--text-dark);
  font-family: var(--body);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .12em;
  cursor: pointer;
}
.comparison-endpoint:hover { text-decoration: underline; text-underline-offset: 5px; }
.comparison-endpoint:focus-visible {
  outline: 2px solid var(--text-dark);
  outline-offset: 4px;
}
.comparison-tip {
  color: var(--muted-dark);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-align: center;
}
.comparison-caption {
  margin-top: 7px;
  color: var(--muted-dark);
  font-size: .75rem;
  line-height: 1.5;
  text-align: center;
}
@media (max-width: 480px) {
  .comparison-toolbar { gap: 8px; margin-top: 9px; }
  .comparison-endpoint { gap: 6px; font-size: .64rem; letter-spacing: .09em; }
  .comparison-tip { max-width: 100px; font-size: .57rem; line-height: 1.5; }
  .comparison-caption { font-size: .69rem; }
  .comparison-label { padding: 7px 10px; font-size: .58rem; }
}
@media (prefers-reduced-motion: reduce) {
  .comparison-handle { transition: none; }
}
body.reduced-motion .comparison-handle { transition: none; }
