{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "horizon-light",
  "type": "registry:ui",
  "title": "Horizon Light",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "WebGL planetary horizon limb shader with a razor-sharp incandescent core, volumetric FBM atmospheric corona, interactive solar apex tracking, and 8-bit dithered bloom.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/horizon-light.tsx",
      "content": "\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nconst VERTEX_SHADER = `\n  attribute vec2 a_position;\n  varying vec2 v_uv;\n  void main() {\n    v_uv = a_position * 0.5 + 0.5;\n    gl_Position = vec4(a_position, 0.0, 1.0);\n  }\n`;\n\n/**\n * Fragment Shader: Planetary Horizon Light & Volumetric Ember Corona\n *\n * Renders a physical curved planetary horizon limb with:\n * - Razor-sharp incandescent core along the curved horizon arc\n * - Volumetric atmospheric scatter rising above the horizon\n * - Subtle radial sunbeams / god-rays emanating from the horizon apex (interactive with pointer X/Y)\n * - Deep Warm Graphite eclipse occlusion (or warm architectural bone in light mode) below the horizon curve\n * - High-frequency optical dither to eliminate 8-bit gradient banding\n */\nconst FRAGMENT_SHADER = `\n  precision highp float;\n\n  varying vec2 v_uv;\n  uniform float u_time;\n  uniform vec2 u_resolution;\n  uniform vec2 u_mouse;\n  uniform float u_lightMode;\n  uniform float u_apexY;\n  uniform float u_intensity;\n  uniform vec3 u_primaryColor;\n  uniform vec3 u_secondaryColor;\n  uniform vec3 u_deepColor;\n  uniform vec3 u_coreColor;\n\n  float hash(vec2 p) {\n    p = fract(p * vec2(123.34, 456.21));\n    p += dot(p, p + 45.32);\n    return fract(p.x * p.y);\n  }\n\n  float noise(vec2 p) {\n    vec2 i = floor(p);\n    vec2 f = fract(p);\n    // Quintic C2 interpolation for ultra-soft, crease-free volumetric transitions\n    vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n    float a = hash(i);\n    float b = hash(i + vec2(1.0, 0.0));\n    float c = hash(i + vec2(0.0, 1.0));\n    float d = hash(i + vec2(1.0, 1.0));\n    return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n  }\n\n  float softFbm(vec2 p) {\n    float v = 0.0;\n    float a = 0.55;\n    mat2 rot = mat2(0.8, 0.6, -0.6, 0.8);\n    // 2 low-frequency octaves for wide, pillowy atmospheric light shafts\n    for (int i = 0; i < 2; i++) {\n      v += a * noise(p);\n      p = rot * p * 1.65 + vec2(1.7, 9.2);\n      a *= 0.45;\n    }\n    return v;\n  }\n\n  void main() {\n    vec2 uv = v_uv;\n    float aspect = u_resolution.x / max(u_resolution.y, 1.0);\n\n    // Normalized centered coordinates: x in [-aspect*0.5, aspect*0.5], y in [0, 1] (0 = bottom, 1 = top)\n    vec2 p = vec2((uv.x - 0.5) * aspect, uv.y);\n\n    // Interactive pointer offset shifts the solar apex gently along the horizon\n    float mouseShiftX = (u_mouse.x - 0.5) * 0.28 * aspect;\n    float mouseLiftY = (u_mouse.y - 0.5) * 0.03;\n\n    // Giant planetary circle centered far below the frame so its top arc forms the horizon line\n    float radius = max(aspect * 1.45, 2.1);\n    float apexY = u_apexY + mouseLiftY;\n    vec2 planetCenter = vec2(0.0, apexY - radius);\n\n    // Signed distance from planetary surface:\n    // dist > 0.0 => sky/atmosphere above the horizon\n    // dist == 0.0 => exact curved horizon rim\n    // dist < 0.0 => planetary surface below the horizon\n    vec2 toFrag = p - planetCenter;\n    float dist = length(toFrag) - radius;\n\n    // Horizontal distance from the solar apex (shifted slightly by pointer)\n    float horizDist = (p.x - mouseShiftX * 0.35) / max(aspect * 0.55, 0.8);\n    float centerFalloff = exp(-horizDist * horizDist * 1.85);\n    float wideFalloff = exp(-horizDist * horizDist * 0.65);\n\n    // Soft, wide-angle volumetric rays anchored deep below the horizon so atan() never pinches\n    vec2 rayOrigin = vec2(mouseShiftX * 0.3, apexY - 0.65);\n    vec2 rayDir = normalize(p - rayOrigin);\n    float angle = atan(rayDir.x, max(rayDir.y, 0.15));\n\n    // Combine gentle cosine lobes with low-frequency quintic noise for diffused, cloud-soft beams\n    float primaryWave = sin(angle * 2.4 + u_time * 0.08) * 0.5 + 0.5;\n    float secondaryWave = cos(angle * 4.1 - u_time * 0.05) * 0.5 + 0.5;\n    float softNoise = softFbm(vec2(angle * 2.2 + u_time * 0.04, max(dist, 0.0) * 1.1 - u_time * 0.07));\n    float rawRays = mix(primaryWave * 0.55 + secondaryWave * 0.45, softNoise, 0.5);\n    float raySmooth = smoothstep(0.15, 0.85, rawRays);\n\n    // Fade ray modulation smoothly away from the horizon limb so the core stays seamless\n    float rayAltitudeFade = smoothstep(0.0, 0.16, max(dist, 0.0)) * smoothstep(0.65, 0.08, max(dist, 0.0));\n    float rayMod = mix(1.0, mix(0.86, 1.16, raySmooth), rayAltitudeFade);\n\n    // 1. Ultra-crisp horizon limb line (the glowing arc itself)\n    float rimCore = exp(-abs(dist) * 140.0) * (0.35 + 0.95 * centerFalloff) * u_intensity;\n    float rimTight = exp(-abs(dist) * 38.0) * (0.25 + 0.85 * centerFalloff) * u_intensity;\n\n    // 2. Upper atmospheric scatter (rising above the horizon: dist > 0)\n    float aboveMask = smoothstep(-0.02, 0.015, dist);\n    float posDist = max(dist, 0.0);\n    float innerCorona = exp(-posDist * 11.5) * centerFalloff * aboveMask * u_intensity;\n    float midAtmosphere = exp(-posDist * 4.2) * wideFalloff * rayMod * aboveMask * u_intensity;\n    float outerBloom = exp(-posDist * 1.85) * wideFalloff * rayMod * aboveMask * u_intensity;\n\n    // 3. Sub-horizon inner planetary rim glow (subtle reflection below the arc: dist < 0)\n    float belowMask = 1.0 - smoothstep(-0.005, 0.01, dist);\n    float negDist = max(-dist, 0.0);\n    float subHorizonGlow = exp(-negDist * 16.0) * (0.2 + 0.65 * centerFalloff) * belowMask * u_intensity;\n\n    vec3 darkBg = vec3(0.047, 0.047, 0.043);      // #0c0c0b\n    vec3 lightBg = vec3(0.957, 0.945, 0.918);     // #f4f1ea\n\n    // Dark Mode composition: Eclipse planet with luminous corona\n    vec3 darkCol = darkBg;\n    darkCol += u_deepColor * outerBloom * 0.75;\n    darkCol += u_primaryColor * midAtmosphere * 0.72;\n    darkCol += u_secondaryColor * innerCorona * 0.68;\n    darkCol += mix(u_primaryColor, u_secondaryColor, 0.5) * rimTight * 0.85;\n    darkCol += u_coreColor * rimCore * 0.95;\n    darkCol += mix(u_deepColor, u_primaryColor, 0.35) * subHorizonGlow * 0.45;\n\n    // Light Mode composition: Warm architectural bone with crisp horizon illumination\n    vec3 lightCol = lightBg;\n    lightCol = mix(lightCol, vec3(1.0, 0.86, 0.76), outerBloom * 0.55);\n    lightCol = mix(lightCol, u_secondaryColor, midAtmosphere * 0.38);\n    lightCol = mix(lightCol, u_primaryColor, innerCorona * 0.42);\n    lightCol = mix(lightCol, u_primaryColor, rimTight * 0.58);\n    lightCol += vec3(1.0, 0.96, 0.90) * rimCore * 0.42;\n    lightCol = mix(lightCol, vec3(0.92, 0.89, 0.84), belowMask * (1.0 - subHorizonGlow * 0.6) * 0.35);\n\n    vec3 col = mix(darkCol, lightCol, u_lightMode);\n\n    // Subtle edge vignette so the top corners stay clean for navbar & typography\n    float topFade = smoothstep(0.98, 0.62, uv.y);\n    col = mix(mix(darkBg, lightBg, u_lightMode), col, topFade);\n\n    // High-frequency filmic grain dither to prevent 8-bit gradient banding\n    float grain = (hash(gl_FragCoord.xy + fract(u_time) * 100.0) - 0.5) / 255.0;\n    col += grain * 1.6;\n\n    gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n  }\n`;\n\nfunction hexToRgbNormalized(hex: string): [number, number, number] {\n  const clean = hex.replace(\"#\", \"\").trim();\n  const full =\n    clean.length === 3\n      ? clean\n        .split(\"\")\n        .map((c) => c + c)\n        .join(\"\")\n      : clean.padEnd(6, \"0\");\n  const num = parseInt(full.slice(0, 6), 16);\n  if (Number.isNaN(num)) return [1.0, 0.302, 0.11];\n  return [\n    ((num >> 16) & 255) / 255,\n    ((num >> 8) & 255) / 255,\n    (num & 255) / 255,\n  ];\n}\n\nexport interface HorizonLightPreset {\n  id: string;\n  label: string;\n  primaryColor: string;\n  secondaryColor: string;\n  deepColor: string;\n  coreColor: string;\n}\n\nexport const HORIZON_LIGHT_PRESETS: HorizonLightPreset[] = [\n  {\n    id: \"ember\",\n    label: \"Vermilion Eclipse\",\n    primaryColor: \"#FF4D1C\",\n    secondaryColor: \"#FF8A3D\",\n    deepColor: \"#6E1404\",\n    coreColor: \"#FFF3E0\",\n  },\n  {\n    id: \"cobalt\",\n    label: \"Orbital Cobalt\",\n    primaryColor: \"#2563EB\",\n    secondaryColor: \"#38BDF8\",\n    deepColor: \"#0B1D51\",\n    coreColor: \"#F0F9FF\",\n  },\n  {\n    id: \"emerald\",\n    label: \"Solaris Borealis\",\n    primaryColor: \"#10B981\",\n    secondaryColor: \"#6EE7B7\",\n    deepColor: \"#064E3B\",\n    coreColor: \"#ECFDF5\",\n  },\n  {\n    id: \"supernova\",\n    label: \"Violet Supernova\",\n    primaryColor: \"#9333EA\",\n    secondaryColor: \"#F472B6\",\n    deepColor: \"#3B0764\",\n    coreColor: \"#FAF5FF\",\n  },\n];\n\nexport interface HorizonLightProps {\n  /** Primary atmospheric scatter color (default: \"#FF4D1C\" International Vermilion) */\n  primaryColor?: string;\n  /** Inner corona glow color (default: \"#FF8A3D\" Solar Amber) */\n  secondaryColor?: string;\n  /** Outer deep atmospheric bloom color (default: \"#6E1404\" Deep Crimson Ember) */\n  deepColor?: string;\n  /** Razor-sharp planetary limb core color (default: \"#FFF3E0\" Incandescent Core) */\n  coreColor?: string;\n  /** Vertical position of the planetary horizon apex (0.2 to 0.75, default: 0.43) */\n  horizonHeight?: number;\n  /** Overall corona and limb intensity multiplier (0.4 to 1.8, default: 1.0) */\n  intensity?: number;\n  /** Speed multiplier for volumetric FBM god-rays (default: 1.0) */\n  speed?: number;\n  /** Whether pointer X/Y gently shifts the solar apex along the curved limb */\n  interactive?: boolean;\n  /** Shader surface mode: \"dark\" (Warm Graphite eclipse), \"light\" (Architectural Bone), or \"auto\" */\n  themeMode?: \"dark\" | \"light\" | \"auto\";\n  /** Optional custom foreground content */\n  children?: React.ReactNode;\n  /** Additional container class names */\n  className?: string;\n}\n\nexport function HorizonLight({\n  primaryColor = \"#FF4D1C\",\n  secondaryColor = \"#FF8A3D\",\n  deepColor = \"#6E1404\",\n  coreColor = \"#FFF3E0\",\n  horizonHeight = 0.43,\n  intensity = 1.0,\n  speed = 1.0,\n  interactive = true,\n  themeMode = \"dark\",\n  children,\n  className,\n}: HorizonLightProps) {\n  const containerRef = useRef<HTMLDivElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  // Interactive HUD state for standalone demo preview\n  const [activePresetId, setActivePresetId] = useState<string>(\"ember\");\n  const [localLightMode, setLocalLightMode] = useState<boolean>(\n    themeMode === \"light\"\n  );\n  const [localApexY, setLocalApexY] = useState<number>(horizonHeight);\n\n  useEffect(() => {\n    setLocalApexY(horizonHeight);\n  }, [horizonHeight]);\n\n  useEffect(() => {\n    if (themeMode !== \"auto\") {\n      setLocalLightMode(themeMode === \"light\");\n    }\n  }, [themeMode]);\n\n  const activePreset = HORIZON_LIGHT_PRESETS.find(\n    (p) => p.id === activePresetId\n  );\n\n  const effectivePrimary =\n    activePresetId === \"ember\"\n      ? primaryColor\n      : (activePreset?.primaryColor ?? primaryColor);\n  const effectiveSecondary =\n    activePresetId === \"ember\"\n      ? secondaryColor\n      : (activePreset?.secondaryColor ?? secondaryColor);\n  const effectiveDeep =\n    activePresetId === \"ember\"\n      ? deepColor\n      : (activePreset?.deepColor ?? deepColor);\n  const effectiveCore =\n    activePresetId === \"ember\"\n      ? coreColor\n      : (activePreset?.coreColor ?? coreColor);\n\n  // Keep latest uniform values in a ref so the WebGL loop updates smoothly without recreating the context\n  const uniformsRef = useRef({\n    primary: hexToRgbNormalized(effectivePrimary),\n    secondary: hexToRgbNormalized(effectiveSecondary),\n    deep: hexToRgbNormalized(effectiveDeep),\n    core: hexToRgbNormalized(effectiveCore),\n    apexY: localApexY,\n    intensity,\n    speed,\n    interactive,\n    lightModeTarget: localLightMode ? 1.0 : 0.0,\n  });\n\n  useEffect(() => {\n    uniformsRef.current = {\n      primary: hexToRgbNormalized(effectivePrimary),\n      secondary: hexToRgbNormalized(effectiveSecondary),\n      deep: hexToRgbNormalized(effectiveDeep),\n      core: hexToRgbNormalized(effectiveCore),\n      apexY: localApexY,\n      intensity,\n      speed,\n      interactive,\n      lightModeTarget: localLightMode ? 1.0 : 0.0,\n    };\n  }, [\n    effectivePrimary,\n    effectiveSecondary,\n    effectiveDeep,\n    effectiveCore,\n    localApexY,\n    intensity,\n    speed,\n    interactive,\n    localLightMode,\n  ]);\n\n  // Sync with document theme only when themeMode === \"auto\"\n  useEffect(() => {\n    if (themeMode !== \"auto\") return;\n    const checkTheme = () => {\n      const html = document.documentElement;\n      const isLight =\n        html.classList.contains(\"light\") || !html.classList.contains(\"dark\");\n      setLocalLightMode(isLight);\n    };\n    checkTheme();\n    const observer = new MutationObserver(checkTheme);\n    observer.observe(document.documentElement, {\n      attributes: true,\n      attributeFilter: [\"class\"],\n    });\n    return () => observer.disconnect();\n  }, [themeMode]);\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n    const container = containerRef.current;\n    if (!canvas || !container) return;\n\n    const gl = canvas.getContext(\"webgl\", {\n      alpha: false,\n      antialias: false,\n      powerPreference: \"high-performance\",\n    });\n\n    if (!gl) return;\n\n    const compileShader = (type: number, source: string) => {\n      const shader = gl.createShader(type);\n      if (!shader) return null;\n      gl.shaderSource(shader, source);\n      gl.compileShader(shader);\n      if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n        gl.deleteShader(shader);\n        return null;\n      }\n      return shader;\n    };\n\n    const vs = compileShader(gl.VERTEX_SHADER, VERTEX_SHADER);\n    const fs = compileShader(gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n    if (!vs || !fs) return;\n\n    const program = gl.createProgram();\n    if (!program) return;\n    gl.attachShader(program, vs);\n    gl.attachShader(program, fs);\n    gl.linkProgram(program);\n    if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return;\n    gl.useProgram(program);\n\n    // Fullscreen quad\n    const buffer = gl.createBuffer();\n    gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n    gl.bufferData(\n      gl.ARRAY_BUFFER,\n      new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]),\n      gl.STATIC_DRAW\n    );\n\n    const posLoc = gl.getAttribLocation(program, \"a_position\");\n    gl.enableVertexAttribArray(posLoc);\n    gl.vertexAttribPointer(posLoc, 2, gl.FLOAT, false, 0, 0);\n\n    const uTime = gl.getUniformLocation(program, \"u_time\");\n    const uRes = gl.getUniformLocation(program, \"u_resolution\");\n    const uMouse = gl.getUniformLocation(program, \"u_mouse\");\n    const uLightMode = gl.getUniformLocation(program, \"u_lightMode\");\n    const uApexY = gl.getUniformLocation(program, \"u_apexY\");\n    const uIntensity = gl.getUniformLocation(program, \"u_intensity\");\n    const uPrimary = gl.getUniformLocation(program, \"u_primaryColor\");\n    const uSecondary = gl.getUniformLocation(program, \"u_secondaryColor\");\n    const uDeep = gl.getUniformLocation(program, \"u_deepColor\");\n    const uCore = gl.getUniformLocation(program, \"u_coreColor\");\n\n    let width = 0;\n    let height = 0;\n\n    const handleResize = () => {\n      if (!canvas || !container) return;\n      // Render at max 1.5x DPR for locked 60fps performance even on 4K displays\n      const dpr = Math.min(window.devicePixelRatio || 1, 1.5);\n      const rect = container.getBoundingClientRect();\n      width = Math.max(1, Math.floor(rect.width * dpr));\n      height = Math.max(1, Math.floor(rect.height * dpr));\n      if (canvas.width !== width || canvas.height !== height) {\n        canvas.width = width;\n        canvas.height = height;\n        gl.viewport(0, 0, width, height);\n      }\n    };\n\n    handleResize();\n    const resizeObserver = new ResizeObserver(handleResize);\n    resizeObserver.observe(container);\n    window.addEventListener(\"resize\", handleResize, { passive: true });\n\n    // Smooth damped pointer tracking\n    const targetMouse = { x: 0.5, y: 0.5 };\n    const currentMouse = { x: 0.5, y: 0.5 };\n\n    const handlePointerMove = (e: PointerEvent) => {\n      if (!uniformsRef.current.interactive || !container) return;\n      const rect = container.getBoundingClientRect();\n      if (rect.width <= 0 || rect.height <= 0) return;\n      const nx = (e.clientX - rect.left) / rect.width;\n      const ny = 1.0 - (e.clientY - rect.top) / rect.height;\n      if (nx >= 0 && nx <= 1 && ny >= 0 && ny <= 1) {\n        targetMouse.x = nx;\n        targetMouse.y = ny;\n      }\n    };\n\n    window.addEventListener(\"pointermove\", handlePointerMove, {\n      passive: true,\n    });\n\n    const reducedMotion = window.matchMedia(\n      \"(prefers-reduced-motion: reduce)\"\n    ).matches;\n\n    let rafId = 0;\n    let currentLightMode = uniformsRef.current.lightModeTarget;\n    let currentApex = uniformsRef.current.apexY;\n    const startTime = performance.now();\n\n    const render = (now: number) => {\n      const cfg = uniformsRef.current;\n      const elapsed = reducedMotion\n        ? 0.0\n        : ((now - startTime) * 0.001) * cfg.speed;\n\n      // Damped spring interpolation for pointer & parameters\n      currentMouse.x += (targetMouse.x - currentMouse.x) * 0.04;\n      currentMouse.y += (targetMouse.y - currentMouse.y) * 0.04;\n      currentLightMode += (cfg.lightModeTarget - currentLightMode) * 0.08;\n      currentApex += (cfg.apexY - currentApex) * 0.08;\n\n      gl.uniform1f(uTime, elapsed);\n      gl.uniform2f(uRes, width, height);\n      gl.uniform2f(uMouse, currentMouse.x, currentMouse.y);\n      gl.uniform1f(uLightMode, currentLightMode);\n      gl.uniform1f(uApexY, currentApex);\n      gl.uniform1f(uIntensity, cfg.intensity);\n      gl.uniform3fv(uPrimary, cfg.primary);\n      gl.uniform3fv(uSecondary, cfg.secondary);\n      gl.uniform3fv(uDeep, cfg.deep);\n      gl.uniform3fv(uCore, cfg.core);\n\n      gl.drawArrays(gl.TRIANGLES, 0, 6);\n\n      if (!reducedMotion) {\n        rafId = requestAnimationFrame(render);\n      }\n    };\n\n    rafId = requestAnimationFrame(render);\n\n    return () => {\n      cancelAnimationFrame(rafId);\n      resizeObserver.disconnect();\n      window.removeEventListener(\"resize\", handleResize);\n      window.removeEventListener(\"pointermove\", handlePointerMove);\n      gl.deleteBuffer(buffer);\n      gl.deleteProgram(program);\n      gl.deleteShader(vs);\n      gl.deleteShader(fs);\n    };\n  }, []);\n\n  return (\n    <div\n      ref={containerRef}\n      data-fullscreen-scroll\n      className={cn(\n        \"relative w-full min-h-[540px] overflow-hidden rounded-2xl select-none flex flex-col justify-between\",\n        localLightMode ? \"bg-[#f4f1ea] text-zinc-900\" : \"bg-[#0c0c0b] text-white\",\n        className\n      )}\n    >\n      {/* WebGL Planetary Horizon Shader */}\n      <canvas\n        ref={canvasRef}\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute inset-0 h-full w-full block\"\n      />\n\n      {/* Content Layer */}\n      {children ? (\n        <div className=\"relative z-10 flex-1 flex flex-col\">{children}</div>\n      ) : (\n        <div className=\"relative z-10 flex-1 flex flex-col justify-between p-6 sm:p-10\">\n          {/* Top Telemetry Bar */}\n          <div className=\"flex flex-wrap items-center justify-between gap-3\">\n            <div\n              className={cn(\n                \"inline-flex items-center gap-2 rounded-full px-3 py-1 text-[11px] font-mono uppercase tracking-widest border backdrop-blur-md\",\n                localLightMode\n                  ? \"bg-white/60 border-zinc-900/10 text-zinc-700\"\n                  : \"bg-white/[0.04] border-white/10 text-zinc-300\"\n              )}\n            >\n              <span\n                className=\"h-1.5 w-1.5 rounded-full animate-pulse\"\n                style={{ backgroundColor: effectivePrimary }}\n              />\n              GLSL Planetary Limb SDF · 4-Octave FBM\n            </div>\n\n            {/* Mode & Preset Controls */}\n            <div className=\"flex flex-wrap items-center gap-1.5\">\n              {HORIZON_LIGHT_PRESETS.map((preset) => {\n                const isSelected = activePresetId === preset.id;\n                return (\n                  <button\n                    key={preset.id}\n                    type=\"button\"\n                    onClick={() => setActivePresetId(preset.id)}\n                    className={cn(\n                      \"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium transition-all border backdrop-blur-md\",\n                      isSelected\n                        ? localLightMode\n                          ? \"bg-zinc-900 text-white border-zinc-900 shadow-sm\"\n                          : \"bg-white text-zinc-950 border-white shadow-sm\"\n                        : localLightMode\n                          ? \"bg-white/60 text-zinc-700 border-zinc-900/10 hover:bg-white/90\"\n                          : \"bg-black/40 text-zinc-300 border-white/10 hover:bg-white/10\"\n                    )}\n                  >\n                    <span\n                      className=\"h-2 w-2 rounded-full\"\n                      style={{ backgroundColor: preset.primaryColor }}\n                    />\n                    {preset.label.split(\" \")[1]}\n                  </button>\n                );\n              })}\n\n              <button\n                type=\"button\"\n                onClick={() => setLocalLightMode((prev) => !prev)}\n                className={cn(\n                  \"ml-1 rounded-full px-2.5 py-1 text-xs font-mono border backdrop-blur-md transition-colors\",\n                  localLightMode\n                    ? \"bg-zinc-900/10 border-zinc-900/15 text-zinc-800 hover:bg-zinc-900/15\"\n                    : \"bg-white/10 border-white/15 text-zinc-200 hover:bg-white/15\"\n                )}\n              >\n                {localLightMode ? \"Light Surface\" : \"Eclipse Dark\"}\n              </button>\n            </div>\n          </div>\n\n          {/* Center Hero Copy */}\n          <div className=\"my-auto py-12 text-center max-w-2xl mx-auto\">\n            <p\n              className={cn(\n                \"text-xs font-mono uppercase tracking-[0.25em] mb-3\",\n                localLightMode ? \"text-zinc-600\" : \"text-zinc-400\"\n              )}\n            >\n              Atmospheric Scatter &amp; Solar Corona\n            </p>\n            <h2\n              className={cn(\n                \"text-3xl sm:text-5xl font-semibold tracking-tight leading-[1.08]\",\n                localLightMode ? \"text-zinc-950\" : \"text-white\"\n              )}\n            >\n              Planetary horizon light with volumetric god-rays.\n            </h2>\n            <p\n              className={cn(\n                \"mt-4 text-sm sm:text-base max-w-xl mx-auto leading-relaxed\",\n                localLightMode ? \"text-zinc-700\" : \"text-zinc-300/85\"\n              )}\n            >\n              Move your pointer across the horizon arc to shift the solar apex\n              in real time. Rendered via a signed-distance planetary sphere and\n              8-bit dithered atmospheric bloom.\n            </p>\n          </div>\n\n          {/* Bottom Horizon Elevation Scrubber */}\n          <div className=\"flex flex-wrap items-center justify-between gap-4 pt-2\">\n            <div\n              className={cn(\n                \"text-[11px] font-mono\",\n                localLightMode ? \"text-zinc-600\" : \"text-zinc-400\"\n              )}\n            >\n              APEX ELEVATION:{\" \"}\n              <span className=\"font-semibold\">\n                {Math.round(localApexY * 100)}%\n              </span>\n            </div>\n\n            <div\n              className={cn(\n                \"flex items-center gap-3 rounded-full px-3.5 py-1.5 border backdrop-blur-md\",\n                localLightMode\n                  ? \"bg-white/65 border-zinc-900/10\"\n                  : \"bg-black/45 border-white/10\"\n              )}\n            >\n              <span\n                className={cn(\n                  \"text-[11px] font-mono\",\n                  localLightMode ? \"text-zinc-600\" : \"text-zinc-400\"\n                )}\n              >\n                Horizon Arc\n              </span>\n              <input\n                type=\"range\"\n                min={0.25}\n                max={0.68}\n                step={0.01}\n                value={localApexY}\n                onChange={(e) => setLocalApexY(parseFloat(e.target.value))}\n                aria-label=\"Horizon Apex Height\"\n                className=\"w-28 accent-orange-500 cursor-pointer\"\n              />\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n\nexport default HorizonLight;\n",
      "type": "registry:ui",
      "target": "components/ui/horizon-light.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (typeof window === \"undefined\") return false;\n\n  try {\n    if (navigator.clipboard && window.isSecureContext) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n\n    const textArea = document.createElement(\"textarea\");\n    textArea.value = text;\n    textArea.style.position = \"fixed\";\n    textArea.style.left = \"-999999px\";\n    textArea.style.top = \"-999999px\";\n    document.body.appendChild(textArea);\n    textArea.focus();\n    textArea.select();\n    const succeeded = document.execCommand(\"copy\");\n    textArea.remove();\n    return succeeded;\n  } catch {\n    return false;\n  }\n}\n",
      "type": "registry:lib",
      "target": "lib/utils.ts"
    }
  ]
}
