{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "portfolio-v5",
  "title": "Portfolio v5",
  "description": "Left-column about and projects over a WebGPU Optimized Black Hole background — Jon Doe filler. New projects only (shadcn init --template next).",
  "dependencies": [
    "vgpu",
    "@vgpu/wgsl",
    "@webgpu/types",
    "class-variance-authority",
    "radix-ui"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/new-york/templates/portfolio-v5/components/ui/button.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n  \"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n        outline:\n          \"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n        secondary:\n          \"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n        ghost:\n          \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n        destructive:\n          \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n        link: \"text-primary underline-offset-4 hover:underline\",\n      },\n      size: {\n        default:\n          \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n        xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n        sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n        lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n        icon: \"size-8\",\n        \"icon-xs\":\n          \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n        \"icon-sm\":\n          \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n        \"icon-lg\": \"size-9\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nfunction Button({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"button\"> &\n  VariantProps<typeof buttonVariants> & {\n    asChild?: boolean\n  }) {\n  const Comp = asChild ? Slot.Root : \"button\"\n\n  return (\n    <Comp\n      data-slot=\"button\"\n      data-variant={variant}\n      data-size={size}\n      className={cn(buttonVariants({ variant, size, className }))}\n      {...props}\n    />\n  )\n}\n\nexport { Button, buttonVariants }\n",
      "type": "registry:ui",
      "target": "components/ui/button.tsx"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/app/layout.tsx",
      "content": "import type { Metadata, Viewport } from \"next\"\nimport { Oxanium } from \"next/font/google\"\nimport type { ReactNode } from \"react\"\n\nimport { BlackHole } from \"../components/black-hole\"\n\nimport \"./globals.css\"\n\nconst oxanium = Oxanium({\n  subsets: [\"latin\"],\n  variable: \"--font-oxanium\",\n})\n\nexport const metadata: Metadata = {\n  title: \"Jon Doe\",\n  description:\n    \"Fullstack developer — about and projects over a WebGPU black hole.\",\n}\n\nexport const viewport: Viewport = {\n  width: \"device-width\",\n  initialScale: 1,\n  viewportFit: \"cover\",\n  colorScheme: \"dark\",\n  themeColor: \"#000000\",\n}\n\nexport default function RootLayout({ children }: { children: ReactNode }) {\n  return (\n    <html\n      lang=\"en\"\n      className={`${oxanium.variable} dark h-full antialiased`}\n      suppressHydrationWarning\n    >\n      <body className=\"relative m-0 min-h-svh overflow-x-hidden bg-black p-0 font-sans text-base text-white antialiased\">\n        <div\n          className=\"fixed inset-0 z-0 overflow-hidden bg-black\"\n          aria-hidden\n        >\n          <BlackHole />\n        </div>\n        {children}\n      </body>\n    </html>\n  )\n}\n",
      "type": "registry:page",
      "target": "app/layout.tsx"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/app/page.tsx",
      "content": "import { Button } from \"@/components/ui/button\"\n\nconst projects = [\n  {\n    name: \"Panfry\",\n    href: \"https://github.com/\",\n    description: \"A small recipe box for the meals I actually cook on repeat.\",\n  },\n  {\n    name: \"Longmile\",\n    href: \"https://github.com/\",\n    description:\n      \"Tracks my slow, patient return to running after a bad knee.\",\n  },\n  {\n    name: \"Spinebox\",\n    href: \"https://github.com/\",\n    description: \"A shelf for the books I have actually finished this year.\",\n  },\n  {\n    name: \"Coinwell\",\n    href: \"https://github.com/\",\n    description: \"A simple, honest look at where my money actually goes.\",\n  },\n] as const\n\nexport default function HomePage() {\n  return (\n    <main className=\"pointer-events-none relative z-10 max-w-md px-4 pt-[max(16vh,calc(1.5rem+env(safe-area-inset-top)))] pb-16 text-base text-white sm:max-w-lg sm:px-6 md:max-w-md md:px-8 lg:max-w-lg\">\n      <div className=\"flex flex-col gap-10\">\n        <div className=\"flex flex-col gap-5\">\n          <nav className=\"pointer-events-auto flex flex-wrap gap-x-4 gap-y-1\">\n            <Button\n              variant=\"link\"\n              asChild\n              className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n            >\n              <a\n                href=\"https://instagram.com\"\n                target=\"_blank\"\n                rel=\"noreferrer\"\n              >\n                Instagram\n              </a>\n            </Button>\n            <Button\n              variant=\"link\"\n              asChild\n              className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n            >\n              <a href=\"https://x.com\" target=\"_blank\" rel=\"noreferrer\">\n                X\n              </a>\n            </Button>\n            <Button\n              variant=\"link\"\n              asChild\n              className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n            >\n              <a href=\"https://github.com\" target=\"_blank\" rel=\"noreferrer\">\n                GitHub\n              </a>\n            </Button>\n          </nav>\n\n          <section className=\"pointer-events-auto flex flex-col gap-3 leading-relaxed\">\n            <p>\n              I&apos;m Jon, a fullstack developer in Portland. Most of my work\n              is with early AI infrastructure teams.\n            </p>\n            <p>\n              I keep the stack small and ship in small pieces. I want to leave\n              code the next person can read without me there to explain it.\n            </p>\n            <p>\n              Outside work I cook the same handful of dinners on repeat.\n              I&apos;m easing back into running after a bad knee, and working\n              through a pile of books I bought and never opened.\n            </p>\n          </section>\n        </div>\n\n        <section className=\"pointer-events-auto flex flex-col gap-4\">\n          <h2 className=\"text-base font-normal\">Projects</h2>\n          <ul className=\"flex flex-col gap-4\">\n            {projects.map((project) => (\n              <li key={project.name} className=\"flex flex-col gap-1\">\n                <Button\n                  variant=\"link\"\n                  asChild\n                  className=\"h-auto w-fit justify-start p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n                >\n                  <a href={project.href} target=\"_blank\" rel=\"noreferrer\">\n                    {project.name}\n                  </a>\n                </Button>\n                <span>{project.description}</span>\n              </li>\n            ))}\n          </ul>\n        </section>\n      </div>\n    </main>\n  )\n}\n",
      "type": "registry:page",
      "target": "app/page.tsx"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/app/globals.css",
      "content": "@import \"tailwindcss\";\n\n@custom-variant dark (&:is(.dark *));\n\n:root {\n  --background: oklch(0 0 0);\n  --foreground: oklch(0.985 0 0);\n  --primary: oklch(0.985 0 0);\n  --primary-foreground: oklch(0 0 0);\n  --muted-foreground: oklch(0.708 0 0);\n  --border: oklch(1 0 0 / 15%);\n  --ring: oklch(0.985 0 0 / 40%);\n}\n\n@theme inline {\n  --font-sans: var(--font-oxanium);\n  --color-background: var(--background);\n  --color-foreground: var(--foreground);\n  --color-primary: var(--primary);\n  --color-primary-foreground: var(--primary-foreground);\n  --color-muted-foreground: var(--muted-foreground);\n  --color-border: var(--border);\n  --color-ring: var(--ring);\n}\n\n@layer base {\n  * {\n    @apply border-border;\n  }\n\n  html,\n  body {\n    @apply bg-black text-base text-white;\n  }\n}\n",
      "type": "registry:file",
      "target": "app/globals.css"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useRef } from \"react\"\n\nimport { createRenderer } from \"./black-hole/renderer\"\n\n/**\n * Optimized Black Hole (vgpu). Mount inside a sized ancestor (layout uses\n * `fixed inset-0`). Skips WebGPU when the user prefers reduced motion or\n * when init fails — the page stays black either way.\n */\nexport function BlackHole() {\n  const canvasRef = useRef<HTMLCanvasElement>(null)\n\n  useEffect(() => {\n    const canvas = canvasRef.current\n    if (!canvas) return\n\n    const reduceMotion = window.matchMedia(\n      \"(prefers-reduced-motion: reduce)\"\n    ).matches\n    if (reduceMotion) return\n\n    const renderer = createRenderer({ canvas })\n    void renderer.ready.catch((error: unknown) => {\n      console.error(\"[black-hole] renderer failed\", error)\n    })\n\n    return () => {\n      renderer.dispose()\n    }\n  }, [])\n\n  return (\n    <canvas ref={canvasRef} className=\"block h-full w-full touch-none\" />\n  )\n}\n",
      "type": "registry:component",
      "target": "components/black-hole.tsx"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/renderer.ts",
      "content": "// Browser lifecycle for the baked black-hole pipeline. VGPU stays dynamically imported.\n\nimport type { Frame, Gpu, Surface } from \"vgpu\";\n\ntype VgpuApi = typeof import(\"vgpu\");\n\nimport {\n  createEffects,\n  createTargets,\n  destroyTargets,\n  prewarm,\n  renderChain,\n  setBakeUniforms,\n  setBindings,\n  setPostUniforms,\n  setShadeUniforms,\n  type Effects,\n  type Targets,\n} from \"./pipeline\";\nimport { defaultHeroSettings } from \"./settings\";\n\nconst SCENE_YAW_TAU_S = 0.325;\n\nconst MAX_FRAME_DT_S = 0.1;\n\nconst TARGET_FPS = 60;\n\nconst FRAME_PACING_EPSILON_MS = 2;\n\nconst MIN_FRAME_INTERVAL_MS = 1000 / TARGET_FPS - FRAME_PACING_EPSILON_MS;\nconst MOBILE_QUERY = \"(max-width: 767px)\";\n\ninterface RendererOptions {\n  canvas: HTMLCanvasElement;\n}\n\ntype RenderSize = { width: number; height: number };\n\nexport function createRenderer({ canvas }: RendererOptions) {\n  const settings = defaultHeroSettings();\n  const desktopLayout = {\n    centerX: settings.centerX,\n    centerY: settings.centerY,\n    cameraRoll: settings.cameraRoll,\n    mouseYaw: settings.mouseYaw,\n    centerFade: settings.centerFade,\n  };\n  const mobileQuery = window.matchMedia(MOBILE_QUERY);\n  const applyResponsiveLayout = () => {\n    Object.assign(\n      settings,\n      mobileQuery.matches\n        ? {\n            centerX: 0,\n            centerY: 0,\n            cameraRoll: 0,\n            mouseYaw: 0,\n            centerFade: 1,\n          }\n        : desktopLayout\n    );\n  };\n  applyResponsiveLayout();\n  const bloomScale = Math.min(Math.max(window.devicePixelRatio, 1), 2) / 2;\n  settings.bloom.radius *= bloomScale;\n  settings.bloom.strength *= bloomScale;\n\n  let disposed = false;\n\n  let api: VgpuApi | undefined;\n  let gpu: Gpu | undefined;\n  let surface: Surface | undefined;\n  let effects: Effects | undefined;\n  let targets: Targets | undefined;\n  let loop: { stop(): void } | undefined;\n  let observer: ResizeObserver | undefined;\n  let intersection: IntersectionObserver | undefined;\n  let documentVisible =\n    typeof document === \"undefined\" ? true : !document.hidden;\n  let canvasIntersecting = true;\n\n  let started = false;\n  let animationTime = 0;\n  let lastFrameAt: number | undefined;\n  let resizeFrame = 0;\n  let pendingSize: RenderSize | undefined;\n  let forceBake = true;\n  let pointerXNormalized = 0;\n  let currentSceneYaw = 0;\n  let lastYawAt: number | undefined;\n\n  const onLayoutChange = () => {\n    applyResponsiveLayout();\n    forceBake = true;\n  };\n  mobileQuery.addEventListener(\"change\", onLayoutChange);\n\n  const onPointerMove = (event: PointerEvent) => {\n    if (event.pointerType !== \"mouse\") return;\n    const width = Math.max(window.innerWidth, 1);\n    pointerXNormalized = Math.min(\n      1,\n      Math.max(-1, (event.clientX / width) * 2 - 1)\n    );\n  };\n\n  const recenterPointer = () => {\n    pointerXNormalized = 0;\n  };\n  const onPointerOut = (event: PointerEvent) => {\n    if (event.relatedTarget === null) recenterPointer();\n  };\n  const onVisibilityChange = () => {\n    if (document.hidden) recenterPointer();\n    documentVisible = !document.hidden;\n    reconcileLoop();\n  };\n\n  function reconcileLoop(): void {\n    if (!started || !gpu || !api) return;\n    const shouldRun = !disposed && documentVisible && canvasIntersecting;\n    if (shouldRun === Boolean(loop)) return;\n    if (shouldRun) {\n      lastFrameAt = undefined;\n      lastYawAt = undefined;\n      loop = startPacedLoop(api, gpu);\n    } else {\n      loop?.stop();\n      loop = undefined;\n    }\n  }\n\n  function startPacedLoop(vgpu: VgpuApi, activeGpu: Gpu): { stop(): void } {\n    let stopped = false;\n\n    let lastPresentedAt: number | undefined;\n    const tick = (timestamp: number): void => {\n      if (stopped) return;\n      if (\n        lastPresentedAt === undefined ||\n        timestamp - lastPresentedAt >= MIN_FRAME_INTERVAL_MS\n      ) {\n        lastPresentedAt = timestamp;\n        try {\n          vgpu.frame(activeGpu, renderFrame);\n        } catch (error) {\n          handleFailure(error);\n        }\n      }\n      if (!stopped) frameHandle = requestAnimationFrame(tick);\n    };\n    let frameHandle = requestAnimationFrame(tick);\n    return {\n      stop(): void {\n        stopped = true;\n        cancelAnimationFrame(frameHandle);\n      },\n    };\n  }\n\n  const advanceAnimationTime = (now: number): number => {\n    animationTime +=\n      lastFrameAt === undefined ? 0 : Math.max(0, (now - lastFrameAt) / 1000);\n    lastFrameAt = now;\n    return animationTime;\n  };\n\n  const renderFrame = (frame: Frame): void => {\n    if (disposed || !effects || !targets || !surface) return;\n    const now = clockMs();\n    const runBake = forceBake;\n    forceBake = false;\n    if (runBake) setBakeUniforms(effects, targets, settings);\n    setShadeUniforms(\n      effects,\n      targets,\n      settings,\n      advanceAnimationTime(now),\n      advanceSceneYaw(now)\n    );\n    renderChain(frame, effects, targets, surface, runBake);\n  };\n\n  const advanceSceneYaw = (now: number): number => {\n    if (settings.mouseYaw <= 0) {\n      currentSceneYaw = 0;\n      lastYawAt = now;\n      return 0;\n    }\n    const dt =\n      lastYawAt === undefined\n        ? 0\n        : Math.min(Math.max((now - lastYawAt) / 1000, 0), MAX_FRAME_DT_S);\n    lastYawAt = now;\n    const target = pointerXNormalized * Math.max(0, settings.mouseYaw);\n    currentSceneYaw +=\n      (target - currentSceneYaw) * (1 - Math.exp(-dt / SCENE_YAW_TAU_S));\n    return currentSceneYaw;\n  };\n\n  const applyResize = () => {\n    resizeFrame = 0;\n    const size = pendingSize;\n    pendingSize = undefined;\n    if (disposed || !size || !gpu || !api || !effects || !targets || !surface)\n      return;\n    try {\n      const previousTargets = targets;\n      const nextTargets = createTargets(api, gpu, [\n        Math.max(1, Math.round(size.width)),\n        Math.max(1, Math.round(size.height)),\n      ]);\n      try {\n        setBindings(effects, nextTargets);\n        setPostUniforms(effects, nextTargets, settings);\n      } catch (error) {\n        destroyTargets(nextTargets);\n        throw error;\n      }\n      targets = nextTargets;\n      destroyTargets(previousTargets);\n      forceBake = true;\n    } catch (error) {\n      handleFailure(error);\n    }\n  };\n  const resize = (size: RenderSize) => {\n    if (disposed || size.width <= 0 || size.height <= 0) return;\n    pendingSize = size;\n    if (!resizeFrame) resizeFrame = requestAnimationFrame(applyResize);\n  };\n\n  const measure = () => {\n    resize({\n      width: canvas.clientWidth,\n      height: canvas.clientHeight,\n    });\n  };\n\n  const dispose = () => {\n    if (disposed) return;\n    disposed = true;\n    loop?.stop();\n    if (resizeFrame) cancelAnimationFrame(resizeFrame);\n    observer?.disconnect();\n    intersection?.disconnect();\n    if (typeof window !== \"undefined\") {\n      mobileQuery.removeEventListener(\"change\", onLayoutChange);\n      window.removeEventListener(\"pointermove\", onPointerMove);\n      window.removeEventListener(\"pointerout\", onPointerOut);\n      window.removeEventListener(\"blur\", recenterPointer);\n      document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n    }\n    gpu?.dispose();\n  };\n\n  const initialize = async () => {\n    const vgpu = await import(\"vgpu\");\n    const { init } = vgpu;\n    if (disposed) return;\n    const nextGpu = await init();\n    if (disposed) {\n      nextGpu.dispose();\n      return;\n    }\n    gpu = nextGpu;\n    api = vgpu;\n    surface = vgpu.surface(gpu, canvas, { dpr: 1 });\n    effects = createEffects(vgpu, gpu);\n    targets = createTargets(vgpu, gpu, surface.size);\n    setBindings(effects, targets);\n    setPostUniforms(effects, targets, settings);\n    await prewarm(effects, targets, surface);\n    if (disposed) return;\n    observer =\n      typeof ResizeObserver === \"undefined\"\n        ? undefined\n        : new ResizeObserver(measure);\n    observer?.observe(canvas);\n    window.addEventListener(\"pointermove\", onPointerMove, { passive: true });\n    window.addEventListener(\"pointerout\", onPointerOut, { passive: true });\n    window.addEventListener(\"blur\", recenterPointer);\n    document.addEventListener(\"visibilitychange\", onVisibilityChange);\n    if (typeof IntersectionObserver !== \"undefined\") {\n      intersection = new IntersectionObserver(\n        (entries) => {\n          canvasIntersecting =\n            entries[entries.length - 1]?.isIntersecting ?? canvasIntersecting;\n          reconcileLoop();\n        },\n        { threshold: 0 }\n      );\n      intersection.observe(canvas);\n    }\n    measure();\n    started = true;\n    documentVisible = !document.hidden;\n    reconcileLoop();\n  };\n\n  function handleFailure(error: unknown): never {\n    dispose();\n    throw error;\n  }\n\n  const ready = initialize().catch((error: unknown) => {\n    if (disposed) return;\n    handleFailure(error);\n  });\n\n  return { ready, dispose };\n}\n\nfunction clockMs(): number {\n  return typeof performance === \"undefined\" ? Date.now() : performance.now();\n}\n",
      "type": "registry:lib",
      "target": "components/black-hole/renderer.ts"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/pipeline.ts",
      "content": "import type { Effect, Frame, Gpu, Surface, Target } from \"vgpu\";\n\nimport bakeWgsl from \"./bake.wgsl\";\nimport bloomWgsl from \"./bloom.wgsl\";\nimport compositeWgsl from \"./composite.wgsl\";\nimport {\n  createNoiseVolume,\n  NOISE_VOLUME_SIZE,\n  noiseVolumeSampler,\n} from \"./noise-volume.mjs\";\nimport refineWgsl from \"./refine.wgsl\";\nimport shadeWgsl from \"./shade.wgsl\";\nimport type { HeroSettings } from \"./settings\";\n\nexport type VgpuApi = typeof import(\"vgpu\");\ntype Output = Surface | Target;\ntype NoiseVolume = ReturnType<typeof createNoiseVolume>;\n\nexport interface Effects {\n  bake: Effect;\n  refine: Effect;\n  shade: Effect;\n  bloomExtract: Effect;\n  bloomBlurH0: Effect;\n  bloomBlurV0: Effect;\n  bloomDown1: Effect;\n  bloomBlurH1: Effect;\n  bloomBlurV1: Effect;\n  bloomDown2: Effect;\n  bloomBlurH2: Effect;\n  bloomBlurV2: Effect;\n  composite: Effect;\n  postSampler: GPUSampler;\n  noiseVolume: NoiseVolume;\n  noiseSampler: GPUSampler;\n}\n\nexport interface Targets {\n  gbuffer: Target;\n  aa: Target;\n  scene: Target;\n  bloom0: Target;\n  bloomPing0: Target;\n  bloom1: Target;\n  bloomPing1: Target;\n  bloom2: Target;\n  bloomPing2: Target;\n}\n\nconst GBUFFER_FORMATS: readonly GPUTextureFormat[] = [\n  \"rg32float\",\n  \"rg32float\",\n  \"rgba16float\",\n  \"rgba16float\",\n];\nconst AA_FORMATS: readonly GPUTextureFormat[] = [\"rg8unorm\", \"rgba16float\"];\nconst CLEAR: readonly [number, number, number, number] = [0, 0, 0, 1];\n\nexport function createEffects(vgpu: VgpuApi, gpu: Gpu): Effects {\n  const postSampler = vgpu.sampler(gpu, {\n    minFilter: \"linear\",\n    magFilter: \"linear\",\n  });\n  const noiseSampler = noiseVolumeSampler(vgpu, gpu);\n  return {\n    bake: vgpu.effect(gpu, bakeWgsl),\n    refine: vgpu.effect(gpu, refineWgsl),\n    shade: vgpu.effect(gpu, shadeWgsl),\n    bloomExtract: vgpu.effect(gpu, bloomWgsl),\n    bloomBlurH0: vgpu.effect(gpu, bloomWgsl),\n    bloomBlurV0: vgpu.effect(gpu, bloomWgsl),\n    bloomDown1: vgpu.effect(gpu, bloomWgsl),\n    bloomBlurH1: vgpu.effect(gpu, bloomWgsl),\n    bloomBlurV1: vgpu.effect(gpu, bloomWgsl),\n    bloomDown2: vgpu.effect(gpu, bloomWgsl),\n    bloomBlurH2: vgpu.effect(gpu, bloomWgsl),\n    bloomBlurV2: vgpu.effect(gpu, bloomWgsl),\n    composite: vgpu.effect(gpu, compositeWgsl),\n    postSampler,\n    noiseSampler,\n    noiseVolume: createNoiseVolume(gpu, NOISE_VOLUME_SIZE),\n  };\n}\n\nexport function createTargets(\n  vgpu: VgpuApi,\n  gpu: Gpu,\n  size: readonly [number, number]\n): Targets {\n  const full = normalizeSize(size),\n    half = scaleSize(full, 2),\n    quarter = scaleSize(full, 4),\n    eighth = scaleSize(full, 8);\n  const postTarget = (targetSize: readonly [number, number]) =>\n    vgpu.target(gpu, {\n      size: targetSize,\n      colors: [{ format: \"rgba16float\" }],\n    });\n  const created: Target[] = [];\n  const own = (value: Target) => {\n    created.push(value);\n    return value;\n  };\n  try {\n    return {\n      gbuffer: own(\n        vgpu.target(gpu, {\n          size: full,\n          colors: GBUFFER_FORMATS.map((format) => ({ format })),\n        })\n      ),\n      aa: own(\n        vgpu.target(gpu, {\n          size: full,\n          colors: AA_FORMATS.map((format) => ({ format })),\n        })\n      ),\n      scene: own(postTarget(full)),\n      bloom0: own(postTarget(half)),\n      bloomPing0: own(postTarget(half)),\n      bloom1: own(postTarget(quarter)),\n      bloomPing1: own(postTarget(quarter)),\n      bloom2: own(postTarget(eighth)),\n      bloomPing2: own(postTarget(eighth)),\n    };\n  } catch (error) {\n    try {\n      destroyTargetList(created.reverse());\n    } catch {\n      // The allocation failure remains the primary error.\n    }\n    throw error;\n  }\n}\n\nexport function destroyTargets(targets: Targets): void {\n  destroyTargetList([\n    targets.gbuffer,\n    targets.aa,\n    targets.scene,\n    targets.bloom0,\n    targets.bloomPing0,\n    targets.bloom1,\n    targets.bloomPing1,\n    targets.bloom2,\n    targets.bloomPing2,\n  ]);\n}\n\nfunction destroyTargetList(values: readonly Target[]): void {\n  let failed = false;\n  let failure: unknown;\n  for (const value of values) {\n    try {\n      destroyTarget(value);\n    } catch (error) {\n      if (!failed) failure = error;\n      failed = true;\n    }\n  }\n  if (failed) throw failure;\n}\n\nfunction destroyTarget(value: Target | undefined): void {\n  (value as { destroy?: () => void } | undefined)?.destroy?.();\n}\n\nexport function setBindings(effects: Effects, targets: Targets): void {\n  const [hit1, hit2, sky, view] = targets.gbuffer.colors;\n  const [aa, aaGeom] = targets.aa.colors;\n  effects.bake.set({ bake: { resolution: targets.gbuffer.size } });\n  effects.refine.set({\n    gHit1: hit1,\n    gSky: sky,\n    refine: { resolution: targets.gbuffer.size },\n  });\n  effects.shade.set({\n    gHit1: hit1,\n    gHit2: hit2,\n    gSky: sky,\n    gView: view,\n    gAa: aa,\n    gAaGeom: aaGeom,\n    noiseVolume: effects.noiseVolume,\n    noiseSampler: effects.noiseSampler,\n    shade: { resolution: targets.gbuffer.size },\n  });\n  const scene = targets.scene.colors[0]!,\n    bloom0 = targets.bloom0.colors[0]!,\n    bloomPing0 = targets.bloomPing0.colors[0]!,\n    bloom1 = targets.bloom1.colors[0]!,\n    bloomPing1 = targets.bloomPing1.colors[0]!,\n    bloom2 = targets.bloom2.colors[0]!,\n    bloomPing2 = targets.bloomPing2.colors[0]!;\n  effects.bloomExtract.set({\n    source: scene,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomBlurH0.set({\n    source: bloom0,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomBlurV0.set({\n    source: bloomPing0,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomDown1.set({\n    source: bloom0,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomBlurH1.set({\n    source: bloom1,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomBlurV1.set({\n    source: bloomPing1,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomDown2.set({\n    source: bloom1,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomBlurH2.set({\n    source: bloom2,\n    linearSampler: effects.postSampler,\n  });\n  effects.bloomBlurV2.set({\n    source: bloomPing2,\n    linearSampler: effects.postSampler,\n  });\n  effects.composite.set({\n    scene,\n    bloomNear: bloom0,\n    bloomMedium: bloom1,\n    bloomFar: bloom2,\n    linearSampler: effects.postSampler,\n  });\n}\n\nexport function setBakeUniforms(\n  effects: Effects,\n  targets: Targets,\n  settings: HeroSettings\n): void {\n  const geometry = {\n    resolution: targets.gbuffer.size,\n    yaw: 0,\n    pitch: settings.cameraY,\n    orbitRadius: settings.distance,\n    diskOuter: settings.diskRadius,\n    fov: settings.fov,\n    centerX: settings.centerX,\n    centerY: settings.centerY,\n    roll: settings.cameraRoll,\n  };\n  effects.bake.set({ bake: geometry });\n  effects.refine.set({ refine: geometry });\n}\nexport function setShadeUniforms(\n  effects: Effects,\n  targets: Targets,\n  settings: HeroSettings,\n  time: number,\n  sceneYaw: number\n): void {\n  effects.shade.set({\n    shade: {\n      resolution: targets.gbuffer.size,\n      time,\n      diskOuter: settings.diskRadius,\n      sceneYaw,\n      centerFade: settings.centerFade,\n    },\n    disk: settings.disk,\n    stars: settings.stars,\n  });\n}\nexport function setPostUniforms(\n  effects: Effects,\n  targets: Targets,\n  settings: HeroSettings\n): void {\n  const threshold = Math.max(0, settings.bloom.threshold),\n    knee = Math.max(0.0001, settings.bloom.knee),\n    radius = Math.max(0.1, settings.bloom.radius);\n  const downsample = (\n    sourceSize: readonly [number, number],\n    applyThreshold: boolean\n  ) => ({\n    sourceSize,\n    direction: [0, 0],\n    params: [applyThreshold ? threshold : -1, knee, radius, 0],\n  });\n  const blur = (\n    sourceSize: readonly [number, number],\n    x: number,\n    y: number\n  ) => ({\n    sourceSize,\n    direction: [x, y],\n    params: [-1, knee, radius, 1],\n  });\n  effects.bloomExtract.set({ bloom: downsample(targets.scene.size, true) });\n  effects.bloomBlurH0.set({ bloom: blur(targets.bloom0.size, 1, 0) });\n  effects.bloomBlurV0.set({ bloom: blur(targets.bloomPing0.size, 0, 1) });\n  effects.bloomDown1.set({ bloom: downsample(targets.bloom0.size, false) });\n  effects.bloomBlurH1.set({ bloom: blur(targets.bloom1.size, 1, 0) });\n  effects.bloomBlurV1.set({ bloom: blur(targets.bloomPing1.size, 0, 1) });\n  effects.bloomDown2.set({ bloom: downsample(targets.bloom1.size, false) });\n  effects.bloomBlurH2.set({ bloom: blur(targets.bloom2.size, 1, 0) });\n  effects.bloomBlurV2.set({ bloom: blur(targets.bloomPing2.size, 0, 1) });\n  effects.composite.set({\n    composite: {\n      params: [Math.max(0, settings.bloom.strength), 0, 0, 0],\n    },\n  });\n}\n\nexport async function prewarm(\n  effects: Effects,\n  targets: Targets,\n  output: Output\n): Promise<void> {\n  const bloomOutput = { colors: [targets.bloom0.format] };\n  await Promise.all([\n    effects.bake.compile(targets.gbuffer),\n    effects.refine.compile(targets.aa),\n    effects.shade.compile(targets.scene),\n    effects.bloomExtract.compile(bloomOutput),\n    effects.bloomBlurH0.compile(bloomOutput),\n    effects.bloomBlurV0.compile(bloomOutput),\n    effects.bloomDown1.compile(bloomOutput),\n    effects.bloomBlurH1.compile(bloomOutput),\n    effects.bloomBlurV1.compile(bloomOutput),\n    effects.bloomDown2.compile(bloomOutput),\n    effects.bloomBlurH2.compile(bloomOutput),\n    effects.bloomBlurV2.compile(bloomOutput),\n    effects.composite.compile({ colors: [output.format] }),\n  ]);\n}\n\nexport function renderChain(\n  frame: Frame,\n  effects: Effects,\n  targets: Targets,\n  output: Output,\n  bake: boolean\n): void {\n  if (bake) {\n    frame.pass({ target: targets.gbuffer, clear: CLEAR }, (pass) =>\n      pass.draw(effects.bake)\n    );\n    frame.pass({ target: targets.aa, clear: CLEAR }, (pass) =>\n      pass.draw(effects.refine)\n    );\n  }\n  frame.pass({ target: targets.scene, clear: CLEAR }, (pass) =>\n    pass.draw(effects.shade)\n  );\n  frame.pass({ target: targets.bloom0, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomExtract)\n  );\n  frame.pass({ target: targets.bloomPing0, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomBlurH0)\n  );\n  frame.pass({ target: targets.bloom0, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomBlurV0)\n  );\n  frame.pass({ target: targets.bloom1, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomDown1)\n  );\n  frame.pass({ target: targets.bloomPing1, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomBlurH1)\n  );\n  frame.pass({ target: targets.bloom1, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomBlurV1)\n  );\n  frame.pass({ target: targets.bloom2, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomDown2)\n  );\n  frame.pass({ target: targets.bloomPing2, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomBlurH2)\n  );\n  frame.pass({ target: targets.bloom2, clear: CLEAR }, (pass) =>\n    pass.draw(effects.bloomBlurV2)\n  );\n  frame.pass({ target: output, clear: CLEAR }, (pass) =>\n    pass.draw(effects.composite)\n  );\n}\n\nfunction normalizeSize(size: readonly [number, number]): [number, number] {\n  return [Math.max(1, Math.floor(size[0])), Math.max(1, Math.floor(size[1]))];\n}\nfunction scaleSize(\n  size: readonly [number, number],\n  divisor: number\n): [number, number] {\n  return [\n    Math.max(1, Math.floor(size[0] / divisor)),\n    Math.max(1, Math.floor(size[1] / divisor)),\n  ];\n}\n",
      "type": "registry:lib",
      "target": "components/black-hole/pipeline.ts"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/settings.ts",
      "content": "export interface DiskLook {\n  brightness: number;\n  speed: number;\n  stretch: number;\n  detail: number;\n  turbulence: number;\n  density: number;\n  doppler: number;\n  cloudScale: number;\n  cloudSpeed: number;\n  cloudStrength: number;\n  spare0: number;\n  spare1: number;\n  spare2: number;\n  spare3: number;\n}\n\nexport interface StarLook {\n  brightness: number;\n  density: number;\n  contrast: number;\n  warmth: number;\n  twinkle: number;\n}\n\nexport interface BloomLook {\n  strength: number;\n  threshold: number;\n  knee: number;\n  radius: number;\n}\n\nexport interface HeroSettings {\n  cameraY: number;\n  distance: number;\n  diskRadius: number;\n  fov: number;\n  centerX: number;\n  centerY: number;\n  cameraRoll: number;\n  mouseYaw: number;\n  centerFade: number;\n  bloom: BloomLook;\n  disk: DiskLook;\n  stars: StarLook;\n}\n\n/** Shared deterministic production defaults for the browser and headless renderer. */\nexport function defaultHeroSettings(): HeroSettings {\n  return {\n    cameraY: 0.16,\n    distance: 13.5,\n    diskRadius: 9,\n    fov: 3,\n    centerX: 0.8,\n    centerY: 0.3,\n    cameraRoll: -0.27,\n    mouseYaw: 0.15,\n    centerFade: 0,\n    bloom: { strength: 1, threshold: 0, knee: 0.18, radius: 1.5 },\n    disk: {\n      brightness: 0.75,\n      speed: 0.75,\n      stretch: 5.75,\n      detail: 3.44,\n      turbulence: 4.46,\n      density: 1.38,\n      doppler: 1.21,\n      cloudScale: 20,\n      cloudSpeed: 0.3,\n      cloudStrength: 0.2,\n      spare0: 0.43,\n      spare1: -0.25,\n      spare2: -0.67,\n      spare3: 0.69,\n    },\n    stars: { brightness: 1, density: 1, contrast: 13, warmth: 0.5, twinkle: 0 },\n  };\n}\n",
      "type": "registry:lib",
      "target": "components/black-hole/settings.ts"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/noise-volume.mjs",
      "content": "// Deterministic tiled value-noise lattice shared by the disk shader and Node rendering.\nexport const NOISE_VOLUME_SIZE = 64;\n\nconst FORMAT = \"r8unorm\";\nconst SEED = 13;\nconst fr = Math.fround;\nconst fract = (value) => fr(value - Math.floor(value));\nconst K0 = fr(0.1031);\nconst K1 = fr(0.103);\nconst K2 = fr(0.0973);\nconst K3 = fr(33.33);\n\n/** @param {number} x @param {number} y @param {number} z */\nfunction hash31(x, y, z) {\n  let qx = fract(fr(x * K0));\n  let qy = fract(fr(y * K1));\n  let qz = fract(fr(z * K2));\n  const d = fr(\n    fr(fr(qx * fr(qy + K3)) + fr(qy * fr(qz + K3))) + fr(qz * fr(qx + K3))\n  );\n  qx = fr(qx + d);\n  qy = fr(qy + d);\n  qz = fr(qz + d);\n  return fract(fr(fr(qx + qy) * qz));\n}\n\n/** Use signed coordinates so the disk's angular axes match the original analytic noise. */\nfunction latticeCoord(index, size) {\n  return index < size / 2 ? index : index - size;\n}\n\nfunction buildNoiseVolume(size, seed) {\n  const data = new Uint8Array(size * size * size);\n  const offset = seed * 1024;\n  let cursor = 0;\n  for (let z = 0; z < size; z++) {\n    const pz = latticeCoord(z, size) + offset;\n    for (let y = 0; y < size; y++) {\n      const py = latticeCoord(y, size);\n      for (let x = 0; x < size; x++) {\n        data[cursor++] = Math.min(\n          255,\n          Math.round(hash31(latticeCoord(x, size), py, pz) * 255)\n        );\n      }\n    }\n  }\n  return data;\n}\n\nconst cache = new Map();\n\nfunction noiseVolumeData(size, seed) {\n  const key = `${size}:${seed}`;\n  let data = cache.get(key);\n  if (!data) {\n    data = buildNoiseVolume(size, seed);\n    cache.set(key, data);\n  }\n  return data;\n}\n\n/**\n * @param {import(\"vgpu\").Gpu} gpu\n * @param {number} [size]\n * @param {string} [label]\n */\nexport function createNoiseVolume(\n  gpu,\n  size = NOISE_VOLUME_SIZE,\n  label = \"black-hole-noise\"\n) {\n  const texture = gpu.device.createTexture({\n    size: [size, size, size],\n    // vgpu Device.createTexture takes `dimension` (WebGPU-style), not `kind`.\n    dimension: \"3d\",\n    format: FORMAT,\n    usage: [\"texture_binding\", \"copy_dst\"],\n    label,\n  });\n  try {\n    gpu.gpu.queue.writeTexture(\n      { texture: texture.gpu },\n      noiseVolumeData(size, SEED),\n      { offset: 0, bytesPerRow: size, rowsPerImage: size },\n      { width: size, height: size, depthOrArrayLayers: size }\n    );\n    return texture;\n  } catch (error) {\n    try {\n      texture.destroy();\n    } catch {\n      // Preserve the upload failure that made this texture unusable.\n    }\n    throw error;\n  }\n}\n\n/** @param {typeof import(\"vgpu\")} vgpu @param {import(\"vgpu\").Gpu} gpu */\nexport function noiseVolumeSampler(vgpu, gpu) {\n  return vgpu.sampler(gpu, {\n    addressModeU: \"repeat\",\n    addressModeV: \"repeat\",\n    addressModeW: \"repeat\",\n    minFilter: \"linear\",\n    magFilter: \"linear\",\n  });\n}\n",
      "type": "registry:lib",
      "target": "components/black-hole/noise-volume.mjs"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/bake.wgsl",
      "content": "// One-shot geodesic bake: store two disk crossings, the lensed sky, and view directions.\n\nimport { TraceResult, cameraRay, escapeRadiusFor, traceRay } from \"./geodesic.wgsl\";\n\nstruct Bake {\n  resolution: vec2f,\n  yaw: f32,\n  pitch: f32,\n  orbitRadius: f32,\n  diskOuter: f32,\n  fov: f32,\n  centerX: f32,\n  centerY: f32,\n  roll: f32,\n}\n\n@group(0) @binding(0) var<uniform> bake: Bake;\n\nconst FLAG_HOLE: f32 = 1.0;\n\nconst FLAG_ESCAPED: f32 = 2.0;\n\nstruct GBuffer {\n  @location(0) hit1: vec2f,\n  @location(1) hit2: vec2f,\n  @location(2) sky: vec4f,\n  @location(3) view: vec4f,\n}\n\n@fragment fn fs_main(@location(0) uv: vec2f) -> GBuffer {\n  let ray = cameraRay(\n    uv,\n    bake.resolution,\n    bake.yaw,\n    bake.pitch,\n    bake.orbitRadius,\n    bake.fov,\n    bake.centerX,\n    bake.centerY,\n    bake.roll,\n  );\n  var traced = traceRay(ray.position, ray.velocity, bake.diskOuter, escapeRadiusFor(bake.orbitRadius));\n\n  if (traced.swallowed < 0.5 && traced.escaped < 0.5) {\n    traced.swallowed = 1.0;\n  }\n\n  return GBuffer(\n    traced.hit1Plane,\n    traced.hit2Plane,\n    vec4f(traced.finalVelocity, traced.swallowed * FLAG_HOLE + traced.escaped * FLAG_ESCAPED),\n    vec4f(traced.hit1Direction, traced.hit2Direction),\n  );\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/bake.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/bloom.wgsl",
      "content": "// HDR bloom downsample and separable Gaussian blur.\n\nstruct Bloom {\n  sourceSize: vec2f,\n  direction: vec2f,\n  params: vec4f,\n}\n\n@group(0) @binding(0) var<uniform> bloom: Bloom;\n@group(0) @binding(1) var source: texture_2d<f32>;\n@group(0) @binding(2) var linearSampler: sampler;\n\nfn softThreshold(color: vec3f) -> vec3f {\n  let threshold = bloom.params.x;\n  if (threshold <= 0.0) {\n    return color;\n  }\n\n  let brightness = dot(color, vec3f(0.2126, 0.7152, 0.0722));\n  let knee = max(min(bloom.params.y, threshold), 0.000001);\n  let soft = clamp(brightness - threshold + knee, 0.0, 2.0 * knee);\n  let softContribution = soft * soft / (4.0 * knee + 0.0001);\n  let contribution = max(brightness - threshold, softContribution) / max(brightness, 0.0001);\n  return color * contribution;\n}\n\nfn downsample(uv: vec2f) -> vec3f {\n  let texel = 1.0 / bloom.sourceSize;\n  let offset = texel * 0.5;\n  let color = (\n    textureSample(source, linearSampler, uv + vec2f(-offset.x, -offset.y)).rgb +\n    textureSample(source, linearSampler, uv + vec2f( offset.x, -offset.y)).rgb +\n    textureSample(source, linearSampler, uv + vec2f(-offset.x,  offset.y)).rgb +\n    textureSample(source, linearSampler, uv + vec2f( offset.x,  offset.y)).rgb\n  ) * 0.25;\n  return softThreshold(color);\n}\n\nfn gaussianBlur(uv: vec2f) -> vec3f {\n  let sigma = max(bloom.params.z, 0.5);\n  let inverseTwoSigmaSquared = 0.5 / (sigma * sigma);\n  let w0 = 1.0;\n  let w1 = exp(-1.0 * inverseTwoSigmaSquared);\n  let w2 = exp(-4.0 * inverseTwoSigmaSquared);\n  let w3 = exp(-9.0 * inverseTwoSigmaSquared);\n  let w4 = exp(-16.0 * inverseTwoSigmaSquared);\n\n  let pair12 = w1 + w2;\n  let pair34 = w3 + w4;\n  let offset12 = (w1 + 2.0 * w2) / max(pair12, 0.000001);\n  let offset34 = (3.0 * w3 + 4.0 * w4) / max(pair34, 0.000001);\n  let normalization = w0 + 2.0 * (pair12 + pair34);\n  let texel = bloom.direction / bloom.sourceSize;\n\n  var color = textureSample(source, linearSampler, uv).rgb * w0;\n  color += textureSample(source, linearSampler, uv + texel * offset12).rgb * pair12;\n  color += textureSample(source, linearSampler, uv - texel * offset12).rgb * pair12;\n  color += textureSample(source, linearSampler, uv + texel * offset34).rgb * pair34;\n  color += textureSample(source, linearSampler, uv - texel * offset34).rgb * pair34;\n  return color / normalization;\n}\n\n@fragment fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {\n  var color: vec3f;\n  if (bloom.params.w > 0.5) {\n    color = gaussianBlur(uv);\n  } else {\n    color = downsample(uv);\n  }\n  return vec4f(color, 1.0);\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/bloom.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/composite.wgsl",
      "content": "// Combine bloom levels, tone map, vignette, and convert to display output.\n\nstruct Composite {\n  params: vec4f,\n}\n\n@group(0) @binding(0) var<uniform> composite: Composite;\n@group(0) @binding(1) var scene: texture_2d<f32>;\n@group(0) @binding(2) var bloomNear: texture_2d<f32>;\n@group(0) @binding(3) var bloomMedium: texture_2d<f32>;\n@group(0) @binding(4) var bloomFar: texture_2d<f32>;\n@group(0) @binding(5) var linearSampler: sampler;\n\nconst EXPOSURE: f32 = 1.15;\nconst SATURATION: f32 = 0.0;\n\nfn aces(x: vec3f) -> vec3f {\n  let a = 2.51;\n  let b = 0.03;\n  let c = 2.43;\n  let d = 0.59;\n  let e = 0.14;\n  return clamp((x * (a * x + vec3f(b))) / (x * (c * x + vec3f(d)) + vec3f(e)), vec3f(0.0), vec3f(1.0));\n}\n\nfn tonemap(linearColor: vec3f, uv: vec2f) -> vec3f {\n  var color = aces(linearColor * EXPOSURE);\n\n  let centered = uv - vec2f(0.5);\n  let vignette = 1.0 - smoothstep(0.55, 1.15, length(centered) * 1.6);\n  color *= mix(0.72, 1.0, vignette);\n\n  color = pow(color, vec3f(1.0 / 2.2));\n  let luma = dot(color, vec3f(0.2126, 0.7152, 0.0722));\n  return mix(vec3f(luma), color, SATURATION);\n}\n\n@fragment fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {\n  let sceneColor = textureSample(scene, linearSampler, uv).rgb;\n  let bloom =\n    textureSample(bloomNear, linearSampler, uv).rgb * 0.50 +\n    textureSample(bloomMedium, linearSampler, uv).rgb * 0.32 +\n    textureSample(bloomFar, linearSampler, uv).rgb * 0.18;\n  let hdr = sceneColor + bloom * composite.params.x;\n  return vec4f(tonemap(hdr, uv), 1.0);\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/composite.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/disk.wgsl",
      "content": "// Accretion-disk material with deterministic tiled noise and radial prefiltering.\n\nimport { GBufferSample, HORIZON, ISCO } from \"./gbuffer.wgsl\";\n\nexport struct DiskLook {\n  brightness: f32,\n  speed: f32,\n  stretch: f32,\n  detail: f32,\n  turbulence: f32,\n  density: f32,\n  doppler: f32,\n  cloudScale: f32,\n  cloudSpeed: f32,\n  cloudStrength: f32,\n  spare0: f32,\n  spare1: f32,\n  spare2: f32,\n  spare3: f32,\n}\n\nexport struct DiskSample {\n  color: vec3f,\n  alpha: f32,\n}\n\nstruct NoiseLattice {\n  invSize: f32,\n}\n\nfn noise3(tex: texture_3d<f32>, samp: sampler, lattice: NoiseLattice, p: vec3f) -> f32 {\n  let i = floor(p);\n  let f = p - i;\n  let u = f * f * (3.0 - 2.0 * f);\n  return textureSampleLevel(tex, samp, (i + u + vec3f(0.5)) * lattice.invSize, 0.0).r;\n}\n\nfn streakFbm(\n  tex: texture_3d<f32>,\n  samp: sampler,\n  lattice: NoiseLattice,\n  angle: f32,\n  radius: f32,\n  angScale: f32,\n  radScale: f32,\n  octaves: i32,\n  dAngle: f32,\n  dRadius: f32,\n  lacAng: f32,\n  lacRad: f32,\n  seed: f32,\n) -> f32 {\n  var value: f32 = 0.0;\n  var total: f32 = 0.0;\n  var amplitude: f32 = 0.5;\n  var a = angScale;\n  var r = radScale;\n  var offset = seed;\n  for (var i = 0; i < octaves; i++) {\n    let visible = clamp(1.0 - 1.7 * max(dAngle * a, dRadius * r), 0.0, 1.0);\n    var sampleValue: f32 = 0.5;\n    if (visible > 0.004) {\n      sampleValue = mix(\n        0.5,\n        noise3(tex, samp, lattice, vec3f(cos(angle) * a, sin(angle) * a, radius * r + offset)),\n        visible,\n      );\n    }\n    value += amplitude * sampleValue;\n    total += amplitude;\n    a *= lacAng;\n    r *= lacRad;\n    offset += 23.7;\n    amplitude *= 0.55;\n  }\n  return value / max(total, 0.0001);\n}\n\nfn ridgeFbm(\n  tex: texture_3d<f32>,\n  samp: sampler,\n  lattice: NoiseLattice,\n  angle: f32,\n  radius: f32,\n  angScale: f32,\n  radScale: f32,\n  octaves: i32,\n  dAngle: f32,\n  dRadius: f32,\n  lacAng: f32,\n  lacRad: f32,\n  seed: f32,\n) -> f32 {\n  var value: f32 = 0.0;\n  var total: f32 = 0.0;\n  var amplitude: f32 = 0.5;\n  var a = angScale;\n  var r = radScale;\n  var offset = seed;\n  for (var i = 0; i < octaves; i++) {\n    let visible = clamp(1.0 - 1.7 * max(dAngle * a, dRadius * r), 0.0, 1.0);\n    var crest: f32 = 0.42;\n    if (visible > 0.004) {\n      let n = noise3(tex, samp, lattice, vec3f(cos(angle) * a, sin(angle) * a, radius * r + offset));\n      crest = mix(0.42, pow(1.0 - abs(n * 2.0 - 1.0), 1.35), visible);\n    }\n    value += amplitude * crest;\n    total += amplitude;\n    a *= lacAng;\n    r *= lacRad;\n    offset += 41.9;\n    amplitude *= 0.62;\n  }\n  return value / max(total, 0.0001);\n}\n\nstruct FieldParams {\n  angBase: f32,\n  radBase: f32,\n  flowRad: f32,\n  chaos: f32,\n  outward: f32,\n  dAngle: f32,\n  dRadius: f32,\n}\n\nfn smokeField(\n  tex: texture_3d<f32>, samp: sampler, lattice: NoiseLattice,\n  angle: f32, radius: f32, p: FieldParams,\n) -> vec2f {\n  let warpA = (streakFbm(\n    tex, samp, lattice, angle, radius, p.angBase * 0.55, p.flowRad * 1.6,\n    2, p.dAngle, p.dRadius, 1.6, 2.0, 3.7,\n  )) - 0.5;\n  let warpB = (streakFbm(\n    tex, samp, lattice, angle + 2.4, radius * 1.13,\n    p.angBase * 2.8, p.radBase * 0.45, 3, p.dAngle, p.dRadius,\n    1.7, 2.0, 61.3,\n  )) - 0.5;\n  let radiusW = radius + (warpA * 1.9 + warpB * 1.25 * p.outward) * p.chaos;\n  let angleW = angle + (warpB * 0.9 - warpA * 0.35) * p.chaos * 0.55 / max(radius * 0.22, 0.35);\n\n  let flow = streakFbm(\n    tex, samp, lattice, angleW, radiusW, p.angBase, p.flowRad,\n    3, p.dAngle, p.dRadius, 2.0, 1.12, 131.7,\n  );\n  let threads = ridgeFbm(\n    tex, samp, lattice, angleW, radiusW, p.angBase * 0.85, p.radBase,\n    5, p.dAngle, p.dRadius, 1.26, 2.05, 0.0,\n  );\n\n  let fineVis = clamp(1.0 - 1.7 * max(p.dAngle * p.angBase * 0.85, p.dRadius * p.radBase), 0.0, 1.0);\n  let field = mix(flow, flow * 0.22 + threads * 1.05, fineVis);\n  let rim = (warpA + warpB * 0.5) * 0.9;\n  return vec2f(f32(field), rim);\n}\n\nconst FIELD_MEAN = 0.52;\n\nconst SHEAR_REF_RADIUS = 6.5;\n\nexport const SHEAR_PERIOD: f32 = 10.0;\nconst TWO_PI = 6.283185307;\n\nexport fn shadeDisk(\n  g: GBufferSample,\n  look: DiskLook,\n  time: f32,\n  footprint: f32,\n  noiseTex: texture_3d<f32>,\n  noiseSampler: sampler,\n) -> DiskSample {\n  var lattice: NoiseLattice;\n  lattice.invSize = 1.0 / f32(textureDimensions(noiseTex).x);\n\n  let plane = vec2f(g.position.x, g.position.z);\n  let radius = g.diskPolar.x;\n  let azimuth = g.diskPolar.y;\n  let radiusNorm = clamp(g.diskUv.x, 0.0, 1.0);\n  let viewDirection = g.viewDirection;\n\n  let slant = max(abs(viewDirection.y), 0.022);\n  let grazing = min(1.0 / slant, 34.0);\n\n  let viewPlane = normalize(vec2f(viewDirection.x, viewDirection.z) + vec2f(1e-6, 0.0));\n  let radialDir = normalize(plane + vec2f(1e-6, 0.0));\n  let alignR = clamp(abs(dot(radialDir, viewPlane)), 0.0, 1.0);\n  let alignT = sqrt(max(1.0 - alignR * alignR, 0.0));\n  let stretchSq = grazing * grazing - 1.0;\n  let kR = sqrt(1.0 + stretchSq * alignR * alignR);   // radial elongation\n  let kT = sqrt(1.0 + stretchSq * alignT * alignT);   // tangential elongation\n  let baseScaleR = max(look.detail, 0.05);\n  let baseScaleA = max(look.stretch, 0.05);\n  let pixelWorld = footprint / max(baseScaleR * kR, baseScaleA * kT / max(radius, ISCO));\n  let dRadius = pixelWorld * kR;\n  let dAngle = pixelWorld * kT / max(radius, ISCO);\n\n  let omega = look.speed * 0.55 / pow(radius, 1.5);\n  let omegaRef = look.speed * 0.55 / pow(SHEAR_REF_RADIUS, 1.5);\n  let dOmega = omega - omegaRef;\n  let rigid = fract(time * omegaRef / TWO_PI) * TWO_PI;\n  let swirl = max(0.0, 0.85 + look.spare1);\n  let flowBase = azimuth - rigid + swirl * log(radius / ISCO);\n\n  let cycle = time / SHEAR_PERIOD;\n  let u0 = fract(cycle);\n  let u1 = fract(cycle + 0.5);\n  let shear0 = (u0 - 0.5) * SHEAR_PERIOD;\n  let shear1 = (u1 - 0.5) * SHEAR_PERIOD;\n  let w0 = 1.0 - abs(2.0 * u0 - 1.0);\n  let w1 = 1.0 - w0;\n  let angle0 = flowBase - dOmega * shear0;\n  let angle1 = flowBase - dOmega * shear1;\n\n  let outward = smoothstep(0.0, 0.92, radiusNorm);\n  let fray = max(0.0, 1.0 + look.spare3);\n  let chaos = look.turbulence * (0.08 + 2.10 * outward * outward) * fray;\n\n  let angBase = max(look.stretch, 0.05) * 0.45 * (0.80 + 1.45 * outward * fray);\n  let radBase = max(look.detail, 0.05) * 2.35;\n  let flowRad = max(look.detail, 0.05) * 0.105;\n\n  var params: FieldParams;\n  params.angBase = angBase;\n  params.radBase = radBase;\n  params.flowRad = flowRad;\n  params.chaos = chaos;\n  params.outward = outward;\n  params.dAngle = dAngle;\n  params.dRadius = dRadius;\n  let lobeShift = abs(dOmega) * SHEAR_PERIOD * 0.5 * angBase * 0.85;\n  let rho = 1.0 - smoothstep(0.12, 1.1, lobeShift);\n\n  var blended: vec2f;\n  var lobeVariance = 1.0;\n  if (rho > 0.98) {\n    let angleMerged = mix(angle1, angle0, w0);\n    blended = smokeField(noiseTex, noiseSampler, lattice, angleMerged, radius, params);\n  } else {\n    let lobe0 = smokeField(noiseTex, noiseSampler, lattice, angle0, radius, params);\n    let lobe1 = smokeField(noiseTex, noiseSampler, lattice, angle1, radius, params);\n    blended = mix(lobe1, lobe0, w0);\n    lobeVariance = sqrt(max(w0 * w0 + w1 * w1 + 2.0 * rho * w0 * w1, 0.25));\n  }\n  var field = FIELD_MEAN + (blended.x - FIELD_MEAN) / lobeVariance;\n\n  let cloudRate = omegaRef * look.cloudSpeed;\n  let cloudRigid = fract(time * cloudRate / TWO_PI) * TWO_PI;\n  let cloudAngle = azimuth - cloudRigid + 0.32 * log(radius / ISCO);\n  let cloudScale = max(look.cloudScale, 0.05);\n  let cloudRaw = streakFbm(\n    noiseTex,\n    noiseSampler,\n    lattice,\n    cloudAngle,\n    radius,\n    cloudScale,\n    cloudScale * 0.34,\n    2,\n    dAngle,\n    dRadius,\n    1.72,\n    1.86,\n    211.7,\n  );\n  let cloud = smoothstep(0.28, 0.72, cloudRaw);\n  let cloudStrength = clamp(look.cloudStrength, 0.0, 0.95);\n  let cloudMultiplier = mix(1.0 - cloudStrength, 1.0 + cloudStrength, cloud);\n  field *= cloudMultiplier;\n\n  let rimNoise = blended.y;\n  let innerEdge = smoothstep(0.0, 0.055, radiusNorm);\n  let outerEdge = 1.0 - smoothstep(0.42 + rimNoise * 0.30 * fray, 1.0, radiusNorm);\n  let envelope = innerEdge * outerEdge * mix(1.0, 0.62, outward);\n\n  let contrast = max(0.2, 1.0 + look.spare2);\n  let lo = 0.50 - 0.16 / contrast;\n  let hi = 0.50 + 0.21 / contrast;\n  var smoke = clamp(pow(smoothstep(lo, hi, field), 1.0 + 0.9 * contrast) * envelope, 0.0, 1.0);\n\n  let fieldN = clamp((field - (lo - 0.10)) / max(hi - lo + 0.26, 0.02), 0.0, 1.0);\n  let emissivity = (mix(0.05, 1.0, pow(fieldN, 1.35)) + 2.2 * pow(fieldN, 5.0)) * envelope;\n\n  let path = pow(grazing, 0.62);\n  let thickness = mix(0.30, 0.85, radiusNorm);\n  let opticalDepth = smoke * thickness * path * look.density * 0.95;\n  let coverage = 1.0 - exp(-opticalDepth);\n\n  let heat = pow(1.0 - radiusNorm, 1.25);\n  var thermal = mix(vec3f(0.52, 0.14, 0.03), vec3f(1.0, 0.56, 0.17), smoothstep(0.03, 0.5, heat));\n  thermal = mix(thermal, vec3f(1.0, 0.94, 0.83), pow(heat, 2.2));\n\n  let tangent = normalize(vec3f(-plane.y, 0.0, plane.x));\n  let orbitalSpeed = min(0.64, 0.94 / sqrt(max(radius - HORIZON, 0.25)));\n  let towardObserver = dot(tangent, -normalize(viewDirection));\n  let beaming = pow(clamp(1.0 / (1.0 - orbitalSpeed * towardObserver), 0.72, 1.55), 1.5 * look.doppler);\n  let redshift = sqrt(max(1.0 - HORIZON / radius, 0.025));\n\n  let facing = mix(0.82, 1.0, step(0.0, g.side));\n\n  let flux = pow(clamp(ISCO / radius, 0.0, 1.0), 1.7);\n  let core = 1.0 + 2.6 * pow(1.0 - radiusNorm, 5.0);\n\n  let arcLift = max(0.0, 1.0 + look.spare0);\n  let faceOn = smoothstep(0.16, 0.75, abs(viewDirection.y));\n  let lift = 1.0 + 1.55 * arcLift * faceOn;\n  let edgeGlow = 1.0 + 0.55 * smoothstep(6.0, 26.0, grazing);\n\n  let source = thermal * beaming * redshift * facing * flux * lift * edgeGlow * core * emissivity;\n  let emission = source * look.brightness * 1.35;\n\n  var sample: DiskSample;\n  sample.color = vec3f(emission);\n  sample.alpha = coverage;\n  return sample;\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/disk.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/gbuffer.wgsl",
      "content": "// Shared decoding contract for the baked crossings consumed by the frame shader.\n\nexport const HORIZON: f32 = 1.0;\n\nexport const ISCO: f32 = 3.0;\nexport const TAU: f32 = 6.28318530718;\nexport const PI_CONST: f32 = 3.14159265359;\n\nexport struct GBufferSample {\n  position: vec3f,\n  normal: vec3f,\n  diskUv: vec2f,\n  diskPolar: vec2f,\n  rayDirection: vec3f,\n  viewDirection: vec3f,\n  side: f32,\n  coverage: f32,\n  span: f32,\n  isHit: bool,\n  synthesized: bool,\n  isBlackHole: bool,\n  escaped: bool,\n}\n\nexport struct GBufferLayers {\n  front: GBufferSample,\n  back: GBufferSample,\n}\n\nfn decodeDirection(encoded: vec2f) -> vec3f {\n  let horizontal = sqrt(max(1.0 - encoded.x * encoded.x, 0.0));\n  return vec3f(cos(encoded.y) * horizontal, encoded.x, sin(encoded.y) * horizontal);\n}\n\nfn decodeLayer(\n  plane: vec2f, encodedDirection: vec2f, sky: vec4f, flags: i32,\n  diskOuter: f32, aa: vec2f, synthesized: bool,\n) -> GBufferSample {\n  var sample: GBufferSample;\n  let planeRadius = length(plane);\n  let isHit = planeRadius > ISCO * 0.5;\n  let radius = max(planeRadius, ISCO);\n  let azimuth = atan2(plane.y, plane.x);\n  let direction = decodeDirection(encodedDirection);\n  let side = select(1.0, -1.0, direction.y > 0.0);\n\n  sample.position = select(vec3f(0.0), vec3f(plane.x, 0.0, plane.y), isHit);\n  sample.normal = select(vec3f(0.0), vec3f(0.0, side, 0.0), isHit);\n  sample.diskUv = vec2f(\n    clamp((radius - ISCO) / max(diskOuter - ISCO, 0.001), 0.0, 1.0),\n    (azimuth + PI_CONST) / TAU,\n  );\n  sample.diskPolar = vec2f(radius, azimuth);\n  sample.rayDirection = sky.xyz;\n  sample.viewDirection = direction;\n  sample.side = select(0.0, side, isHit);\n  sample.coverage = clamp(aa.x, 0.0, 1.0);\n  sample.span = clamp(aa.y, 0.0, 1.0);\n  sample.isHit = isHit;\n  sample.synthesized = synthesized && isHit;\n  sample.isBlackHole = (flags & 1) != 0;\n  sample.escaped = (flags & 2) != 0;\n  return sample;\n}\n\nexport fn decodeGBuffer(\n  hit1: vec2f, hit2: vec2f, sky: vec4f, view: vec4f,\n  diskOuter: f32, aa: vec2f, aaGeom: vec4f,\n) -> GBufferLayers {\n  let flags = i32(sky.w + 0.5);\n  let substitute = length(hit1) <= ISCO * 0.5 && length(aaGeom.xy) > ISCO * 0.5;\n  let frontPlane = select(hit1, aaGeom.xy, substitute);\n  let frontDirection = select(view.xy, aaGeom.zw, substitute);\n  var layers: GBufferLayers;\n  layers.front = decodeLayer(frontPlane, frontDirection, sky, flags, diskOuter, aa, substitute);\n  layers.back = decodeLayer(hit2, view.zw, sky, flags, diskOuter, vec2f(1.0, 0.0), false);\n  if (!layers.front.isHit) {\n    layers.back.isHit = false;\n    layers.back.side = 0.0;\n    layers.back.normal = vec3f(0.0);\n  }\n  return layers;\n}\n\nexport fn sampleAtRadius(g: GBufferSample, radius: f32, diskOuter: f32) -> GBufferSample {\n  var moved = g;\n  let clamped = clamp(radius, ISCO, max(diskOuter, ISCO));\n  let azimuth = g.diskPolar.y;\n  moved.position = vec3f(cos(azimuth) * clamped, 0.0, sin(azimuth) * clamped);\n  moved.diskPolar = vec2f(clamped, azimuth);\n  moved.diskUv = vec2f(\n    clamp((clamped - ISCO) / max(diskOuter - ISCO, 0.001), 0.0, 1.0),\n    g.diskUv.y,\n  );\n  return moved;\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/gbuffer.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/geodesic.wgsl",
      "content": "// Shared Schwarzschild-like ray integration used by the bake and refinement passes.\n\nexport const HORIZON: f32 = 1.0;\n\nexport const ISCO: f32 = 3.0;\n\nexport const MAX_STEPS: i32 = 768;\n\nexport struct TraceResult {\n  hit1Plane: vec2f,\n  hit1Direction: vec2f,\n  hit2Plane: vec2f,\n  hit2Direction: vec2f,\n  hitCount: i32,\n  swallowed: f32,\n  escaped: f32,\n\n  finalVelocity: vec3f,\n}\n\nexport struct CameraRay {\n  position: vec3f,\n  velocity: vec3f,\n}\n\nexport fn escapeRadiusFor(orbitRadius: f32) -> f32 {\n  return max(120.0, orbitRadius + 8.0);\n}\n\nexport fn encodeDirection(direction: vec3f) -> vec2f {\n  return vec2f(direction.y, atan2(direction.z, direction.x));\n}\n\nfn geodesicAcceleration(position: vec3f, velocity: vec3f) -> vec3f {\n  let r2 = max(dot(position, position), 0.0001);\n  let angularMomentum = cross(position, velocity);\n  let h2 = dot(angularMomentum, angularMomentum);\n  return -1.5 * h2 * position / (r2 * r2 * sqrt(r2));\n}\n\nexport fn cameraRay(\n  uv: vec2f,\n  resolution: vec2f,\n  yaw: f32,\n  pitch: f32,\n  orbitRadius: f32,\n  fov: f32,\n  centerX: f32,\n  centerY: f32,\n  roll: f32,\n) -> CameraRay {\n  let aspect = resolution.x / max(resolution.y, 1.0);\n  let ndc = vec2f(uv.x * 2.0 - 1.0, 1.0 - uv.y * 2.0);\n  let screenPlane = (ndc - vec2f(centerX, centerY)) * vec2f(aspect, 1.0);\n  let cosine = cos(roll);\n  let sine = sin(roll);\n  let screen = vec2f(\n    screenPlane.x * cosine - screenPlane.y * sine,\n    screenPlane.x * sine + screenPlane.y * cosine,\n  );\n\n  let clampedPitch = clamp(pitch, -1.319, 1.319);\n  let cameraPosition = vec3f(\n    sin(yaw) * cos(clampedPitch) * orbitRadius,\n    sin(clampedPitch) * orbitRadius,\n    cos(yaw) * cos(clampedPitch) * orbitRadius,\n  );\n  let forward = normalize(vec3f(0.0) - cameraPosition);\n  let right = normalize(cross(forward, vec3f(0.0, 1.0, 0.0)));\n  let up = cross(right, forward);\n\n  var ray: CameraRay;\n  ray.position = cameraPosition;\n  ray.velocity = normalize(forward * fov + right * screen.x + up * screen.y);\n  return ray;\n}\n\nexport fn traceRay(cameraPosition: vec3f, initialVelocity: vec3f, diskOuter: f32, escapeRadius: f32) -> TraceResult {\n  var position = cameraPosition;\n  var velocity = initialVelocity;\n\n  var result: TraceResult;\n  result.hit1Plane = vec2f(0.0);\n  result.hit1Direction = vec2f(0.0);\n  result.hit2Plane = vec2f(0.0);\n  result.hit2Direction = vec2f(0.0);\n  result.hitCount = 0;\n  result.swallowed = 0.0;\n  result.escaped = 0.0;\n\n  for (var stepIndex = 0; stepIndex < MAX_STEPS; stepIndex++) {\n    let radius = length(position);\n    if (radius < HORIZON * 1.004) {\n      result.swallowed = 1.0;\n      break;\n    }\n    if (radius > escapeRadius && dot(position, velocity) > 0.0) {\n      result.escaped = 1.0;\n      break;\n    }\n\n    let stepSize = clamp((radius - HORIZON) * 0.035, 0.0045, 0.075 * max(1.0, radius / 6.0));\n\n    let previousPosition = position;\n    let previousVelocity = velocity;\n\n    let acceleration0 = geodesicAcceleration(position, velocity);\n    velocity += acceleration0 * (0.5 * stepSize);\n    position += velocity * stepSize;\n    let acceleration1 = geodesicAcceleration(position, velocity);\n    velocity += acceleration1 * (0.5 * stepSize);\n    velocity = normalize(velocity);\n\n    if (result.hitCount < 2) {\n      let previousSide = select(-1.0, 1.0, previousPosition.y >= 0.0);\n      let currentSide = select(-1.0, 1.0, position.y >= 0.0);\n      if (previousSide != currentSide) {\n        let t = clamp(previousPosition.y / (previousPosition.y - position.y), 0.0, 1.0);\n        let crossing = mix(previousPosition, position, t);\n        let planeRadius = length(crossing.xz);\n        if (planeRadius >= ISCO && planeRadius <= diskOuter) {\n          let direction = encodeDirection(normalize(mix(previousVelocity, velocity, t)));\n          if (result.hitCount == 0) {\n            result.hit1Plane = crossing.xz;\n            result.hit1Direction = direction;\n          } else {\n            result.hit2Plane = crossing.xz;\n            result.hit2Direction = direction;\n          }\n          result.hitCount += 1;\n        }\n      }\n    }\n  }\n\n  result.finalVelocity = velocity;\n  return result;\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/geodesic.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/refine.wgsl",
      "content": "// One-shot photon-ring refinement: measure sub-pixel coverage and synthesize missed crossings.\n\nimport { HORIZON, ISCO, cameraRay, encodeDirection, escapeRadiusFor, traceRay } from \"./geodesic.wgsl\";\n\nstruct Refine {\n  resolution: vec2f,\n  yaw: f32,\n  pitch: f32,\n  orbitRadius: f32,\n  diskOuter: f32,\n  fov: f32,\n  centerX: f32,\n  centerY: f32,\n  roll: f32,\n}\n\n@group(0) @binding(0) var<uniform> refine: Refine;\n\n@group(0) @binding(1) var gHit1: texture_2d<f32>;\n\n@group(0) @binding(2) var gSky: texture_2d<f32>;\n\nconst SUB_STEPS: i32 = 4;\n\nconst MASK_RADIUS: i32 = 2;\n\nconst GRADIENT_LIMIT: f32 = 0.12;\n\nconst B_CRIT: f32 = 2.59807621;\n\nconst CRITICAL_BAND: f32 = 0.06;\n\nfn isHitAt(plane: vec2f) -> bool {\n  return length(plane) > ISCO * 0.5;\n}\n\nstruct RefineOut {\n  @location(0) coverage: vec2f,\n  @location(1) geometry: vec4f,\n}\n\n@fragment fn fs_main(@location(0) uv: vec2f) -> RefineOut {\n  let dimensions = vec2i(textureDimensions(gHit1, 0));\n  let texel = vec2i(clamp(uv * refine.resolution, vec2f(0.0), refine.resolution - vec2f(1.0)));\n  let annulus = max(refine.diskOuter - ISCO, 0.001);\n\n  let centerPlane = textureLoad(gHit1, texel, 0).xy;\n  let centerHit = isHitAt(centerPlane);\n  let centerHole = (i32(textureLoad(gSky, texel, 0).w + 0.5) & 1) != 0;\n  let centerRadiusNorm = clamp((length(centerPlane) - ISCO) / annulus, 0.0, 1.0);\n\n  let centerRay = cameraRay(\n    uv,\n    refine.resolution,\n    refine.yaw,\n    refine.pitch,\n    refine.orbitRadius,\n    refine.fov,\n    refine.centerX,\n    refine.centerY,\n    refine.roll,\n  );\n  let impactParameter = length(cross(centerRay.position, centerRay.velocity));\n\n  var boundary = abs(impactParameter - B_CRIT) < CRITICAL_BAND * HORIZON;\n  for (var dy = -MASK_RADIUS; dy <= MASK_RADIUS; dy++) {\n    for (var dx = -MASK_RADIUS; dx <= MASK_RADIUS; dx++) {\n      let neighbor = clamp(texel + vec2i(dx, dy), vec2i(0), dimensions - vec2i(1));\n      let plane = textureLoad(gHit1, neighbor, 0).xy;\n      let hit = isHitAt(plane);\n      let hole = (i32(textureLoad(gSky, neighbor, 0).w + 0.5) & 1) != 0;\n      if (hit != centerHit || hole != centerHole) {\n        boundary = true;\n      }\n      if (hit && centerHit) {\n        let radiusNorm = clamp((length(plane) - ISCO) / annulus, 0.0, 1.0);\n        if (abs(radiusNorm - centerRadiusNorm) > GRADIENT_LIMIT) {\n          boundary = true;\n        }\n      }\n    }\n  }\n\n  if (!boundary) {\n    return RefineOut(vec2f(select(0.0, 1.0, centerHit), 0.0), vec4f(0.0));\n  }\n\n  let escapeRadius = escapeRadiusFor(refine.orbitRadius);\n  var hits = 0.0;\n  var minRadius = 1e9;\n  var maxRadius = -1e9;\n  var bestPlane = vec2f(0.0);\n  var bestDirection = vec2f(0.0);\n  var bestRadius = 0.0;\n  var bestDistance = 1e9;\n  for (var sy = 0; sy < SUB_STEPS; sy++) {\n    for (var sx = 0; sx < SUB_STEPS; sx++) {\n      let offset = (vec2f(f32(sx), f32(sy)) + vec2f(0.5)) / f32(SUB_STEPS);\n      let subUv = (vec2f(texel) + offset) / refine.resolution;\n      let ray = cameraRay(\n        subUv,\n        refine.resolution,\n        refine.yaw,\n        refine.pitch,\n        refine.orbitRadius,\n        refine.fov,\n        refine.centerX,\n        refine.centerY,\n        refine.roll,\n      );\n      let traced = traceRay(ray.position, ray.velocity, refine.diskOuter, escapeRadius);\n      if (traced.hitCount > 0) {\n        let radius = length(traced.hit1Plane);\n        hits += 1.0;\n        minRadius = min(minRadius, radius);\n        maxRadius = max(maxRadius, radius);\n        let distance = length(offset - vec2f(0.5));\n        if (distance < bestDistance) {\n          bestDistance = distance;\n          bestPlane = traced.hit1Plane;\n          bestDirection = traced.hit1Direction;\n          bestRadius = radius;\n        }\n      }\n    }\n  }\n\n  let coverage = hits / f32(SUB_STEPS * SUB_STEPS);\n  if (hits < 0.5) {\n    return RefineOut(vec2f(0.0, 0.0), vec4f(0.0));\n  }\n\n  var r0 = length(centerPlane);\n  var span = 0.0;\n  var geometry = vec4f(0.0);\n  if (centerHit) {\n    span = 2.0 * max(abs(maxRadius - r0), abs(r0 - minRadius));\n  } else {\n    r0 = 0.5 * (minRadius + maxRadius);\n    span = maxRadius - minRadius;\n    geometry = vec4f(bestPlane * (r0 / max(bestRadius, ISCO)), bestDirection);\n  }\n  return RefineOut(vec2f(coverage, clamp(span / annulus, 0.0, 1.0)), geometry);\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/refine.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/shade.wgsl",
      "content": "// Per-frame shading: decode the bake, shade stars and disk layers, then composite them.\n\nimport { GBufferSample, GBufferLayers, decodeGBuffer, sampleAtRadius, ISCO, PI_CONST, TAU } from \"./gbuffer.wgsl\";\nimport { DiskLook, DiskSample, shadeDisk, SHEAR_PERIOD } from \"./disk.wgsl\";\nimport { StarLook, shadeStars } from \"./stars.wgsl\";\n\nstruct Shade {\n  resolution: vec2f,\n  time: f32,\n  diskOuter: f32,\n  sceneYaw: f32,\n  centerFade: f32,\n}\n\nconst DISK_GAIN: f32 = 1.35;\n\nfn centeredCopyFade(uvY: f32) -> f32 {\n  let distanceFromCenter = abs(uvY - 0.5);\n  return pow(smoothstep(0.08, 0.38, distanceFromCenter), 2.2);\n}\n\n@group(0) @binding(0) var<uniform> shade: Shade;\n@group(0) @binding(1) var gHit1: texture_2d<f32>;\n@group(0) @binding(2) var gHit2: texture_2d<f32>;\n@group(0) @binding(3) var gSky: texture_2d<f32>;\n@group(0) @binding(4) var gView: texture_2d<f32>;\n@group(0) @binding(5) var<uniform> disk: DiskLook;\n@group(0) @binding(6) var<uniform> stars: StarLook;\n\n@group(0) @binding(7) var noiseVolume: texture_3d<f32>;\n@group(0) @binding(8) var noiseSampler: sampler;\n\n@group(0) @binding(9) var gAa: texture_2d<f32>;\n\n@group(0) @binding(10) var gAaGeom: texture_2d<f32>;\n\nfn diskFootprintAxes(g: GBufferSample) -> vec2f {\n  let angular = max(disk.stretch, 0.05);\n  let noiseAngle = g.diskPolar.y\n    - min(shade.time, SHEAR_PERIOD * 0.5) * (disk.speed * 0.55 / pow(g.diskPolar.x, 1.5));\n  let noiseCoords = vec3f(\n    cos(noiseAngle) * angular,\n    sin(noiseAngle) * angular,\n    g.diskPolar.x * disk.detail,\n  );\n  return vec2f(\n    max(fwidth(noiseCoords.x), fwidth(noiseCoords.y)),\n    fwidth(noiseCoords.z),\n  );\n}\n\nfn diskFootprint(axes: vec2f) -> f32 {\n  return min(max(axes.x, axes.y), 4.0);\n}\n\nfn rotateY(v: vec3f, angle: f32) -> vec3f {\n  let c = cos(angle);\n  let s = sin(angle);\n  return vec3f(c * v.x + s * v.z, v.y, -s * v.x + c * v.z);\n}\n\nfn wrapAngle(angle: f32) -> f32 {\n  return angle - TAU * floor((angle + PI_CONST) / TAU);\n}\n\nfn rotateSample(g: GBufferSample, angle: f32) -> GBufferSample {\n  var rotated = g;\n  rotated.position = rotateY(g.position, angle);\n  rotated.viewDirection = rotateY(g.viewDirection, angle);\n  rotated.rayDirection = rotateY(g.rayDirection, angle);\n  let azimuth = wrapAngle(g.diskPolar.y - angle);\n  rotated.diskPolar = vec2f(g.diskPolar.x, azimuth);\n  rotated.diskUv = vec2f(g.diskUv.x, (azimuth + PI_CONST) / TAU);\n  return rotated;\n}\n\nfn rotateLayers(layers: GBufferLayers, angle: f32) -> GBufferLayers {\n  var rotated: GBufferLayers;\n  rotated.front = rotateSample(layers.front, angle);\n  rotated.back = rotateSample(layers.back, angle);\n  return rotated;\n}\n\nconst AA_TAPS: i32 = 6;\n\nconst AA_SPAN_MIN: f32 = 0.15;\n\nfn shadeFront(g: GBufferSample, footprint: f32, angularFootprint: f32) -> DiskSample {\n  let annulus = max(shade.diskOuter - ISCO, 0.001);\n  let spanWorld = g.span * annulus;\n  if (g.span <= AA_SPAN_MIN) {\n    return shadeDisk(g, disk, shade.time, footprint, noiseVolume, noiseSampler);\n  }\n\n  let tapFootprint = min(max(angularFootprint, max(disk.detail, 0.05) * (spanWorld / f32(AA_TAPS))), 4.0);\n  let step = spanWorld / f32(AA_TAPS);\n  let start = g.diskPolar.x - spanWorld * 0.5;\n\n  var sumEmission = vec3f(0.0);\n  var sumAlpha = 0.0;\n  var taps = 0.0;\n  for (var i = 0; i < AA_TAPS; i++) {\n    let radius = start + (f32(i) + 0.5) * step;\n    if (radius < ISCO || radius > shade.diskOuter) {\n      continue;\n    }\n    let tap = shadeDisk(\n      sampleAtRadius(g, radius, shade.diskOuter), disk, shade.time,\n      tapFootprint, noiseVolume, noiseSampler,\n    );\n    sumEmission += tap.color * tap.alpha;\n    sumAlpha += tap.alpha;\n    taps += 1.0;\n  }\n  if (taps < 0.5) {\n    return shadeDisk(g, disk, shade.time, footprint, noiseVolume, noiseSampler);\n  }\n\n  var sample: DiskSample;\n  let meanAlpha = sumAlpha / taps;\n  sample.alpha = meanAlpha;\n  sample.color = select(vec3f(0.0), (sumEmission / taps) / max(meanAlpha, 1e-6), meanAlpha > 1e-6);\n  return sample;\n}\n\nfn emptyDiskSample() -> DiskSample {\n  var sample: DiskSample;\n  sample.color = vec3f(0.0);\n  sample.alpha = 0.0;\n  return sample;\n}\n\nfn compositeDisk(under: vec3f, sample: DiskSample) -> vec3f {\n  return sample.color * sample.alpha * DISK_GAIN + under * (1.0 - sample.alpha);\n}\n\n@fragment fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {\n  let dimensions = vec2f(textureDimensions(gHit1, 0));\n  let texel = vec2i(clamp(uv * dimensions, vec2f(0.0), dimensions - vec2f(1.0)));\n\n  let aa = textureLoad(gAa, texel, 0).xy;\n  let aaGeom = textureLoad(gAaGeom, texel, 0);\n\n  let baked = decodeGBuffer(\n    textureLoad(gHit1, texel, 0).xy,\n    textureLoad(gHit2, texel, 0).xy,\n    textureLoad(gSky, texel, 0),\n    textureLoad(gView, texel, 0),\n    shade.diskOuter,\n    aa,\n    aaGeom,\n  );\n\n  let frontAxes = diskFootprintAxes(baked.front);\n  let backAxes = diskFootprintAxes(baked.back);\n  let frontFootprint = diskFootprint(frontAxes);\n  let backFootprint = diskFootprint(backAxes);\n\n  let bakedRayDirection = baked.front.rayDirection;\n  let skyDdx = dpdx(bakedRayDirection);\n  let skyDdy = dpdy(bakedRayDirection);\n\n  let layers = rotateLayers(baked, -shade.sceneYaw);\n  let g = layers.front;\n  let skyDdxRotated = rotateY(skyDdx, -shade.sceneYaw);\n  let skyDdyRotated = rotateY(skyDdy, -shade.sceneYaw);\n\n  var background = vec3f(0.0);\n  if (!g.isBlackHole && g.escaped) {\n    background = shadeStars(g.rayDirection, stars, shade.time, skyDdxRotated, skyDdyRotated);\n  }\n\n  var backSample = emptyDiskSample();\n  var frontSample = emptyDiskSample();\n  if (layers.back.isHit) {\n    backSample = shadeDisk(layers.back, disk, shade.time, backFootprint, noiseVolume, noiseSampler);\n  }\n  if (layers.front.isHit) {\n    frontSample = shadeFront(layers.front, frontFootprint, frontAxes.x);\n    frontSample.alpha *= layers.front.coverage;\n  }\n\n  var color = background;\n  color = compositeDisk(color, backSample);\n  color = compositeDisk(color, frontSample);\n\n  let centerMask = mix(\n    1.0,\n    centeredCopyFade(uv.y),\n    clamp(shade.centerFade, 0.0, 1.0),\n  );\n  let heroFade = centerMask;\n\n  color *= heroFade;\n\n  return vec4f(color, 1.0);\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/shade.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/components/black-hole/stars.wgsl",
      "content": "// Procedural lensed star field with anisotropic footprint prefiltering.\n\nimport { pcg3d, unitFloat } from \"@vgpu/wgsl-std/hash\";\n\nconst STAR_INTENSITY: f32 = 1.9;\n\nconst ANCHOR_CELLS: f32 = 36.0;\nconst ANCHOR_FILL: f32 = 0.75;\nconst ANCHOR_RADIUS: f32 = 0.00110;\nconst ANCHOR_PEAK: f32 = 1.0;\n\nconst FIELD_CELLS: f32 = 93.0;\nconst FIELD_FILL: f32 = 0.75;\nconst FIELD_RADIUS: f32 = 0.00070;\nconst FIELD_PEAK: f32 = 0.45;\n\nconst DUST_CELLS: f32 = 151.0;\nconst DUST_FILL: f32 = 0.75;\nconst DUST_RADIUS: f32 = 0.00040;\nconst DUST_PEAK: f32 = 0.22;\n\nconst COUNT_SLOPE: f32 = 2.0;\n\nconst STAR_FLUX_AREA: f32 = 0.5385;\n\nconst MAX_PREFILTER_PIXELS: f32 = 4.0;\n\nconst STAR_WARM: vec3f = vec3f(1.1741, 0.9745, 0.7397);\nconst STAR_COOL: vec3f = vec3f(0.8954, 1.0131, 1.1781);\n\nexport struct StarLook {\n  brightness: f32,\n  density: f32,\n  contrast: f32,\n  warmth: f32,\n  twinkle: f32,\n}\n\nfn faceCoords(direction: vec3f) -> vec3f {\n  let magnitude = abs(direction);\n  if (magnitude.x >= magnitude.y && magnitude.x >= magnitude.z) {\n    return vec3f(direction.yz / magnitude.x, select(1.0, 0.0, direction.x > 0.0));\n  }\n  if (magnitude.y >= magnitude.z) {\n    return vec3f(direction.xz / magnitude.y, select(3.0, 2.0, direction.y > 0.0));\n  }\n  return vec3f(direction.xy / magnitude.z, select(5.0, 4.0, direction.z > 0.0));\n}\n\nfn faceProject(direction: vec3f, axis: i32) -> vec2f {\n  if (axis == 0) {\n    return direction.yz / abs(direction.x);\n  }\n  if (axis == 1) {\n    return direction.xz / abs(direction.y);\n  }\n  return direction.xy / abs(direction.z);\n}\n\nstruct SkyFilter {\n  inverseJacobian: mat2x2f,\n  pixelsPerFace: f32,\n  faceMajor: f32,\n}\n\nfn skyFilter(direction: vec3f, axis: i32, ddx: vec3f, ddy: vec3f) -> SkyFilter {\n  let base = faceProject(direction, axis);\n  let jx = faceProject(direction + ddx, axis) - base;\n  let jy = faceProject(direction + ddy, axis) - base;\n\n  let determinant = jx.x * jy.y - jx.y * jy.x;\n  let safeDeterminant = select(determinant, 1.0e-24, abs(determinant) < 1.0e-24);\n  let inverse = mat2x2f(vec2f(jy.y, -jx.y), vec2f(-jy.x, jx.x)) * (1.0 / safeDeterminant);\n\n  var prefilter: SkyFilter;\n  prefilter.inverseJacobian = inverse;\n  prefilter.pixelsPerFace = 1.0 / sqrt(max(abs(determinant), 1.0e-24));\n  prefilter.faceMajor = max(length(jx), length(jy));\n  return prefilter;\n}\n\nstruct SkyState {\n  brightness: f32,\n  rangePower: f32,\n  meanFlux: f32,\n  warmth: f32,\n  twinkle: f32,\n  time: f32,\n  fillScale: f32,\n  radiusScale: f32,\n}\n\nfn resolveSky(look: StarLook, face: vec2f, time: f32) -> SkyState {\n  let range = clamp(look.contrast, 1.0, 512.0);\n  let rangePower = range * range;\n\n  let compression = 1.0 + dot(face, face);\n  let root = sqrt(compression);\n\n  var sky: SkyState;\n  sky.brightness = max(0.0, look.brightness) * STAR_INTENSITY;\n  sky.rangePower = rangePower;\n  sky.meanFlux = COUNT_SLOPE / (range + COUNT_SLOPE - 1.0);\n  sky.warmth = clamp(look.warmth, 0.0, 1.0);\n  sky.twinkle = clamp(look.twinkle, 0.0, 1.0);\n  sky.time = time;\n  sky.fillScale = max(0.0, look.density) / (compression * root);\n  sky.radiusScale = sqrt(compression * root);\n  return sky;\n}\n\nstruct Species {\n  cells: f32,\n  fill: f32,\n  peak: f32,\n  faceRadius: f32,\n  radiusPixels: f32,\n  gain: f32,\n}\n\nfn resolveSpecies(\n  cells: f32,\n  fill: f32,\n  peak: f32,\n  angularRadius: f32,\n  sky: SkyState,\n  prefilter: SkyFilter,\n) -> Species {\n  let faceRadius = angularRadius * sky.radiusScale;\n  let starPixels = faceRadius * prefilter.pixelsPerFace;\n\n  var species: Species;\n  species.cells = cells;\n  species.fill = clamp(fill * sky.fillScale, 0.0, 1.0);\n  species.peak = peak * sky.brightness;\n  species.faceRadius = faceRadius;\n  species.radiusPixels = clamp(starPixels, 1.0, MAX_PREFILTER_PIXELS);\n  species.gain = min(1.0, starPixels * starPixels);\n  return species;\n}\n\nfn starPoint(\n  cell: vec2f,\n  grid: vec2f,\n  faceIndex: i32,\n  seed: i32,\n  species: Species,\n  sky: SkyState,\n  prefilter: SkyFilter,\n) -> vec3f {\n  let hashed = pcg3d(bitcast<vec3u>(vec3i(vec2i(cell), faceIndex * 131 + seed)));\n  let presence = unitFloat(hashed.x);\n  if (presence > species.fill) {\n    return vec3f(0.0);\n  }\n\n  let jitter = vec2f(unitFloat(hashed.y), unitFloat(hashed.z)) - vec2f(0.5);\n  let center = cell + vec2f(0.5) + jitter * 0.8;\n  let offsetPixels = prefilter.inverseJacobian * ((grid - center) / species.cells);\n  let falloff = 1.0 - smoothstep(0.0, species.radiusPixels, length(offsetPixels));\n\n  let uniform01 = presence / max(species.fill, 1.0e-6);\n  let flux = inverseSqrt(1.0 + uniform01 * (sky.rangePower - 1.0));\n\n  let tint = mix(vec3f(1.0), mix(STAR_WARM, STAR_COOL, unitFloat(hashed.y ^ hashed.z)), sky.warmth);\n\n  let phase = unitFloat(hashed.y) * 6.2831853;\n  let shimmer = 1.0 + sky.twinkle * 0.06 * sin(sky.time * (0.35 + unitFloat(hashed.z) * 0.4) + phase);\n  return tint * (falloff * falloff * species.peak * flux * shimmer * species.gain);\n}\n\nfn starSpecies(\n  face: vec3f,\n  seed: i32,\n  species: Species,\n  sky: SkyState,\n  prefilter: SkyFilter,\n) -> vec3f {\n  let faceIndex = i32(face.z);\n  let grid = face.xy * species.cells;\n  let total = starPoint(floor(grid), grid, faceIndex, seed, species, sky, prefilter);\n\n  let extent = species.faceRadius * species.cells;\n  let mean = species.peak * sky.meanFlux * species.fill * STAR_FLUX_AREA * extent * extent;\n  let meanTint = mix(vec3f(1.0), 0.5 * (STAR_WARM + STAR_COOL), sky.warmth);\n  let cellsPerPixel = species.cells * prefilter.faceMajor;\n  return mix(total, meanTint * mean, smoothstep(1.0, 3.0, cellsPerPixel));\n}\n\nexport fn shadeStars(direction: vec3f, look: StarLook, time: f32, ddx: vec3f, ddy: vec3f) -> vec3f {\n  let d = normalize(direction);\n  let face = faceCoords(d);\n  let prefilter = skyFilter(d, i32(face.z) / 2, ddx, ddy);\n  let sky = resolveSky(look, face.xy, time);\n\n  return starSpecies(\n    face, 17,\n    resolveSpecies(ANCHOR_CELLS, ANCHOR_FILL, ANCHOR_PEAK, ANCHOR_RADIUS, sky, prefilter),\n    sky, prefilter,\n  ) + starSpecies(\n    face, 71,\n    resolveSpecies(FIELD_CELLS, FIELD_FILL, FIELD_PEAK, FIELD_RADIUS, sky, prefilter),\n    sky, prefilter,\n  ) + starSpecies(\n    face, 149,\n    resolveSpecies(DUST_CELLS, DUST_FILL, DUST_PEAK, DUST_RADIUS, sky, prefilter),\n    sky, prefilter,\n  );\n}\n",
      "type": "registry:file",
      "target": "components/black-hole/stars.wgsl"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/lib/wgsl-env.d.ts",
      "content": "/// <reference types=\"@webgpu/types\" />\n/// <reference types=\"@vgpu/wgsl/wgsl-types\" />\n",
      "type": "registry:lib",
      "target": "lib/wgsl-env.d.ts"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/next.config.ts",
      "content": "import type { NextConfig } from \"next\"\n\ntype WebpackConfig = {\n  module?: { rules?: unknown[] }\n}\n\nconst nextConfig: NextConfig = {\n  turbopack: {\n    rules: {\n      \"*.wgsl\": {\n        loaders: [\"@vgpu/wgsl/loader-webpack\"],\n        as: \"*.js\",\n      },\n    },\n  },\n  webpack(config: WebpackConfig) {\n    config.module ??= {}\n    config.module.rules ??= []\n    config.module.rules.push({\n      test: /\\.wgsl$/,\n      loader: \"@vgpu/wgsl/loader-webpack\",\n    })\n    return config\n  },\n}\n\nexport default nextConfig\n",
      "type": "registry:file",
      "target": "next.config.ts"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/AGENTS.md",
      "content": "# Personalizing this portfolio\n\nThis site ships with filler content for a fictional fullstack developer\n(\"Jon Doe\"). It's a demo persona, not a template you fill in\nfield-by-field — your job is to fully re-skin the site as the real person\nwho owns this project.\n\nThis is a single-page site: one screen with a row of social links, a\nshort about section, and a list of projects, over a WebGPU black hole.\nThere are no other routes. All of that copy lives in `app/page.tsx` —\nsame pattern as portfolio-v1.\n\n**Trigger:** the user attaches their resume (a PDF) directly to you and\nasks you to personalize the site — e.g. by mentioning `@AGENTS.md`. When\nthat happens, follow the steps below.\n\nThe resume is personal data and has no reason to live in this repo. Work\nfrom the attachment. Do **not** copy it into the project directory at any\npoint — not to read it, not to run the extraction in Step 1, not\n\"just temporarily while I work.\" As a safety net in case someone saves it\nhere by hand, add a line to `.gitignore` before you start (skip if it's\nalready listed):\n\n```\ngrep -qxF 'resume.pdf' .gitignore || echo 'resume.pdf' >> .gitignore\n```\n\n## Step 1 — Read the resume\n\nRead the attached resume. Pull out:\n\n- Full name\n- Real profession / field / title (e.g. \"Full-Stack Developer\", \"Product\n  Designer\", \"Marine Biologist\") — this drives the tone of everything below\n- A narrative bio: a short first-person about section synthesized from\n  their summary, experience, and notable work, in a voice that matches\n  their actual field. Do not reuse the demo's \"AI infrastructure /\n  ship in small pieces\" framing with the name swapped in — the whole\n  voice changes.\n- Notable projects, portfolio pieces, or work worth listing under Projects\n- A real repo or live URL for each of those projects, if the resume has one\n- Social / profile links actually present in the resume (LinkedIn, GitHub,\n  personal site, X, Instagram, Dribbble, etc.)\n\n### Recovering the real URL behind a link\n\nReading the PDF only gives you visible text — \"GitHub\" as a clickable\nlabel doesn't tell you what it links to. Before treating any link as\nunresolved, try recovering the actual target from the raw bytes of the\nfile.\n\nThis needs a real filesystem path, and the resume is an attachment, not a\nfile in the repo. Copy it to a scratch location **outside the project** —\nyour OS temp directory — run the search there, and delete it when done:\n\n```\n# adjust the source to wherever the attachment actually is on disk\ncp <attached-resume-path> \"${TMPDIR:-/tmp}/resume.pdf\"\ngrep -a -o \"/URI[^)]*)\" \"${TMPDIR:-/tmp}/resume.pdf\"\nrm \"${TMPDIR:-/tmp}/resume.pdf\"\n```\n\nOn Windows use the temp dir (`\"$TEMP/resume.pdf\"` in Git Bash,\n`$env:TEMP` in PowerShell). Never copy it under the project directory,\neven for a moment. If you can't get a filesystem path to the attachment at\nall, ask the user for the path to the file on their machine and grep it in\nplace — still don't bring it into the repo.\n\nMost resumes (exported from Google Docs, Word, or a resume builder) store\ntheir hyperlink targets as plain-text `/URI (...)` entries even when the\nrest of the PDF is compressed, so this works more often than not. Match\neach URL back to the label near it in the resume text — a `github.com/...`\nURL is GitHub, `linkedin.com/in/...` is LinkedIn, and so on. Do this for\nevery link-looking label in the resume, not just the obvious ones — it's\nwhat makes Step 3 actually work instead of falling back to asking every\ntime.\n\nOnly fall back to asking the user for the real link if this comes up empty\nand the resume text still shows an unresolved label — some PDFs compress\nthe annotation objects too, which a plain-text search can't see through.\n\n## Step 2 — About section\n\nRewrite the three about `<p>` paragraphs in `app/page.tsx`, in the new\nvoice from Step 1:\n\n- **Paragraph 1** — who they are: name, role, and what they work on or who\n  for. The original is \"I'm Jon, a fullstack developer in Portland. Most\n  of my work is with early AI infrastructure teams.\"\n- **Paragraph 2** — a concrete stance on how they work (the demo: \"I keep\n  the stack small and ship in small pieces...\").\n- **Paragraph 3** — a line or two about life outside work that sets up the\n  projects below (the demo's cooking / running / books map to the demo\n  projects). If the person's real projects aren't personal side-projects,\n  this can be more about focus areas or what they're learning — keep it\n  short and keep it human. A nurse or an accountant doesn't get the \"ship\n  in small pieces\" developer framing; match the stance to their field.\n\nAlso update `app/layout.tsx` — `metadata.title` (currently \"Jon Doe\" →\ntheir name) and `metadata.description`.\n\n**Length budget:** the demo about section is three short paragraphs on\npurpose. Count the words before you rewrite and stay within about 20%.\nDon't add a fourth paragraph. A longer about section isn't more thorough,\nit's just a worse read.\n\nThe page has no name heading and no job-title line — the about copy is the\nonly identity prose on the site. Don't add an `<h1>` name; that's a\ndeliberate design choice for this template.\n\n## Step 3 — Links\n\nDo not shorten or remove the Instagram, X, and GitHub links in\n`app/page.tsx` — keep all three labels. This is a fixed set of redirect\nslots, not a list you edit down to what the resume happens to mention.\n(\"X\" is the platform formerly called Twitter — a resume may still label it\neither way.) Same pattern as portfolio-v1.\n\nFor each of the three, the `href` rule is the same for every platform,\nevery time — resolved or not:\n\n- Resume has a real link/handle for the platform (most dev resumes have a\n  GitHub) → replace that one `href` with the real URL. Keep\n  `target=\"_blank\" rel=\"noreferrer\"` as-is — it already opens in a new tab.\n- Resume doesn't mention the platform (Instagram usually won't; a resume\n  link labeled \"Twitter\" is the same platform as X — fill the X slot\n  with it, don't treat it as a new one), **or you can't recover a real URL\n  for it** → set `href=\"#\"`. Don't leave the original bare-domain\n  placeholder (`https://instagram.com`, etc.) — that's a working link to\n  the wrong page, which is worse than an obvious placeholder. `href=\"#\"`\n  reads unambiguously as \"not filled in yet.\"\n\nA link's visible text alone (\"Portfolio\", \"GitHub\") doesn't tell you the\n`href` — use the extraction command from Step 1 to recover it before\nconcluding it's unresolved. Only after that comes up empty do you treat it\nlike \"not on the resume\": don't guess a URL, don't leave a URL that looks\nreal but isn't. Set it to `href=\"#\"`, and ask the user for the actual link\nso you can fill it in for real.\n\n**Never add a \"Portfolio\" link found on the resume.** This site *is* their\nportfolio — that resume link points at wherever their portfolio currently\nlives, and once they've personalized this template, this is that site.\nSkip it entirely; don't add it to the list, no matter what domain it\nresolves to.\n\n**Beyond the fixed three, actively check the resume for these and add each\none you find as a new `<Button variant=\"link\" asChild>` in the same nav** — never remove or replace\nany of the original three to make room for them, only append:\n\n- **LinkedIn** — check for this every time. It's the single most common\n  link on a resume that isn't already one of the three slots. If found, it\n  goes right after X and before GitHub, so the order reads\n  Instagram, X, LinkedIn, and GitHub.\n- Anything else the resume links to (Dribbble, a Mastodon handle, etc.)\n  also goes at the end, in the order you found it. This isn't a closed\n  list — LinkedIn is just the one to never skip checking for.\n\nExact placement for LinkedIn, so it's unambiguous — this is the only block\nin `app/page.tsx` that changes shape:\n\n```jsx\n<nav className=\"pointer-events-auto flex flex-wrap gap-x-4 gap-y-1\">\n  <Button\n    variant=\"link\"\n    asChild\n    className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n  >\n    <a href=\"#\" target=\"_blank\" rel=\"noreferrer\">\n      Instagram\n    </a>\n  </Button>\n  <Button\n    variant=\"link\"\n    asChild\n    className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n  >\n    <a href=\"#\" target=\"_blank\" rel=\"noreferrer\">\n      X\n    </a>\n  </Button>\n  <Button\n    variant=\"link\"\n    asChild\n    className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n  >\n    <a\n      href=\"https://linkedin.com/in/their-real-handle\"\n      target=\"_blank\"\n      rel=\"noreferrer\"\n    >\n      LinkedIn\n    </a>\n  </Button>\n  <Button\n    variant=\"link\"\n    asChild\n    className=\"h-auto p-0 text-base font-normal text-white underline decoration-white/40 underline-offset-4 hover:decoration-white\"\n  >\n    <a\n      href=\"https://github.com/their-real-handle\"\n      target=\"_blank\"\n      rel=\"noreferrer\"\n    >\n      GitHub\n    </a>\n  </Button>\n</nav>\n```\n\nThis example shows a resume with LinkedIn and GitHub but no Instagram or\nX, which is the common case — Instagram and X fall back to `#`, LinkedIn\ngets inserted, GitHub gets its real handle. If LinkedIn isn't on the\nresume, don't add that block at all; just apply the `#`-or-real rule to\nthe original three.\n\n## Step 4 — Projects\n\nReplace the `projects` array at the top of `app/page.tsx` with the\nperson's real projects, portfolio pieces, or notable work from the resume.\n\n- Keep the shape: `name`, `href`, `description`. The description is one\n  line, roughly the length of the originals — what the project is, not a\n  pitch.\n- Keep four entries. If the resume genuinely doesn't support four distinct\n  projects, say so and ask before shipping fewer.\n- `href`: a real repo or live URL if the resume has one (recover it per\n  Step 1), otherwise `\"#\"` — never leave the bare `https://github.com/`\n  placeholder, which is a working link to the wrong page. Each entry opens\n  in a new tab already.\n\n## Step 5 — Unslop pass\n\nBefore you're done, read `UNSLOP.md` and check the about section and every\nproject description you wrote against it. AI-generated prose has a\nrecognizable smell — stacked em dashes, rule-of-three lists, \"not just X\nbut Y,\" fortune-cookie closing lines, decorative jargon — and short\nportfolio copy is exactly where it shows. Rewrite what trips those\npatterns before finishing.\n\n## Do not touch\n\n- `components/black-hole.tsx`, everything under `components/black-hole/`,\n  and the `<BlackHole />` usage in `app/layout.tsx`. The background is a\n  near-verbatim port of vgpu's Optimized Black Hole example; it isn't\n  derived from the resume. It ships on by default; the owner removes it\n  themselves if they don't want it.\n- `next.config.ts` — it registers the WGSL loader for Turbopack and\n  webpack. The black hole won't render without it.\n- `lib/wgsl-env.d.ts`. The template needs no env vars, so there is no\n  `.env.example`.\n- Theme, CSS, and layout structure — the copy and social `href`s in\n  `app/page.tsx` and `app/layout.tsx` metadata are the only things that\n  change.\n\n## When you're done\n\nThe resume was never copied into the repo, so there's nothing to clean up\nthere. If you made a scratch copy in a temp directory for the Step 1\nextraction, confirm it's deleted. If the user has a `resume.pdf` sitting in\nthe project root anyway (a manual drop, or a previous run), point it out\nand offer to remove it — `.gitignore` now keeps it from being committed\neither way.\n",
      "type": "registry:file",
      "target": "AGENTS.md"
    },
    {
      "path": "registry/new-york/templates/portfolio-v5/UNSLOP.md",
      "content": "# Unslop\n\nA pass to run against everything written during personalization — the\nabout paragraphs and every project `description` in `app/page.tsx`. This\napplies whenever `AGENTS.md` has you drafting prose for this site.\n\nShort copy is where AI tells are most obvious, and this template is almost\nnothing but short copy. Hold it to a high bar.\n\n## Process\n\n1. Draft the content per `AGENTS.md`.\n2. Before you're done, read it back against every pattern below.\n3. Rewrite what trips a pattern. Preserve the meaning and the person's real\n   voice — don't flatten it, just strip the tells.\n4. Self-audit once more: \"would this specific sentence survive if a human\n   who does this work for real wrote it?\" If not, cut or rewrite it.\n\n## Patterns to detect and fix\n\n### Style\n\n1. **Em dashes.** This is short copy — use none. A single em dash in a\n   two-sentence bio is the most common generated-bio tell there is. Use a\n   period or a comma.\n   - Bad: \"Hey — I'm Jon. Fullstack developer — building for AI teams.\"\n   - Better: \"I'm Jon, a fullstack developer.\"\n2. **Colon as a mid-sentence connector.** \"The honest version:\" or \"The\n   short story:\" add nothing — they're a wind-up before the actual\n   sentence. Cut the wind-up, state the point.\n3. **Manufactured profundity.** A closing line that sounds like a fortune\n   cookie is a tell, not a flourish.\n   - Bad: \"I build things I'd want to use. That's the whole philosophy.\"\n   - Just say what the thing is: \"A recipe box for the meals I actually\n     cook.\"\n4. **Rhetorical setups.** \"X reads like Y until you realize Z\" and similar\n   setup-then-reveal openings are a generated pattern. Open with the fact.\n5. **Title case, curly quotes, decorative emphasis.** Sentence case,\n   straight quotes, no bolding proper nouns.\n\n### Language\n\n6. **AI vocabulary.** Additionally, crucial, delve, empower, facilitate,\n   foster, garner, intricate, landscape (abstract), leverage, pivotal,\n   robust, seamless, showcase, streamline, tapestry, testament,\n   transformative, underscore, utilize, vibrant, \"at the intersection of.\"\n   Replace with the plain word or cut.\n7. **Fancy ways to say \"is.\"** \"serves as\", \"stands as\", \"boasts\". Just say\n   \"is\" or \"has.\"\n8. **\"Not just X, but Y.\"** State the point directly.\n9. **Rule of three.** Two triads back to back — \"simple, tested, and\n   maintainable\" then \"cooking, running, and reading\" — is a strong tell.\n   Use the number of items that's actually true, and vary the sentence\n   shape so it isn't three identical parallel clauses every time.\n10. **Vague attribution.** \"People say\", \"known for\" — if there's no\n    source, cut the claim or make it a fact you can stand behind.\n\n### Length\n\n11. **Padding past the point.** An extra clause restating the previous one,\n    an implication spelled out that the reader already got. `AGENTS.md`\n    gives a word-count budget measured against what you're replacing — if\n    you're over it, cut a sentence, don't tighten the wording of all of\n    them.\n12. **One idea per paragraph.** If the two `details` paragraphs make the\n    same point from different sides, keep the sharper one and cut the\n    other, or make the second one do a different job (the demo's second\n    paragraph is about life outside work, not more work philosophy).\n\n### Voice\n\n13. **Say what happened, not how it felt.** \"made the workflow seamless\"\n    names a feeling. \"cut the review step from three tools to one\" names a\n    fact. If a project description could sit unchanged in anyone else's\n    portfolio, it says nothing — make it specific to this project.\n14. **Active voice, real actor.** \"the score was improved by streaming\"\n    becomes \"streaming the response improved the score.\"\n15. **Cut adverbs propping up a weak verb.** \"runs significantly faster\"\n    becomes the actual number, or a stronger verb.\n16. **Plain word over the fancier synonym.** \"utilize\" → \"use\", \"leverage\"\n    → \"use\", \"facilitate\" → \"help\", \"numerous\" → \"many.\"\n17. **Chatbot artifacts.** No \"I hope this helps,\" no apologizing, no\n    address to a reader who isn't there — this is a bio, not a chat reply.\n\n## Sound test\n\nRead the about section out loud. If it sounds like something written\n_about_ the person rather than _by_ them, it's still slopped.\n",
      "type": "registry:file",
      "target": "UNSLOP.md"
    }
  ],
  "docs": "New Next.js project only (same flow as https://ui.shadcn.com/create):\n  npx shadcn@latest init --template next -y \"https://uiception.com/r/portfolio-v5.json\"\n\nThis scaffolds Next.js + shadcn, then installs the black-hole portfolio.\n\nSingle-page site — a left column of about copy, social links, and projects over a WebGPU black hole. No blog, no other routes.\n\nType is Oxanium (next/font/google), wired to --font-sans in app/globals.css at text-base. Social and project links use Button variant=\"link\". Edit about, social links, and projects in app/page.tsx. The black hole lives in app/layout.tsx as a fixed full-viewport background. Requires a browser with WebGPU; otherwise the page stays black with the same copy. next.config.ts registers the WGSL loader for Turbopack and webpack.\n\nPreview at /view/portfolio-v5.",
  "categories": [
    "template",
    "portfolio"
  ],
  "type": "registry:block"
}