import { motion } from 'framer-motion'
import { Container } from '@/components/Container'
import { Eyebrow, SectionHeader, P, CT, CP } from '@/components/Texts'

const items = [
  {
    title: 'FungiStor',
    subtitle: 'Long-Term AI Memory',
    description: 'Erasure coding + compression slash storage bloat by up to 10× vs basic replication. Source-encrypted shards are geo-dispersed—lose pieces, rebuild perfectly from a quorum.',
    video: '/videos/fungistor.mp4',
  },
  {
    title: 'HeroDB',
    subtitle: 'Active AI Memory',
    description: 'Multimodal vector+keyword retrieval makes RAG feel instant across text, image, audio. Time-aware, policy-guarded context keeps results fresh while access stays governed.',
    video: '/videos/herodb.mp4',
  },
  {
    title: 'MOS Sandboxes',
    subtitle: 'Secure Agent Workspaces',
    description: 'Attested, signed workspaces spin up ≈5s worldwide—ready to execute. Hardware isolation and scoped egress: run hard, tear down clean, zero residue.',
    video: '/videos/herodb.mp4',
  },
  {
    title: 'Mycelium Mesh',
    subtitle: 'Secure Communication Network',
    description: 'A private, public-key fabric with self-healing multi-path routing. Glides through NATs and firewalls—direct, low-latency, no middlemen.',
    video: '/videos/mesh.mp4',
  },
  {
    title: 'Deterministic Deployment',
    subtitle: 'Verifiable Code Execution',
    description: 'Declare intent, get a hash; remote attestation proves that is what runs. Reproducible builds, signed artifacts, immutable logs—supply chain, sealed.',
    video: '/videos/deterministic.mp4',
  },
  {
    title: 'Agent Coordination',
    subtitle: 'Sovereign Workflow Management',
    description: 'Your private agent conducts swarms of specialists in parallel. Policies fan out work; human checkpoints keep you in command.',
    video: '/videos/agent.mp4',
  },
]

export function BentoSection() {
  return (
    <section className="bg-black py-20 lg:py-32">
      <Container>
        <motion.div
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, amount: 0.3 }}
          transition={{ duration: 0.6, ease: 'easeOut' }}
          className="mx-auto mb-16 max-w-3xl text-center"
        >
          <Eyebrow color="accent">Components</Eyebrow>
          <SectionHeader color="light">
            Intelligence Fabric
          </SectionHeader>
          <P className="mt-6" color="lightSecondary">
            A complete infrastructure for building and deploying sovereign AI agents with enterprise-grade security and performance. Your data never leaves your control.
          </P>
        </motion.div>

        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
          {items.map((item, index) => (
            <motion.div
              key={index}
              initial={{ opacity: 0, y: 20 }}
              whileInView={{ opacity: 1, y: 0 }}
              viewport={{ once: true, amount: 0.2 }}
              transition={{ duration: 0.45, delay: index * 0.1, ease: 'easeOut' }}
              className="overflow-hidden rounded-2xl border border-gray-800 bg-gray-900 p-6 transition-all duration-300 hover:scale-105 hover:border-cyan-500 hover:shadow-lg"
            >
              <video
                src={item.video}
                autoPlay
                loop
                muted
                playsInline
                className="w-full h-40 object-cover mb-4 rounded-lg"
              />
              <p className="text-sm font-medium text-cyan-500">{item.subtitle}</p>
              <CT as="h3" className="mt-2" color="light">{item.title}</CT>
              <CP className="mt-3" color="lightSecondary">{item.description}</CP>
            </motion.div>
          ))}
        </div>
      </Container>
    </section>
  )
}
