(() => { "use strict"; const init = () => { const body = document.body; if (!body || !body.classList.contains("bp7150-paper-system")) return; const cards = body.querySelectorAll( ".bp7140-card, .bp7140-route-card, .bp7140-release-card, .bp7140-relationship a" ); cards.forEach((card, index) => { card.classList.add("bp7150-card-indexed"); card.style.setProperty("--bp7150-stagger", String(index % 8)); }); const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)"); if (!reduceMotion.matches) { const media = body.querySelectorAll( ".bp7140-hero__media, .bp7140-article-hero__media, .bp7140-route-card__media, .bp7140-release-card__media" ); media.forEach((surface) => { surface.classList.add("bp7150-coated-media"); let frame = 0; let pointerX = 64; let pointerY = 24; const paint = () => { frame = 0; surface.style.setProperty("--bp7150-x", `${pointerX.toFixed(2)}%`); surface.style.setProperty("--bp7150-y", `${pointerY.toFixed(2)}%`); }; const queuePaint = (event) => { const bounds = surface.getBoundingClientRect(); if (!bounds.width || !bounds.height) return; pointerX = ((event.clientX - bounds.left) / bounds.width) * 100; pointerY = ((event.clientY - bounds.top) / bounds.height) * 100; if (!frame) frame = window.requestAnimationFrame(paint); }; surface.addEventListener("pointerenter", () => { surface.classList.add("is-sheen-active"); }, { passive: true }); surface.addEventListener("pointermove", queuePaint, { passive: true }); surface.addEventListener("pointerleave", () => { surface.classList.remove("is-sheen-active"); pointerX = 64; pointerY = 24; if (!frame) frame = window.requestAnimationFrame(paint); }, { passive: true }); surface.addEventListener("focusin", () => { surface.classList.add("is-sheen-active"); }); surface.addEventListener("focusout", () => { surface.classList.remove("is-sheen-active"); }); }); } document.documentElement.classList.add("bp7150-paper-ready"); body.dataset.bp7150Release = "packaging-paper-system-v7.15.0"; }; if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", init, { once: true }); } else { init(); } })();