{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "noise-forge-sting",
  "title": "Noise Forge Sting",
  "description": "The Remocn wordmark forges out of noise on a warm glow, tagline fading in below.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "registryDependencies": ["@remocn/gsh"],
  "files": [
    {
      "path": "registry/remocn/noise-forge-sting/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont as loadGeist } from \"@remotion/google-fonts/Geist\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport type { ReactNode } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  interpolateColors,\n  random,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/remocn/gsh/gradient-engine\";\nimport { GshGround, gshParams } from \"@/lib/remocn/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/remocn/gsh/presets\";\n\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"600\"],\n  subsets: [\"latin\"],\n});\nconst geist = loadGeist(\"normal\", {\n  weights: [\"300\", \"400\"],\n  subsets: [\"latin\"],\n});\n\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst LIGHT = Easing.bezier(0.22, 1, 0.36, 1);\nconst COOL = Easing.bezier(0.65, 0, 0.35, 1);\nconst CAMERA = Easing.bezier(0.45, 0, 0.55, 1);\n\nconst B = {\n  spark: 0,\n  seam: 4,\n  seamLen: 18,\n  forge: 12,\n  ring: 6,\n  glyphLen: 15,\n  markLen: 18,\n  seamOut: 30,\n  seamOutLen: 18,\n  lock: 48,\n  cool: 54,\n  coolLen: 18,\n  tagline: 66,\n  end: 126,\n};\n\nexport const NOISE_FORGE_STING_DURATION = B.end;\n\nconst SLICES = 11;\nconst BARS = 6;\n\nconst ramp = (f: number, start: number, dur: number, easing = ENTER) =>\n  interpolate(f, [start, start + dur], [0, 1], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing,\n  });\n\nconst clamp01 = (v: number) => Math.min(1, Math.max(0, v));\n\nexport interface NoiseForgeStingProps {\n  theme?: \"dark\" | \"light\";\n  accent?: string;\n  ink?: string;\n  hot?: string;\n  tagline?: string;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}\n\nconst THEMES = {\n  dark: {\n    ink: \"#f3f4f7\",\n    sub: \"rgba(226,230,242,0.66)\",\n    hot: \"#ffffff\",\n    halo: \"rgba(214,224,255,0.9)\",\n    accent: \"#4a6bff\",\n    ground: undefined as GshPresetId | undefined,\n    groundParams: {\n      kind: \"limb\",\n      colors: [\"#e6ebff\", \"#7d93ff\", \"#2f4fe0\", \"#0a1038\"],\n      background: \"#020308\",\n      speed: 1.4,\n      loopSeconds: 14,\n      warp: 0.45,\n      grain: 0.12,\n      seed: 3,\n    } as Partial<GradientParams>,\n    tallParams: {\n      kind: \"mist\",\n      colors: [\"#e6ebff\", \"#7d93ff\", \"#2f4fe0\", \"#0a1038\"],\n      background: \"#020308\",\n      speed: 0.9,\n      loopSeconds: 16,\n      scale: 0.85,\n      warp: 0.4,\n      blur: 0.7,\n      grain: 0.12,\n      seed: 4,\n    } as Partial<GradientParams> | undefined,\n    lift: 1.55,\n  },\n  light: {\n    ink: \"#15161b\",\n    sub: \"rgba(28,30,40,0.6)\",\n    hot: \"#ff5b1f\",\n    halo: \"rgba(255,138,61,0.85)\",\n    accent: \"#3B5BFD\",\n    ground: \"paper-crease\" as GshPresetId | undefined,\n    groundParams: undefined as Partial<GradientParams> | undefined,\n    tallParams: undefined as Partial<GradientParams> | undefined,\n    lift: 1,\n  },\n};\n\ntype Glyph = { key: string; order: number; mark: boolean; char: string };\n\nfunction glyphPlan(word: string): Glyph[] {\n  const chars = Array.from(word);\n  const n = chars.length;\n  const centre = (n - 1) / 2;\n  const letters = chars.map((c, i) => ({\n    key: `${c}-${i.toString()}`,\n    order: Math.floor(Math.abs(i - centre)),\n    mark: false,\n    char: c,\n  }));\n  const last = letters.reduce((m, g) => Math.max(m, g.order), 0);\n  return [{ key: \"mark\", order: last + 1, mark: true, char: \"\" }, ...letters];\n}\n\nfunction Slice({\n  index,\n  frame,\n  start,\n  lockAt,\n  amp,\n  seed,\n  children,\n}: {\n  index: number;\n  frame: number;\n  start: number;\n  lockAt: number;\n  amp: number;\n  seed: string;\n  children: ReactNode;\n}) {\n  const tick = Math.floor(frame / 2);\n  const appear = start + Math.floor(random(`${seed}-a-${index}`) * 4);\n  if (frame < appear) return null;\n  const p = clamp01((frame - start) / Math.max(1, lockAt - start));\n  const r = random(`${seed}-x-${index}-${tick}`) * 2 - 1;\n  const left = (1 - p) ** 1.6;\n  const dx = r * amp * left;\n  const sx = 1 + left * random(`${seed}-s-${index}-${tick}`) * 1.4;\n  const flicker = p < 0.8 && random(`${seed}-f-${index}-${tick}`) < 0.28;\n  if (flicker) return null;\n  const top = (index / SLICES) * 100;\n  const bottom = 100 - ((index + 1) / SLICES) * 100;\n  return (\n    <span\n      style={{\n        position: \"absolute\",\n        inset: 0,\n        clipPath: `inset(${top}% -60% ${bottom}% -60%)`,\n        transform: `translateX(${dx}em) scaleX(${sx})`,\n        transformOrigin: \"50% 50%\",\n      }}\n    >\n      {children}\n    </span>\n  );\n}\n\nfunction Bars({\n  frame,\n  start,\n  len,\n  seed,\n  color,\n}: {\n  frame: number;\n  start: number;\n  len: number;\n  seed: string;\n  color: string;\n}) {\n  const p = (frame - start) / len;\n  if (p < 0 || p > 0.5) return null;\n  const tick = Math.floor(frame / 2);\n  const fade = 1 - p / 0.5;\n  return (\n    <>\n      {Array.from({ length: BARS }, (_, i) => {\n        const k = `${seed}-b-${i}-${tick}`;\n        if (random(`${k}-on`) < 0.3) return null;\n        const row = Math.floor(random(`${k}-y`) * SLICES);\n        const w = 30 + random(`${k}-w`) * 110;\n        const x = -40 + random(`${k}-p`) * 110;\n        return (\n          <span\n            key={`bar-${i.toString()}`}\n            style={{\n              position: \"absolute\",\n              left: `${x}%`,\n              top: `${(row / SLICES) * 100}%`,\n              width: `${w}%`,\n              height: `${(0.55 / SLICES) * 100}%`,\n              background: color,\n              opacity: fade * (0.55 + random(`${k}-o`) * 0.45),\n            }}\n          />\n        );\n      })}\n    </>\n  );\n}\n\nfunction MarkSvg({ color }: { color: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 124.06 134.26\"\n      style={{ height: \"0.76em\", width: \"auto\", display: \"block\" }}\n      aria-hidden\n    >\n      <path fill={color} d={REMOCN_R_PATH} />\n    </svg>\n  );\n}\n\nfunction ForgedGlyph({\n  glyph,\n  frame,\n  color,\n  hot,\n}: {\n  glyph: Glyph;\n  frame: number;\n  color: string;\n  hot: string;\n}) {\n  const start = B.forge + glyph.order * B.ring;\n  const len = glyph.mark ? B.markLen : B.glyphLen;\n  const seed = `nf-${glyph.key}`;\n  const content = glyph.mark ? <MarkSvg color={color} /> : glyph.char;\n  const locked = frame >= start + len;\n  const box = {\n    position: \"relative\" as const,\n    display: \"inline-block\",\n    marginLeft: glyph.mark ? 0 : glyph.key.endsWith(\"-0\") ? \"0.04em\" : 0,\n  };\n  if (locked) {\n    return <span style={{ ...box, color }}>{content}</span>;\n  }\n  const amp = glyph.mark ? 0.5 : 0.36;\n  return (\n    <span style={{ ...box, color }}>\n      <span style={{ visibility: \"hidden\", display: \"inline-block\" }}>\n        {content}\n      </span>\n      {frame >= start &&\n        Array.from({ length: SLICES }, (_, i) => {\n          const lockAt =\n            start + len * (0.4 + 0.6 * random(`${seed}-l-${i.toString()}`));\n          return (\n            <Slice\n              key={`s-${i.toString()}`}\n              index={i}\n              frame={frame}\n              start={start}\n              lockAt={lockAt}\n              amp={amp}\n              seed={seed}\n            >\n              {content}\n            </Slice>\n          );\n        })}\n      <Bars frame={frame} start={start} len={len} seed={seed} color={hot} />\n    </span>\n  );\n}\n\nexport function NoiseForgeSting({\n  theme = \"dark\",\n  accent,\n  ink,\n  hot,\n  tagline = \"Launch videos, built from parts.\",\n  ground,\n  groundParams,\n}: NoiseForgeStingProps) {\n  const frame = useCurrentFrame();\n  const { width: W, height: H } = useVideoConfig();\n  const c = THEMES[theme];\n  const inkC = ink ?? c.ink;\n  const markC = accent ?? c.accent;\n  const hotC = hot ?? c.hot;\n  const portrait = H > W * 1.1;\n  const custom = Boolean(ground || groundParams);\n  const preset = ground ?? (groundParams ? undefined : c.ground);\n  const gParams =\n    groundParams ??\n    (ground\n      ? undefined\n      : portrait && c.tallParams\n        ? c.tallParams\n        : c.groundParams);\n  const lift = custom || (portrait && c.tallParams) ? 1 : c.lift;\n\n  const fontSize = portrait ? W * 0.205 : W * 0.172;\n  const glyphs = glyphPlan(\"emocn\");\n\n  const cool = ramp(frame, B.cool, B.coolLen, COOL);\n  const heat = 1 - cool;\n  const letterC = interpolateColors(cool, [0, 1], [hotC, inkC]);\n  const markColor = interpolateColors(cool, [0, 1], [hotC, markC]);\n\n  const sparkIn = ramp(frame, B.spark - 3, 6, LIGHT);\n  const seamGrow = ramp(frame, B.seam, B.seamLen, ENTER);\n  const seamOut = ramp(frame, B.seamOut, B.seamOutLen, COOL);\n  const seamW = interpolate(seamGrow, [0, 1], [0.05, 4.4]);\n  const seamH = interpolate(seamOut, [0, 1], [1, 0.3]);\n\n  const punch = interpolate(\n    frame,\n    [B.lock, B.lock + 2, B.lock + 8],\n    [1, 1.028, 1],\n    {\n      extrapolateLeft: \"clamp\",\n      extrapolateRight: \"clamp\",\n      easing: CAMERA,\n    },\n  );\n  const push = interpolate(frame, [0, B.end], [1.04, 1], {\n    easing: CAMERA,\n    extrapolateRight: \"clamp\",\n  });\n\n  const glowA = (fontSize * 0.05 + 2) * heat;\n  const glowB = fontSize * 0.22 * heat;\n  const glow =\n    heat > 0.01\n      ? `drop-shadow(0 0 ${glowA}px ${c.halo}) drop-shadow(0 0 ${glowB}px ${c.halo})`\n      : undefined;\n\n  const tagSize = fontSize * (portrait ? 0.36 : 0.25);\n  const words = tagline.split(\" \");\n  const groundFade = interpolate(frame, [0, 18], [0.35, 1], {\n    extrapolateRight: \"clamp\",\n  });\n\n  return (\n    <AbsoluteFill\n      style={{\n        overflow: \"hidden\",\n        background: gshParams(preset, gParams).background,\n      }}\n    >\n      <AbsoluteFill\n        style={{\n          opacity: groundFade,\n          transform: lift !== 1 ? `scale(${lift})` : undefined,\n          transformOrigin: \"50% 0%\",\n        }}\n      >\n        <GshGround\n          preset={preset}\n          params={gParams}\n          timeOffset={4}\n          timeScale={0.5}\n        />\n      </AbsoluteFill>\n      <AbsoluteFill\n        style={{\n          alignItems: \"center\",\n          justifyContent: \"center\",\n          transform: `scale(${push * punch})`,\n        }}\n      >\n        <div\n          style={{\n            display: \"flex\",\n            flexDirection: \"column\",\n            alignItems: \"center\",\n            gap: fontSize * (portrait ? 0.34 : 0.26),\n            marginTop: portrait ? -H * 0.04 : 0,\n          }}\n        >\n          <div\n            style={{\n              position: \"relative\",\n              display: \"flex\",\n              alignItems: \"baseline\",\n              fontFamily: manrope.fontFamily,\n              fontWeight: 600,\n              fontSize,\n              letterSpacing: \"-0.025em\",\n              lineHeight: 1,\n              filter: glow,\n            }}\n          >\n            <span\n              style={{\n                position: \"absolute\",\n                left: \"50%\",\n                top: \"52%\",\n                width: `${seamW}em`,\n                height: Math.max(2, fontSize * 0.018) * seamH,\n                transform: \"translate(-50%, -50%)\",\n                borderRadius: 999,\n                background: hotC,\n                opacity: sparkIn * (1 - seamOut),\n              }}\n            />\n            {glyphs.map((g) => (\n              <ForgedGlyph\n                key={g.key}\n                glyph={g}\n                frame={frame}\n                color={g.mark ? markColor : letterC}\n                hot={hotC}\n              />\n            ))}\n          </div>\n          <div\n            style={{\n              display: \"flex\",\n              flexWrap: \"wrap\",\n              justifyContent: \"center\",\n              maxWidth: portrait ? W * 0.8 : W * 0.8,\n              rowGap: tagSize * 0.1,\n              fontFamily: geist.fontFamily,\n              fontWeight: 300,\n              fontSize: tagSize,\n              letterSpacing: \"-0.02em\",\n              lineHeight: 1.12,\n              color: c.sub,\n            }}\n          >\n            {words.map((w, i) => {\n              const p = ramp(frame, B.tagline + i * 2, 14);\n              return (\n                <span\n                  key={`${w}-${i.toString()}`}\n                  style={{\n                    display: \"inline-block\",\n                    overflow: \"hidden\",\n                    paddingBottom: tagSize * 0.14,\n                    marginBottom: -tagSize * 0.14,\n                    marginRight: i < words.length - 1 ? tagSize * 0.26 : 0,\n                  }}\n                >\n                  <span\n                    style={{\n                      display: \"inline-block\",\n                      transform: `translateY(${(1 - p) * 105}%)`,\n                      filter: p < 1 ? `blur(${(1 - p) * 6}px)` : undefined,\n                    }}\n                  >\n                    {w}\n                  </span>\n                </span>\n              );\n            })}\n          </div>\n        </div>\n      </AbsoluteFill>\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/noise-forge-sting.tsx"
    }
  ],
  "type": "registry:component"
}
