.portrait-compare {
  --photo-share: 50%;
  display: grid;
  justify-items: center;
  gap: .65rem;
  margin: 1rem 0 .5rem;
  padding: 1rem .75rem .75rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--bg);
}
.portrait-compare[hidden] { display: none; }
.portrait-compare figcaption { font-weight: 550; }
.portrait-compare__coin {
  position: relative;
  width: min(100%, 16rem);
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px double var(--accent);
  border-radius: 50%;
  background: var(--surface);
  isolation: isolate;
}
.portrait-compare__coin:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.portrait-compare__avatar, .portrait-compare__photo, .portrait-compare__photo::before {
  position: absolute;
  inset: 0;
}
/* Frame the front half of the studio sprite and rotate the photo about the
   midpoint of the pupils so that both eye lines meet at the divider. */
.portrait-compare[data-loaded] .portrait-compare__avatar {
  background: url('/assets/studio/retrato.webp') 5.3% 18.8% / 220% auto no-repeat;
}
.portrait-compare__photo { clip-path: inset(0 calc(100% - var(--photo-share)) 0 0); }
.portrait-compare[data-loaded] .portrait-compare__photo::before {
  content: '';
  inset: -5% auto auto -16.5%;
  width: 180%;
  height: 180%;
  background: url('/assets/caetano-portrait.webp') center / cover;
  transform: rotate(12deg);
  transform-origin: 37% 26.6%;
}
.portrait-compare__divider {
  position: absolute;
  inset: 0 auto 0 var(--photo-share);
  width: 2px;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 3px #000;
}
.portrait-compare__divider::after {
  content: '↔';
  position: absolute;
  top: 84%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 1.55rem;
  border: 1px solid var(--accent);
  border-radius: 2rem;
  color: var(--accent);
  background: var(--bg);
  font: 500 1rem/1 var(--sans);
}
.portrait-compare__coin input {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}
.portrait-compare__choices { display: flex; gap: .25rem; }
.portrait-compare__choices button {
  min-width: 4rem;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 2rem;
  color: var(--text);
  background: var(--surface);
  font: 500 .875rem var(--sans);
}
.portrait-compare__choices button[aria-pressed='true'] { color: var(--accent-ink); background: var(--accent); }
.portrait-compare small { text-align: center; color: var(--muted); font-size: .75rem; line-height: 1.45; }
