// Penumbrai marketing — light progressive enhancement only. (function () { "use strict"; // Sticky nav state var nav = document.getElementById("nav"); var onScroll = function () { if (window.scrollY > 24) nav.classList.add("scrolled"); else nav.classList.remove("scrolled"); }; window.addEventListener("scroll", onScroll, { passive: true }); onScroll(); // Reveal-on-scroll for major blocks var targets = document.querySelectorAll( ".section, .feature, .card, .plan, .definition, .compare__col, .schema" ); targets.forEach(function (el) { el.classList.add("reveal"); }); if ("IntersectionObserver" in window) { var io = new IntersectionObserver(function (entries) { entries.forEach(function (e) { if (e.isIntersecting) { e.target.classList.add("in"); io.unobserve(e.target); } }); }, { threshold: 0.12, rootMargin: "0px 0px -8% 0px" }); targets.forEach(function (el) { io.observe(el); }); } else { targets.forEach(function (el) { el.classList.add("in"); }); } // Demo form — front-end only stub (wires to /api/leads once deployed) var form = document.getElementById("demoForm"); var note = document.getElementById("formNote"); if (form) { form.addEventListener("submit", function (ev) { ev.preventDefault(); var email = form.email.value.trim(); var ok = /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email); if (!ok) { note.textContent = "Please enter a valid work email."; note.style.color = "var(--risk)"; form.email.focus(); return; } note.textContent = "Thanks — we'll be in touch within one business day."; note.style.color = "var(--good)"; form.reset(); }); } })();