/* OpenHero source by Cristian Olivera Chávez. MIT License Copyright (c) 2026 Cristian Olivera Chávez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ "use client"; import { useEffect, useRef } from "react"; import { Icon } from "@iconify/react"; export default function Page() { const cursorRef = useRef(null); const auraRef = useRef(null); const scrollLineRef = useRef(null); const lightCorridorRef = useRef(null); const portalVideoRef = useRef(null); const heroTextRef = useRef(null); const heroRef = useRef(null); const dustCanvasRef = useRef(null); const circValRef = useRef(null); const c1Ref = useRef(null); const c2Ref = useRef(null); const c3Ref = useRef(null); const fallbackRef = useRef(null); const tickerItems = [ ["Atmospheric O₂", "+340 ppm"], ["Regolith pH", "6.8 optimal"], ["Photon density", "1,240 μmol/m²/s"], ["Growth sync", "Circadian 98.2%"], ["CO₂ scrub rate", "14.2 t/day"], ["Biomass yield", "340% above baseline"], ["Lunar soil enrichment", "Phase III active"], ]; const scrubberBars = [45, 62, 38, 78, 55, 85, 42, 70, 58, 88, 44, 66, 52, 80, 48, 72, 60, 90, 38, 68]; const regolithItems = [ { icon: "material-symbols:light-mode-outline-rounded", className: "ri-gold", name: "Photosynthetic Rate", value: "2,400×", }, { icon: "material-symbols:eco-outline-rounded", className: "ri-green", name: "Biomass Conversion", value: "94.8%", }, { icon: "material-symbols:water-drop-outline-rounded", className: "ri-silver", name: "Water Use Efficiency", value: "−82%", }, ]; const cards = [ { icon: "material-symbols:biotech-outline-rounded", title: "Lunar-Regolith\nEnrichment", text: "Iron-depleted regolith inoculated with nitrogen-fixing archaeal strains. Achieves agricultural-grade soil in 8 lunar cycles.", metric: "8", metricSuffix: " cycles", metricLabel: "To fertile soil", progress: "73%", iconStyle: {}, }, { icon: "material-symbols:forest-outline-rounded", title: "Synthetic Crop\nGenome", text: "CRISPR-optimised C4 photosynthesis pathway embedded in staple crops, tolerant of 0.3 atm pressure and −40°C diurnal variance.", metric: "340", metricSuffix: "%", metricLabel: "Yield uplift", progress: "91%", iconStyle: { background: "oklch(72% 0.14 145 / 0.1)", borderColor: "oklch(72% 0.14 145 / 0.2)", color: "var(--leaf-green)", }, }, { icon: "material-symbols:satellite-alt-outline-rounded", title: "Photon\nOptimisation", text: "Spectral tuning of supplemental grow-light arrays to match chlorophyll-a/b absorption maxima at 680nm and 700nm.", metric: "99.4", metricSuffix: "%", metricLabel: "Photon capture", progress: "99%", iconStyle: { background: "oklch(88% 0.03 100 / 0.08)", borderColor: "oklch(88% 0.03 100 / 0.15)", color: "var(--moon-silver)", }, }, ]; useEffect(() => { let mouseX = 0; let mouseY = 0; let auraX = 0; let auraY = 0; let ticking = false; const cursor = cursorRef.current; const aura = auraRef.current; const scrollLine = scrollLineRef.current; const lightCorridor = lightCorridorRef.current; const portalVideo = portalVideoRef.current; const heroText = heroTextRef.current; const hero = heroRef.current; const canvas = dustCanvasRef.current; const circVal = circValRef.current; const c1 = c1Ref.current; const c2 = c2Ref.current; const c3 = c3Ref.current; const fallback = fallbackRef.current; const animateCount = ( el: HTMLSpanElement | null, target: number, duration: number, decimals = 0 ) => { if (!el) return; const start = performance.now(); const step = (now: number) => { const progress = Math.min((now - start) / duration, 1); const eased = 1 - Math.pow(1 - progress, 4); const value = target * eased; el.textContent = decimals ? value.toFixed(decimals) : String(Math.round(value)); if (progress < 1) requestAnimationFrame(step); }; requestAnimationFrame(step); }; const handleMouseMove = (e: MouseEvent) => { mouseX = e.clientX; mouseY = e.clientY; if (cursor) { cursor.style.left = `${mouseX}px`; cursor.style.top = `${mouseY}px`; } }; const animateAura = () => { auraX += (mouseX - auraX) * 0.1; auraY += (mouseY - auraY) * 0.1; if (aura) { aura.style.left = `${auraX}px`; aura.style.top = `${auraY}px`; } requestAnimationFrame(animateAura); }; const handleMouseDown = () => { if (cursor) cursor.style.transform = "translate(-50%, -50%) scale(0.5)"; }; const handleMouseUp = () => { if (cursor) cursor.style.transform = "translate(-50%, -50%) scale(1)"; }; const hoverables = document.querySelectorAll( ".btn-dew, .cta-submit, .bio-card, .regolith-item, a, button" ); hoverables.forEach((el) => { el.addEventListener("mouseenter", () => aura?.classList.add("hovering")); el.addEventListener("mouseleave", () => aura?.classList.remove("hovering")); el.addEventListener("mousemove", (ev: Event) => { const e = ev as MouseEvent; const rect = el.getBoundingClientRect(); const x = ((e.clientX - rect.left) / rect.width) * 100; const y = ((e.clientY - rect.top) / rect.height) * 100; el.style.setProperty("--mx", `${x}%`); el.style.setProperty("--my", `${y}%`); }); }); const handleScroll = () => { if (ticking) return; ticking = true; requestAnimationFrame(() => { const scrolled = window.scrollY; const maxScroll = document.body.scrollHeight - window.innerHeight || 1; const pct = (scrolled / maxScroll) * 100; if (scrollLine) scrollLine.style.width = `${pct}%`; if (lightCorridor) { const hueRotate = Math.min(scrolled * 0.15, 180); lightCorridor.style.filter = `hue-rotate(${hueRotate}deg)`; lightCorridor.style.transform = `translateX(-50%) translateY(${scrolled * 0.2}px) scale(${1 + scrolled * 0.0005})`; } if (portalVideo && scrolled < window.innerHeight * 1.5) { portalVideo.style.transform = `scale(${1.02 + scrolled * 0.0002}) translateY(${scrolled * 0.1}px)`; } if (heroText && scrolled < window.innerHeight) { heroText.style.transform = `translateY(${scrolled * -0.08}px)`; } const parallaxCards = document.querySelectorAll(".parallax-card"); parallaxCards.forEach((card) => { const rect = card.getBoundingClientRect(); if (rect.top < window.innerHeight && rect.bottom > 0) { const yOffset = (window.innerHeight - rect.top) * 0.05; card.style.transform = `translateY(-${yOffset}px)`; } }); ticking = false; }); }; const heroObserver = new IntersectionObserver( (entries, obs) => { if (entries[0]?.isIntersecting) { setTimeout(() => animateCount(c1, 94, 2200), 1400); setTimeout(() => animateCount(c2, 14200, 2400), 1500); setTimeout(() => animateCount(c3, 34, 2000), 1600); obs.disconnect(); } }, { threshold: 0.3 } ); if (hero) heroObserver.observe(hero); const bloomObserver = new IntersectionObserver( (entries, obs) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.classList.add("bloomed"); obs.unobserve(entry.target); } }); }, { threshold: 0.12, rootMargin: "0px 0px -40px 0px" } ); document.querySelectorAll(".bloom-reveal").forEach((el) => bloomObserver.observe(el)); const barsWrap = document.getElementById("scrubber-bars"); if (barsWrap) { barsWrap.innerHTML = ""; scrubberBars.forEach((h, i) => { const bar = document.createElement("div"); bar.className = "scrubber-bar"; bar.style.height = `${h}%`; bar.style.animationDelay = `${i * 0.15}s`; bar.style.animationDuration = `${2.5 + Math.random()}s`; barsWrap.appendChild(bar); }); } const updateClock = () => { if (!circVal) return; const now = new Date(); const h = String(now.getHours()).padStart(2, "0"); const m = String(now.getMinutes()).padStart(2, "0"); circVal.textContent = `${h}:${m}`; }; updateClock(); const clockTimer = window.setInterval(updateClock, 1000); if (canvas) { const ctx = canvas.getContext("2d"); if (ctx) { const particles: Array<{ x: number; y: number; vx: number; vy: number; size: number; alpha: number; warm: boolean; }> = []; const resize = () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; }; resize(); window.addEventListener("resize", resize); for (let i = 0; i < 80; i++) { particles.push({ x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight, vx: (Math.random() - 0.5) * 0.25, vy: -Math.random() * 0.4 - 0.05, size: Math.random() * 2 + 0.5, alpha: Math.random() * 0.35 + 0.05, warm: Math.random() > 0.3, }); } const draw = () => { ctx.clearRect(0, 0, canvas.width, canvas.height); particles.forEach((p) => { p.x += p.vx + Math.sin(Date.now() * 0.0003 + p.y * 0.01) * 0.2; p.y += p.vy; if (p.y < -5) { p.y = canvas.height + 5; p.x = Math.random() * canvas.width; } ctx.beginPath(); ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2); ctx.fillStyle = p.warm ? `oklch(88% 0.14 85 / ${p.alpha})` : `oklch(72% 0.14 145 / ${p.alpha * 0.5})`; ctx.fill(); }); requestAnimationFrame(draw); }; draw(); const handleResizeCleanup = () => window.removeEventListener("resize", resize); return () => { handleResizeCleanup(); }; } } if (portalVideo && fallback) { const handleCanPlay = () => { fallback.style.opacity = "0"; fallback.style.transition = "opacity 1s"; }; const handleError = () => { portalVideo.style.display = "none"; }; portalVideo.addEventListener("canplay", handleCanPlay); portalVideo.addEventListener("error", handleError); animateAura(); window.addEventListener("mousemove", handleMouseMove); window.addEventListener("mousedown", handleMouseDown); window.addEventListener("mouseup", handleMouseUp); window.addEventListener("scroll", handleScroll, { passive: true }); handleScroll(); return () => { window.removeEventListener("mousemove", handleMouseMove); window.removeEventListener("mousedown", handleMouseDown); window.removeEventListener("mouseup", handleMouseUp); window.removeEventListener("scroll", handleScroll); window.clearInterval(clockTimer); heroObserver.disconnect(); bloomObserver.disconnect(); portalVideo.removeEventListener("canplay", handleCanPlay); portalVideo.removeEventListener("error", handleError); }; } animateAura(); window.addEventListener("mousemove", handleMouseMove); window.addEventListener("mousedown", handleMouseDown); window.addEventListener("mouseup", handleMouseUp); window.addEventListener("scroll", handleScroll, { passive: true }); handleScroll(); return () => { window.removeEventListener("mousemove", handleMouseMove); window.removeEventListener("mousedown", handleMouseDown); window.removeEventListener("mouseup", handleMouseUp); window.removeEventListener("scroll", handleScroll); window.clearInterval(clockTimer); heroObserver.disconnect(); bloomObserver.disconnect(); }; }, []); return ( <>
Lunar-Regolith Cycle · Phase III

Grow Beyond Earth's Horizon

Next-generation bioluminescent agriculture for off-world environments. Atmospheric scrubbers, photosynthetic optimization, and circadian growth-sync engineered for lunar soil.

0 %
O₂ yield
efficiency
0 t
CO₂ captured
annually
0 ×
Crop yield
multiplier
L1
Lunar
Station
{[...tickerItems, ...tickerItems].map(([label, value], index) => ( {label} {value} ))}
Atmospheric Systems

Carbon Scrubbers
at scale

Our proprietary atmospheric scrubbers leverage engineered algal biofilms operating at 2,400× the natural photosynthetic rate. Zero-energy passive capture sustained by bioluminescent colonies embedded in the regolith membrane.

CO₂ → O₂ Flux
Real-time Scrubber Array · Module 7
{scrubberBars.map((height, index) => (
))}
Capture efficiency
0% 87% 100%
14.2 t/day
Scrub Rate
99.4%
Purity Output
Growth Synchronisation
14:32
Growth Cycle
Photonic
16h active
Rest phase
8h dormant
Chlorophyll
Peak 98.2%
Nutrient
Auto-cycle
Circadian Architecture

Biological
time-keeping

Synthetic circadian oscillators derived from cyanobacterial clock proteins regulate photosynthetic output across a 24-hour lunar equivalent cycle. Yield improvements of 340% over static-light agriculture.

{regolithItems.map((item) => (
{item.name} {item.value}
))}
{cards.map((card, index) => (
{card.title.split("\n").map((line) => ( {line}
))}
{card.text}
{card.metric} {card.metricSuffix}
{card.metricLabel}
))}
Pioneer Programme

Cultivate the
next frontier

Join fourteen planetary research institutions currently piloting our astra-botanical systems. Applications for the 2026 lunar deployment cohort are now open.

); }