/* Scale each 3:2 scene proportionally, independently of the page height. */
.rt-site-floor {
    --floor-transition:clamp(520px,65vw,960px);
    --floor-crossfade:160px;
    --floor-intro-fade:180px;
    --floor-middle-size:min(100vw,var(--floor-middle-desktop-size,1536px));
    --floor-lower-size:min(100vw,var(--floor-lower-desktop-size,1536px));
    --floor-middle-image:var(--floor-middle-desktop-image,image-set(url('background-section-2.avif') type('image/avif'),url('background-section-2.webp') type('image/webp')));
    --floor-lower-image:var(--floor-lower-desktop-image,image-set(url('background-section-3.avif') type('image/avif'),url('background-section-3.webp') type('image/webp')));
    /* Keep the decorative box stable while the composition is fitted. */
    position:absolute; inset:0;
    z-index:-1; pointer-events:none; overflow:hidden;
    display:var(--floor-display,block); opacity:var(--floor-brightness,.55);
    /* Fade the scene itself instead of compositing a mask over the entire page. */
}
.rt-site-floor::before,.rt-site-floor::after {
    content:''; position:absolute; left:0; right:0;
    background-position:center top; background-repeat:repeat;
    transform:translateY(var(--floor-start,0px));
    -webkit-mask-composite:source-in; mask-composite:intersect;
}
.rt-site-floor::before {
    --tile-height:calc(var(--floor-middle-size) * 2 / 3);
    top:0; height:calc(var(--floor-transition) + var(--floor-crossfade));
    background-image:var(--floor-middle-image);
    background-size:var(--floor-middle-size) auto;
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 var(--floor-intro-fade),#000 calc(100% - 2 * var(--floor-crossfade)),transparent),repeating-linear-gradient(to bottom,transparent 0,#000 40px,#000 calc(var(--tile-height) - 40px),transparent var(--tile-height));
    mask-image:linear-gradient(to bottom,transparent,#000 var(--floor-intro-fade),#000 calc(100% - 2 * var(--floor-crossfade)),transparent),repeating-linear-gradient(to bottom,transparent 0,#000 40px,#000 calc(var(--tile-height) - 40px),transparent var(--tile-height));
}
.rt-site-floor::after {
    --tile-height:calc(var(--floor-lower-size) * 2 / 3);
    top:calc(var(--floor-transition) - var(--floor-crossfade)); bottom:0;
    background-image:var(--floor-lower-image);
    background-size:var(--floor-lower-size) auto;
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 calc(2 * var(--floor-crossfade))),repeating-linear-gradient(to bottom,transparent 0,#000 40px,#000 calc(var(--tile-height) - 40px),transparent var(--tile-height));
    mask-image:linear-gradient(to bottom,transparent,#000 calc(2 * var(--floor-crossfade))),repeating-linear-gradient(to bottom,transparent 0,#000 40px,#000 calc(var(--tile-height) - 40px),transparent var(--tile-height));
}
.rt-site-floor[data-floor-third="off"]::before {
    bottom:0; height:auto;
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 var(--floor-intro-fade)),repeating-linear-gradient(to bottom,transparent 0,#000 40px,#000 calc(var(--tile-height) - 40px),transparent var(--tile-height));
    mask-image:linear-gradient(to bottom,transparent,#000 var(--floor-intro-fade)),repeating-linear-gradient(to bottom,transparent 0,#000 40px,#000 calc(var(--tile-height) - 40px),transparent var(--tile-height));
}
.rt-site-floor[data-floor-third="off"]::after { display:none; }
/* The third scene starts near the FAQ, outside the initial viewport. */
.home .rt-site-floor:not([data-floor-lower-ready="on"])::after { background-image:none; }
@media(max-width:720px) {
    .rt-site-floor {
        --floor-transition:620px;
        --floor-crossfade:120px;
        --floor-intro-fade:140px;
        --floor-middle-size:var(--floor-middle-mobile-size,560px);
        --floor-lower-size:var(--floor-lower-mobile-size,560px);
        --floor-middle-image:var(--floor-middle-mobile-image,image-set(url('background-section-2-768w.avif') 1x type('image/avif'),url('background-section-2-1024w.avif') 1.8x type('image/avif'),url('background-section-2-1120w.avif') 2x type('image/avif'),url('background-section-2.avif') 3x type('image/avif'),url('background-section-2-768w.webp') 1x type('image/webp'),url('background-section-2-1024w.webp') 1.8x type('image/webp'),url('background-section-2-1120w.webp') 2x type('image/webp'),url('background-section-2.webp') 3x type('image/webp')));
        --floor-lower-image:var(--floor-lower-mobile-image,image-set(url('background-section-3-768w.avif') 1x type('image/avif'),url('background-section-3-1024w.avif') 1.8x type('image/avif'),url('background-section-3-1120w.avif') 2x type('image/avif'),url('background-section-3.avif') 3x type('image/avif'),url('background-section-3-768w.webp') 1x type('image/webp'),url('background-section-3-1024w.webp') 1.8x type('image/webp'),url('background-section-3-1120w.webp') 2x type('image/webp'),url('background-section-3.webp') 3x type('image/webp')));
    }
}
