/* Live typeface scenes, mounted over their still images by scenes/index.js. */
/* display is forced because the image block hides one child per breakpoint. */
.newa-scene {
  display: block !important;
  position: absolute;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
  user-select: none;
  -webkit-user-select: none;
}
.newa-scene.is-ready {
  opacity: 1;
}
.newa-scene__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0 !important;
  border-radius: 0 !important;
}

/* The posters float on the page: no frame round the still or the scene, and
   nothing clipped at the edge of the box. The still is a cut-out of the same
   picture, and gives way to the scene once that is ready. */
html .image-block_container__JGwMj img[src*="/foundry/theme/images/"][src*="-poster-"] {
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transition: opacity 0.5s ease;
}
html .image-block_container__JGwMj:has(> .newa-scene--float.is-ready) img {
  opacity: 0;
}
.newa-scene--float {
  overflow: visible;
  border-radius: 0 !important;
  background: none;
}
/* The poster wall and the Nimbo shelves run on in every direction: out to
   both edges of the window, and up and down behind the type testers either
   side, fading out as they go under them (index.js sizes the boxes; see
   BLEED there). Each fade is eased (smootherstep, f) so it has no edge.
   Between the two the fades cover the same stretch of page, and there the
   shelves (on top) fade in as f(t) while the wall below holds on, fading as
   1 - f(t)^3: the page shows through at most (1 - f)(f^3), a few percent,
   so the colours stay full where they meet instead of washing out. */
