// Cursor-tracked foil. Updates two CSS custom properties on the
// .holo-badge so the conic gradient and the sheen highlight follow
// the pointer. mouseleave resets so the badge isn't stuck mid-tilt.
document.querySelectorAll('.holo-badge').forEach(function (badge) {
badge.addEventListener('mousemove', function (e) {
var r = badge.getBoundingClientRect();
var x = ((e.clientX - r.left) / r.width) * 100;
var y = ((e.clientY - r.top) / r.height) * 100;
badge.style.setProperty('--mx', x + '%');
badge.style.setProperty('--my', y + '%');
badge.style.setProperty('--angle', (x * 3.6) + 'deg');
});
badge.addEventListener('mouseleave', function () {
badge.style.setProperty('--mx', '50%');
badge.style.setProperty('--my', '50%');
});
});