{
	"$schema": "https://ui.shadcn.com/schema/registry-item.json",
	"name": "NeonGlyphs-JS-CSS",
	"title": "NeonGlyphs",
	"description": "A deep field of glowing neon glyphs floating through a 3D plane, with bloom and a color-split edge fade.",
	"type": "registry:component",
	"files": [
		{
			"type": "registry:file",
			"path": "NeonGlyphs.css",
			"target": "@components/NeonGlyphs.css",
			"content": ".neon-glyphs-container {\n  position: relative;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n}\n\n.neon-glyphs-canvas {\n  position: absolute;\n  inset: 0;\n  display: block;\n  width: 100%;\n  height: 100%;\n}\n"
		},
		{
			"type": "registry:component",
			"path": "NeonGlyphs.jsx",
			"content": "'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport './NeonGlyphs.css';\n\nconst MAX_COLORS = 8;\nconst MAX_CLICKS = 4;\nconst MAX_STEPS = 56;\nconst MAX_RENDER_DIM = 2400;\nconst BLOOM_LEVELS = 6;\nconst INTRO_SECONDS = 2.4;\nconst CLICK_SECONDS = 1.6;\nconst ATLAS_CELL = 64;\nconst ATLAS_COLUMNS = 16;\nconst DEFAULT_COLORS = ['#a6f3fa', '#ea6fe0', '#6fd6f7', '#d351b6', '#5aaef0'];\nconst DEFAULT_CHARACTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#$%&*+=<>?!';\nconst DEFAULT_FONT = '\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';\n\nconst VERTEX = `#version 300 es\nvoid main() {\n  vec2 p = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2));\n  gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);\n}`;\n\nconst SCENE = `#version 300 es\nprecision highp float;\nuniform sampler2D uAtlas;\nuniform vec2 uRes;\nuniform vec2 uAtlasGrid;\nuniform float uCount;\nuniform float uCell;\nuniform mat3 uBasis;\nuniform float uFocal;\nuniform float uDepth;\nuniform float uTime;\nuniform float uGlyphTime;\nuniform float uDensity;\nuniform float uFlicker;\nuniform float uBrightness;\nuniform float uSeed;\nuniform vec3 uColors[${MAX_COLORS}];\nuniform float uColorCount;\nuniform vec4 uHover;\nuniform vec4 uClicks[${MAX_CLICKS}];\nuniform float uIntro;\nout vec4 outColor;\n\nfloat h21(vec2 p) {\n  vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n  q += dot(q, q.yzx + 33.33);\n  return fract((q.x + q.y) * q.z);\n}\n\nfloat h31(vec3 p) {\n  p = fract(p * vec3(0.1031, 0.1030, 0.0973));\n  p += dot(p, p.yxz + 33.33);\n  return fract((p.x + p.y) * p.z);\n}\n\nvec3 pick(float h) {\n  return uColors[int(min(floor(h * uColorCount), uColorCount - 1.0))];\n}\n\nfloat glyph(float id, vec2 local, float lod) {\n  vec2 q = (floor(clamp(local, 0.0, 0.999) * 14.0) + 0.5) / 14.0;\n  float index = min(floor(id * uCount), uCount - 1.0);\n  float column = mod(index, uAtlasGrid.x);\n  float row = floor(index / uAtlasGrid.x);\n  vec2 uv = vec2((column + q.x) / uAtlasGrid.x, (row + 1.0 - q.y) / uAtlasGrid.y);\n  return textureLod(uAtlas, uv, lod).a;\n}\n\nvoid main() {\n  vec2 frag = gl_FragCoord.xy;\n  vec2 p = (frag - 0.5 * uRes) / uRes.y;\n  vec3 rd = normalize(vec3(p, -uFocal));\n  vec3 U = uBasis[0];\n  vec3 V = uBasis[1];\n  vec3 N = uBasis[2];\n  vec3 C = vec3(0.0, 0.0, -uFocal);\n  float half_ = 0.5 * uDepth * uCell;\n  float dn = dot(rd, N);\n  float cn = dot(C, N);\n  float tNear = 0.0;\n  float tFar = 40.0 * uFocal;\n  if (abs(dn) > 1e-5) {\n    float ta = (cn - half_) / dn;\n    float tb = (cn + half_) / dn;\n    tNear = max(min(ta, tb), 0.0);\n    tFar = max(ta, tb);\n  } else if (abs(cn) > half_) {\n    outColor = vec4(0.0, 0.0, 0.0, 1.0);\n    return;\n  }\n  if (tFar <= tNear) {\n    outColor = vec4(0.0, 0.0, 0.0, 1.0);\n    return;\n  }\n  float stepLen = 0.5 * uCell;\n  float count = min(ceil((tFar - tNear) / stepLen), ${MAX_STEPS.toFixed(1)});\n  vec3 right = normalize(cross(rd, vec3(0.0, 1.0, 0.0)));\n  vec3 up = cross(right, rd);\n  float jitter = fract(52.9829189 * fract(dot(frag, vec2(0.06711056, 0.00583715))));\n  float t = tNear + stepLen * jitter;\n  vec3 P0 = rd * t - C;\n  vec3 L = vec3(dot(P0, U), dot(P0, V), dot(P0, N)) / uCell;\n  vec3 dL = vec3(dot(rd, U), dot(rd, V), dot(rd, N)) * 0.5;\n  float depthScale = uFocal * uRes.y * uCell / max(-rd.z, 0.05);\n  vec3 flow = vec3(0.9 * sin(uTime * 0.05), uTime * 0.22, 0.6 * sin(uTime * 0.037));\n  vec3 accum = vec3(0.0);\n\n  for (int i = 0; i < ${MAX_STEPS}; i++) {\n    if (float(i) >= count) break;\n    float tt = t + float(i) * stepLen;\n    float layer = floor(L.z);\n    vec3 Lp = L + vec3(h21(vec2(layer, 5.3) + uSeed), h21(vec2(layer, 8.1) + uSeed), 0.0) - flow;\n    vec3 cell = floor(Lp);\n    float appear = clamp((uIntro - abs(cell.x) * 0.012 - abs(cell.y) * 0.016 - h31(cell + uSeed + 19.0) * 0.7) / 0.35, 0.0, 1.0);\n    if (appear > 0.0) {\n      float cycle = uTime * (0.06 + 0.07 * h31(cell + uSeed + 2.7)) + h31(cell + uSeed + 4.9);\n      float slot = floor(cycle);\n      float phase = cycle - slot;\n      vec3 id = cell + slot * 31.0;\n      bool present = h31(id + uSeed + 13.7) < uDensity;\n      float power = present ? (1.0 + 1.6 * h31(id + uSeed + 9.0)) * smoothstep(0.0, 0.2, phase) * (1.0 - smoothstep(0.7, 1.0, phase)) : 0.0;\n      vec3 color = pick(h31(id + uSeed + 3.0));\n      float rate = 4.0;\n      if (uHover.w > 0.001) {\n        vec2 hv = (cell.xy + 0.5 - uHover.xy) / uHover.z;\n        float w = exp(-dot(hv, hv)) * uHover.w;\n        if (present) {\n          power *= 1.0 + 1.2 * w;\n          rate += 10.0 * w;\n        } else if (w > 0.02 && h31(cell + uSeed + 63.0) < w * 0.25) {\n          present = true;\n          power = 1.4 * w;\n          rate = 12.0;\n        }\n      }\n      for (int c = 0; c < ${MAX_CLICKS}; c++) {\n        vec4 click = uClicks[c];\n        if (click.w <= 0.0) continue;\n        float reach = length(cell.xy + 0.5 - click.xy) - click.z * 16.0;\n        float fade = 1.0 - click.z / ${CLICK_SECONDS.toFixed(1)};\n        float ring = exp(-reach * reach / 5.0) * fade * fade;\n        if (ring < 0.03) continue;\n        if (present) {\n          power *= 1.0 + 2.5 * ring;\n          color = mix(color, vec3(1.0), 0.4 * ring);\n          rate = max(rate, 16.0);\n        } else if (h31(cell + uSeed + float(c) * 5.1 + 71.0) < ring * 0.5) {\n          present = true;\n          power = 2.0 * ring;\n          color = mix(color, vec3(1.0), 0.3);\n          rate = 16.0;\n        }\n      }\n      if (present && power > 0.001) {\n        vec3 bob = 0.1 * sin(uTime * (0.4 + 0.5 * vec3(h31(id + 1.1), h31(id + 2.2), h31(id + 3.3))) + 6.2831 * vec3(h31(id + 4.4), h31(id + 5.5), h31(id + 6.6)));\n        vec3 offset = (Lp - cell - 0.5 - bob) / 0.8;\n        vec3 world = U * offset.x + V * offset.y + N * offset.z;\n        vec2 local = vec2(dot(world, right), dot(world, up)) + 0.5;\n        if (local.x > 0.0 && local.x < 1.0 && local.y > 0.0 && local.y < 1.0) {\n          float pixels = depthScale / tt * 0.8;\n          float lod = clamp(log2(64.0 / max(pixels, 1.0)), 2.0, 6.0);\n          float seedHash = h31(id + uSeed + 11.0);\n          float charId = h31(id * 1.31 + floor(uGlyphTime * rate + seedHash * 9.0) * 17.17 + uSeed);\n          float ink = glyph(charId, local, lod);\n          float cover = smoothstep(0.25, 0.45, ink) * ink;\n          if (cover > 0.0) {\n            float beat = floor(uTime * 3.5 + seedHash * 3.0);\n            if (h31(id * 0.73 + beat * 9.13 + uSeed) > 1.0 - uFlicker) {\n              power *= 5.5;\n              color = mix(color, vec3(1.0), 0.4);\n            }\n            color = mix(color, pick(fract(seedHash + 0.37 + uTime * 0.05 + Lp.y * 0.012)), 0.25);\n            float fog = exp(-tt / uCell * 0.0086);\n            accum += color * cover * power * appear * fog * smoothstep(1.5, 4.0, pixels);\n          }\n        }\n      }\n    }\n    L += dL;\n  }\n\n  outColor = vec4(accum * 0.3 * uBrightness, 1.0);\n}`;\n\nconst DOWN = `#version 300 es\nprecision highp float;\nuniform sampler2D uSource;\nuniform vec2 uTexel;\nout vec4 outColor;\nvoid main() {\n  vec2 uv = gl_FragCoord.xy * 2.0 * uTexel;\n  vec3 c = texture(uSource, uv + vec2(-0.5, -0.5) * uTexel).rgb;\n  c += texture(uSource, uv + vec2(0.5, -0.5) * uTexel).rgb;\n  c += texture(uSource, uv + vec2(-0.5, 0.5) * uTexel).rgb;\n  c += texture(uSource, uv + vec2(0.5, 0.5) * uTexel).rgb;\n  outColor = vec4(min(c * 0.25, vec3(2.0)), 1.0);\n}`;\n\nconst BLUR = `#version 300 es\nprecision highp float;\nuniform sampler2D uSource;\nuniform vec2 uStep;\nuniform vec2 uSize;\nout vec4 outColor;\nvoid main() {\n  vec2 uv = gl_FragCoord.xy / uSize;\n  vec3 c = texture(uSource, uv).rgb * 0.2270270;\n  c += texture(uSource, uv + uStep * 1.3846154).rgb * 0.3162162;\n  c += texture(uSource, uv - uStep * 1.3846154).rgb * 0.3162162;\n  c += texture(uSource, uv + uStep * 3.2307692).rgb * 0.0702703;\n  c += texture(uSource, uv - uStep * 3.2307692).rgb * 0.0702703;\n  outColor = vec4(c, 1.0);\n}`;\n\nconst UP = `#version 300 es\nprecision highp float;\nuniform sampler2D uSource;\nuniform sampler2D uBase;\nuniform vec2 uSize;\nout vec4 outColor;\nvoid main() {\n  vec2 uv = gl_FragCoord.xy / uSize;\n  outColor = vec4(texture(uBase, uv).rgb + texture(uSource, uv).rgb * 0.8, 1.0);\n}`;\n\nconst ACCUM = `#version 300 es\nprecision highp float;\nuniform sampler2D uScene;\nuniform sampler2D uBloom;\nuniform sampler2D uPrev;\nuniform vec2 uRes;\nuniform float uGlow;\nuniform float uBlend;\nout vec4 outColor;\nvoid main() {\n  vec2 uv = gl_FragCoord.xy / uRes;\n  vec3 bloom = texture(uBloom, uv).rgb;\n  vec3 current = texture(uScene, uv).rgb + bloom * uGlow;\n  vec3 previous = texture(uPrev, uv).rgb;\n  outColor = vec4(mix(previous, current, uBlend), 1.0);\n}`;\n\nconst COMPOSITE = `#version 300 es\nprecision highp float;\nuniform sampler2D uScene;\nuniform vec2 uRes;\nuniform float uFade;\nuniform float uAberration;\nuniform float uLightMode;\nuniform float uOpacity;\nout vec4 outColor;\n\nfloat feather(float x, float w) {\n  if (w <= 0.0) return 1.0;\n  float t = clamp(min(x, 1.0 - x) / w, 0.0, 1.0);\n  return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n\nfloat mask(vec2 uv) {\n  return feather(uv.x, uFade * 0.34) * feather(uv.y, uFade * 0.44);\n}\n\nvec3 lightAt(vec2 uv) {\n  return texture(uScene, uv).rgb;\n}\n\nvoid main() {\n  vec2 uv = gl_FragCoord.xy / uRes;\n  float m = mask(uv);\n  vec2 dir = (uv - 0.5) * vec2(uRes.x / uRes.y, 1.0);\n  float edge = 1.0 - m;\n  vec2 shift = dir * uAberration * (0.004 + 0.05 * edge * edge) / vec2(uRes.x / uRes.y, 1.0);\n  vec2 ur = uv + shift;\n  vec2 ub = uv - shift;\n  vec3 c = vec3(lightAt(ur).r * mask(ur), lightAt(uv).g * m, lightAt(ub).b * mask(ub));\n  float peak = max(max(c.r, c.g), c.b);\n  if (peak <= 0.0005) {\n    outColor = vec4(0.0);\n    return;\n  }\n  float mapped = peak < 0.75 ? peak : 0.75 + 0.25 * (1.0 - exp(-(peak - 0.75) / 0.25));\n  vec3 col = c * (mapped / peak);\n  col = mix(col, vec3(mapped), smoothstep(0.9, 2.6, peak) * 0.55);\n  float alpha;\n  if (uLightMode > 0.5) {\n    vec3 hue = c / peak;\n    float lum = dot(hue, vec3(0.2126, 0.7152, 0.0722));\n    hue = clamp(mix(vec3(lum), hue, 1.7), 0.0, 1.0);\n    lum = dot(hue, vec3(0.2126, 0.7152, 0.0722));\n    vec3 ink = clamp(hue * (0.46 / max(lum, 0.2)), 0.0, 1.0);\n    float lift = max(peak - 0.14, 0.0) / 0.86;\n    alpha = (1.0 - exp(-3.2 * lift)) * 0.95;\n    col = ink * alpha;\n  } else {\n    alpha = max(max(col.r, col.g), col.b);\n  }\n  outColor = vec4(col, alpha) * uOpacity;\n}`;\n\nconst SCENE_UNIFORMS = [\n  'uAtlas',\n  'uRes',\n  'uAtlasGrid',\n  'uCount',\n  'uCell',\n  'uBasis',\n  'uFocal',\n  'uDepth',\n  'uTime',\n  'uGlyphTime',\n  'uDensity',\n  'uFlicker',\n  'uBrightness',\n  'uSeed',\n  'uColors',\n  'uColorCount',\n  'uHover',\n  'uClicks',\n  'uIntro'\n];\n\nconst PROGRAMS = {\n  scene: { source: SCENE, uniforms: SCENE_UNIFORMS },\n  down: { source: DOWN, uniforms: ['uSource', 'uTexel'] },\n  blur: { source: BLUR, uniforms: ['uSource', 'uStep', 'uSize'] },\n  up: { source: UP, uniforms: ['uSource', 'uBase', 'uSize'] },\n  accum: { source: ACCUM, uniforms: ['uScene', 'uBloom', 'uPrev', 'uRes', 'uGlow', 'uBlend'] },\n  composite: { source: COMPOSITE, uniforms: ['uScene', 'uRes', 'uFade', 'uAberration', 'uLightMode', 'uOpacity'] }\n};\n\nconst NAMES = Object.keys(PROGRAMS);\n\nconst clamp = (value, min, max) => Math.min(max, Math.max(min, value));\n\nconst num = (value, fallback) => {\n  const parsed = Number(value);\n  return Number.isFinite(parsed) ? parsed : fallback;\n};\n\nconst compileShader = (gl, type, source) => {\n  const shader = gl.createShader(type);\n  if (!shader) return null;\n  gl.shaderSource(shader, source);\n  gl.compileShader(shader);\n  return shader;\n};\n\nconst startProgram = (gl, source) => {\n  const vertex = compileShader(gl, gl.VERTEX_SHADER, VERTEX);\n  const fragment = compileShader(gl, gl.FRAGMENT_SHADER, source);\n  const program = vertex && fragment ? gl.createProgram() : null;\n  if (!vertex || !fragment || !program) {\n    if (vertex) gl.deleteShader(vertex);\n    if (fragment) gl.deleteShader(fragment);\n    return null;\n  }\n  gl.attachShader(program, vertex);\n  gl.attachShader(program, fragment);\n  gl.linkProgram(program);\n  return { program, vertex, fragment };\n};\n\nconst finishProgram = (gl, job, names) => {\n  const { program, vertex, fragment } = job;\n  const linked = gl.getProgramParameter(program, gl.LINK_STATUS);\n  if (!linked && !gl.isContextLost()) {\n    const broken = [vertex, fragment].filter(shader => !gl.getShaderParameter(shader, gl.COMPILE_STATUS));\n    if (broken.length) broken.forEach(shader => console.error(gl.getShaderInfoLog(shader)));\n    else console.error(gl.getProgramInfoLog(program));\n  }\n  gl.deleteShader(vertex);\n  gl.deleteShader(fragment);\n  if (!linked) {\n    gl.deleteProgram(program);\n    return null;\n  }\n  const uniforms = {};\n  for (const name of names) uniforms[name] = gl.getUniformLocation(program, name);\n  return { program, uniforms };\n};\n\nconst buildAtlas = (gl, characters, fontFamily) => {\n  const list = [...new Set([...characters].filter(char => char.trim()))];\n  if (!list.length) list.push('#');\n  const columns = Math.min(ATLAS_COLUMNS, list.length);\n  const rows = Math.ceil(list.length / columns);\n  const canvas = document.createElement('canvas');\n  canvas.width = ATLAS_CELL * columns;\n  canvas.height = ATLAS_CELL * rows;\n  const context = canvas.getContext('2d');\n  if (context) {\n    context.font = `500 ${Math.round(ATLAS_CELL * 0.74)}px ${fontFamily}`;\n    context.textAlign = 'center';\n    context.textBaseline = 'middle';\n    context.fillStyle = '#fff';\n    list.forEach((char, index) => {\n      const column = index % columns;\n      const row = Math.floor(index / columns);\n      context.fillText(char, column * ATLAS_CELL + ATLAS_CELL / 2, row * ATLAS_CELL + ATLAS_CELL / 2 + 2);\n    });\n  }\n  const texture = gl.createTexture();\n  gl.bindTexture(gl.TEXTURE_2D, texture);\n  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE, canvas);\n  gl.generateMipmap(gl.TEXTURE_2D);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n  return { texture, count: list.length, grid: [columns, rows] };\n};\n\nconst planeBasis = (tilt, turn, rotation) => {\n  const a = (tilt * Math.PI) / 180;\n  const b = (turn * Math.PI) / 180;\n  const c = (rotation * Math.PI) / 180;\n  const roll = v => [v[0] * Math.cos(c) - v[1] * Math.sin(c), v[0] * Math.sin(c) + v[1] * Math.cos(c), v[2]];\n  const pitch = v => [v[0], v[1] * Math.cos(a) + v[2] * Math.sin(a), -v[1] * Math.sin(a) + v[2] * Math.cos(a)];\n  const yaw = v => [v[0] * Math.cos(b) + v[2] * Math.sin(b), v[1], -v[0] * Math.sin(b) + v[2] * Math.cos(b)];\n  const apply = v => yaw(pitch(roll(v)));\n  return [apply([1, 0, 0]), apply([0, 1, 0]), apply([0, 0, 1])];\n};\n\nconst NeonGlyphs = ({\n  colors = DEFAULT_COLORS,\n  characters = DEFAULT_CHARACTERS,\n  fontFamily = DEFAULT_FONT,\n  cellSize = 16,\n  depth = 12,\n  tilt = 25,\n  turn = 0,\n  rotation = 0,\n  perspective = 60,\n  sway = 0.5,\n  speed = 0.15,\n  density = 0.1,\n  trails = 0.25,\n  glow = 0.75,\n  flicker = 0.5,\n  scramble = 0.5,\n  brightness = 1,\n  fade = 0.75,\n  aberration = 0.5,\n  variation = 0,\n  opacity = 1,\n  intro = true,\n  mouseInteraction = true,\n  burstOnClick = true,\n  lightMode = false,\n  paused = false,\n  dpr,\n  className = '',\n  ...rest\n}) => {\n  const containerRef = useRef(null);\n  const canvasRef = useRef(null);\n  const wakeRef = useRef(null);\n  const releaseRef = useRef(0);\n  const [generation, setGeneration] = useState(0);\n  const palette = (Array.isArray(colors) && colors.length ? colors : DEFAULT_COLORS).slice(0, MAX_COLORS).map(String);\n  const settings = {\n    colors: palette,\n    characters: String(characters || DEFAULT_CHARACTERS),\n    fontFamily: fontFamily || DEFAULT_FONT,\n    cellSize: clamp(num(cellSize, 16), 6, 80),\n    depth: clamp(Math.round(num(depth, 12)), 1, 32),\n    tilt: clamp(num(tilt, 25), -80, 80),\n    turn: clamp(num(turn, 0), -80, 80),\n    rotation: num(rotation, 0),\n    perspective: clamp(num(perspective, 60), 10, 120),\n    sway: clamp(num(sway, 0.5), 0, 2),\n    speed: Math.max(0, num(speed, 0.15)),\n    density: clamp(num(density, 0.1), 0, 1),\n    trails: clamp(num(trails, 0.25), 0, 1),\n    glow: clamp(num(glow, 0.75), 0, 3),\n    flicker: clamp(num(flicker, 0.5), 0, 1),\n    scramble: clamp(num(scramble, 0.5), 0, 4),\n    brightness: Math.max(0, num(brightness, 1)),\n    fade: clamp(num(fade, 0.75), 0, 1),\n    aberration: clamp(num(aberration, 0.5), 0, 2),\n    variation: num(variation, 0),\n    opacity: clamp(num(opacity, 1), 0, 1),\n    intro,\n    mouseInteraction,\n    burstOnClick,\n    lightMode,\n    paused,\n    dpr\n  };\n  const settingsRef = useRef(settings);\n  settingsRef.current = settings;\n\n  useEffect(() => {\n    wakeRef.current?.();\n  });\n\n  useEffect(() => {\n    const container = containerRef.current;\n    const canvas = canvasRef.current;\n    if (!container || !canvas) return undefined;\n    cancelAnimationFrame(releaseRef.current);\n    releaseRef.current = 0;\n    const gl = canvas.getContext('webgl2', {\n      alpha: true,\n      premultipliedAlpha: true,\n      antialias: false,\n      depth: false,\n      stencil: false,\n      powerPreference: 'default'\n    });\n    if (!gl) return undefined;\n    const parallel = gl.getExtension('KHR_parallel_shader_compile');\n    const floatTargets = Boolean(gl.getExtension('EXT_color_buffer_float'));\n    const jobs = {};\n    const programs = {};\n    let broken = false;\n    for (const name of NAMES) {\n      const job = startProgram(gl, PROGRAMS[name].source);\n      if (!job) broken = true;\n      else jobs[name] = job;\n    }\n    const finishAll = () => {\n      for (const name of NAMES) {\n        const job = jobs[name];\n        if (!job) continue;\n        delete jobs[name];\n        const done = finishProgram(gl, job, PROGRAMS[name].uniforms);\n        if (done) programs[name] = done;\n        else broken = true;\n      }\n      return !broken;\n    };\n    if (!parallel) finishAll();\n    const vao = gl.createVertexArray();\n    const probe = document.createElement('canvas');\n    probe.width = 1;\n    probe.height = 1;\n    const probeContext = probe.getContext('2d', { willReadFrequently: true });\n    const reduce = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;\n    const colorData = new Float32Array(MAX_COLORS * 3);\n    const clickData = new Float32Array(MAX_CLICKS * 4);\n    const state = {\n      time: 0,\n      glyphTime: 0,\n      clock: 0,\n      intro: settingsRef.current.intro && !reduce && !settingsRef.current.paused ? 0 : INTRO_SECONDS,\n      width: 1,\n      height: 1,\n      ratio: 1,\n      paletteKey: '',\n      colorCount: 1,\n      atlas: null,\n      atlasKey: '',\n      targets: null,\n      flip: 0,\n      fresh: true,\n      pointer: { x: 0, y: 0, inside: false },\n      hover: { x: 0, y: 0, vx: 0, vy: 0, presence: 0, placed: false },\n      lean: { x: 0, y: 0, vx: 0, vy: 0 },\n      angles: { tilt: 0, turn: 0 },\n      clicks: []\n    };\n    let raf = 0;\n    let last = 0;\n    let visible = true;\n    let alive = true;\n    let lost = false;\n\n    const toRgb = value => {\n      if (!probeContext || !value) return [1, 1, 1];\n      const css = /^[0-9a-f]{3,8}$/i.test(value) ? `#${value}` : value;\n      probeContext.clearRect(0, 0, 1, 1);\n      probeContext.fillStyle = '#000000';\n      probeContext.fillStyle = css;\n      probeContext.fillRect(0, 0, 1, 1);\n      const [r, g, b] = probeContext.getImageData(0, 0, 1, 1).data;\n      return [r / 255, g / 255, b / 255];\n    };\n\n    const syncPalette = s => {\n      const key = s.colors.join('|');\n      if (key === state.paletteKey) return;\n      state.paletteKey = key;\n      colorData.fill(0);\n      s.colors.forEach((color, index) => colorData.set(toRgb(color), index * 3));\n      state.colorCount = s.colors.length;\n    };\n\n    const syncAtlas = s => {\n      const key = `${s.fontFamily}|${s.characters}`;\n      if (key === state.atlasKey && state.atlas) return;\n      state.atlasKey = key;\n      if (state.atlas) gl.deleteTexture(state.atlas.texture);\n      state.atlas = buildAtlas(gl, s.characters, s.fontFamily);\n      document.fonts?.load?.(`500 64px ${s.fontFamily}`, s.characters).then(\n        () => {\n          if (!alive || state.atlasKey !== key || gl.isContextLost()) return;\n          if (state.atlas) gl.deleteTexture(state.atlas.texture);\n          state.atlas = buildAtlas(gl, s.characters, s.fontFamily);\n          wakeRef.current?.();\n        },\n        () => {}\n      );\n    };\n\n    const makeTarget = (width, height) => {\n      const texture = gl.createTexture();\n      gl.bindTexture(gl.TEXTURE_2D, texture);\n      gl.texImage2D(\n        gl.TEXTURE_2D,\n        0,\n        floatTargets ? gl.RGBA16F : gl.RGBA8,\n        width,\n        height,\n        0,\n        gl.RGBA,\n        floatTargets ? gl.HALF_FLOAT : gl.UNSIGNED_BYTE,\n        null\n      );\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n      const framebuffer = gl.createFramebuffer();\n      gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n      gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n      gl.clearColor(0, 0, 0, 1);\n      gl.clear(gl.COLOR_BUFFER_BIT);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n      return { texture, framebuffer, width, height };\n    };\n\n    const freeTarget = target => {\n      gl.deleteTexture(target.texture);\n      gl.deleteFramebuffer(target.framebuffer);\n    };\n\n    const freeTargets = () => {\n      if (!state.targets) return;\n      freeTarget(state.targets.scene);\n      state.targets.trail.forEach(freeTarget);\n      state.targets.levels.forEach(level => {\n        freeTarget(level.a);\n        freeTarget(level.b);\n      });\n      state.targets = null;\n    };\n\n    const syncTargets = () => {\n      const w = canvas.width;\n      const h = canvas.height;\n      if (state.targets && state.targets.width === w && state.targets.height === h) return;\n      freeTargets();\n      const quality = Math.min(1, 1.5 / Math.max(state.ratio, 1));\n      const sw = Math.max(1, Math.round(w * quality));\n      const sh = Math.max(1, Math.round(h * quality));\n      const levels = [];\n      let lw = sw;\n      let lh = sh;\n      for (let i = 0; i < BLOOM_LEVELS; i++) {\n        lw = Math.max(1, Math.round(lw / 2));\n        lh = Math.max(1, Math.round(lh / 2));\n        levels.push({ a: makeTarget(lw, lh), b: makeTarget(lw, lh) });\n      }\n      state.targets = {\n        width: w,\n        height: h,\n        scene: makeTarget(sw, sh),\n        trail: [makeTarget(w, h), makeTarget(w, h)],\n        levels\n      };\n      state.flip = 0;\n      state.fresh = true;\n    };\n\n    const syncAngles = () => {\n      const s = settingsRef.current;\n      const t = state.clock;\n      state.angles.tilt = s.tilt + s.sway * 4 * Math.sin(t * 0.17 + 1.1) + state.lean.y;\n      state.angles.turn = s.turn + s.sway * 9 * Math.sin(t * 0.11) + state.lean.x;\n    };\n\n    const project = (px, py) => {\n      const s = settingsRef.current;\n      const focal = 1 / Math.tan((s.perspective * Math.PI) / 180 / 2);\n      const [U, V, N] = planeBasis(state.angles.tilt, state.angles.turn, s.rotation);\n      const d = [(px - state.width / 2) / state.height, (state.height / 2 - py) / state.height, -focal];\n      const dn = d[0] * N[0] + d[1] * N[1] + d[2] * N[2];\n      if (dn > -1e-5) return null;\n      const t = (-focal * N[2]) / dn;\n      const P = [d[0] * t, d[1] * t, d[2] * t + focal];\n      const cell = s.cellSize / state.height;\n      return {\n        x: (P[0] * U[0] + P[1] * U[1] + P[2] * U[2]) / cell,\n        y: (P[0] * V[0] + P[1] * V[1] + P[2] * V[2]) / cell\n      };\n    };\n\n    const draw = (program, target, width, height) => {\n      gl.bindFramebuffer(gl.FRAMEBUFFER, target ? target.framebuffer : null);\n      gl.viewport(0, 0, width, height);\n      gl.useProgram(program.program);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n    };\n\n    const bind = (unit, texture) => {\n      gl.activeTexture(gl.TEXTURE0 + unit);\n      gl.bindTexture(gl.TEXTURE_2D, texture);\n    };\n\n    const render = dt => {\n      const { scene, down, blur, up, accum, composite } = programs;\n      if (!scene || !down || !blur || !up || !accum || !composite || broken || lost) return;\n      const s = settingsRef.current;\n      syncPalette(s);\n      syncAtlas(s);\n      syncTargets();\n      if (!state.atlas || !state.targets) return;\n      const targets = state.targets;\n      const w = canvas.width;\n      const h = canvas.height;\n      gl.disable(gl.BLEND);\n      gl.bindVertexArray(vao);\n\n      syncAngles();\n      const u = scene.uniforms;\n      gl.useProgram(scene.program);\n      bind(0, state.atlas.texture);\n      gl.uniform1i(u.uAtlas, 0);\n      gl.uniform2f(u.uRes, targets.scene.width, targets.scene.height);\n      gl.uniform2f(u.uAtlasGrid, state.atlas.grid[0], state.atlas.grid[1]);\n      gl.uniform1f(u.uCount, state.atlas.count);\n      const cell = s.cellSize / state.height;\n      gl.uniform1f(u.uCell, cell);\n      const [U, V, N] = planeBasis(state.angles.tilt, state.angles.turn, s.rotation);\n      gl.uniformMatrix3fv(u.uBasis, false, [...U, ...V, ...N]);\n      gl.uniform1f(u.uFocal, 1 / Math.tan((s.perspective * Math.PI) / 180 / 2));\n      gl.uniform1f(u.uDepth, s.depth);\n      gl.uniform1f(u.uTime, state.time);\n      gl.uniform1f(u.uGlyphTime, state.glyphTime);\n      gl.uniform1f(u.uDensity, s.density);\n      gl.uniform1f(u.uFlicker, s.flicker * 0.07);\n      gl.uniform1f(u.uBrightness, s.brightness);\n      gl.uniform1f(u.uSeed, (s.variation % 1000) * 13.37);\n      gl.uniform3fv(u.uColors, colorData);\n      gl.uniform1f(u.uColorCount, state.colorCount);\n      gl.uniform4f(u.uHover, state.hover.x, state.hover.y, 5.5, state.hover.presence);\n      clickData.fill(0);\n      state.clicks.forEach((click, index) => {\n        clickData[index * 4] = click.x;\n        clickData[index * 4 + 1] = click.y;\n        clickData[index * 4 + 2] = state.clock - click.start;\n        clickData[index * 4 + 3] = 1;\n      });\n      gl.uniform4fv(u.uClicks, clickData);\n      gl.uniform1f(u.uIntro, state.intro);\n      draw(scene, targets.scene, targets.scene.width, targets.scene.height);\n\n      let source = targets.scene;\n      targets.levels.forEach(level => {\n        gl.useProgram(down.program);\n        bind(0, source.texture);\n        gl.uniform1i(down.uniforms.uSource, 0);\n        gl.uniform2f(down.uniforms.uTexel, 1 / source.width, 1 / source.height);\n        draw(down, level.a, level.a.width, level.a.height);\n        gl.useProgram(blur.program);\n        gl.uniform1i(blur.uniforms.uSource, 0);\n        gl.uniform2f(blur.uniforms.uSize, level.a.width, level.a.height);\n        bind(0, level.a.texture);\n        gl.uniform2f(blur.uniforms.uStep, 1 / level.a.width, 0);\n        draw(blur, level.b, level.a.width, level.a.height);\n        bind(0, level.b.texture);\n        gl.uniform2f(blur.uniforms.uStep, 0, 1 / level.a.height);\n        draw(blur, level.a, level.a.width, level.a.height);\n        source = level.a;\n      });\n      for (let i = targets.levels.length - 2; i >= 0; i--) {\n        const level = targets.levels[i];\n        gl.useProgram(up.program);\n        bind(0, targets.levels[i + 1].a.texture);\n        bind(1, level.a.texture);\n        gl.uniform1i(up.uniforms.uSource, 0);\n        gl.uniform1i(up.uniforms.uBase, 1);\n        gl.uniform2f(up.uniforms.uSize, level.b.width, level.b.height);\n        draw(up, level.b, level.b.width, level.b.height);\n        const swap = level.a;\n        level.a = level.b;\n        level.b = swap;\n      }\n\n      const read = targets.trail[state.flip];\n      const write = targets.trail[1 - state.flip];\n      const au = accum.uniforms;\n      gl.useProgram(accum.program);\n      bind(0, targets.scene.texture);\n      bind(1, targets.levels[0].a.texture);\n      bind(2, read.texture);\n      gl.uniform1i(au.uScene, 0);\n      gl.uniform1i(au.uBloom, 1);\n      gl.uniform1i(au.uPrev, 2);\n      gl.uniform2f(au.uRes, w, h);\n      gl.uniform1f(au.uGlow, s.glow * (s.lightMode ? 0.25 : 1.8));\n      const tau = s.trails * 0.15;\n      gl.uniform1f(au.uBlend, state.fresh || tau <= 0.001 ? 1 : 1 - Math.exp(-Math.max(dt, 1 / 240) / tau));\n      draw(accum, write, w, h);\n      state.flip = 1 - state.flip;\n      state.fresh = false;\n\n      const cu = composite.uniforms;\n      gl.useProgram(composite.program);\n      bind(0, write.texture);\n      gl.uniform1i(cu.uScene, 0);\n      gl.uniform2f(cu.uRes, w, h);\n      gl.uniform1f(cu.uFade, s.fade);\n      gl.uniform1f(cu.uAberration, s.aberration);\n      gl.uniform1f(cu.uLightMode, s.lightMode ? 1 : 0);\n      gl.uniform1f(cu.uOpacity, s.opacity);\n      draw(composite, null, w, h);\n      gl.bindVertexArray(null);\n    };\n\n    const resize = () => {\n      const s = settingsRef.current;\n      const width = Math.max(1, container.clientWidth);\n      const height = Math.max(1, container.clientHeight);\n      const base = Math.min(s.dpr || window.devicePixelRatio || 1, 2);\n      const longest = Math.max(width, height) * base;\n      const ratio = longest > MAX_RENDER_DIM ? (base * MAX_RENDER_DIM) / longest : base;\n      const pixelWidth = Math.max(1, Math.round(width * ratio));\n      const pixelHeight = Math.max(1, Math.round(height * ratio));\n      if (canvas.width !== pixelWidth || canvas.height !== pixelHeight) {\n        canvas.width = pixelWidth;\n        canvas.height = pixelHeight;\n      }\n      state.width = width;\n      state.height = height;\n      state.ratio = pixelHeight / height;\n      state.fresh = true;\n      render(0);\n    };\n\n    const pending = () => NAMES.filter(name => jobs[name]);\n\n    const compiling = () =>\n      NAMES.some(name => {\n        const job = jobs[name];\n        return Boolean(job && parallel && !gl.getProgramParameter(job.program, parallel.COMPLETION_STATUS_KHR));\n      });\n\n    const ready = () => {\n      if (broken) return false;\n      const waiting = pending();\n      if (!waiting.length) return true;\n      if (!parallel || compiling()) return false;\n      return finishAll();\n    };\n\n    const frame = now => {\n      raf = 0;\n      if (!alive || !visible || document.hidden || lost) return;\n      if (!ready()) {\n        if (!broken && pending().length) raf = requestAnimationFrame(frame);\n        return;\n      }\n      const s = settingsRef.current;\n      const dt = last ? Math.min(0.05, (now - last) / 1000) : 0;\n      last = now;\n      const moving = !s.paused && !reduce;\n      if (moving) {\n        state.clock += dt;\n        state.intro += dt;\n        state.time += dt * s.speed;\n        state.glyphTime += dt * s.scramble;\n        state.clicks = state.clicks.filter(click => state.clock - click.start < CLICK_SECONDS);\n      } else if (state.intro < INTRO_SECONDS) {\n        state.intro = INTRO_SECONDS;\n      }\n      const { pointer, hover, lean } = state;\n      const leaning = s.mouseInteraction && pointer.inside && !reduce;\n      const leanX = leaning ? ((pointer.x / state.width) * 2 - 1) * 5 : 0;\n      const leanY = leaning ? ((pointer.y / state.height) * 2 - 1) * 3 : 0;\n      if (dt > 0) {\n        lean.vx += (40 * (leanX - lean.x) - 12 * lean.vx) * dt;\n        lean.vy += (40 * (leanY - lean.y) - 12 * lean.vy) * dt;\n        lean.x += lean.vx * dt;\n        lean.y += lean.vy * dt;\n      }\n      syncAngles();\n      const target = leaning ? project(pointer.x, pointer.y) : null;\n      if (target) {\n        if (!hover.placed) {\n          hover.x = target.x;\n          hover.y = target.y;\n          hover.vx = 0;\n          hover.vy = 0;\n          hover.placed = true;\n        }\n        if (dt > 0) {\n          hover.vx += (90 * (target.x - hover.x) - 18 * hover.vx) * dt;\n          hover.vy += (90 * (target.y - hover.y) - 18 * hover.vy) * dt;\n          hover.x += hover.vx * dt;\n          hover.y += hover.vy * dt;\n        }\n      }\n      const goal = target ? 1 : 0;\n      hover.presence += (goal - hover.presence) * (1 - Math.exp(-dt / (goal > hover.presence ? 0.25 : 0.6)));\n      if (!target && hover.presence < 0.001) hover.placed = false;\n      render(dt);\n      const animating = moving && (s.speed > 0 || s.scramble > 0 || s.sway > 0 || state.clicks.length > 0);\n      const settling =\n        Math.abs(goal - hover.presence) > 0.002 ||\n        state.intro < INTRO_SECONDS ||\n        Math.hypot(lean.vx, lean.vy) > 0.01 ||\n        Math.hypot(leanX - lean.x, leanY - lean.y) > 0.01;\n      if (animating || settling) raf = requestAnimationFrame(frame);\n      else last = 0;\n    };\n\n    const wake = () => {\n      if (!raf && alive && visible && !document.hidden && !lost) raf = requestAnimationFrame(frame);\n    };\n\n    const locate = event => {\n      const rect = container.getBoundingClientRect();\n      const x = event.clientX - rect.left;\n      const y = event.clientY - rect.top;\n      return { x, y, inside: x >= 0 && y >= 0 && x <= rect.width && y <= rect.height };\n    };\n\n    const onPointerMove = event => {\n      const spot = locate(event);\n      state.pointer.x = spot.x;\n      state.pointer.y = spot.y;\n      state.pointer.inside = spot.inside;\n      wake();\n    };\n\n    const onPointerDown = event => {\n      const s = settingsRef.current;\n      if (!s.mouseInteraction || !s.burstOnClick || event.button !== 0 || reduce || s.paused) return;\n      if (\n        event.target instanceof Element &&\n        event.target.closest('a, button, input, textarea, select, label, [role=\"button\"]')\n      )\n        return;\n      const spot = locate(event);\n      if (!spot.inside) return;\n      const point = project(spot.x, spot.y);\n      if (!point) return;\n      state.clicks.push({ x: point.x, y: point.y, start: state.clock });\n      while (state.clicks.length > MAX_CLICKS) state.clicks.shift();\n      wake();\n    };\n\n    const onPointerLeave = () => {\n      state.pointer.inside = false;\n      wake();\n    };\n\n    const onVisibility = () => {\n      last = 0;\n      wake();\n    };\n\n    const onLost = event => {\n      event.preventDefault();\n      lost = true;\n      cancelAnimationFrame(raf);\n      raf = 0;\n    };\n\n    const onRestored = () => setGeneration(value => value + 1);\n\n    const resizeObserver = new ResizeObserver(resize);\n    resizeObserver.observe(container);\n    const intersection = new IntersectionObserver(entries => {\n      visible = entries.some(entry => entry.isIntersecting);\n      if (visible) {\n        last = 0;\n        wake();\n      }\n    });\n    intersection.observe(container);\n    window.addEventListener('pointermove', onPointerMove, { passive: true });\n    window.addEventListener('pointerdown', onPointerDown);\n    document.documentElement.addEventListener('pointerleave', onPointerLeave);\n    document.addEventListener('visibilitychange', onVisibility);\n    canvas.addEventListener('webglcontextlost', onLost);\n    canvas.addEventListener('webglcontextrestored', onRestored);\n    resize();\n    wake();\n    wakeRef.current = () => {\n      if (!raf) render(0);\n      wake();\n    };\n\n    return () => {\n      alive = false;\n      cancelAnimationFrame(raf);\n      wakeRef.current = null;\n      resizeObserver.disconnect();\n      intersection.disconnect();\n      window.removeEventListener('pointermove', onPointerMove);\n      window.removeEventListener('pointerdown', onPointerDown);\n      document.documentElement.removeEventListener('pointerleave', onPointerLeave);\n      document.removeEventListener('visibilitychange', onVisibility);\n      canvas.removeEventListener('webglcontextlost', onLost);\n      canvas.removeEventListener('webglcontextrestored', onRestored);\n      if (!gl.isContextLost()) {\n        gl.deleteVertexArray(vao);\n        freeTargets();\n        if (state.atlas) gl.deleteTexture(state.atlas.texture);\n        NAMES.forEach(name => {\n          const program = programs[name];\n          if (program) gl.deleteProgram(program.program);\n        });\n        const release = () => {\n          const waiting = pending();\n          if (!waiting.length || gl.isContextLost()) return;\n          if (compiling()) {\n            requestAnimationFrame(release);\n            return;\n          }\n          waiting.forEach(name => {\n            const job = jobs[name];\n            if (!job) return;\n            gl.deleteShader(job.vertex);\n            gl.deleteShader(job.fragment);\n            gl.deleteProgram(job.program);\n            delete jobs[name];\n          });\n        };\n        release();\n      }\n      const free = () => {\n        releaseRef.current = 0;\n        if (!canvas.isConnected && !gl.isContextLost()) gl.getExtension('WEBGL_lose_context')?.loseContext();\n      };\n      if (canvas.isConnected) releaseRef.current = requestAnimationFrame(free);\n      else free();\n    };\n  }, [generation]);\n\n  return (\n    <div ref={containerRef} className={`neon-glyphs-container${className ? ` ${className}` : ''}`} {...rest}>\n      <canvas ref={canvasRef} className=\"neon-glyphs-canvas\" aria-hidden=\"true\" />\n    </div>\n  );\n};\n\nexport default NeonGlyphs;\n"
		}
	],
	"registryDependencies": [],
	"dependencies": []
}