.hf-premade-film-preview {
    --cycle: 3.45s;
    --ease: cubic-bezier(.37, 0, .23, 1);
    --hero: translateY(-15.3%) scale(1.17);
    --film-top: 43%;
    --pickup-drop: 12%;
    --foil: polygon(
        0.39% 16.00%, 0.79% 15.14%, 1.18% 14.43%, 1.57% 13.71%,
        1.97% 13.14%, 4.72% 10.14%, 7.48% 8.14%, 10.24% 6.57%,
        12.99% 5.43%, 15.75% 4.43%, 18.50% 3.57%, 21.26% 2.86%,
        24.02% 2.29%, 26.77% 1.71%, 29.53% 1.29%, 32.28% 1.00%,
        35.04% 0.71%, 37.80% 0.43%, 40.55% 0.29%, 43.31% 0.29%,
        46.06% 0.29%, 48.82% 0.29%, 51.57% 0.43%, 54.33% 0.71%,
        57.09% 1.00%, 59.84% 1.43%, 62.60% 1.86%, 65.35% 2.43%,
        68.11% 3.14%, 70.87% 4.00%, 73.62% 5.00%, 76.38% 6.14%,
        79.13% 7.57%, 81.89% 9.14%, 84.65% 11.14%, 87.40% 12.00%,
        90.16% 12.57%, 92.91% 13.29%, 95.67% 14.43%, 98.03% 15.71%,
        98.43% 16.14%, 98.82% 16.43%, 99.21% 17.00%, 99.41% 17.29%,
        99.41% 18.21%, 99.21% 18.50%, 98.82% 18.79%, 98.43% 19.07%,
        98.03% 19.21%, 95.67% 19.64%, 92.91% 20.50%, 90.16% 21.36%,
        87.40% 22.07%, 84.65% 22.79%, 81.89% 24.21%, 79.13% 26.21%,
        76.38% 27.36%, 73.62% 28.50%, 70.87% 29.36%, 68.11% 31.07%,
        65.35% 31.79%, 62.60% 32.36%, 59.84% 32.93%, 57.09% 33.36%,
        54.33% 32.64%, 51.57% 33.21%, 48.82% 33.50%, 46.06% 33.50%,
        43.31% 33.50%, 40.55% 33.21%, 37.80% 33.64%, 35.04% 33.50%,
        32.28% 33.21%, 29.53% 32.93%, 26.77% 33.07%, 24.02% 32.64%,
        21.26% 31.93%, 18.50% 31.21%, 15.75% 30.36%, 12.99% 28.36%,
        10.24% 27.21%, 7.48% 25.79%, 4.72% 23.93%, 1.97% 21.36%,
        1.57% 20.79%, 1.18% 20.07%, 0.79% 19.21%, 0.39% 17.79%
    );
    position: absolute;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-preview { visibility: visible; }

.hf-premade-film-stage {
    position: absolute;
    inset: 0;
    width: min(100%, 121.95cqh);
    height: min(100%, 82cqw);
    margin: auto;
}

.hf-premade-film-stage span {
    position: absolute;
    inset: 0;
}

.hf-premade-film-stage > span { opacity: 0; }

.hf-premade-film-product {
    transform-origin: 50% 69.53%;
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage img {
    position: absolute;
    inset: auto;
    max-width: none;
    max-height: none;
    object-fit: fill;
    filter: none;
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage .hf-premade-film-open {
    inset: 43% auto auto 36.79%;
    width: 26.42%;
    height: 53.05%;
    filter: saturate(.89);
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage
:is(.hf-premade-film-placed, .hf-premade-film-carried, .hf-premade-film-result) {
    inset: var(--film-top) auto auto 36.08%;
    width: 31.56%;
    height: 53.05%;
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage
:is(.hf-premade-film-placed, .hf-premade-film-carried) {
    clip-path: var(--foil);
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage .hf-premade-film-carried {
    top: calc(var(--film-top) - var(--pickup-drop));
    /* Undo the perspective of the sample so the foil keeps its shape during the flip. */
    transform-origin: 50% 16.7%;
    transform: rotateX(62deg) scaleY(2.13);
}

.hf-premade-film-placed,
.hf-premade-film-result { opacity: 0; }

.hf-premade-film-guides::before,
.hf-premade-film-guides::after {
    content: "";
    position: absolute;
    top: -7%;
    width: 2.4%;
    height: 54%;
    background: linear-gradient(90deg, #7f8b92, #f0f5f7 39%, #b3bec4 68%, #829097);
    border-radius: 0 0 2px 2px;
}

.hf-premade-film-guides::before { left: 26.8%; }
.hf-premade-film-guides::after { right: 26.8%; }

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage .hf-premade-film-magazine {
    inset: -32.3% auto auto 33.8%;
    width: 32.4%;
    height: 53.3%;
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage .hf-premade-film-picker {
    inset: 14.68% auto auto 18.25%;
    width: 63.5%;
    height: 27.62%;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 55% 100%, 55% 64.6%, 45% 64.6%, 45% 100%, 0 100%);
    transform: translateZ(1px);
}

/* Split the photo into the cross-shaft and the shorter, rotating suction rod. */
.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage .hf-premade-film-suction {
    inset: 14.9% auto auto 18.25%;
    width: 63.5%;
    height: 25.14%;
    clip-path: inset(64.6% 45% 0);
}

.hf-premade-film-pickup,
.hf-premade-film-flip {
    transform-style: preserve-3d;
}

.hf-premade-film-flip {
    transform-origin: 50% 27.5%;
}

.hf-native .hf-home-categories .hf-home-category-grid .hf-category-photo .hf-premade-film-stage .hf-premade-film-press {
    inset: -11.4% auto auto 27.25%;
    width: 45.5%;
    height: 61.7%;
}

/* The die stays against the foil while the upper plate takes up spring travel. */
.hf-premade-film-press { clip-path: inset(48% 0 0); }
.hf-premade-film-press.hf-premade-film-carriage { clip-path: inset(0 0 51%); }

.hf-premade-film-photo.is-previewing .hf-premade-film-carriage {
    animation: hf-premade-carriage-load var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-product {
    animation: hf-premade-product-in var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-placement {
    animation: hf-premade-placement-camera var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-pickup {
    animation: hf-premade-pickup-stroke var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-flip {
    animation: hf-premade-flip var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-carried {
    animation: hf-premade-carried var(--cycle) linear both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-placed {
    animation: hf-premade-placed var(--cycle) linear both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-sealing {
    animation: hf-premade-sealing-camera var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-press-stroke {
    animation: hf-premade-press-stroke var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-open {
    animation: hf-premade-open-out var(--cycle) var(--ease) both;
}

.hf-premade-film-photo.is-previewing .hf-premade-film-result {
    animation: hf-premade-sample-in var(--cycle) var(--ease) both;
}

@keyframes hf-premade-product-in {
    0% { opacity: 0; transform: translateY(1.6%) scale(.985); }
    10%, 81% { opacity: 1; transform: none; }
    100% { opacity: 1; transform: var(--hero); }
}

@keyframes hf-premade-placement-camera {
    0%, 52%, 100% { opacity: 0; }
    10%, 43% { opacity: 1; }
}

@keyframes hf-premade-pickup-stroke {
    0%, 12%, 47%, 100% { transform: translateY(0); }
    29%, 33% { transform: translateY(var(--pickup-drop)); }
}

@keyframes hf-premade-flip {
    0%, 12%, 46%, 100% { transform: rotateX(180deg); }
    27%, 37% { transform: rotateX(0deg); }
}

@keyframes hf-premade-carried {
    0%, 9% { opacity: 0; }
    12%, 31% { opacity: 1; }
    31.03%, 100% { opacity: 0; }
}

@keyframes hf-premade-placed {
    0%, 31% { opacity: 0; }
    31.03%, 95% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes hf-premade-sealing-camera {
    0%, 51% { opacity: 0; transform: none; }
    58%, 84% { opacity: 1; transform: none; }
    92%, 100% { opacity: 0; transform: translateY(-6%); }
}

@keyframes hf-premade-press-stroke {
    0%, 60%, 84%, 100% { transform: translateY(0); }
    70%, 76% { transform: translateY(10.65%); }
}

@keyframes hf-premade-carriage-load {
    0%, 70%, 76%, 100% { transform: translateY(0); }
    72%, 74% { transform: translateY(2.2%); }
}

@keyframes hf-premade-open-out {
    0%, 95% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes hf-premade-sample-in {
    0%, 81% { opacity: 0; }
    95%, 100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hf-premade-film-photo.is-previewing .hf-premade-film-stage * { animation: none; }

    .hf-premade-film-photo.is-previewing .hf-premade-film-product {
        opacity: 1;
        transform: var(--hero);
    }

    .hf-premade-film-photo.is-previewing .hf-premade-film-open { opacity: 0; }
    .hf-premade-film-photo.is-previewing .hf-premade-film-result { opacity: 1; }
}
