.avatar-crop {
    display: block;
    aspect-ratio: 200 / 289;
    overflow: hidden;
}

.avatar-crop > img {
    --zoom: var(--avatar-zoom, 1);
    --x: var(--avatar-x, 50);
    --y: var(--avatar-y, 50);
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    object-position: calc(var(--x) * 1%) calc(var(--y) * 1%);
    /* Offset the scaled image so its zoom follows the selected crop position. */
    transform: translate(
        calc((50 - var(--x)) * (var(--zoom) - 1) * 1%),
        calc((50 - var(--y)) * (var(--zoom) - 1) * 1%)
    ) scale(var(--zoom));
}
