{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "strand",
  "type": "registry:ui",
  "title": "Strand",
  "description": "A converging thread field: silver filaments strung between two off-screen loom anchors — ends pinned, free middles bowing under noise like threads at uneven tension. Each thread is a 1/|d| neon glow with a white-hot core and long silver falloff, depth-faded into a dim far weave; the cursor parts the field with a Gaussian bend that eases in and cascades from near threads to far. Original OGL fragment shader, DPR-clamped with a 1920px render cap, offscreen-paused, reduced-motion-safe. Idles on its own when untouched — a ghost cursor parts the threads.",
  "dependencies": [
    "ogl"
  ],
  "registryDependencies": [
    "https://crucibleui.com/r/use-visibility-pause.json",
    "https://crucibleui.com/r/use-reduced-motion.json",
    "https://crucibleui.com/r/use-dpr-cap.json"
  ],
  "files": [
    {
      "path": "registry/default/backgrounds/strand/strand.tsx",
      "type": "registry:ui",
      "target": "components/crucible/strand.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Mesh, Program, Renderer, Triangle } from \"ogl\";\n\nimport { cn } from \"@/lib/utils\";\nimport { useReducedMotion } from \"@/hooks/use-reduced-motion\";\nimport { useVisibilityPause } from \"@/hooks/use-visibility-pause\";\nimport { clampDpr, useDprCap } from \"@/hooks/use-dpr-cap\";\n\nexport interface StrandProps extends React.ComponentPropsWithoutRef<\"div\"> {\n  /**\n   * Two tones: `[core, tail]`. `core` is the white-hot 1px filament center,\n   * `tail` is the silver its glow cools into. Any hex string.\n   * @default [\"#fafafa\", \"#a3a3a3\"]\n   */\n  colors?: [string, string];\n  /**\n   * Number of threads, clamped 2–64. A real uniform-driven prop — changing it\n   * live-updates the shader without ever rebuilding the GL context.\n   * @default 32\n   */\n  lineCount?: number;\n  /**\n   * How far the free middles bow and wander under noise. 1 = default drift,\n   * 0 = perfectly taut threads. @default 1\n   */\n  amplitude?: number;\n  /**\n   * Vertical fan of the thread field as a fraction of the element height,\n   * clamped 0–1.5. @default 1\n   */\n  spread?: number;\n  /**\n   * How strongly both ends of every thread pinch toward the two off-screen\n   * loom anchors: 0 = parallel threads, 1 = full pinch. @default 0.6\n   */\n  convergence?: number;\n  /** Drift speed multiplier. 1 = default. @default 1 */\n  speed?: number;\n  /** Overall glow brightness. 1 = default. @default 1 */\n  intensity?: number;\n  /**\n   * Threads part around the cursor with a Gaussian bend that cascades from\n   * near threads to far ones. @default true\n   */\n  interactive?: boolean;\n  /** Radius of the cursor bend, as a fraction of the element height. @default 0.3 */\n  bendRadius?: number;\n  /** How far threads part around the cursor. 0 disables the bend. @default 1 */\n  bendStrength?: number;\n  /**\n   * Idle autoplay: after ~1.5s with no real pointer over the field, a seeded\n   * ghost cursor drifts through it on a slow Lissajous path, parting the\n   * threads at a softer strength, so it never looks dead in thumbnails and\n   * heroes. The real pointer takes over instantly. Only when `interactive`;\n   * never under reduced motion. @default true\n   */\n  idle?: boolean;\n  /** Freeze the animation, holding the current frame. @default false */\n  paused?: boolean;\n}\n\nconst DEFAULT_COLORS: [string, string] = [\n  \"#fafafa\", // white — hot filament core\n  \"#a3a3a3\", // neutral-400 silver — glow tail\n];\n\n/** Hex → [r,g,b] in 0–1. Accepts #rgb / #rrggbb. */\nfunction hexToRgb(hex: string): [number, number, number] {\n  let h = hex.replace(\"#\", \"\").trim();\n  if (h.length === 3) {\n    h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];\n  }\n  const int = parseInt(h, 16);\n  if (Number.isNaN(int) || h.length !== 6) return [0.98, 0.98, 0.98];\n  return [((int >> 16) & 255) / 255, ((int >> 8) & 255) / 255, (int & 255) / 255];\n}\n\n/**\n * Original converging-thread-field fragment shader. N filaments are evaluated\n * analytically per pixel: each thread's ends pin toward two off-screen loom\n * anchors (left and right) while its free middle bows and wanders under one\n * value-noise eval plus a cheap trig detail term riding on it — threads under\n * uneven tension. Rendering is a 1/|d| neon profile per thread (white-hot\n * ~1px core, long soft silver falloff — the glow doubles as free bloom),\n * accumulated and squashed through an exponential tone curve so crossings\n * bloom instead of clipping. The cursor parts the field with a Gaussian bend\n * gated by an eased 0→1 influence scalar, staggered per line so near threads\n * respond first and the release cascades back out. Grain dithering defeats\n * 8-bit banding in the glow. GLSL ES 1.00 (WebGL1/2 compatible).\n */\nconst FRAGMENT = /* glsl */ `\nprecision highp float;\n\nvarying vec2 vUv;\n\nuniform float uTime;\nuniform vec2 uResolution;\nuniform vec2 uPointer;     // eased pointer, 0..1, y-up\nuniform float uSeed;       // per-instance time offset — desyncs multiple instances\nuniform float uInfluence;  // eased 0..1 cursor-influence scalar\n\nuniform vec3 uColorCore;   // white-hot filament center\nuniform vec3 uColorTail;   // silver glow tail\nuniform float uLineCount;\nuniform float uAmplitude;\nuniform float uSpread;\nuniform float uConvergence;\nuniform float uSpeed;\nuniform float uIntensity;\nuniform float uBendRadius;\nuniform float uBendStrength;\n\nconst int MAX_LINES = 64;\nconst float PI = 3.14159265359;\n\nfloat hash11(float n) {\n  return fract(sin(n * 127.1 + 0.7) * 43758.5453123);\n}\n\nfloat hash21(vec2 p) {\n  p = fract(p * vec2(123.34, 456.21));\n  p += dot(p, p + 45.32);\n  return fract(p.x * p.y);\n}\n\nfloat vnoise(vec2 p) {\n  vec2 i = floor(p);\n  vec2 f = fract(p);\n  float a = hash21(i);\n  float b = hash21(i + vec2(1.0, 0.0));\n  float c = hash21(i + vec2(0.0, 1.0));\n  float d = hash21(i + vec2(1.0, 1.0));\n  vec2 u = f * f * (3.0 - 2.0 * f);\n  return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\n\nvoid main() {\n  vec2 uv = vUv;\n  float aspect = uResolution.x / max(uResolution.y, 1.0);\n  float t = (uTime + uSeed) * uSpeed;\n  float count = clamp(uLineCount, 2.0, float(MAX_LINES));\n\n  // Loom anchors sit beyond both screen edges; tx is the position along the\n  // extended span between them. pinch peaks mid-screen and shrinks toward the\n  // anchors, so at convergence 1 the fan pinches fully just off-screen.\n  float margin = 0.22;\n  float tx = (uv.x + margin) / (1.0 + 2.0 * margin);\n  float pinch = sin(PI * tx);\n  float profile = mix(1.0, pinch, clamp(uConvergence, 0.0, 1.0));\n  // Wander envelope: anchored ends, free middles — even at convergence 0 the\n  // threads stay pinned at the loom and billow through the center.\n  float freeMid = pow(pinch, 0.85);\n\n  float bend2 = max(uBendRadius * uBendRadius, 1e-4);\n  // Hot-core width in buffer pixels, gently tracking element size.\n  float coreW = clamp(uResolution.y / 900.0, 0.75, 1.6);\n\n  vec3 acc = vec3(0.0);\n  for (int i = 0; i < MAX_LINES; i++) {\n    if (float(i) >= count) break;\n    float fi = float(i);\n    float h1 = hash11(fi * 1.618 + 0.71);\n    float h2 = hash11(fi * 2.317 + 4.30);\n    float h3 = hash11(fi * 3.113 + 9.20);\n\n    // Lane (evenly spaced, seeded jitter) and shuffled depth so near and far\n    // threads interleave instead of sorting top-to-bottom.\n    float lane = (fi + 0.5) / count - 0.5 + (h1 - 0.5) * (0.5 / count);\n    float depth = h2; // 0 near .. 1 far\n\n    // Per-line clock: each thread drifts at its own rate and phase.\n    float lt = t * mix(0.7, 1.25, h3) + h1 * 43.0;\n\n    // Wander: ONE noise eval per line, plus a cheap trig detail term whose\n    // phase is modulated by the noise so it never reads as a comb.\n    float n = vnoise(vec2(uv.x * aspect * 1.35 + h1 * 89.0, lt * 0.11)) - 0.5;\n    float detail = sin(uv.x * aspect * 9.0 + h2 * 61.0 + lt * 0.35 + n * 5.0);\n    float amp = uAmplitude * 0.16 * freeMid * mix(1.0, 0.5, depth) * mix(0.75, 1.2, h3);\n    float yc = 0.5 + lane * clamp(uSpread, 0.0, 1.5) * 0.96 * profile\n             + (n * 2.0 + detail * 0.22) * amp;\n\n    // Cursor bend: Gaussian part, gated by the eased influence scalar with a\n    // per-line stagger — threads nearer the cursor's lane engage first, and on\n    // leave the release cascades back out through the field.\n    float stagger = clamp(abs(yc - uPointer.y) * 1.5, 0.0, 0.7);\n    float lineInf = smoothstep(stagger, stagger + 0.3, uInfluence);\n    float dx = (uv.x - uPointer.x) * aspect;\n    float dy = yc - uPointer.y;\n    float gauss = exp(-(dx * dx + dy * dy) / bend2);\n    yc += uBendStrength * lineInf * dy * gauss * 1.7;\n\n    // 1/|d| neon glow: hot ~1px core with a long soft falloff — the falloff\n    // IS the bloom, no extra passes.\n    float dpx = abs(uv.y - yc) * uResolution.y;\n    float w = mix(1.8, 1.0, depth) * coreW;\n    float g = w / (dpx + w);\n\n    // Depth-faded silver with a slow shimmer breathing along each thread, and\n    // a gentle lift where the cursor holds the field open.\n    float bright = mix(1.0, 0.15, depth);\n    bright *= 0.82 + 0.18 * sin(lt * 0.9 + uv.x * aspect * 6.0 + h2 * 20.0);\n    bright *= 1.0 + 0.6 * lineInf * gauss;\n\n    acc += mix(uColorTail, uColorCore, pow(g, 3.0)) * (g * bright);\n  }\n\n  // Squash the accumulated glow — crossings bloom and roll off, never clip.\n  vec3 threads = 1.0 - exp(-acc * 1.25 * uIntensity);\n\n  // Near-black plate with a faint cool lift toward the base.\n  vec3 col = mix(vec3(0.010, 0.011, 0.014), vec3(0.026, 0.028, 0.034),\n                 pow(1.0 - uv.y, 1.5));\n  col += threads;\n\n  // Vignette sinks the frame edges; grain dither defeats 8-bit banding.\n  vec2 vg = (uv - 0.5) * vec2(aspect, 1.0);\n  col *= 1.0 - 0.30 * dot(vg, vg);\n  float grain = hash21(gl_FragCoord.xy + fract(t) * 137.0) - 0.5;\n  col += grain * (1.8 / 255.0);\n\n  gl_FragColor = vec4(max(col, 0.0), 1.0);\n}\n`;\n\nconst VERTEX = /* glsl */ `\nprecision highp float;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUv;\nvoid main() {\n  vUv = uv;\n  gl_Position = vec4(position, 0.0, 1.0);\n}\n`;\n\ninterface Uniform<T> {\n  value: T;\n}\n\ninterface Internals {\n  renderer: Renderer;\n  mesh: Mesh;\n  program: Program;\n  uTime: Uniform<number>;\n  uSeed: Uniform<number>;\n  uInfluence: Uniform<number>;\n  uResolution: Uniform<[number, number]>;\n  uPointer: Uniform<[number, number]>;\n  seed: number;\n  loseContext: (() => void) | null;\n}\n\n/** OGL early-returns on a failed link without creating uniformLocations. */\nfunction programLinked(program: Program): boolean {\n  return (program as unknown as { uniformLocations?: unknown }).uniformLocations !== undefined;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(Math.max(v, lo), hi);\n\n/** Longest edge of the drawing buffer — larger elements upscale imperceptibly. */\nconst MAX_RENDER_DIMENSION = 1920;\n\n/** uTime for the reduced-motion still: threads gracefully bowed mid-drift. */\nconst REDUCED_TIME = 6.0;\n\n/** Ghost takes over this long (ms) after the last real pointer activity. */\nconst GHOST_DELAY_MS = 1500;\n/** Ghost bend strength relative to a real pointer. */\nconst GHOST_PRESENCE = 0.75;\n\n/** Deterministic per-instance time offset so multiple instances desynchronize. */\nlet instanceCounter = 0;\n\n/**\n * Strand — a converging thread field. Silver filaments strung between two\n * off-screen loom anchors: ends pinned, free middles bowing and wandering\n * under noise like threads held at uneven tension. Each thread renders as a\n * 1/|d| neon glow — white-hot 1px core, long soft silver falloff — depth-faded\n * so near threads burn bright over a dim far weave. The cursor parts the\n * field with a Gaussian bend that eases in and out (never pops) and cascades\n * from near threads to far ones.\n *\n * Original OGL fragment shader on a fullscreen triangle: mounted once with\n * every knob a live uniform, DPR ≤2 with a 1920px max-render-dimension cap,\n * offscreen- and hidden-tab-paused, reduced-motion-safe (a frozen mid-drift\n * still), full WebGL teardown on unmount, fails soft on lost context. Drop it\n * inside any `relative` container; it fills and sits behind content.\n */\nexport function Strand({\n  colors = DEFAULT_COLORS,\n  lineCount = 32,\n  amplitude = 1,\n  spread = 1,\n  convergence = 0.6,\n  speed = 1,\n  intensity = 1,\n  interactive = true,\n  bendRadius = 0.3,\n  bendStrength = 1,\n  idle = true,\n  paused = false,\n  className,\n  ...props\n}: StrandProps) {\n  const internalsRef = React.useRef<Internals | null>(null);\n  const [ready, setReady] = React.useState(false);\n  const [failed, setFailed] = React.useState(false);\n\n  const reducedMotion = useReducedMotion();\n\n  // Live mirrors read inside the RAF loop without re-subscribing it.\n  const interactiveRef = React.useRef(interactive);\n  interactiveRef.current = interactive;\n  const idleRef = React.useRef(idle);\n  idleRef.current = idle;\n  // performance.now() of the last real pointer activity; -Infinity = never.\n  const lastRealPointerRef = React.useRef(-Infinity);\n  const insideRef = React.useRef(false);\n\n  // Pointer + influence integration state.\n  const pointerRef = React.useRef<[number, number]>([0.5, 0.5]);\n  const pointerTargetRef = React.useRef<[number, number]>([0.5, 0.5]);\n  const influenceRef = React.useRef(0);\n  const influenceTargetRef = React.useRef(0);\n  const lastElapsedRef = React.useRef(0);\n\n  const tick = React.useCallback((elapsed: number) => {\n    const it = internalsRef.current;\n    if (!it || !programLinked(it.program)) return;\n\n    // useVisibilityPause restarts `elapsed` at 0 whenever its `paused` option\n    // flips; re-seat so the first frame after a resume steps by 0, not backwards.\n    if (elapsed < lastElapsedRef.current) lastElapsedRef.current = elapsed;\n    let dt = elapsed - lastElapsedRef.current;\n    lastElapsedRef.current = elapsed;\n    if (dt < 0) dt = 0;\n    if (dt > 0.05) dt = 0.05; // clamp jumps after a pause/tab-switch\n\n    // Idle ghost: a slow seeded Lissajous cursor while nobody is over the field.\n    const pt = pointerTargetRef.current;\n    if (\n      interactiveRef.current &&\n      idleRef.current &&\n      !insideRef.current &&\n      performance.now() - lastRealPointerRef.current > GHOST_DELAY_MS\n    ) {\n      const gt = elapsed + it.seed;\n      pt[0] = 0.5 + 0.34 * Math.sin(gt * 0.27) * Math.cos(gt * 0.083);\n      pt[1] = 0.5 + 0.22 * Math.sin(gt * 0.19 + 1.3);\n      influenceTargetRef.current = GHOST_PRESENCE;\n    }\n\n    // Frame-rate-independent pointer damping (exponential time constant).\n    const pc = pointerRef.current;\n    const pe = 1 - Math.exp(-7 * dt);\n    pc[0] += (pt[0] - pc[0]) * pe;\n    pc[1] += (pt[1] - pc[1]) * pe;\n\n    // Eased 0→1 influence scalar — quicker to engage than to let go, so the\n    // bend fades in and out instead of popping.\n    const target = interactiveRef.current ? influenceTargetRef.current : 0;\n    const cur = influenceRef.current;\n    const k = target > cur ? 5 : 2.4;\n    influenceRef.current = cur + (target - cur) * (1 - Math.exp(-k * dt));\n\n    it.uTime.value = elapsed;\n    it.uInfluence.value = influenceRef.current;\n    it.uPointer.value[0] = pc[0];\n    it.uPointer.value[1] = pc[1];\n    it.renderer.render({ scene: it.mesh });\n  }, []);\n\n  const containerRef = useVisibilityPause<HTMLDivElement>(tick, {\n    paused: paused || reducedMotion,\n  });\n\n  // Host-imposed DPR ceiling (galleries of thumbnails cap fill rate).\n  const dprCap = useDprCap();\n\n  // ---- setup / teardown (mount once; every knob is a live uniform) ----\n  React.useEffect(() => {\n    const container = containerRef.current;\n    if (!container) return;\n\n    // Fresh canvas per mount: a canvas whose context was killed via\n    // WEBGL_lose_context (our teardown) can only ever return that dead\n    // context again — StrictMode's double-mount would come back black.\n    const canvas = document.createElement(\"canvas\");\n    canvas.setAttribute(\"aria-hidden\", \"true\");\n    canvas.className = \"absolute inset-0 block h-full w-full\";\n    container.appendChild(canvas);\n\n    const baseDpr = clampDpr(dprCap, 2);\n\n    let renderer: Renderer;\n    let gl: Renderer[\"gl\"];\n    try {\n      renderer = new Renderer({\n        canvas,\n        dpr: baseDpr,\n        alpha: true,\n        antialias: false, // fullscreen fragment pass — MSAA buys nothing\n        premultipliedAlpha: false,\n      });\n      gl = renderer.gl;\n      gl.clearColor(0, 0, 0, 0);\n    } catch (err) {\n      console.warn(\"[crucible] WebGL unavailable — rendering static fallback.\", err);\n      canvas.remove();\n      setFailed(true);\n      return;\n    }\n\n    const onContextLost = (e: Event) => {\n      e.preventDefault();\n      setFailed(true);\n    };\n    canvas.addEventListener(\"webglcontextlost\", onContextLost);\n\n    const seed = (instanceCounter++ % 64) * 5.3;\n\n    const uTime: Uniform<number> = { value: 0 };\n    const uSeed: Uniform<number> = { value: seed };\n    const uInfluence: Uniform<number> = { value: 0 };\n    const uResolution: Uniform<[number, number]> = {\n      value: [gl.drawingBufferWidth || 1, gl.drawingBufferHeight || 1],\n    };\n    const uPointer: Uniform<[number, number]> = { value: [0.5, 0.5] };\n\n    const program = new Program(gl, {\n      vertex: VERTEX,\n      fragment: FRAGMENT,\n      uniforms: {\n        uTime,\n        uSeed,\n        uInfluence,\n        uResolution,\n        uPointer,\n        uColorCore: { value: hexToRgb(colors[0]) },\n        uColorTail: { value: hexToRgb(colors[1]) },\n        uLineCount: { value: clamp(Math.round(lineCount), 2, 64) },\n        uAmplitude: { value: Math.max(amplitude, 0) },\n        uSpread: { value: clamp(spread, 0, 1.5) },\n        uConvergence: { value: clamp(convergence, 0, 1) },\n        uSpeed: { value: Math.max(speed, 0) },\n        uIntensity: { value: Math.max(intensity, 0) },\n        uBendRadius: { value: clamp(bendRadius, 0.05, 1) },\n        uBendStrength: { value: Math.max(bendStrength, 0) },\n      },\n    });\n\n    const geometry = new Triangle(gl);\n    const mesh = new Mesh(gl, { geometry, program });\n\n    const loseExt = gl.getExtension(\"WEBGL_lose_context\");\n\n    const internals: Internals = {\n      renderer,\n      mesh,\n      program,\n      uTime,\n      uSeed,\n      uInfluence,\n      uResolution,\n      uPointer,\n      seed,\n      loseContext: loseExt ? () => loseExt.loseContext() : null,\n    };\n    internalsRef.current = internals;\n\n    const resize = () => {\n      const { clientWidth: w, clientHeight: h } = container;\n      // DPR ≤2 plus a max-render-dimension cap: huge elements render at most\n      // 1920px on their longest edge and upscale imperceptibly.\n      const longest = Math.max(w, h, 1) * baseDpr;\n      renderer.dpr =\n        longest > MAX_RENDER_DIMENSION\n          ? baseDpr * (MAX_RENDER_DIMENSION / longest)\n          : baseDpr;\n      renderer.setSize(Math.max(w, 1), Math.max(h, 1));\n      uResolution.value[0] = gl.drawingBufferWidth;\n      uResolution.value[1] = gl.drawingBufferHeight;\n      // Keep the frame correct even while the loop is idle (paused/reduced).\n      if (programLinked(program)) renderer.render({ scene: mesh });\n    };\n\n    const ro = new ResizeObserver(resize);\n    ro.observe(container);\n    resize();\n\n    const onPointerMove = (e: PointerEvent) => {\n      const rect = container.getBoundingClientRect();\n      if (rect.width === 0 || rect.height === 0) return;\n      pointerTargetRef.current[0] = (e.clientX - rect.left) / rect.width;\n      // Flip Y so \"up\" on screen is 1.\n      pointerTargetRef.current[1] = 1 - (e.clientY - rect.top) / rect.height;\n      influenceTargetRef.current = 1;\n      insideRef.current = true;\n      lastRealPointerRef.current = performance.now();\n    };\n    const onPointerLeave = () => {\n      // Keep the last pointer position — the influence scalar fades the bend\n      // out in place instead of dragging threads back through center.\n      influenceTargetRef.current = 0;\n      insideRef.current = false;\n      // The ghost resumes after the usual delay rather than snapping in.\n      lastRealPointerRef.current = performance.now();\n    };\n\n    container.addEventListener(\"pointermove\", onPointerMove);\n    container.addEventListener(\"pointerleave\", onPointerLeave);\n    container.addEventListener(\"pointercancel\", onPointerLeave);\n\n    setReady(true);\n\n    return () => {\n      setReady(false);\n      internalsRef.current = null;\n      ro.disconnect();\n      canvas.removeEventListener(\"webglcontextlost\", onContextLost);\n      container.removeEventListener(\"pointermove\", onPointerMove);\n      container.removeEventListener(\"pointerleave\", onPointerLeave);\n      container.removeEventListener(\"pointercancel\", onPointerLeave);\n      internals.loseContext?.();\n      canvas.remove();\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [dprCap]);\n\n  // ---- live-sync knob uniforms in place; re-render if the loop is idle ----\n  React.useEffect(() => {\n    const it = internalsRef.current;\n    if (!it || !programLinked(it.program)) return;\n    const u = it.program.uniforms;\n    u.uColorCore.value = hexToRgb(colors[0]);\n    u.uColorTail.value = hexToRgb(colors[1]);\n    u.uLineCount.value = clamp(Math.round(lineCount), 2, 64);\n    u.uAmplitude.value = Math.max(amplitude, 0);\n    u.uSpread.value = clamp(spread, 0, 1.5);\n    u.uConvergence.value = clamp(convergence, 0, 1);\n    u.uSpeed.value = Math.max(speed, 0);\n    u.uIntensity.value = Math.max(intensity, 0);\n    u.uBendRadius.value = clamp(bendRadius, 0.05, 1);\n    u.uBendStrength.value = Math.max(bendStrength, 0);\n    if (paused || reducedMotion) it.renderer.render({ scene: it.mesh });\n  });\n\n  // ---- designed still under reduced motion; hold frame when paused ----\n  React.useEffect(() => {\n    const it = internalsRef.current;\n    if (!it || !ready || !programLinked(it.program)) return;\n    if (reducedMotion) {\n      // A composed mid-drift frame: threads gracefully bowed, interaction off.\n      // Seed zeroed so the still is the same designed frame on every instance.\n      it.uTime.value = REDUCED_TIME;\n      it.uSeed.value = 0;\n      it.uInfluence.value = 0;\n      it.uPointer.value[0] = 0.5;\n      it.uPointer.value[1] = 0.5;\n      influenceRef.current = 0;\n      influenceTargetRef.current = 0;\n      it.renderer.render({ scene: it.mesh });\n    } else {\n      it.uSeed.value = it.seed;\n      if (paused) it.renderer.render({ scene: it.mesh });\n    }\n  }, [reducedMotion, paused, ready]);\n\n  return (\n    <div\n      ref={containerRef}\n      aria-hidden\n      data-crucible=\"strand\"\n      className={cn(\n        \"absolute inset-0 -z-10 block overflow-hidden bg-neutral-950\",\n        className\n      )}\n      {...props}\n    >\n      {failed && (\n        <div\n          aria-hidden\n          className=\"absolute inset-0\"\n          style={{\n            background:\n              \"linear-gradient(178deg, transparent 44%, rgba(250,250,250,0.10) 49%, transparent 50%, transparent 58%, rgba(163,163,163,0.08) 63%, transparent 64%)\",\n          }}\n        />\n      )}\n    </div>\n  );\n}\n"
    }
  ]
}