Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
/* MCM · comportamiento del prototipo (en Bricks: elemento Code o script en la página) */
(function () {
'use strict';
var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches || /[?&]stillb/.test(location.search); // ?still = estado final sin animación (capturas)
/* Header: sombra al hacer scroll + menú móvil */
var header = document.getElementById('header');
var burger = document.getElementById('burger');
var nav = document.getElementById('nav');
function onScroll() { header.classList.toggle('is-stuck', window.scrollY > 8); }
onScroll();
window.addEventListener('scroll', onScroll, { passive: true });
burger.addEventListener('click', function () {
var open = nav.classList.toggle('is-open');
burger.setAttribute('aria-expanded', String(open));
burger.setAttribute('aria-label', open ? 'Cerrar menú' : 'Abrir menú');
});
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape' && nav.classList.contains('is-open')) { burger.click(); burger.focus(); }
});
var year = document.getElementById('year');
if (year) year.textContent = new Date().getFullYear();
/* Curva de la falla: se dibuja al entrar en pantalla */
var chain = document.getElementById('chain');
if (chain) {
if ('IntersectionObserver' in window && !reduce) {
chain.classList.add('is-ready');
var io = new IntersectionObserver(function (es) {
es.forEach(function (e) { if (e.isIntersecting) { chain.classList.add('is-in'); io.disconnect(); } });
}, { threshold: 0.35 });
io.observe(chain);
}
}
/* Carrusel de logos: pausa manual (WCAG 2.2.2) */
var marquee = document.getElementById('marquee');
var toggle = document.getElementById('marquee-toggle');
if (marquee && toggle) {
toggle.addEventListener('click', function () {
var paused = marquee.classList.toggle('is-paused');
toggle.setAttribute('aria-pressed', String(paused));
toggle.setAttribute('aria-label', paused ? 'Reanudar carrusel de logos' : 'Pausar carrusel de logos');
toggle.querySelector('use').setAttribute('href', paused ? '#i-play' : '#i-pause');
});
}
})();