"use client"; import { motion, useInView } from "framer-motion"; import { useEffect, useRef, useState } from "react"; const demoMessages = [ { agent: "You", role: "system", text: "Build a SaaS landing page with pricing, blog, and auth.", delay: 0 }, { agent: "CEO", role: "ceo", text: "Analyzing goal... Creating departments: Engineering, Design, Content.", delay: 800 }, { agent: "CEO", role: "ceo", text: "Hiring 4 specialists for this mission.", delay: 1600 }, { agent: "Lead Engineer", role: "engineer", text: "Picked up task: Set up Next.js project with auth routes.", delay: 2400 }, { agent: "UI Designer", role: "designer", text: "Picked up task: Design landing page and pricing components.", delay: 3000 }, { agent: "Researcher", role: "researcher", text: "Picked up task: Competitive analysis of SaaS pricing models.", delay: 3600 }, { agent: "Lead Engineer", role: "engineer", text: "Completed: Auth scaffolding with JWT + session middleware.", delay: 4400 }, { agent: "UI Designer", role: "designer", text: "Completed: Responsive landing page with 3-tier pricing grid.", delay: 5200 }, { agent: "CEO", role: "ceo", text: "All tasks delivered. 3 documents ready for review.", delay: 6000 }, ]; const logTone: Record<(typeof demoMessages)[number]["role"], string> = { system: "text-[var(--muted-strong)]", ceo: "text-[#ca8a04]", engineer: "text-[var(--accent)]", designer: "text-[#8b5cf6]", researcher: "text-[#059669]", }; const steps = [ { number: 1, title: "Set Your Goal", description: "Describe the company, its mission, and what you want delivered." }, { number: 2, title: "Agents Self-Organize", description: "A CEO analyzes your goal, hires specialists, and delegates the work." }, { number: 3, title: "Collect Results", description: "Review deliverables, approve decisions, and download finished work." }, ]; function DemoPanel() { const anchorRef = useRef(null); const isVisible = useInView(anchorRef, { once: true, amount: 0.4 }); const [visibleCount, setVisibleCount] = useState(0); const logRef = useRef(null); useEffect(() => { if (!isVisible) return; const timers = demoMessages.map((message, index) => window.setTimeout(() => setVisibleCount(index + 1), message.delay), ); return () => timers.forEach((timer) => window.clearTimeout(timer)); }, [isVisible]); useEffect(() => { if (logRef.current) { logRef.current.scrollTop = logRef.current.scrollHeight; } }, [visibleCount]); return (
{demoMessages.slice(0, visibleCount).map((message, index) => ( {message.text} ))} {visibleCount < demoMessages.length && isVisible && (
); } export function HowItWorks() { return (

How It Works

Watch a Company Come to Life

); }