/** * @name LANDING_SCRIPT * @description Tiny scroll-driven animation controller for the public protocol engine scene. */ export declare const LANDING_SCRIPT = "\n(() => {\n const dropdowns = Array.from(document.querySelectorAll('[data-nav-dropdown]'));\n const mobileToggle = document.querySelector('[data-mobile-nav-toggle]');\n const mobilePanel = document.querySelector('#mobile-nav-panel');\n const mobileCloseTargets = Array.from(document.querySelectorAll('[data-mobile-nav-close], [data-mobile-nav-link]'));\n const setDetectedOs = () => {\n const platform = String(navigator.platform || '').toLowerCase();\n const userAgent = String(navigator.userAgent || '').toLowerCase();\n const os = userAgent.includes('windows') || platform.includes('win')\n ? 'windows'\n : userAgent.includes('linux') || platform.includes('linux')\n ? 'linux'\n : 'macos';\n document.documentElement.dataset.os = os;\n };\n\n setDetectedOs();\n\n const setMobileNavOpen = (isOpen) => {\n document.documentElement.classList.toggle('mobile-nav-open', isOpen);\n\n if (mobileToggle) {\n mobileToggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');\n mobileToggle.setAttribute('aria-label', isOpen ? 'Close navigation' : 'Open navigation');\n }\n\n if (mobilePanel) {\n mobilePanel.setAttribute('aria-hidden', isOpen ? 'false' : 'true');\n }\n };\n\n if (mobileToggle) {\n mobileToggle.addEventListener('click', () => {\n setMobileNavOpen(!document.documentElement.classList.contains('mobile-nav-open'));\n });\n }\n\n mobileCloseTargets.forEach((target) => {\n target.addEventListener('click', () => {\n setMobileNavOpen(false);\n });\n });\n\n dropdowns.forEach((dropdown) => {\n dropdown.addEventListener('toggle', () => {\n if (!dropdown.open) {\n return;\n }\n\n dropdowns.forEach((other) => {\n if (other !== dropdown) {\n other.open = false;\n }\n });\n });\n });\n\n document.addEventListener('pointerdown', (event) => {\n const target = event.target;\n if (!(target instanceof Node)) {\n return;\n }\n\n if (dropdowns.some((dropdown) => dropdown.contains(target))) {\n return;\n }\n\n dropdowns.forEach((dropdown) => {\n dropdown.open = false;\n });\n }, { passive: true });\n\n document.addEventListener('keydown', (event) => {\n if (event.key !== 'Escape') {\n return;\n }\n\n dropdowns.forEach((dropdown) => {\n dropdown.open = false;\n });\n setMobileNavOpen(false);\n });\n\n const scene = document.querySelector('[data-engine-scene]');\n const machine = document.querySelector('[data-machine-section]');\n if ((!scene && !machine) || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {\n return;\n }\n\n const clamp = (value, min, max) => Math.max(min, Math.min(max, value));\n let ticking = false;\n\n const update = () => {\n if (scene) {\n const rect = scene.getBoundingClientRect();\n const progress = clamp((window.innerHeight - rect.top) / (window.innerHeight + rect.height), 0, 1);\n scene.style.setProperty('--engine-tilt', String(-12 + progress * 20) + 'deg');\n scene.style.setProperty('--engine-spin', String(progress * 48) + 'deg');\n scene.style.setProperty('--orbit-a', String(progress * -120) + 'deg');\n scene.style.setProperty('--orbit-b', String(progress * 150) + 'deg');\n scene.style.setProperty('--orbit-c', String(progress * 90) + 'deg');\n scene.style.setProperty('--chip-spread', String(progress * 24) + 'px');\n scene.style.setProperty('--hero-glow', String(.14 + progress * .34));\n }\n\n if (machine) {\n const rect = machine.getBoundingClientRect();\n const progress = clamp((window.innerHeight - rect.top) / (window.innerHeight + rect.height), 0, 1);\n machine.style.setProperty('--machine-progress', progress.toFixed(3));\n machine.style.setProperty('--machine-open', String(progress * 150) + 'px');\n machine.style.setProperty('--machine-rotate', String(-8 + progress * 16) + 'deg');\n machine.style.setProperty('--machine-fade', String(.18 + progress * .82));\n machine.style.setProperty('--machine-rail-scale', String(.4 + progress * .6));\n }\n ticking = false;\n };\n\n const requestUpdate = () => {\n if (!ticking) {\n window.requestAnimationFrame(update);\n ticking = true;\n }\n };\n\n update();\n window.addEventListener('scroll', requestUpdate, { passive: true });\n window.addEventListener('resize', requestUpdate);\n})();\n"; //# sourceMappingURL=scripts.d.ts.map