@property --percent {
    syntax: "<percent>";
    initial-value: 50%;
    inherits: false;
}
#gallery {
    --size: 100%;
    --gap: 10px;
    --space: 5px;
    position: relative;
    width: min(100%, 1600px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--size), 1fr));
    gap: var(--gap);
    /*padding: var(--gap);*/
}

@media (max-width: 800px) {
    #gallery {
        --size: 150px;
    }
}
.bg-image {
    --percent: 100%;
    --parallax-height: 200%;
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    gap: var(--space);
    padding-block: var(--space);
    padding-inline: var(--space);
    border-radius: 0;
    border: 0.1rem solid white;
    background-image: var(--img);
    background-size: auto var(--parallax-height);
    background-position: center bottom var(--percent);
    background-repeat: no-repeat;
    -webkit-animation: parallax linear both;
    animation: parallax linear both;
    animation-timeline: view();
    animation-range: cover;
    -webkit-animation-duration: 1ms;
    animation-duration: 1ms;
    transform: translateZ(0);
}
@-webkit-keyframes parallax {
    to {
        /*
        --percent: 0%;
        animation-timeline使うと何故か動かない
*/
        background-position: center bottom 0%;
    }
}
@keyframes parallax {
    to {
        /*
        --percent: 0%;
        animation-timeline使うと何故か動かない
*/
        background-position: center bottom 0%;
    }
}

.bg-image .blank {
    width: 100%;
    aspect-ratio: 1 / 1;
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
    touch-callout: none;
	height: 60vh;
}
.bg-image h2 {
    font-size: 1rem;
    text-transform: capitalize;
}
.bg-image * {
    mix-blend-mode: difference;
}
.bg-image::before {
    content: "image loading...";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: white;
    z-index: -1;
    mix-blend-mode: darken;
}
article:nth-child(5n of .bg-image) {
    --parallax-height: 450%;
}
article:nth-child(5n + 1 of .bg-image) {
    --parallax-height: 300%;
}
article:nth-child(5n + 2 of .bg-image) {
    --parallax-height: 240%;
}
article:nth-child(5n + 3 of .bg-image) {
    --parallax-height: 400%;
}
article:nth-child(5n + 4 of .bg-image) {
    --parallax-height: 320%;
}