.newa-scene--float[data-scene="cumulo-poster-1"],
.newa-scene--float[data-scene="cumulo-poster-2"] {
  z-index: 0;
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}
.newa-scene--float[data-scene="cumulo-poster-1"] {
  --fade: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.000) calc(var(--bleed-top, 16%) * 0.000),
    rgba(0, 0, 0, 0.005) calc(var(--bleed-top, 16%) * 0.083),
    rgba(0, 0, 0, 0.035) calc(var(--bleed-top, 16%) * 0.167),
    rgba(0, 0, 0, 0.104) calc(var(--bleed-top, 16%) * 0.250),
    rgba(0, 0, 0, 0.210) calc(var(--bleed-top, 16%) * 0.333),
    rgba(0, 0, 0, 0.347) calc(var(--bleed-top, 16%) * 0.417),
    rgba(0, 0, 0, 0.500) calc(var(--bleed-top, 16%) * 0.500),
    rgba(0, 0, 0, 0.653) calc(var(--bleed-top, 16%) * 0.583),
    rgba(0, 0, 0, 0.790) calc(var(--bleed-top, 16%) * 0.667),
    rgba(0, 0, 0, 0.896) calc(var(--bleed-top, 16%) * 0.750),
    rgba(0, 0, 0, 0.965) calc(var(--bleed-top, 16%) * 0.833),
    rgba(0, 0, 0, 0.995) calc(var(--bleed-top, 16%) * 0.917),
    rgba(0, 0, 0, 1.000) calc(var(--bleed-top, 16%) * 1.000),
    rgba(0, 0, 0, 1.000) calc(100% - var(--bleed-bottom, 16%) * 1.000),
    rgba(0, 0, 0, 1.000) calc(100% - var(--bleed-bottom, 16%) * 0.917),
    rgba(0, 0, 0, 1.000) calc(100% - var(--bleed-bottom, 16%) * 0.833),
    rgba(0, 0, 0, 0.999) calc(100% - var(--bleed-bottom, 16%) * 0.750),
    rgba(0, 0, 0, 0.991) calc(100% - var(--bleed-bottom, 16%) * 0.667),
    rgba(0, 0, 0, 0.958) calc(100% - var(--bleed-bottom, 16%) * 0.583),
    rgba(0, 0, 0, 0.875) calc(100% - var(--bleed-bottom, 16%) * 0.500),
    rgba(0, 0, 0, 0.721) calc(100% - var(--bleed-bottom, 16%) * 0.417),
    rgba(0, 0, 0, 0.507) calc(100% - var(--bleed-bottom, 16%) * 0.333),
    rgba(0, 0, 0, 0.280) calc(100% - var(--bleed-bottom, 16%) * 0.250),
    rgba(0, 0, 0, 0.103) calc(100% - var(--bleed-bottom, 16%) * 0.167),
    rgba(0, 0, 0, 0.015) calc(100% - var(--bleed-bottom, 16%) * 0.083),
    rgba(0, 0, 0, 0.000) calc(100% - var(--bleed-bottom, 16%) * 0.000)
  );
}
.newa-scene--float[data-scene="cumulo-poster-2"] {
  --fade: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.000) calc(var(--bleed-top, 16%) * 0.000),
    rgba(0, 0, 0, 0.005) calc(var(--bleed-top, 16%) * 0.083),
    rgba(0, 0, 0, 0.035) calc(var(--bleed-top, 16%) * 0.167),
    rgba(0, 0, 0, 0.104) calc(var(--bleed-top, 16%) * 0.250),
    rgba(0, 0, 0, 0.210) calc(var(--bleed-top, 16%) * 0.333),
    rgba(0, 0, 0, 0.347) calc(var(--bleed-top, 16%) * 0.417),
    rgba(0, 0, 0, 0.500) calc(var(--bleed-top, 16%) * 0.500),
    rgba(0, 0, 0, 0.653) calc(var(--bleed-top, 16%) * 0.583),
    rgba(0, 0, 0, 0.790) calc(var(--bleed-top, 16%) * 0.667),
    rgba(0, 0, 0, 0.896) calc(var(--bleed-top, 16%) * 0.750),
    rgba(0, 0, 0, 0.965) calc(var(--bleed-top, 16%) * 0.833),
    rgba(0, 0, 0, 0.995) calc(var(--bleed-top, 16%) * 0.917),
    rgba(0, 0, 0, 1.000) calc(var(--bleed-top, 16%) * 1.000),
    rgba(0, 0, 0, 1.000) calc(100% - var(--bleed-bottom, 16%) * 1.000),
    rgba(0, 0, 0, 0.995) calc(100% - var(--bleed-bottom, 16%) * 0.917),
    rgba(0, 0, 0, 0.965) calc(100% - var(--bleed-bottom, 16%) * 0.833),
    rgba(0, 0, 0, 0.896) calc(100% - var(--bleed-bottom, 16%) * 0.750),
    rgba(0, 0, 0, 0.790) calc(100% - var(--bleed-bottom, 16%) * 0.667),
    rgba(0, 0, 0, 0.653) calc(100% - var(--bleed-bottom, 16%) * 0.583),
    rgba(0, 0, 0, 0.500) calc(100% - var(--bleed-bottom, 16%) * 0.500),
    rgba(0, 0, 0, 0.347) calc(100% - var(--bleed-bottom, 16%) * 0.417),
    rgba(0, 0, 0, 0.210) calc(100% - var(--bleed-bottom, 16%) * 0.333),
    rgba(0, 0, 0, 0.104) calc(100% - var(--bleed-bottom, 16%) * 0.250),
    rgba(0, 0, 0, 0.035) calc(100% - var(--bleed-bottom, 16%) * 0.167),
    rgba(0, 0, 0, 0.005) calc(100% - var(--bleed-bottom, 16%) * 0.083),
    rgba(0, 0, 0, 0.000) calc(100% - var(--bleed-bottom, 16%) * 0.000)
  );
}
/* The type testers sit over the wall where it runs under them. */
html [class*="blocks-container_container"]:has(> .image-block_container__JGwMj > .newa-scene[data-scene="cumulo-poster-1"])
  > [class*="font-display_font-display"] {
  position: relative;
  z-index: 1;
}
/* Below 900px the image block hides every descendant but its phone-size
   image, which would take the scene's canvas with it and leave the box
   empty now that the still gives way. The canvas stays. */
html .image-block_container__JGwMj .newa-scene > canvas {
  display: block !important;
}

/* The fanned books run under the type tester that follows them. */
html [class*="font-display_font-display__"] {
  z-index: 1;
}

/* Let the bottle canvas cross its image block without clipping silhouettes. */
html .image-block_container__JGwMj:has(.newa-scene[data-scene="venturous-poster-3"]),
html .image-block_container__JGwMj:has(.newa-scene[data-scene="venturous-poster-3"]) > figure {
  overflow: visible;
}

/* The fallback is a different arrangement from the live rigid-body pile.
   Do not crossfade their silhouettes during the first half-second of the drop. */
.newa-scene[data-scene="venturous-poster-3"],
html .image-block_container__JGwMj img[src*="/foundry/theme/images/"][src*="venturous-poster-3"] {
  transition: none;
}
html .image-block_container__JGwMj:has(> .newa-scene[data-scene="venturous-poster-3"])
  img[src*="venturous-poster-3"] {
  opacity: 0;
}
