# Silk Shader Background: replication prompt

Paste this into Claude, Cursor, Replit, Lovable or v0.

```text
Build a self-contained index.html newsletter hero with a full-screen <canvas> background rendered by raw WebGL 1 (no libraries). Draw one oversized triangle covering clip space. Fragment shader: compute a height field h(uv,t) from two crossing sine waves whose coordinates are pre-warped by low-frequency sine offsets and a 5-octave value-noise fbm sampled at 0.55 scale, plus a small mouse offset. Estimate the normal from finite differences of h (scale 0.6), light it with a directional light and a Phong-style specular (power 14) for sheen, map h through smoothstep into a 3-color ramp (shadow, mid, highlight), add a radial vignette and 3.5% animated film grain. Uniforms: resolution, time, eased mouse, three colors, folds, sheen, grain. Cap the device pixel ratio at 1.5. Overlay centered Instrument Serif headline "The ideas worth / your inbox." in cream, a muted lede and a frosted signup pill. Add palette buttons bottom-right (Dusk, Tide, Moss, Pearl). Render one static frame under prefers-reduced-motion.
```

## Key code

```glsl
float surface(vec2 uv, float t){
  vec2 q = uv;
  q += .55*vec2(sin(uv.y*1.6 + t*.7), sin(uv.x*1.2 - t*.55));
  q += .35*vec2(fbm(uv*.55 + t*.15), fbm(uv*.55 - t*.15 + 5.2));
  float h = sin(q.x*uFolds + 1.4*sin(q.y*1.3 + t*.8) + t)
          + .45*sin(q.y*uFolds*.6 - q.x*.9 - t*.6);
  return h*.5;
}
/* normal from finite differences, then diffuse + specular sheen */
vec3 n = normalize(vec3((h-hx)/e*.6, (h-hy)/e*.6, 1.));
```
