{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sateen",
  "type": "registry:ui",
  "title": "Sateen",
  "description": "Flowing lit fabric: broad domain-drifted folds carry fine silky striations while a satin specular band — an orbiting light caught by the cloth's gradient — sweeps across the drape. Moonlit pewter-blue, billows under the cursor. Original OGL fragment shader, offscreen-paused and reduced-motion-safe. Idles on its own when untouched — a ghost touch billows the cloth.",
  "dependencies": [
    "ogl"
  ],
  "registryDependencies": [
    "https://crucibleui.com/r/use-reduced-motion.json",
    "https://crucibleui.com/r/use-visibility-pause.json",
    "https://crucibleui.com/r/use-dpr-cap.json"
  ],
  "files": [
    {
      "path": "registry/default/backgrounds/sateen/sateen.tsx",
      "type": "registry:ui",
      "target": "components/crucible/sateen.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 SateenProps extends React.ComponentPropsWithoutRef<\"div\"> {\n  /**\n   * Two-stop palette: `[base, sheen]`. `base` is the deep body of the cloth,\n   * `sheen` the pale satin highlight that sweeps across it. Any hex string.\n   * Defaults to moonlit pewter-blue.\n   */\n  colors?: [string, string];\n  /** Drift speed multiplier. 1 = default slow drape. Default 1. */\n  speed?: number;\n  /** Overall zoom of the weave, clamped 0.25–4. Default 1. */\n  scale?: number;\n  /** Drape angle in degrees — tilts the whole cloth. Default 18. */\n  rotation?: number;\n  /**\n   * Strength of the orbiting satin highlight, 0 disables it entirely.\n   * Default 1.\n   */\n  sheenIntensity?: number;\n  /** Frequency multiplier for the broad slow folds, clamped 0.25–4. Default 1. */\n  foldDensity?: number;\n  /**\n   * Frequency multiplier for the fine silky ridges riding the folds,\n   * clamped 0.25–4. Default 1.\n   */\n  striationDensity?: number;\n  /**\n   * When true the cloth billows softly under the cursor and settles after it\n   * leaves. Default true.\n   */\n  interactive?: boolean;\n  /**\n   * Idle autoplay: after ~1.5s with no real pointer over the cloth, a seeded\n   * ghost touch drifts across it on a slow Lissajous path, billowing it at a\n   * softer strength, so the fabric never looks dead in thumbnails and heroes.\n   * The real pointer takes over instantly. Only when `interactive`; never\n   * under reduced motion. Default true.\n   */\n  idle?: boolean;\n  /** Freeze the animation, holding the current frame. */\n  paused?: boolean;\n}\n\nconst DEFAULT_COLORS: [string, string] = [\n  \"#1a2030\", // pewter-blue base — the deep body of the cloth\n  \"#aebedd\", // moonlit sheen — the satin highlight\n];\n\n/** Ghost takes over this long (ms) after the last real pointer activity. */\nconst GHOST_DELAY_MS = 1500;\n/** Ghost billow strength (the real pointer peaks at 1). */\nconst GHOST_PRESENCE = 0.6;\n\n/** `uTime` used for the single designed frame under prefers-reduced-motion. */\nconst REDUCED_MOTION_TIME = 6.0;\n\n/** Deterministic per-instance desync — no Math.random(), no hydration risk. */\nlet instanceCount = 0;\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.1, 0.125, 0.19];\n  return [((int >> 16) & 255) / 255, ((int >> 8) & 255) / 255, (int & 255) / 255];\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\n/**\n * Original lit-fabric fragment shader. The cloth is a nested-trig height\n * field: two incommensurate domain-warped sines form broad slow FOLDS, and a\n * fine striation wave rides them with its phase bent by the fold value — the\n * nesting is what makes tight silky ridges follow the drape instead of lying\n * flat. The premium part is the LIGHTING: the field's screen-space gradient\n * (finite differences) is compared against a slowly orbiting light direction\n * and raised to a power, producing a satin specular band that sweeps across\n * the cloth like light tracking over drapery. Deep-base → pale-sheen two-stop\n * ramp, soft exponential tone curve, and ANIMATED film-grain dither (re-hashed\n * every frame) so the grain shimmers filmically. Pointer press advances the\n * fold phase locally through a Gaussian, so the cloth billows where touched —\n * and because the billow lives inside the height field, the sheen catches on\n * it for free. GLSL ES 1.00 (WebGL1/2 compatible). No fract() on spatial\n * coordinates (only inside the hash), so there are no wrap seams.\n */\nconst FRAGMENT = /* glsl */ `\nprecision highp float;\n\nvarying vec2 vUv;\n\nuniform float uTime;\nuniform vec2 uResolution;\nuniform vec2 uPointer;    // smoothed, 0–1, y-up\nuniform float uInfluence; // eased 0–1 pointer presence\n\nuniform vec3 uBase;       // deep cloth body\nuniform vec3 uSheen;      // pale satin highlight\nuniform float uSpeed;\nuniform float uScale;\nuniform float uRotation;  // radians\nuniform float uSheenI;\nuniform float uFold;      // fold frequency multiplier\nuniform float uStriation; // striation frequency (absolute)\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\n// Fabric height field. q: cloth-space coordinate, pc: pointer in cloth space,\n// press: eased billow strength.\nfloat cloth(vec2 q, float t, vec2 pc, float press) {\n  // Pointer billow: a soft local phase advance — the cloth lifts where\n  // touched, then settles as the influence scalar eases back to zero.\n  vec2 d = q - pc;\n  float bil = press * exp(-dot(d, d) * 5.0);\n\n  vec2 w = q * uFold;\n  // Slow shear drift so the drape never sits still.\n  w += 0.42 * vec2(sin(w.y * 0.7 + t * 0.26), sin(w.x * 0.6 - t * 0.21));\n\n  // Broad folds: two incommensurate domain-warped sines.\n  float fold =\n      sin(w.x * 1.05 + 0.85 * sin(w.y * 1.35 + t * 0.30) + t * 0.20 + bil * 1.9)\n    + 0.55 * sin(w.y * 1.65 - 0.70 * sin(w.x * 1.20 - t * 0.24) - t * 0.14 + bil * 1.3);\n\n  // Fine striations riding the folds — the nested phase coupling is the silk:\n  // ridge phase bends with the drape, so the weave follows the folds.\n  float stri = sin(dot(w, vec2(0.30, 1.0)) * uStriation + fold * 2.5 - t * 0.45 + bil * 3.2);\n\n  return fold * 0.62 + stri * 0.38;\n}\n\nvoid main() {\n  vec2 uv = vUv;\n  float aspect = uResolution.x / max(uResolution.y, 1.0);\n  float t = uTime * uSpeed;\n\n  float cr = cos(uRotation);\n  float sr = sin(uRotation);\n  mat2 R = mat2(cr, sr, -sr, cr);\n\n  float sc = 2.3 * uScale;\n  vec2 p = (uv - 0.5) * vec2(aspect, 1.0);\n  vec2 q = R * p * sc;\n\n  // Pointer transformed into the same cloth space so the billow (and its\n  // sheen response) stays glued to the cursor under rotation and zoom.\n  vec2 pc = R * ((uPointer - 0.5) * vec2(aspect, 1.0)) * sc;\n  float press = uInfluence * 1.15;\n\n  // Height + screen-space gradient via finite differences (~1.6px step).\n  float e = sc * 1.6 / max(uResolution.y, 1.0);\n  float h = cloth(q, t, pc, press);\n  float hx = cloth(q + vec2(e, 0.0), t, pc, press);\n  float hy = cloth(q + vec2(0.0, e), t, pc, press);\n  vec2 grad = vec2(hx - h, hy - h) / e;\n\n  // Satin sheen: gradient alignment with a slowly ORBITING light direction,\n  // raised to a power — a tight bright band plus a wide soft skirt. Gated by\n  // gradient magnitude so flat spans and ridge crests stay matte.\n  float ang = t * 0.12 + 1.9;\n  vec2 ld = vec2(cos(ang), sin(ang));\n  float gm = length(grad);\n  vec2 gn = grad / max(gm, 1e-5);\n  float align = clamp(dot(gn, ld), 0.0, 1.0);\n  float gfac = smoothstep(0.6, 3.6, gm);\n  float sheen = (0.85 * pow(align, 24.0) + 0.30 * pow(align, 6.0)) * gfac * uSheenI;\n\n  // A faint fine counter-drifting underlayer gives the weave depth without a\n  // second lighting pass.\n  float under = cloth(q * 1.8 + vec2(7.7, 3.9), t * 0.7, pc, press * 0.4);\n\n  // Body shading: valleys sink toward near-black, crests lift toward base.\n  float body = 0.33 + 0.25 * h + 0.06 * under;\n\n  // Soft exponential tone curve — highlights roll off asymptotically instead\n  // of clipping to flat patches.\n  float L = 1.0 - exp(-(max(body, 0.0) + sheen) * 1.25);\n\n  // Two-segment ramp: the body stays in the base hue; the sheen color is\n  // reserved for genuine highlights so the cloth never washes out to gray.\n  vec3 col = mix(uBase * 0.30, uBase, smoothstep(0.0, 0.55, L));\n  col = mix(col, uSheen, smoothstep(0.45, 1.0, L));\n\n  // Gentle vignette to seat the fabric behind content.\n  vec2 vg = (uv - 0.5) * vec2(aspect, 1.0);\n  col *= 1.0 - 0.30 * dot(vg, vg);\n\n  // ANIMATED film-grain dither: re-hashed every frame so the grain shimmers\n  // filmically instead of sitting static, and 8-bit banding never survives.\n  float grain = hash21(gl_FragCoord.xy + vec2(fract(t * 61.7) * 173.0, fract(t * 41.3) * 289.0)) - 0.5;\n  col += grain * (2.0 / 255.0);\n\n  gl_FragColor = vec4(max(col, 0.0), 1.0);\n}\n`;\n\ninterface Uniform<T> {\n  value: T;\n}\n\ninterface Internals {\n  renderer: Renderer;\n  gl: Renderer[\"gl\"];\n  mesh: Mesh;\n  program: Program;\n  uTime: Uniform<number>;\n  uResolution: Uniform<[number, number]>;\n  uPointer: Uniform<[number, number]>;\n  uInfluence: Uniform<number>;\n  /** Un-smoothed target the pointer eases toward. */\n  pointerTarget: [number, number];\n  /** Smoothed 0–1 billow strength (mirrors uInfluence). */\n  influence: number;\n  /** Recent pointer movement, decaying — a parked cursor goes quiet. */\n  activity: number;\n  inside: boolean;\n  /** Deterministic per-instance time offset so multiple instances desync. */\n  timeOffset: number;\n  lastElapsed: number;\n  loseContext: (() => void) | null;\n}\n\n/**\n * OGL's Program.setShaders early-returns on a failed link WITHOUT creating\n * `uniformLocations` — rendering such a program throws deep inside OGL. Treat\n * \"unlinked\" as \"skip the frame\": the GLSL warning is already in the console.\n */\nfunction programLinked(program: Program): boolean {\n  return (program as unknown as { uniformLocations?: unknown }).uniformLocations !== undefined;\n}\n\nfunction writeRgb(target: [number, number, number], hex: string) {\n  const [r, g, b] = hexToRgb(hex);\n  target[0] = r;\n  target[1] = g;\n  target[2] = b;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(Math.max(v, lo), hi);\n\n/**\n * Sateen — flowing lit fabric. Broad domain-drifted folds carry fine silky\n * striations, and a satin specular band — the height field's gradient aligned\n * against a slowly orbiting light — sweeps across the cloth like moonlight\n * over drapery. Deep pewter-blue base with a pale sheen by default; the\n * cursor billows the cloth softly where it touches. Mount-once GL with\n * uniforms mutated in place, DPR ≤2 plus a 1920 max-render-dimension cap,\n * offscreen/hidden-tab pause, and a designed static frame under reduced\n * motion. Drop it inside any `relative` container; it fills and sits behind\n * content.\n */\nexport function Sateen({\n  colors = DEFAULT_COLORS,\n  speed = 1,\n  scale = 1,\n  rotation = 18,\n  sheenIntensity = 1,\n  foldDensity = 1,\n  striationDensity = 1,\n  interactive = true,\n  idle = true,\n  paused = false,\n  className,\n  ...rest\n}: SateenProps) {\n  const internalsRef = React.useRef<Internals | null>(null);\n  // GL init can fail (context cap, blocked WebGL) or a live context can be\n  // evicted — both degrade to a static palette wash, never a blank box.\n  const [failed, setFailed] = React.useState(false);\n  const reducedMotion = useReducedMotion();\n\n  const [baseColor, sheenColor] = colors;\n\n  // Latest props, readable inside the mount-once effect and event handlers\n  // without re-triggering GL setup.\n  const propsRef = React.useRef({ interactive, reducedMotion, idle });\n  propsRef.current = { interactive, reducedMotion, idle };\n  // performance.now() of the last real pointer activity; -Infinity = never.\n  const lastRealPointerRef = React.useRef(-Infinity);\n\n  const tick = React.useCallback((elapsed: number) => {\n    const it = internalsRef.current;\n    if (!it || !programLinked(it.program)) return;\n    if (elapsed < it.lastElapsed) it.lastElapsed = elapsed;\n    const dt = clamp(elapsed - it.lastElapsed, 0.0001, 0.1);\n    it.lastElapsed = elapsed;\n\n    // Idle ghost: a slow seeded Lissajous touch while nobody is over the cloth.\n    const { interactive: live, idle: ghostOn } = propsRef.current;\n    const ghost =\n      live &&\n      ghostOn &&\n      !it.inside &&\n      performance.now() - lastRealPointerRef.current > GHOST_DELAY_MS;\n    if (ghost) {\n      it.pointerTarget[0] = 0.5 + 0.34 * Math.sin(elapsed * 0.29) * Math.cos(elapsed * 0.089);\n      it.pointerTarget[1] = 0.5 + 0.28 * Math.sin(elapsed * 0.21 + 1.3);\n    }\n\n    // Frame-rate-independent pointer damping: 1 − e^(−dt/τ).\n    const kPos = 1 - Math.exp(-dt / 0.16);\n    const p = it.uPointer.value;\n    p[0] += (it.pointerTarget[0] - p[0]) * kPos;\n    p[1] += (it.pointerTarget[1] - p[1]) * kPos;\n\n    // Eased influence scalar: ramps in on movement, decays toward a whisper\n    // while the cursor is parked, and fades out fully on leave — the billow\n    // never pops.\n    it.activity *= Math.exp(-dt / 0.9);\n    const target = it.inside ? 0.3 + 0.7 * it.activity : ghost ? GHOST_PRESENCE : 0;\n    const tau = target > it.influence ? 0.22 : 0.5;\n    it.influence += (target - it.influence) * (1 - Math.exp(-dt / tau));\n    it.uInfluence.value = it.influence;\n\n    it.uTime.value = it.timeOffset + elapsed;\n    it.renderer.render({ scene: it.mesh });\n  }, []);\n\n  // The container is the RAF gate (IntersectionObserver, via the hook), the\n  // ResizeObserver target, and the pointer surface.\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  // Mount-once GL setup / full teardown. Prop changes NEVER rebuild the\n  // context — the sync effect below mutates uniforms in place.\n  React.useEffect(() => {\n    const container = containerRef.current;\n    if (!container) return;\n\n    // The canvas is created per mount, never reused: once WEBGL_lose_context\n    // has killed a canvas's context (our teardown), that canvas can only ever\n    // return the same dead context again — under StrictMode's double-mount a\n    // reused JSX canvas would come back permanently 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    let renderer: Renderer;\n    let gl: Renderer[\"gl\"];\n    try {\n      renderer = new Renderer({\n        canvas,\n        dpr: 1, // real DPR is computed per-resize (cap-aware) below\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 uTime: 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    const uInfluence: Uniform<number> = { value: 0 };\n\n    const program = new Program(gl, {\n      vertex: VERTEX,\n      fragment: FRAGMENT,\n      uniforms: {\n        uTime,\n        uResolution,\n        uPointer,\n        uInfluence,\n        // Real values are written by the sync effect on mount.\n        uBase: { value: [0, 0, 0] as [number, number, number] },\n        uSheen: { value: [0, 0, 0] as [number, number, number] },\n        uSpeed: { value: 1 },\n        uScale: { value: 1 },\n        uRotation: { value: 0 },\n        uSheenI: { value: 1 },\n        uFold: { value: 1 },\n        uStriation: { value: 32 },\n      },\n    });\n\n    const geometry = new Triangle(gl);\n    const mesh = new Mesh(gl, { geometry, program });\n    const loseExt = gl.getExtension(\"WEBGL_lose_context\");\n\n    const internals: Internals = {\n      renderer,\n      gl,\n      mesh,\n      program,\n      uTime,\n      uResolution,\n      uPointer,\n      uInfluence,\n      pointerTarget: [0.5, 0.5],\n      influence: 0,\n      activity: 0,\n      inside: false,\n      // Golden-ratio-spaced deterministic offset — several instances on one\n      // page desynchronize without any Math.random().\n      timeOffset: ((instanceCount++ * 0.618034) % 1) * 48,\n      lastElapsed: 0,\n      loseContext: loseExt ? () => loseExt.loseContext() : null,\n    };\n    internalsRef.current = internals;\n\n    const resize = () => {\n      const w = Math.max(container.clientWidth, 1);\n      const h = Math.max(container.clientHeight, 1);\n      // DPR ceiling of 2 plus a 1920 max-render-dimension cap: on ultrawide\n      // heroes the buffer stays bounded and upscales imperceptibly.\n      const native = clampDpr(dprCap);\n      renderer.dpr = Math.max(Math.min(native, 2, 1920 / Math.max(w, h)), 0.5);\n      renderer.setSize(w, h);\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\n    // First frame: under reduced motion this is already the designed still.\n    if (propsRef.current.reducedMotion) uTime.value = REDUCED_MOTION_TIME;\n    resize();\n\n    const onPointerMove = (e: PointerEvent) => {\n      if (!propsRef.current.interactive) return;\n      const it = internalsRef.current;\n      if (!it) return;\n      const r = container.getBoundingClientRect();\n      if (r.width === 0 || r.height === 0) return;\n      it.pointerTarget[0] = (e.clientX - r.left) / r.width;\n      // Flip Y so \"up\" on screen is 1.\n      it.pointerTarget[1] = 1 - (e.clientY - r.top) / r.height;\n      it.inside = true;\n      it.activity = Math.min(1, it.activity + 0.25);\n      lastRealPointerRef.current = performance.now();\n    };\n    const onPointerLeave = () => {\n      const it = internalsRef.current;\n      if (!it) return;\n      // Recenter so the billow settles back to rest, and fade influence out.\n      it.inside = false;\n      it.pointerTarget[0] = 0.5;\n      it.pointerTarget[1] = 0.5;\n      // The ghost resumes after the usual delay rather than snapping in.\n      lastRealPointerRef.current = performance.now();\n    };\n    container.addEventListener(\"pointermove\", onPointerMove);\n    container.addEventListener(\"pointerleave\", onPointerLeave);\n\n    return () => {\n      internalsRef.current = null;\n      ro.disconnect();\n      container.removeEventListener(\"pointermove\", onPointerMove);\n      container.removeEventListener(\"pointerleave\", onPointerLeave);\n      canvas.removeEventListener(\"webglcontextlost\", onContextLost);\n      internals.loseContext?.();\n      canvas.remove();\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [dprCap]);\n\n  // Knob changes mutate uniforms in place — never a context rebuild. While the\n  // loop is idle (paused / reduced motion) re-render one frame so the static\n  // image reflects the new props.\n  React.useEffect(() => {\n    const it = internalsRef.current;\n    if (!it || !programLinked(it.program)) return;\n    const u = it.program.uniforms;\n    writeRgb(u.uBase.value as [number, number, number], baseColor);\n    writeRgb(u.uSheen.value as [number, number, number], sheenColor);\n    u.uSpeed.value = Math.max(speed, 0);\n    u.uScale.value = clamp(scale, 0.25, 4);\n    u.uRotation.value = (rotation * Math.PI) / 180;\n    u.uSheenI.value = Math.max(sheenIntensity, 0);\n    u.uFold.value = clamp(foldDensity, 0.25, 4);\n    u.uStriation.value = 32 * clamp(striationDensity, 0.25, 4);\n    if (!interactive) {\n      it.inside = false;\n      it.pointerTarget[0] = 0.5;\n      it.pointerTarget[1] = 0.5;\n    }\n    if (paused || reducedMotion) {\n      if (reducedMotion) {\n        // The designed still: mid-sweep, sheen band composed, no billow.\n        it.uTime.value = REDUCED_MOTION_TIME;\n        it.uInfluence.value = 0;\n        it.uPointer.value[0] = 0.5;\n        it.uPointer.value[1] = 0.5;\n      }\n      it.renderer.render({ scene: it.mesh });\n    }\n  }, [\n    baseColor,\n    sheenColor,\n    speed,\n    scale,\n    rotation,\n    sheenIntensity,\n    foldDensity,\n    striationDensity,\n    interactive,\n    paused,\n    reducedMotion,\n    // The setup effect rebuilds the program with placeholder uniforms when the\n    // DPR cap changes — re-apply the real values after it.\n    dprCap,\n  ]);\n\n  // Static palette wash if WebGL is unavailable — never a blank box.\n  const fallbackBackground = React.useMemo(() => {\n    const [br, bg, bb] = hexToRgb(baseColor);\n    const [sr, sg, sb] = hexToRgb(sheenColor);\n    const rgba = (r: number, g: number, b: number, a: number) =>\n      `rgba(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)}, ${a})`;\n    return `linear-gradient(155deg, ${rgba(sr, sg, sb, 0.3)} 0%, ${rgba(br, bg, bb, 1)} 45%, rgba(4, 6, 11, 1) 100%)`;\n  }, [baseColor, sheenColor]);\n\n  return (\n    <div\n      ref={containerRef}\n      aria-hidden\n      data-crucible=\"sateen\"\n      {...rest}\n      className={cn(\"absolute inset-0 -z-10 overflow-hidden\", className)}\n    >\n      {failed && <div aria-hidden className=\"absolute inset-0\" style={{ background: fallbackBackground }} />}\n    </div>\n  );\n}\n"
    }
  ]
}