/* ============================================================
   SB PERF — scroll smoothness + load performance
   (loaded last so it can trim expensive effects elsewhere)
   ============================================================ */

/* native scrolling, nothing eased or hijacked */
html { scroll-behavior: auto; }
html:focus-within { scroll-behavior: auto; }

/* 1 · the floating buttons are solid colours: no per-frame backdrop blur behind them */
.float-btn,
#chat-toggle {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 2 · GPU layers only where they are moving right now:
      hero layers keep will-change only while the hero is near the viewport (heroes.js sets .is-live) */
.m4 .m4-hero:not(.is-live) .m4-hero__house,
.m4 .m4-hero:not(.is-live) .m4-hero__composite,
.m4 .m4-hero:not(.is-live) .m4-hero__logo,
.m4 .m4-hero:not(.is-live) .m4-hero__content,
.m4 .m4-hero:not(.is-live) .m4-hero__cloud,
.m4 .m4-hero:not(.is-live) .m4-hero__bank-layer,
.m4 .m4-hero:not(.is-live) .m4-hero__bank-layer--veil,
.m4 .m4-hero:not(.is-live) .m4-hero__puff,
.m4 .m4-hero:not(.is-live) .m4-hero__smoke {
  will-change: auto !important;
}

/* split text lines animate once; they don't need permanent layers afterwards */
[data-split-done],
[data-split-done] .line { will-change: auto !important; }

/* 3 · the long static sections below the projects are skipped by layout & paint until they approach */
#about,
#location,
#site-visit {
  content-visibility: auto;
  contain-intrinsic-size: auto 1200px;
}

.sb-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 100vh;
}

/* 4 · nothing in the page may cause horizontal scroll (which stalls touch scrolling) */
html, body { overflow-x: clip; }

@media (prefers-reduced-motion: reduce) {
  .m4 .m4-hero * { will-change: auto !important; }
}
