/*
 * FC Integration - rendering optimisations (2026-10-26).
 * The existing visual design, blur, colour filters and animations are retained.
 */

/* Avoid layout and repaint caused by rewriting the scrollbar's height on scroll. */
.scrollbar span{
  height:100%;
  min-height:0;
  transform:translateX(-1px) scaleY(.126316);
  transform-origin:50% 0;
  will-change:transform;
}

/*
 * Same visual grain texture, rasterized once rather than using a live SVG
 * turbulence filter. Opacity and soft-light blending are unchanged.
 */
.noise{
  background-image:url("../img/effects/noise-tile.png");
  contain:paint;
}

/* Enabled only after JS measures the real heights for the current viewport.
   Keeps anchor positions and scroll height stable while skipping offscreen paint. */
@supports (content-visibility:auto){
  .fci-virtual .legacy-feature,
  .fci-virtual .legacy-gallery figure,
  .fci-virtual .legacy-tile{
    content-visibility:auto;
  }
  .page-image-break{
    content-visibility:auto; /* already has an explicit CSS height */
  }
}

/* 2026-10-26 - Inner page compositor fix.
 * The full-viewport grain remains, but avoids continuously sampling and
 * blending every scrolling layer. The home page is intentionally unchanged.
 * This is a small approximation of the original soft-light grain effect.
 */
body:not(.home-page) > .noise{
  mix-blend-mode:normal;
  opacity:.07;
}

/* Optional comparison: services.html?original-grain=1 */
body:not(.home-page).fci-original-grain > .noise{
  mix-blend-mode:soft-light;
}
