{
  "name": "hero-geometric",
  "type": "registry:ui",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "three",
    "@react-three/fiber",
    "@react-three/drei"
  ],
  "registryDependencies": [],
  "description": "A geometric hero section with a shader background and premium typography.",
  "files": [
    {
      "path": "components/ui/hero-geometric.tsx",
      "content": "\"use client\";\n\n/* eslint-disable react/no-unknown-property */\nimport { useRef, useMemo } from \"react\";\nimport { Canvas, useFrame, ThreeElements } from \"@react-three/fiber\";\nimport * as THREE from \"three\";\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../lib/utils\";\n\n/* eslint-disable @typescript-eslint/no-namespace */\ndeclare module \"react\" {\n    namespace JSX {\n        // eslint-disable-next-line @typescript-eslint/no-empty-interface\n        interface IntrinsicElements extends ThreeElements { }\n    }\n}\n/* eslint-enable @typescript-eslint/no-namespace */\n\n// --- Shader Code ---\nconst vertexShader = `\nvarying vec2 vUv;\nvoid main() {\n  vUv = uv;\n  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n`;\n\nconst fragmentShader = `\nuniform float uTime;\nuniform vec2 uResolution;\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nvarying vec2 vUv;\n\nvec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }\n\nfloat snoise(vec2 v){\n  const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n           -0.577350269189626, 0.024390243902439);\n  vec2 i  = floor(v + dot(v, C.yy) );\n  vec2 x0 = v -   i + dot(i, C.xx);\n  vec2 i1;\n  i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n  vec4 x12 = x0.xyxy + C.xxzz;\n  x12.xy -= i1;\n  i = mod(i, 289.0);\n  vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n  + i.x + vec3(0.0, i1.x, 1.0 ));\n  vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n  m = m*m ;\n  m = m*m ;\n  vec3 x = 2.0 * fract(p * C.www) - 1.0;\n  vec3 h = abs(x) - 0.5;\n  vec3 ox = floor(x + 0.5);\n  vec3 a0 = x - ox;\n  m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n  vec3 g;\n  g.x  = a0.x  * x0.x  + h.x  * x0.y;\n  g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n  return 130.0 * dot(m, g);\n}\n\nfloat bayerDither4x4(vec2 uv) {\n    int x = int(mod(uv.x, 4.0));\n    int y = int(mod(uv.y, 4.0));\n    \n    int matrix[16];\n    matrix[0] = 0; matrix[1] = 8; matrix[2] = 2; matrix[3] = 10;\n    matrix[4] = 12; matrix[5] = 4; matrix[6] = 14; matrix[7] = 6;\n    matrix[8] = 3; matrix[9] = 11; matrix[10] = 1; matrix[11] = 9;\n    matrix[12] = 15; matrix[13] = 7; matrix[14] = 13; matrix[15] = 5;\n    \n    return float(matrix[y * 4 + x]) / 16.0;\n}\n\nvoid main() {\n    vec2 uv = vUv;\n    vec2 coord = gl_FragCoord.xy;\n    \n    // Enhanced noise with time\n    float noise = snoise(uv * 1.5 + vec2(uTime * 0.05, uTime * 0.03)) * 0.25;\n    \n    // Diagonal gradient from bottom-left to top-right\n    float diagonal = (uv.x + uv.y) * 0.5;\n    \n    // Combine for gradient - emphasize corners\n    float gradient = diagonal * 1.2 + noise;\n    \n    // Interpolate colors based on gradient\n    vec3 deepBlue = uColor1;\n    vec3 paleBlue = uColor2;\n    vec3 softBlue = mix(deepBlue, paleBlue, 0.33);\n    vec3 lightBlue = mix(deepBlue, paleBlue, 0.66);\n    \n    // Map to colors with more distinct steps\n    vec3 color;\n    if (gradient < 0.3) {\n        color = deepBlue;\n    } else if (gradient < 0.55) {\n        color = softBlue;\n    } else if (gradient < 0.8) {\n        color = lightBlue;\n    } else {\n        color = paleBlue;\n    }\n    \n    // Enhanced dithering at boundaries\n    float dither = bayerDither4x4(coord);\n    float threshold = fract(gradient * 4.0);\n    \n    if (gradient < 0.3 && threshold > dither * 0.5) {\n        color = softBlue;\n    } else if (gradient >= 0.3 && gradient < 0.55 && threshold > dither * 0.5) {\n        color = lightBlue;\n    } else if (gradient >= 0.55 && gradient < 0.8 && threshold > dither * 0.5) {\n        color = paleBlue;\n    }\n    \n    // Softer fade to white - only at extreme bottom-left\n    vec2 cornerDist = vec2(uv.x, uv.y);\n    float fadeMask = smoothstep(0.0, 0.25, length(cornerDist));\n    color = mix(vec3(1.0), color, fadeMask);\n    \n    // Add subtle vignette to emphasize corners\n    float vignette = smoothstep(1.2, 0.3, length(uv - 0.5));\n    color = mix(color, color * 0.95, (1.0 - vignette) * 0.3);\n    \n    gl_FragColor = vec4(color, 1.0);\n}\n`;\n\nconst GradientPlane = ({\n    color1,\n    color2,\n    speed = 1\n}: {\n    color1: string;\n    color2: string;\n    speed?: number\n}) => {\n    const meshRef = useRef<THREE.Mesh>(null);\n    const uniforms = useMemo(\n        () => ({\n            uTime: { value: 0 },\n            uResolution: { value: new THREE.Vector2(1000, 1000) },\n            uColor1: { value: new THREE.Color(color1) },\n            uColor2: { value: new THREE.Color(color2) },\n        }),\n        [color1, color2]\n    );\n\n    useFrame((state) => {\n        const { clock, size } = state;\n        uniforms.uTime.value = clock.getElapsedTime() * speed;\n        uniforms.uResolution.value.set(size.width, size.height);\n        uniforms.uColor1.value.set(color1);\n        uniforms.uColor2.value.set(color2);\n    });\n\n    return (\n        <mesh ref={meshRef} scale={[2, 2, 1]}>\n            <planeGeometry args={[2, 2]} />\n            <shaderMaterial\n                vertexShader={vertexShader}\n                fragmentShader={fragmentShader}\n                uniforms={uniforms}\n                transparent={true}\n                depthWrite={false}\n                depthTest={false}\n            />\n        </mesh>\n    );\n};\n\n// --- Main Component ---\n\ninterface HeroGeometricProps {\n    title1?: string;\n    title2?: string;\n    description?: string;\n    className?: string; // Explicitly included\n    color1?: string;\n    color2?: string;\n    speed?: number;\n}\n\nexport default function HeroGeometric({\n    title1,\n    title2,\n    description,\n    color1 = \"#3B82F6\", // Default soft blue\n    color2 = \"#F0F9FF\", // Default pale blue\n    speed = 1,\n    className,\n}: HeroGeometricProps) {\n    return (\n        <div\n            className={cn(\"relative w-full min-h-screen flex flex-col items-center overflow-hidden bg-white text-black\", className)}\n            style={{ containerType: \"size\" }}\n        >\n            {/* Background Shader */}\n            <div className=\"absolute top-0 left-0 w-full h-full z-0 pointer-events-none\">\n                <Canvas\n                    camera={{ position: [0, 0, 1] }}\n                    dpr={[1, 1]}\n                    gl={{\n                        antialias: false,\n                        alpha: true,\n                    }}\n                >\n                    <GradientPlane color1={color1} color2={color2} speed={speed} />\n                </Canvas>\n            </div>\n\n            {/* Content */}\n            {(title1 || title2 || description) && (\n                <div className=\"relative z-10 w-full flex-1 flex flex-col items-center justify-center pt-8 pb-8 md:pt-20 md:pb-20\">\n                    <div className=\"w-full max-w-[1200px] px-6 flex flex-col items-center\">\n                        {/* Headline */}\n                        <div className=\"flex flex-col items-center text-center gap-2 md:gap-4 mb-8 md:mb-12\">\n                            {title1 && (\n                                <div className=\"overflow-hidden\">\n                                    <motion.h1\n                                        initial={{ y: \"100%\", opacity: 0 }}\n                                        animate={{ y: \"0%\", opacity: 1 }}\n                                        transition={{ duration: 1, ease: [0.16, 1, 0.3, 1], delay: 0.2 }}\n                                        className=\"text-[12cqi] md:text-[8cqi] lg:text-[6cqi] leading-[0.9] tracking-tighter text-[#131313]\"\n                                    >\n                                        <span className=\"font-serif italic font-light text-[#1a1a1a]\">\n                                            {title1}\n                                        </span>\n                                    </motion.h1>\n                                </div>\n                            )}\n                            {title2 && (\n                                <div className=\"overflow-hidden\">\n                                    <motion.h1\n                                        initial={{ y: \"100%\", opacity: 0 }}\n                                        animate={{ y: \"0%\", opacity: 1 }}\n                                        transition={{ duration: 1, ease: [0.16, 1, 0.3, 1], delay: 0.35 }}\n                                        className=\"text-[12cqi] md:text-[8cqi] lg:text-[6cqi] leading-[0.9] tracking-tighter font-bold text-black\"\n                                    >\n                                        {title2}\n                                    </motion.h1>\n                                </div>\n                            )}\n                        </div>\n\n                        {/* Subheadline */}\n                        {description && (\n                            <div className=\"max-w-[480px] text-center mb-8\">\n                                <motion.p\n                                    initial={{ opacity: 0, y: 20 }}\n                                    animate={{ opacity: 1, y: 0 }}\n                                    transition={{ duration: 0.8, delay: 0.6, ease: \"easeOut\" }}\n                                    className=\"text-lg md:text-[1.35rem] leading-relaxed text-neutral-600 font-normal\"\n                                >\n                                    {description}\n                                </motion.p>\n                            </div>\n                        )}\n                    </div>\n                </div>\n            )}\n        </div>\n    );\n}\n",
      "type": "registry:ui"
    }
  ]
}