@property --hf-fill-progress {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

.hf-fill-preview {
    --cycle: 3.55s;
    --stroke-ease: cubic-bezier(.37, 0, .23, 1);
    --hero: translateY(-6px) scale(1.07);
    position: absolute;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.hf-fill-product,
.hf-fill-tool,
.hf-fill-stream,
.hf-fill-finished {
    opacity: 0;
}

.hf-fill-product {
    transform-box: view-box;
    transform-origin: 50% 68%;
}

.hf-fill-liquid {
    transform: translateY(calc(198px * (1 - var(--hf-fill-progress))));
}

.hf-fill-stream {
    transform-box: view-box;
    transform-origin: 200px 137px;
    transform: scaleY(clamp(0, calc((179 - 198 * var(--hf-fill-progress)) / 175), 1));
}

.hf-liquid-filling-photo.is-previewing .hf-fill-preview { visibility: visible; }

.hf-liquid-filling-photo.is-previewing .hf-fill-scene {
    animation: hf-fill-dosing var(--cycle) linear both;
}

.hf-liquid-filling-photo.is-previewing .hf-fill-product {
    animation: hf-fill-product-in var(--cycle) var(--stroke-ease) both;
}

.hf-liquid-filling-photo.is-previewing .hf-fill-tool {
    animation: hf-fill-tool-view var(--cycle) ease-in-out both;
}

.hf-liquid-filling-photo.is-previewing .hf-fill-stroke {
    animation: hf-fill-nozzle-stroke var(--cycle) var(--stroke-ease) both;
}

.hf-liquid-filling-photo.is-previewing .hf-fill-stream {
    animation: hf-fill-stream-flow var(--cycle) linear both;
}

.hf-liquid-filling-photo.is-previewing .hf-fill-finished {
    animation: hf-fill-photo-in var(--cycle) ease-in-out both;
}

.hf-liquid-filling-photo.is-previewing .hf-fill-process {
    animation: hf-fill-process-out var(--cycle) step-end both;
}

@keyframes hf-fill-product-in {
    0% { opacity: 0; transform: translateY(4px) scale(.985); }
    10%, 84% { opacity: 1; transform: none; }
    100% { opacity: 1; transform: var(--hero); }
}

@keyframes hf-fill-tool-view {
    0%, 92%, 100% { opacity: 0; }
    10%, 83% { opacity: 1; }
}

@keyframes hf-fill-nozzle-stroke {
    0%, 14%, 87%, 100% { transform: translateY(0); }
    30%, 75% { transform: translateY(49px); }
}

@keyframes hf-fill-dosing {
    0%, 31% { --hf-fill-progress: 0; }
    65% { --hf-fill-progress: .79; }
    74%, 100% { --hf-fill-progress: 1; }
}

@keyframes hf-fill-stream-flow {
    0%, 30%, 75%, 100% { opacity: 0; }
    32%, 73% { opacity: .88; }
}

@keyframes hf-fill-photo-in {
    0%, 88% { opacity: 0; }
    99%, 100% { opacity: 1; }
}

@keyframes hf-fill-process-out {
    0% { opacity: 1; }
    99%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hf-liquid-filling-photo.is-previewing .hf-fill-scene,
    .hf-liquid-filling-photo.is-previewing .hf-fill-scene * { animation: none; }

    .hf-liquid-filling-photo.is-previewing .hf-fill-product {
        opacity: 1;
        transform: var(--hero);
    }

    .hf-fill-process { opacity: 0; }
    .hf-fill-finished { opacity: 1; }
}
