/* The frame stays still while the real photo fades over the toon portrait. */
.portrait-toggle {
  position: relative;
  display: block;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  margin-inline: auto;
  padding: 0;
  overflow: hidden;
  border: 2px solid #00ABD8;
  border-radius: 50%;
  background: #282a2d;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 0 28px 3px rgb(0 171 216 / 8%),
    0 0 85px 22px rgb(0 171 216 / 6%),
    0 0 150px 45px rgb(0 171 216 / 3%);
}

.portrait-toggle:focus-visible {
  outline: 2px solid #f3f5ef;
  outline-offset: 6px;
}

.portrait-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}

.portrait-layer--real {
  /* Keep the photo at its original centered crop. */
  object-position: 50% 50%;
  opacity: 0;
  transition: opacity 1100ms ease-in-out;
}

.portrait-toggle.is-real .portrait-layer--real {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .portrait-layer--real {
    transition: none;
  }
}
/* Align the toon portrait with the photo. */
.portrait-layer--toon-base {
  object-position: 50% 58%;
}
