/* Pixel scroll (assets/js/pixel.js). Only applies once the script has set the section up. */

.px-on {
  position: relative;
  height: calc(var(--px-length, 3) * 100svh);
  padding-block: 0 !important;
  background: transparent !important;   /* the canvas paints both states */
  border-top: 0 !important;
  overflow-x: clip;   /* clip (not hidden) keeps position: sticky working */
}
.px-on .px__stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  margin-inline: calc(50% - 50vw);   /* full-bleed past the section padding */
  display: flex; align-items: center;
  isolation: isolate;   /* the content blends only with the canvas */
}
.px-on .px__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.px-on .px__stage > .ed-wrap {
  position: relative; z-index: 1; width: 100%; max-width: none;
  padding-inline: max(var(--pad-x), calc((100% - var(--max-w)) / 2));   /* same edges as every other section */
  /* lighten = max(content, canvas): every content colour is darker than the page colour, so on it
     the content vanishes exactly; on black pixels it shows as-is. Text and buttons reveal pixel by pixel. */
  mix-blend-mode: lighten;
}
