{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"holo-site-footer","type":"registry:component","title":"Holo Site Footer","description":"The close of a landing: a last call set big with a holo pill between its words and two buttons, then a footer with the mark, a one-line promise, three columns of real links and the copyright with a way back up.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/holo-site-footer.tsx","content":"\"use client\";\n\nimport { useEffect, useRef, useState, type CSSProperties, type RefObject } from \"react\";\n\n/* ============================================================================\n * HOLO ART ENGINE\n *\n * Every picture in the kit (the glass cube grid on a card, the violet tubes,\n * the mosaic, the cobalt slabs, the dark tiled room, the concrete steps) is\n * PAINTED IN CODE by one hand-written WebGL2 ray marcher. Nothing is a photo\n * or a video, so an AI agent can retarget a scene by editing its map().\n *\n * How it stays cheap:\n *   - One shared offscreen WebGL2 context for the whole page, created on the\n *     first request and never per component.\n *   - A picture is rendered ONCE per (scene, size, seed) and cached as a\n *     canvas. Cards, pills and tiles draw the cached canvas into their own 2D\n *     canvas; nothing ray-marches per frame.\n *   - Renders are queued and split into bands of rows across animation\n *     frames, so a large scene never blocks one frame for long.\n *   - Without WebGL2 every <HoloArt> keeps its CSS gradient stand-in.\n *\n * Each scene is its own small program: a shared prelude (SDF helpers, a\n * studio environment with crisp rectangular softboxes, thin-film colour,\n * glass with a real interior march, ACES) plus the scene's own map() and\n * camera, compiled the first time that scene is asked for.\n * ========================================================================== */\n\nexport type HoloKind = \"cubes\" | \"tubes\" | \"mosaic\" | \"slabs\" | \"rings\" | \"ribbon\" | \"foil\" | \"room\" | \"steps\";\n\n/*GLSL-BEGIN*/\nconst HG_PRELUDE = `#version 300 es\nprecision highp float;\nuniform vec2 uRes;\nuniform vec4 uBand;\nuniform float uSeed;\nuniform vec2 uFocus;\nuniform float uZoom;\nout vec4 fragColor;\n\n#define PI 3.14159265\n#define MAT_GLASS 1.0\n#define MAT_CHROME 2.0\n#define MAT_GLOSS 3.0\n#define MAT_MATTE 4.0\n#define MAT_TILE 5.0\n#define MAT_STONE 6.0\n#define MAT_SATIN 7.0\n\nmat2 rot(float a){ float c=cos(a), s=sin(a); return mat2(c,-s,s,c); }\nfloat hash(float n){ return fract(sin(n*127.1+uSeed*13.7)*43758.5453); }\nfloat hash2(vec2 p){ return fract(sin(dot(p,vec2(127.1,311.7))+uSeed*7.1)*43758.5453); }\nfloat vnoise(vec2 p){ vec2 i=floor(p), f=fract(p); f=f*f*(3.0-2.0*f); return mix(mix(hash2(i),hash2(i+vec2(1,0)),f.x),mix(hash2(i+vec2(0,1)),hash2(i+vec2(1,1)),f.x),f.y); }\nfloat sdBox(vec3 p, vec3 b, float r){ vec3 q=abs(p)-b+r; return length(max(q,0.))+min(max(q.x,max(q.y,q.z)),0.)-r; }\nfloat sdSphere(vec3 p, float r){ return length(p)-r; }\nfloat sdTorus(vec3 p, vec2 t){ vec2 q=vec2(length(p.xz)-t.x,p.y); return length(q)-t.y; }\nfloat sdCapsule(vec3 p, vec3 a, vec3 b, float r){ vec3 pa=p-a, ba=b-a; float h=clamp(dot(pa,ba)/dot(ba,ba),0.,1.); return length(pa-ba*h)-r; }\nfloat sdCappedTorus(vec3 p, vec2 sc, float ra, float rb){ p.x=abs(p.x); float k=(sc.y*p.x>sc.x*p.y)?dot(p.xy,sc):length(p.xy); return sqrt(dot(p,p)+ra*ra-2.0*ra*k)-rb; }\nfloat smin(float a, float b, float k){ float h=clamp(0.5+0.5*(b-a)/k,0.,1.); return mix(b,a,h)-k*h*(1.-h); }\n\n// Thin-film interference: the oil-on-water rainbow that makes glass read\n// as holographic. cosT is the cosine to the normal, th the film thickness.\nvec3 film(float cosT, float th){\n  float d = th * (0.35 + 0.65 * cosT);\n  return 0.5 + 0.5 * cos(6.28318 * (d * vec3(1.0, 0.86, 0.72) + vec3(0.0, 0.31, 0.63)));\n}\n\n// A softbox: bright inside an angular rectangle around axis a, crisp edges.\nfloat softbox(vec3 d, vec3 a, vec3 up, vec2 size, float edge){\n  a = normalize(a);\n  vec3 rt = normalize(cross(up, a));\n  vec3 u2 = cross(a, rt);\n  float f = dot(d, a);\n  if (f <= 0.0) return 0.0;\n  vec2 q = vec2(dot(d, rt), dot(d, u2)) / f;\n  vec2 e = smoothstep(size, size - edge, abs(q));\n  return e.x * e.y;\n}\n`;\n\n// The studio the glass objects are photographed in: a pale lavender sweep,\n// a big white overhead box, a cobalt panel left, a hot pink panel right and\n// an orange bounce low. These are what the glass reflects and refracts, so\n// they ARE the kit's palette.\nconst HG_STUDIO = `\nvec3 env(vec3 d){\n  float y = d.y * 0.5 + 0.5;\n  vec3 c = mix(vec3(0.20, 0.21, 0.30), vec3(0.98, 0.97, 1.0), smoothstep(0.25, 0.85, y));\n  c += vec3(2.6) * softbox(d, vec3(0.1, 1.0, 0.35), vec3(0.0, 0.0, -1.0), vec2(0.9, 0.5), 0.12);\n  c += vec3(0.10, 0.28, 1.0) * 2.4 * softbox(d, vec3(-1.0, 0.25, 0.25), vec3(0.0, 1.0, 0.0), vec2(0.45, 0.8), 0.18);\n  c += vec3(1.0, 0.22, 0.62) * 2.0 * softbox(d, vec3(1.0, 0.15, 0.35), vec3(0.0, 1.0, 0.0), vec2(0.4, 0.7), 0.2);\n  c += vec3(1.0, 0.45, 0.10) * 1.3 * softbox(d, vec3(0.3, -1.0, 0.6), vec3(0.0, 0.0, 1.0), vec2(0.7, 0.35), 0.25);\n  c += vec3(0.55, 0.40, 1.0) * 0.9 * softbox(d, vec3(-0.2, 0.3, -1.0), vec3(0.0, 1.0, 0.0), vec2(1.2, 0.6), 0.5);\n  return c;\n}\nvec3 backdrop(vec2 uv){\n  // What the camera sees behind the objects: near-white with two faint\n  // coloured blooms, so art sits on the card's own paper.\n  vec3 c = mix(vec3(0.955, 0.955, 0.975), vec3(0.985, 0.982, 0.995), uv.y);\n  c += vec3(-0.04, -0.02, 0.05) * exp(-6.0 * dot(uv - vec2(0.15, 0.25), uv - vec2(0.15, 0.25)));\n  c += vec3(0.05, -0.02, 0.02) * exp(-6.0 * dot(uv - vec2(0.85, 0.75), uv - vec2(0.85, 0.75)));\n  return c;\n}\n`;\n\n// The ray marcher, shading and tone map, shared by the studio scenes. A scene\n// supplies vec4 map(vec3 p) -> (distance, material, colour id, film), vec3\n// tint(float id) and the camera through CAM_RO / CAM_TA / CAM_FOV.\nconst HG_STUDIO_MAIN = `\nvec3 nrm(vec3 p){\n  vec2 e = vec2(0.0015, 0.0);\n  return normalize(vec3(map(p+e.xyy).x-map(p-e.xyy).x, map(p+e.yxy).x-map(p-e.yxy).x, map(p+e.yyx).x-map(p-e.yyx).x));\n}\nvec4 march(vec3 ro, vec3 rd){\n  float t = 0.0;\n  for (int i = 0; i < 120; i++){\n    vec4 h = map(ro + rd * t);\n    if (h.x < 0.0008 * (1.0 + t)) return vec4(t, h.yzw);\n    t += h.x * 0.75;\n    if (t > 30.0) break;\n  }\n  return vec4(-1.0);\n}\n// Thickness of the object along a ray that starts just inside it.\nfloat thick(vec3 p, vec3 d){\n  float t = 0.02;\n  for (int i = 0; i < 28; i++){\n    float h = map(p + d * t).x;\n    if (h > -0.0005) break;\n    t += max(-h, 0.012);\n  }\n  return t;\n}\nfloat ao(vec3 p, vec3 n){\n  float o = 0.0, s = 1.0;\n  for (int i = 1; i <= 5; i++){\n    float h = 0.03 * float(i);\n    o += (h - map(p + n * h).x) * s;\n    s *= 0.7;\n  }\n  return clamp(1.0 - 2.2 * o, 0.0, 1.0);\n}\nbool gMiss = false;\nvec3 shadeStudio(vec3 ro, vec3 rd, vec2 uv){\n  vec4 h = march(ro, rd);\n  if (h.x < 0.0){ gMiss = true; return backdrop(uv); }\n  vec3 p = ro + rd * h.x;\n  vec3 n = nrm(p);\n  float mat = h.y;\n  vec3 col = tint(h.z);\n  float cosT = clamp(dot(n, -rd), 0.0, 1.0);\n  float fr = 0.04 + 0.96 * pow(1.0 - cosT, 5.0);\n  vec3 r = reflect(rd, n);\n  vec3 L = normalize(vec3(-0.4, 0.9, 0.6));\n  float occ = ao(p, n);\n  if (mat == MAT_GLASS){\n    vec3 fl = film(cosT, h.w);\n    vec3 refl = env(r) * mix(vec3(1.0), fl * 1.6, 0.55);\n    vec3 rdIn = refract(rd, n, 1.0 / 1.48);\n    float th = thick(p - n * 0.003, rdIn);\n    vec3 pOut = p + rdIn * th;\n    vec3 nOut = -nrm(pOut);\n    vec3 rdOut = refract(rdIn, nOut, 1.48);\n    if (dot(rdOut, rdOut) < 0.01) rdOut = reflect(rdIn, nOut);\n    vec3 absorb = exp(-(1.0 - col) * th * 7.5);\n    vec3 trans = env(rdOut) * absorb * mix(vec3(1.0), col, 0.5);\n    // Light scattering inside coloured glass, so a thick block glows.\n    trans += col * col * 0.22 * (1.0 - exp(-th * 3.0));\n    vec3 c = mix(trans, refl, clamp(fr * 1.25, 0.0, 1.0));\n    c += vec3(1.6) * pow(max(dot(r, L), 0.0), 120.0);\n    return c * mix(0.8, 1.0, occ);\n  }\n  if (mat == MAT_CHROME){\n    vec3 fl = film(cosT, 1.4 + h.w);\n    vec3 c = env(r) * mix(vec3(0.9), fl, 0.25) * mix(col, vec3(1.0), 0.6);\n    return c * mix(0.6, 1.0, occ);\n  }\n  if (mat == MAT_GLOSS){\n    float dif = clamp(dot(n, L), 0.0, 1.0) * 0.75 + 0.22;\n    vec3 c = col * col * dif * 0.95 * mix(0.5, 1.0, occ);\n    c = mix(c, env(r), fr * 0.55) + vec3(1.4) * pow(max(dot(r, L), 0.0), 60.0) * 0.6;\n    return c;\n  }\n  // MAT_MATTE\n  float dif = clamp(dot(n, L), 0.0, 1.0) * 0.55 + 0.55;\n  return col * dif * mix(0.5, 1.0, occ) + env(r) * fr * 0.25;\n}\nvec3 aces(vec3 x){ return clamp((x*(2.51*x+0.03))/(x*(2.43*x+0.59)+0.14), 0.0, 1.0); }\nvoid main(){\n  vec2 fc = gl_FragCoord.xy + uBand.xy;\n  vec2 uv = fc / uRes;\n  vec2 q = (fc - 0.5 * uRes) / uRes.y - uFocus;\n  vec3 ro = CAM_RO;\n  vec3 ta = CAM_TA;\n  vec3 ww = normalize(ta - ro);\n  vec3 uu = normalize(cross(ww, vec3(0.0, 1.0, 0.0)));\n  vec3 vv = cross(uu, ww);\n  vec3 rd = normalize(q.x * uu + q.y * vv + CAM_FOV * uZoom * ww);\n  vec3 c = shadeStudio(ro, rd, uv);\n  if (!gMiss){\n    c = aces(c * 1.05);\n    c = pow(c, vec3(1.0 / 2.2));\n  }\n  // A breath of grain so gradients never band on the card.\n  c += (hash2(fc) - 0.5) / 255.0;\n  fragColor = vec4(c, 1.0);\n}\n`;\n\nconst HG_SCENES: Record<HoloKind, string> = {\n  // A 3x3x3 block of rounded glass cubes, coral at the front-left blushing to\n  // pink and cobalt at the back, a chrome ball parked on top, a striped plate.\n  cubes: `\n#define CAM_RO vec3(0.0, 0.25, 4.6)\n#define CAM_TA vec3(0.0, 0.0, 0.0)\n#define CAM_FOV 2.35\nvec3 tint(float id){\n  if (id < 0.5) return vec3(1.0, 0.22, 0.32);\n  if (id < 1.5) return vec3(1.0, 0.55, 0.78);\n  if (id < 2.5) return vec3(0.25, 0.38, 1.0);\n  if (id < 3.5) return vec3(0.92, 0.93, 1.0);\n  if (id < 4.5) return vec3(1.0, 0.25, 0.25);\n  return vec3(0.96);\n}\nvec4 map(vec3 p){\n  vec3 q = p - vec3(-0.15, -0.05, 0.0);\n  q.xz *= rot(0.72);\n  q.yz *= rot(-0.5);\n  vec3 c = clamp(floor(q / 0.36 + 0.5), -1.0, 1.0);\n  vec3 r = q - c * 0.36;\n  float d = sdBox(r, vec3(0.152), 0.035);\n  float k = c.x - c.z * 0.8 + c.y * 0.35 + 1.5;\n  float id = k < 0.9 ? 0.0 : (k < 2.2 ? 1.0 : 2.0);\n  vec4 res = vec4(d, MAT_GLASS, id, 1.1 + 0.4 * c.y);\n  float s = sdSphere(p - vec3(0.78, 0.72, 0.25), 0.27);\n  if (s < res.x) res = vec4(s, MAT_CHROME, 3.0, 0.2);\n  vec3 pp = p - vec3(-0.55, -0.92, 0.2);\n  pp.xz *= rot(0.5);\n  float pl = sdBox(pp, vec3(0.75, 0.02, 0.45), 0.015);\n  if (pl < res.x){\n    float stripe = step(0.5, fract((pp.x + pp.z) * 9.0));\n    res = vec4(pl, MAT_GLOSS, stripe > 0.5 ? 4.0 : 5.0, 0.0);\n  }\n  return res;\n}\n`,\n  // Two fat iridescent arcs crossing, a glass ball and a chrome bead.\n  tubes: `\n#define CAM_RO vec3(0.0, 0.2, 4.4)\n#define CAM_TA vec3(0.0, 0.0, 0.0)\n#define CAM_FOV 2.2\nvec3 tint(float id){\n  if (id < 0.5) return vec3(0.52, 0.36, 1.0);\n  if (id < 1.5) return vec3(0.22, 0.42, 1.0);\n  if (id < 2.5) return vec3(1.0, 0.62, 0.86);\n  return vec3(0.95);\n}\nvec4 map(vec3 p){\n  vec3 a = p - vec3(-0.25, -0.1, 0.0);\n  a.xy *= rot(0.6); a.yz *= rot(1.1);\n  float t1 = sdTorus(a, vec2(0.75, 0.24));\n  vec3 b = p - vec3(0.45, 0.25, -0.35);\n  b.xy *= rot(-0.9); b.xz *= rot(0.7);\n  float t2 = sdCappedTorus(b, vec2(sin(2.2), cos(2.2)), 0.62, 0.2);\n  vec4 res = vec4(t1, MAT_GLASS, 0.0, 1.8);\n  if (t2 < res.x) res = vec4(t2, MAT_GLASS, 1.0, 2.3);\n  float g = sdSphere(p - vec3(0.15, -0.55, 0.65), 0.34);\n  if (g < res.x) res = vec4(g, MAT_GLASS, 2.0, 1.2);\n  float c = sdSphere(p - vec3(-0.95, 0.62, 0.3), 0.17);\n  if (c < res.x) res = vec4(c, MAT_CHROME, 3.0, 0.4);\n  return res;\n}\n`,\n  // A slab of glossy tiles of different heights: orange, red, cobalt, ice.\n  mosaic: `\n#define CAM_RO vec3(0.5, 3.1, 2.3)\n#define CAM_TA vec3(0.0, -0.2, 0.0)\n#define CAM_FOV 2.0\nvec3 tint(float id){\n  if (id < 0.5) return vec3(1.0, 0.45, 0.05);\n  if (id < 1.5) return vec3(1.0, 0.12, 0.10);\n  if (id < 2.5) return vec3(0.10, 0.26, 1.0);\n  if (id < 3.5) return vec3(0.45, 0.65, 1.0);\n  if (id < 4.5) return vec3(0.97, 0.96, 1.0);\n  return vec3(0.18, 0.42, 1.0);\n}\nvec4 map(vec3 p){\n  vec3 q = p;\n  q.xz *= rot(0.35);\n  vec2 base = floor(q.xz / 0.42 + 0.5);\n  vec4 res = vec4(1e5);\n  for (int j = -1; j <= 1; j++) for (int i = -1; i <= 1; i++){\n    vec2 cell = clamp(base + vec2(float(i), float(j)), vec2(-4.0, -3.0), vec2(4.0, 3.0));\n    vec2 r = q.xz - cell * 0.42;\n    float hh = hash2(cell + 3.0);\n    float h = 0.04 + 0.16 * hh * hh;\n    float d = sdBox(vec3(r.x, q.y + 0.4 - h, r.y), vec3(0.195, h, 0.195), 0.03);\n    if (d < res.x) res = vec4(d, MAT_GLOSS, floor(hash2(cell * 1.7 + 9.0) * 6.0), 1.4);\n  }\n  float s = sdSphere(p - vec3(0.55, 0.35, 0.55), 0.24);\n  if (s < res.x) res = vec4(s, MAT_GLASS, 4.0, 1.6);\n  return res;\n}\n`,\n  // Five thin cobalt glass panes fanned along a diagonal.\n  slabs: `\n#define CAM_RO vec3(0.0, 0.4, 4.6)\n#define CAM_TA vec3(0.0, 0.0, 0.0)\n#define CAM_FOV 2.2\nvec3 tint(float id){\n  if (id < 0.5) return vec3(0.02, 0.12, 0.95);\n  if (id < 1.5) return vec3(0.10, 0.30, 1.0);\n  return vec3(0.45, 0.62, 1.0);\n}\nvec4 map(vec3 p){\n  vec4 res = vec4(1e5);\n  for (int i = 0; i < 5; i++){\n    float f = float(i) - 2.0;\n    vec3 q = p - vec3(f * 0.28, f * 0.2, -f * 0.32);\n    q.xy *= rot(0.55); q.yz *= rot(-0.7); q.xz *= rot(0.25);\n    float d = sdBox(q, vec3(0.62, 0.42, 0.065), 0.04);\n    if (d < res.x) res = vec4(d, MAT_GLASS, i == 0 ? 2.0 : (i < 3 ? 1.0 : 0.0), 0.9 + 0.2 * f);\n  }\n  return res;\n}\n`,\n  // Three concentric rings: cobalt, porcelain and coral, seen off-axis.\n  rings: `\n#define CAM_RO vec3(0.0, 0.3, 4.2)\n#define CAM_TA vec3(0.0, 0.0, 0.0)\n#define CAM_FOV 2.0\nvec3 tint(float id){\n  if (id < 0.5) return vec3(0.12, 0.28, 1.0);\n  if (id < 1.5) return vec3(0.96, 0.96, 1.0);\n  if (id < 2.5) return vec3(1.0, 0.28, 0.3);\n  return vec3(0.5, 0.65, 1.0);\n}\nvec4 map(vec3 p){\n  vec3 q = p - vec3(0.2, 0.0, 0.0);\n  q.yz *= rot(1.15); q.xy *= rot(0.4);\n  vec4 res = vec4(1e5);\n  for (int i = 0; i < 3; i++){\n    float R = 0.32 + 0.33 * float(i);\n    float d = sdTorus(q - vec3(0.0, 0.05 * float(i), 0.0), vec2(R, 0.12));\n    float m = i == 1 ? MAT_GLOSS : MAT_GLASS;\n    if (d < res.x) res = vec4(d, m, float(i), 1.3 + 0.3 * float(i));\n  }\n  float s = sdSphere(p - vec3(-1.0, 0.45, 0.4), 0.2);\n  if (s < res.x) res = vec4(s, MAT_GLASS, 3.0, 1.6);\n  return res;\n}\n`,\n  // A long twisted band of foil glass for the capsule pills.\n  ribbon: `\n#define CAM_RO vec3(0.0, 0.0, 4.2)\n#define CAM_TA vec3(0.0, 0.0, 0.0)\n#define CAM_FOV 2.4\nvec3 tint(float id){\n  if (id < 0.5) return vec3(0.62, 0.42, 1.0);\n  if (id < 1.5) return vec3(1.0, 0.58, 0.86);\n  return vec3(0.25, 0.45, 1.0);\n}\nvec4 map(vec3 p){\n  vec3 q = p;\n  q.xy *= rot(-0.12);\n  float tw = q.x * 1.35 + uSeed * 0.7;\n  q.yz *= rot(tw);\n  float d = sdBox(q, vec3(2.6, 0.32, 0.05), 0.04) * 0.6;\n  float id = fract(p.x * 0.18 + 0.5) < 0.5 ? 0.0 : 1.0;\n  vec4 res = vec4(d, MAT_GLASS, id, 1.4 + 0.6 * sin(p.x * 0.9));\n  vec3 b = p - vec3(0.5, 0.05, -0.55);\n  b.yz *= rot(1.2);\n  float t = sdTorus(b, vec2(0.55, 0.16));\n  if (t < res.x) res = vec4(t, MAT_GLASS, 2.0, 2.0);\n  float s = sdSphere(p - vec3(-0.9, 0.1, 0.45), 0.2);\n  if (s < res.x) res = vec4(s, MAT_CHROME, 1.0, 0.6);\n  return res;\n}\n`,\n  // A close-up of a fat twisted torus of foil glass: fills any frame with\n  // colour, for pills and ribbons. The seed turns the torus.\n  foil: `\n#define CAM_RO vec3(0.0, 0.0, 2.6)\n#define CAM_TA vec3(0.0, 0.0, 0.0)\n#define CAM_FOV 1.5\nvec3 tint(float id){\n  if (id < 0.5) return vec3(0.55, 0.36, 1.0);\n  if (id < 1.5) return vec3(1.0, 0.42, 0.74);\n  if (id < 2.5) return vec3(0.16, 0.32, 1.0);\n  return vec3(1.0, 0.52, 0.16);\n}\nvec4 map(vec3 p){\n  // Wide frames (pills, ribbons) stretch the glass sideways to fill them.\n  p.x /= max(1.0, (uRes.x / uRes.y) / 1.7);\n  vec3 q = p;\n  q.xy *= rot(0.35 + uSeed * 0.9);\n  q.yz *= rot(1.25 + uSeed * 0.37);\n  float a = atan(q.z, q.x);\n  vec3 r = vec3(length(q.xz) - 1.35, q.y, 0.0);\n  r.xy *= rot(a * 1.5 + uSeed);\n  float d = (length(vec2(r.x * 0.62, r.y * 1.25)) - 0.5) * 0.7;\n  float id = mod(floor((a + 3.1416) / 1.0471 + uSeed), 3.0);\n  vec4 res = vec4(d, MAT_GLASS, id, 1.5 + 0.8 * sin(a * 2.0));\n  float s = sdSphere(p - vec3(0.95, -0.55, 0.5), 0.28);\n  if (s < res.x) res = vec4(s, MAT_CHROME, 1.0, 0.6);\n  float t2 = sdTorus((p - vec3(-1.1, 0.7, -0.6)).xzy, vec2(0.55, 0.16));\n  if (t2 < res.x) res = vec4(t2, MAT_GLASS, 3.0, 1.2);\n  return res;\n}\n`,\n  room: \"\",\n  steps: \"\",\n};\n\n// The two dark scenes have their own lighting: a charcoal tiled wall, a\n// stone floor and satin metal forks (room); a concrete ledge seen from above\n// (steps). Same marcher idea, one key light, soft shadows, no studio colour.\nconst HG_DARK = `\nvec4 map(vec3 p);\nvec3 nrm(vec3 p){\n  vec2 e = vec2(0.002, 0.0);\n  return normalize(vec3(map(p+e.xyy).x-map(p-e.xyy).x, map(p+e.yxy).x-map(p-e.yxy).x, map(p+e.yyx).x-map(p-e.yyx).x));\n}\nvec4 march(vec3 ro, vec3 rd){\n  float t = 0.0;\n  for (int i = 0; i < 160; i++){\n    vec4 h = map(ro + rd * t);\n    if (h.x < 0.0006 * (1.0 + t)) return vec4(t, h.yzw);\n    t += h.x * 0.85;\n    if (t > 40.0) break;\n  }\n  return vec4(-1.0);\n}\nfloat shadow(vec3 ro, vec3 rd){\n  float r = 1.0, t = 0.03;\n  for (int i = 0; i < 48; i++){\n    float h = map(ro + rd * t).x;\n    r = min(r, 12.0 * h / t);\n    t += clamp(h, 0.02, 0.4);\n    if (r < 0.002 || t > 12.0) break;\n  }\n  return clamp(r, 0.0, 1.0);\n}\nfloat ao(vec3 p, vec3 n){\n  float o = 0.0, s = 1.0;\n  for (int i = 1; i <= 5; i++){\n    float h = 0.04 * float(i);\n    o += (h - map(p + n * h).x) * s;\n    s *= 0.75;\n  }\n  return clamp(1.0 - 2.0 * o, 0.0, 1.0);\n}\nvec3 aces(vec3 x){ return clamp((x*(2.51*x+0.03))/(x*(2.43*x+0.59)+0.14), 0.0, 1.0); }\n`;\n\nconst HG_ROOM = `\n#define CAM_RO vec3(0.0, 1.55, 7.6)\n#define CAM_TA vec3(0.0, 1.15, 0.0)\n#define CAM_FOV 2.05\nfloat tileWall(vec3 p){\n  vec2 c = floor(p.xy / 1.02);\n  vec2 r = p.xy - (c + 0.5) * 1.02;\n  float bulge = 0.02 * hash2(c);\n  return sdBox(vec3(r, p.z + 1.6 - bulge), vec3(0.47, 0.47, 0.12), 0.09);\n}\nvec4 map(vec3 p){\n  vec4 res = vec4(tileWall(p), MAT_TILE, 0.0, 0.0);\n  float back = p.z + 1.62;\n  if (back < res.x) res = vec4(back, MAT_TILE, 1.0, 0.0);\n  // Stone floor: blocks with grooves, a raised step to the right.\n  vec2 fc = floor(vec2(p.x / 1.6, p.z / 0.9));\n  vec2 fr = vec2(p.x, p.z) - (fc + 0.5) * vec2(1.6, 0.9);\n  float fl = sdBox(vec3(fr.x, p.y + 0.3, fr.y), vec3(0.78, 0.3, 0.43), 0.02);\n  if (fl < res.x) res = vec4(fl, MAT_STONE, hash2(fc), 0.0);\n  float step1 = sdBox(p - vec3(4.6, 0.35, -0.6), vec3(1.4, 0.35, 0.9), 0.02);\n  if (step1 < res.x) res = vec4(step1, MAT_STONE, 0.6, 0.0);\n  float plinth = sdBox(p - vec3(-4.9, 0.18, -0.3), vec3(1.1, 0.18, 1.2), 0.02);\n  if (plinth < res.x) res = vec4(plinth, MAT_STONE, 0.3, 0.0);\n  return res;\n}\nvoid main(){\n  vec2 fc = gl_FragCoord.xy + uBand.xy;\n  vec2 q = (fc - 0.5 * uRes) / uRes.y - uFocus;\n  vec3 ro = CAM_RO, ta = CAM_TA;\n  vec3 ww = normalize(ta - ro), uu = normalize(cross(ww, vec3(0.0, 1.0, 0.0))), vv = cross(uu, ww);\n  vec3 rd = normalize(q.x * uu + q.y * vv + CAM_FOV * uZoom * ww);\n  vec3 col = vec3(0.02);\n  vec4 h = march(ro, rd);\n  if (h.x > 0.0){\n    vec3 p = ro + rd * h.x;\n    vec3 n = nrm(p);\n    vec3 L = normalize(vec3(-0.35, 0.85, 0.55));\n    float sh = shadow(p + n * 0.01, L);\n    float oc = ao(p, n);\n    float dif = clamp(dot(n, L), 0.0, 1.0);\n    vec3 r = reflect(rd, n);\n    float fr = 0.04 + 0.96 * pow(1.0 - clamp(dot(n, -rd), 0.0, 1.0), 5.0);\n    // A tall soft window left of camera, what glossy surfaces mirror.\n    float win = smoothstep(0.2, 0.9, r.y) * smoothstep(-0.9, 0.2, -r.x);\n    if (h.y == MAT_TILE){\n      vec3 base = vec3(0.045, 0.046, 0.052);\n      col = base * (0.2 + 1.1 * dif * sh) * oc + vec3(0.45) * win * fr * 0.9 * oc;\n      col += vec3(0.9) * pow(max(dot(r, L), 0.0), 40.0) * 0.35 * sh;\n    } else if (h.y == MAT_STONE){\n      float grain = vnoise(p.xz * 30.0) * 0.03;\n      vec3 base = vec3(0.16, 0.16, 0.165) * (0.8 + 0.25 * h.z) + grain;\n      col = base * (0.2 + 1.1 * dif * sh) * oc + vec3(0.25) * win * fr * 0.4;\n    } else {\n      // Satin metal: a pale grey that holds the window as a broad sheen.\n      vec3 base = vec3(0.52, 0.53, 0.56);\n      float spec = pow(max(dot(r, L), 0.0), 18.0);\n      col = base * (0.18 + 0.9 * dif * sh) * oc + vec3(0.9) * win * 0.55 + vec3(1.2) * spec * sh * 0.5;\n      col += vec3(0.4) * smoothstep(0.0, 1.0, r.y) * 0.3;\n    }\n    float fog = exp(-0.012 * h.x * h.x);\n    col = mix(vec3(0.03, 0.03, 0.035), col, fog);\n  }\n  // A soft overhead pool of light, darker corners.\n  vec2 uv = fc / uRes;\n  col *= 0.75 + 0.5 * exp(-3.0 * dot(uv - vec2(0.5, 0.75), uv - vec2(0.5, 0.75)));\n  col = aces(col * 1.5);\n  col = pow(col, vec3(1.0 / 2.2));\n  col += (hash2(fc) - 0.5) / 255.0;\n  fragColor = vec4(col, 1.0);\n}\n`;\n\nconst HG_STEPS = `\n#define CAM_RO vec3(-2.2, 6.2, 4.4)\n#define CAM_TA vec3(0.6, 0.0, 0.0)\n#define CAM_FOV 2.0\nvec4 map(vec3 p){\n  // A concrete ledge running diagonally, a lower floor, a tiled wall behind.\n  vec3 q = p;\n  q.xz *= rot(0.62);\n  float ledge = sdBox(q - vec3(0.0, 0.5, -0.6), vec3(9.0, 0.5, 1.5), 0.03);\n  vec2 lc = floor(vec2(q.x / 1.5, 0.0));\n  vec4 res = vec4(ledge, MAT_STONE, hash2(lc), 0.0);\n  float floor0 = p.y;\n  if (floor0 < res.x) res = vec4(floor0, MAT_STONE, 0.4, 1.0);\n  vec3 w = q - vec3(0.0, 0.0, -3.2);\n  vec2 c = floor(w.xy / 0.9);\n  vec2 r = w.xy - (c + 0.5) * 0.9;\n  float tiles = sdBox(vec3(r, w.z), vec3(0.42, 0.42, 1.1), 0.08);\n  if (tiles < res.x) res = vec4(tiles, MAT_TILE, 0.0, 0.0);\n  return res;\n}\nvoid main(){\n  vec2 fc = gl_FragCoord.xy + uBand.xy;\n  vec2 q = (fc - 0.5 * uRes) / uRes.y - uFocus;\n  vec3 ro = CAM_RO, ta = CAM_TA;\n  vec3 ww = normalize(ta - ro), uu = normalize(cross(ww, vec3(0.0, 1.0, 0.0))), vv = cross(uu, ww);\n  vec3 rd = normalize(q.x * uu + q.y * vv + CAM_FOV * uZoom * ww);\n  vec3 col = vec3(0.05);\n  vec4 h = march(ro, rd);\n  if (h.x > 0.0){\n    vec3 p = ro + rd * h.x;\n    vec3 n = nrm(p);\n    vec3 L = normalize(vec3(0.5, 0.8, 0.35));\n    float sh = shadow(p + n * 0.01, L);\n    float oc = ao(p, n);\n    float dif = clamp(dot(n, L), 0.0, 1.0);\n    vec3 qq = p; qq.xz *= rot(0.62);\n    // Board-formed concrete: faint planks, pores, edge wear.\n    float plank = 0.018 * sin(qq.x * 7.0 + vnoise(qq.xz * 3.0) * 3.0);\n    float pores = (vnoise(p.xz * 40.0) * 0.6 + vnoise(p.xz * 9.0) * 0.4) * 0.06 - smoothstep(0.82, 0.9, vnoise(p.xz * 70.0)) * 0.05;\n    vec3 base = h.y == MAT_TILE ? vec3(0.03, 0.032, 0.036) : vec3(0.3, 0.3, 0.3) * (0.85 + 0.2 * h.z) + plank + pores - 0.025;\n    if (h.w > 0.5) base *= 0.55;\n    col = base * (0.28 + 1.05 * dif * sh) * oc;\n    col += vec3(0.08) * pow(1.0 - clamp(dot(n, -rd), 0.0, 1.0), 4.0);\n  }\n  col = aces(col * 0.95);\n  col = pow(col, vec3(1.0 / 2.2));\n  col += (hash2(fc) - 0.5) / 255.0;\n  fragColor = vec4(col, 1.0);\n}\n`;\n\n/*GLSL-END*/\n\nconst HG_VERT = `#version 300 es\nin vec2 aPos;\nvoid main(){ gl_Position = vec4(aPos, 0.0, 1.0); }\n`;\n\nfunction hgFragment(kind: HoloKind): string {\n  if (kind === \"room\") return HG_PRELUDE + HG_DARK + HG_ROOM;\n  if (kind === \"steps\") return HG_PRELUDE + HG_DARK + HG_STEPS;\n  return HG_PRELUDE + HG_STUDIO + \"\\n\" + HG_SCENES[kind] + HG_STUDIO_MAIN;\n}\n\n/** CSS stand-ins shown until (or instead of) the rendered picture. */\nexport const HOLO_FALLBACK: Record<HoloKind, string> = {\n  cubes: \"radial-gradient(60% 70% at 35% 45%, #ff8fb8 0%, #ff4d6d 30%, #6f7dff 62%, rgba(240,241,248,0) 80%), #f2f2f8\",\n  tubes: \"radial-gradient(60% 70% at 45% 50%, #b49bff 0%, #6a5cff 35%, #ff9ad5 60%, rgba(240,241,248,0) 82%), #f2f2f8\",\n  mosaic: \"linear-gradient(120deg, #ff7a1a 0 22%, #2f5bff 22% 46%, #ff3b30 46% 64%, #a8c6ff 64% 82%, #f4f4fa 82%)\",\n  slabs: \"radial-gradient(70% 70% at 50% 50%, #3f63ff 0%, #2546ff 35%, #a9bcff 70%, #eef1fb 90%)\",\n  rings: \"radial-gradient(circle at 55% 50%, #f4f4fa 0 18%, #2a48ff 19% 34%, #f4f4fa 35% 46%, #ff4b4f 47% 56%, #c9d4ff 57% 70%, #f2f2f8 71%)\",\n  ribbon: \"linear-gradient(100deg, #8a63ff 0%, #ff8fd0 30%, #f6f2ff 45%, #6f7dff 62%, #ff9ad5 80%, #7b5cff 100%)\",\n  foil: \"linear-gradient(100deg, #6a4dff 0%, #ff6fb5 28%, #ffd2ec 42%, #3a5cff 60%, #b06bff 80%, #ff8a3d 100%)\",\n  room: \"linear-gradient(180deg, #121316 0%, #1b1c20 70%, #2a2b2f 100%)\",\n  steps: \"linear-gradient(160deg, #0d0e10 0%, #3a3b3d 55%, #6b6b6c 100%)\",\n};\n\ninterface HgJob {\n  kind: HoloKind;\n  w: number;\n  h: number;\n  seed: number;\n  focus: [number, number, number];\n  resolve: (c: HTMLCanvasElement | null) => void;\n}\n\ninterface HgProgram {\n  p: WebGLProgram | null;\n  vs: WebGLShader | null;\n  fs: WebGLShader | null;\n  checked: boolean;\n}\n\ninterface HgEngine {\n  gl: WebGL2RenderingContext;\n  canvas: HTMLCanvasElement;\n  buf: WebGLBuffer;\n  ext: { COMPLETION_STATUS_KHR: number } | null;\n  programs: Map<HoloKind, HgProgram>;\n  queue: HgJob[];\n  busy: boolean;\n  cache: Map<string, Promise<HTMLCanvasElement | null>>;\n  lost: boolean;\n}\n\nconst HG_KEY = Symbol.for(\"viberdy.holo-gloss.engine.v1\");\n\nfunction hgEngine(): HgEngine | null {\n  if (typeof window === \"undefined\") return null;\n  const g = globalThis as unknown as Record<symbol, HgEngine | null | undefined>;\n  if (g[HG_KEY] !== undefined) return g[HG_KEY] ?? null;\n  const canvas = document.createElement(\"canvas\");\n  const gl = canvas.getContext(\"webgl2\", { antialias: false, alpha: false, preserveDrawingBuffer: true, premultipliedAlpha: false });\n  if (!gl) {\n    g[HG_KEY] = null;\n    return null;\n  }\n  const buf = gl.createBuffer();\n  if (!buf) {\n    g[HG_KEY] = null;\n    return null;\n  }\n  gl.bindBuffer(gl.ARRAY_BUFFER, buf);\n  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n  const ext = gl.getExtension(\"KHR_parallel_shader_compile\") as { COMPLETION_STATUS_KHR: number } | null;\n  const engine: HgEngine = { gl, canvas, buf, ext, programs: new Map(), queue: [], busy: false, cache: new Map(), lost: false };\n  canvas.addEventListener(\"webglcontextlost\", (e) => {\n    e.preventDefault();\n    engine.lost = true;\n    engine.cache.clear();\n  });\n  g[HG_KEY] = engine;\n  return engine;\n}\n\n/**\n * A kind's program, compiled once and checked once. Asking whether a compile\n * worked blocks the page until it has, so the check waits until the driver\n * says the link is finished (KHR_parallel_shader_compile) and the compile runs\n * off the main thread meanwhile.\n */\nfunction hgProgram(e: HgEngine, kind: HoloKind): HgProgram {\n  const had = e.programs.get(kind);\n  if (had) return had;\n  const gl = e.gl;\n  const p = gl.createProgram();\n  const vs = gl.createShader(gl.VERTEX_SHADER);\n  const fs = gl.createShader(gl.FRAGMENT_SHADER);\n  const made: HgProgram = { p, vs, fs, checked: !p || !vs || !fs };\n  if (p && vs && fs) {\n    gl.shaderSource(vs, HG_VERT);\n    gl.shaderSource(fs, hgFragment(kind));\n    gl.compileShader(vs);\n    gl.compileShader(fs);\n    gl.attachShader(p, vs);\n    gl.attachShader(p, fs);\n    gl.bindAttribLocation(p, 0, \"aPos\");\n    gl.linkProgram(p);\n  } else made.p = null;\n  e.programs.set(kind, made);\n  return made;\n}\n\n/** Whether a kind's program can be checked without waiting (it starts compiling if it has not). */\nfunction hgReady(e: HgEngine, kind: HoloKind): boolean {\n  const pr = hgProgram(e, kind);\n  return pr.checked || !e.ext || !pr.p || e.gl.getProgramParameter(pr.p, e.ext.COMPLETION_STATUS_KHR) === true;\n}\n\n/** The kind's linked program, or null (logged) when it failed. */\nfunction hgLinked(e: HgEngine, kind: HoloKind): WebGLProgram | null {\n  const pr = hgProgram(e, kind);\n  if (pr.checked) return pr.p;\n  pr.checked = true;\n  const gl = e.gl;\n  if (pr.p && !gl.getProgramParameter(pr.p, gl.LINK_STATUS)) {\n    const why = (pr.fs && gl.getShaderInfoLog(pr.fs)) || (pr.vs && gl.getShaderInfoLog(pr.vs)) || gl.getProgramInfoLog(pr.p);\n    console.warn(\"[holo-art] \" + kind + \": \" + why);\n    pr.p = null;\n  }\n  if (pr.vs) gl.deleteShader(pr.vs);\n  if (pr.fs) gl.deleteShader(pr.fs);\n  return pr.p;\n}\n\nfunction hgPump(e: HgEngine) {\n  if (e.busy || !e.queue.length) return;\n  const lost = e.lost || e.gl.isContextLost();\n  // Every queued kind starts compiling here; the first job whose program is\n  // ready renders. With none ready yet, look again next frame.\n  let i = 0;\n  if (!lost) {\n    const ready = e.queue.map((j) => hgReady(e, j.kind));\n    i = ready.indexOf(true);\n  }\n  if (i < 0) {\n    e.busy = true;\n    requestAnimationFrame(() => {\n      e.busy = false;\n      hgPump(e);\n    });\n    return;\n  }\n  const [job] = e.queue.splice(i, 1);\n  if (!job) return;\n  e.busy = true;\n  const done = (c: HTMLCanvasElement | null) => {\n    job.resolve(c);\n    e.busy = false;\n    requestAnimationFrame(() => hgPump(e));\n  };\n  if (lost) return done(null);\n  const prog = hgLinked(e, job.kind);\n  if (!prog) return done(null);\n  const gl = e.gl;\n  e.canvas.width = job.w;\n  e.canvas.height = job.h;\n  gl.viewport(0, 0, job.w, job.h);\n  gl.useProgram(prog);\n  gl.bindBuffer(gl.ARRAY_BUFFER, e.buf);\n  gl.enableVertexAttribArray(0);\n  gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n  gl.uniform2f(gl.getUniformLocation(prog, \"uRes\"), job.w, job.h);\n  gl.uniform1f(gl.getUniformLocation(prog, \"uSeed\"), job.seed);\n  gl.uniform2f(gl.getUniformLocation(prog, \"uFocus\"), job.focus[0], job.focus[1]);\n  gl.uniform1f(gl.getUniformLocation(prog, \"uZoom\"), job.focus[2]);\n  const uBand = gl.getUniformLocation(prog, \"uBand\");\n  // Bands of rows, one band per frame, sized so a band is ~120k pixels.\n  const rows = Math.max(16, Math.floor(120000 / job.w));\n  let y = 0;\n  gl.enable(gl.SCISSOR_TEST);\n  const step = () => {\n    if (e.lost || gl.isContextLost()) return done(null);\n    const hgt = Math.min(rows, job.h - y);\n    gl.scissor(0, y, job.w, hgt);\n    gl.uniform4f(uBand, 0, 0, 0, 0);\n    gl.drawArrays(gl.TRIANGLES, 0, 3);\n    y += hgt;\n    if (y < job.h) {\n      requestAnimationFrame(step);\n      return;\n    }\n    gl.disable(gl.SCISSOR_TEST);\n    const out = document.createElement(\"canvas\");\n    out.width = job.w;\n    out.height = job.h;\n    const ctx = out.getContext(\"2d\");\n    if (!ctx) return done(null);\n    ctx.drawImage(e.canvas, 0, 0);\n    done(out);\n  };\n  step();\n}\n\n/**\n * Render (or fetch from cache) one picture. Sizes are bucketed to 32px so a\n * card resizing by a few pixels reuses its picture.\n */\nexport function requestHoloArt(\n  kind: HoloKind,\n  w: number,\n  h: number,\n  seed = 0,\n  focus: [number, number] | [number, number, number] = [0, 0],\n): Promise<HTMLCanvasElement | null> {\n  const f: [number, number, number] = [focus[0], focus[1], focus[2] ?? 1];\n  const e = hgEngine();\n  if (!e) return Promise.resolve(null);\n  const bw = Math.max(32, Math.min(2400, Math.ceil(w / 32) * 32));\n  const bh = Math.max(32, Math.min(2400, Math.ceil(h / 32) * 32));\n  const key = kind + \":\" + bw + \"x\" + bh + \":\" + seed + \":\" + f.join(\",\");\n  const hit = e.cache.get(key);\n  if (hit) return hit;\n  const p = new Promise<HTMLCanvasElement | null>((resolve) => {\n    e.queue.push({ kind, w: bw, h: bh, seed, focus: f, resolve });\n    hgPump(e);\n  });\n  e.cache.set(key, p);\n  return p;\n}\n\n/* ============================================================================\n * SHARED PIECES\n * ========================================================================== */\n\n/** The kit's face. Urbanist is set at 300 for the quiet line, 700 for the loud one. */\nexport const HG_FONT = 'var(--font-urbanist, \"Urbanist\"), \"Outfit\", ui-sans-serif, system-ui, sans-serif';\n\n/** The kit's palette. Ground and ink do the work; the colour lives inside the glass. */\nexport const HG = {\n  ground: \"#eef0f5\",\n  paper: \"#f7f8fb\",\n  ink: \"#15161b\",\n  inkSoft: \"rgba(21,22,27,0.62)\",\n  inkMute: \"rgba(21,22,27,0.42)\",\n  line: \"rgba(21,22,27,0.10)\",\n  night: \"#0d0e11\",\n  cobalt: \"#2b46ff\",\n  violet: \"#7b5cff\",\n  pink: \"#ff6fb5\",\n  coral: \"#ff4a4a\",\n  orange: \"#ff8a1f\",\n} as const;\n\n/** True once the element has come within `margin` of the viewport. Never goes back. */\nexport function useHgSeen<T extends HTMLElement>(ref: RefObject<T | null>, margin = \"200px\"): boolean {\n  const [seen, setSeen] = useState(false);\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || seen) return;\n    if (typeof IntersectionObserver === \"undefined\") {\n      // No observer to wait for: count it as seen on the next frame.\n      const id = requestAnimationFrame(() => setSeen(true));\n      return () => cancelAnimationFrame(id);\n    }\n    // Watch against the box that scrolls the element when there is one: the\n    // margin only reaches ahead inside its own root, so against the window\n    // it would do nothing for a page living in a scrolling preview.\n    const io = new IntersectionObserver(\n      (es) => {\n        if (es.some((e) => e.isIntersecting)) {\n          setSeen(true);\n          io.disconnect();\n        }\n      },\n      { root: hgScrollParent(el), rootMargin: margin },\n    );\n    io.observe(el);\n    return () => io.disconnect();\n  }, [ref, margin, seen]);\n  return seen;\n}\n\n/**\n * The scrolling box an element lives in: the nearest ancestor that actually\n * scrolls, or null for the window. Resolved lazily on every scroll, because a\n * scroller only becomes one once its content is taller than it.\n */\nexport function hgScrollParent(el: Element | null): HTMLElement | null {\n  let n = el?.parentElement ?? null;\n  while (n && n !== document.body && n !== document.documentElement) {\n    const oy = getComputedStyle(n).overflowY;\n    if ((oy === \"auto\" || oy === \"scroll\" || oy === \"overlay\") && n.scrollHeight > n.clientHeight + 1) return n;\n    n = n.parentElement;\n  }\n  return null;\n}\n\n/**\n * A picture from the art engine, filling its box. Shows the scene's CSS\n * stand-in until the render lands (or forever, without WebGL2), then fades\n * the render in. Renders only once the box is near the viewport.\n */\nexport function HoloArt({\n  kind,\n  seed = 0,\n  focus,\n  className,\n  style,\n  quality = 1,\n}: {\n  kind: HoloKind;\n  seed?: number;\n  /** Shift the subject inside the frame, in frame heights, and zoom: [x, y, zoom = 1]. */\n  focus?: [number, number] | [number, number, number];\n  className?: string;\n  style?: CSSProperties;\n  /** Render resolution as a fraction of device pixels (capped at 2x). */\n  quality?: number;\n}) {\n  const box = useRef<HTMLDivElement>(null);\n  const canvas = useRef<HTMLCanvasElement>(null);\n  const seen = useHgSeen(box, \"600px\");\n  const [size, setSize] = useState<[number, number] | null>(null);\n  const [ready, setReady] = useState(false);\n  const fx = focus?.[0] ?? 0;\n  const fy = focus?.[1] ?? 0;\n  const fz = focus?.[2] ?? 1;\n  useEffect(() => {\n    const el = box.current;\n    if (!el) return;\n    const measure = () => {\n      const r = el.getBoundingClientRect();\n      // offsetWidth ignores transforms, so a card scaled in 3D still asks\n      // for its true layout size.\n      const w = el.offsetWidth || r.width;\n      const h = el.offsetHeight || r.height;\n      if (w > 4 && h > 4) setSize([w, h]);\n    };\n    measure();\n    // A box that is animating its size (a pill opening) would otherwise ask\n    // for a render at every step; wait until it has held still.\n    let t = 0;\n    const settle = () => {\n      window.clearTimeout(t);\n      t = window.setTimeout(measure, 220);\n    };\n    const ro = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(settle) : null;\n    ro?.observe(el);\n    return () => {\n      ro?.disconnect();\n      window.clearTimeout(t);\n    };\n  }, []);\n  useEffect(() => {\n    if (!seen || !size) return;\n    let alive = true;\n    const dpr = Math.min(2, window.devicePixelRatio || 1) * quality;\n    requestHoloArt(kind, size[0] * dpr, size[1] * dpr, seed, [fx, fy, fz]).then((art) => {\n      const c = canvas.current;\n      if (!alive || !art || !c) return;\n      c.width = art.width;\n      c.height = art.height;\n      c.getContext(\"2d\")?.drawImage(art, 0, 0);\n      setReady(true);\n    });\n    return () => {\n      alive = false;\n    };\n  }, [seen, size, kind, seed, fx, fy, fz, quality]);\n  // A box placed by its class keeps that placement; otherwise it becomes the\n  // canvas's containing block.\n  const placed = (className ?? \"\").split(\" \").some((c) => c === \"absolute\" || c === \"fixed\" || c === \"sticky\");\n  return (\n    <div\n      ref={box}\n      aria-hidden\n      className={className}\n      style={{ position: placed ? undefined : \"relative\", overflow: \"hidden\", background: HOLO_FALLBACK[kind], ...style }}\n    >\n      <canvas\n        ref={canvas}\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          width: \"100%\",\n          height: \"100%\",\n          opacity: ready ? 1 : 0,\n          transition: \"opacity 700ms ease\",\n        }}\n      />\n    </div>\n  );\n}\n\n/** The eight-spoke asterisk the kit uses as caret, bullet and spinner. */\nexport function HgAsterisk({ className, style, stroke = 1.6 }: { className?: string; style?: CSSProperties; stroke?: number }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden className={className} style={style} fill=\"none\" stroke=\"currentColor\" strokeWidth={stroke} strokeLinecap=\"round\">\n      <path d=\"M12 3v18M3 12h18M5.6 5.6l12.8 12.8M18.4 5.6 5.6 18.4\" />\n    </svg>\n  );\n}\n\n/** viberdy's V, as a solid mark. */\nexport function HgVMark({ className, style }: { className?: string; style?: CSSProperties }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" aria-hidden className={className} style={style}>\n      <rect width=\"32\" height=\"32\" rx=\"9\" fill=\"currentColor\" />\n      <path d=\"M9 10.5 L15.2 22.5 L16.8 22.5 L23 10.5 L19.6 10.5 L16 18.2 L12.4 10.5 Z\" fill=\"#fff\" />\n    </svg>\n  );\n}\n\n/* ============================================================================\n * PLANS: three glass cards dealt out of a pile\n * ========================================================================== */\n\n/** Allow in-page anchors, site paths and http(s)/mailto links; anything else becomes \"#\". */\nexport function hgSafeHref(href: string): string {\n  const h = href.trim();\n  if (h.includes(\"\\\\\")) return \"#\";\n  if (h.startsWith(\"#\") || (h.startsWith(\"/\") && !h.startsWith(\"//\"))) return h;\n  try {\n    const u = new URL(h);\n    return u.protocol === \"https:\" || u.protocol === \"http:\" || u.protocol === \"mailto:\" ? u.href : \"#\";\n  } catch {\n    return \"#\";\n  }\n}\n\n/* ============================================================================\n * THE CLOSE: a last call, then the footer\n * ========================================================================== */\n\nexport interface HgLink {\n  label: string;\n  href: string;\n}\n\nexport interface HgFooterColumn {\n  title: string;\n  links: HgLink[];\n}\n\nexport const HG_FOOTER_COLUMNS: HgFooterColumn[] = [\n  {\n    title: \"Library\",\n    links: [\n      { label: \"All components\", href: \"/library\" },\n      { label: \"Styles\", href: \"/styles\" },\n      { label: \"Templates\", href: \"/templates\" },\n      { label: \"Pricing\", href: \"/pricing\" },\n    ],\n  },\n  {\n    title: \"Kits\",\n    links: [\n      { label: \"Holo Gloss\", href: \"/styles/holo-gloss\" },\n      { label: \"All kits\", href: \"/styles\" },\n      { label: \"Docs\", href: \"/docs\" },\n      { label: \"License\", href: \"/license\" },\n    ],\n  },\n  {\n    title: \"Elsewhere\",\n    links: [\n      { label: \"X\", href: \"https://x.com/viberdy\" },\n      { label: \"GitHub\", href: \"https://github.com/viberdy-dev/ui\" },\n      { label: \"Terms\", href: \"/terms\" },\n      { label: \"Privacy\", href: \"/privacy\" },\n    ],\n  },\n];\n\nconst HG_CLOSE_CSS = `\n.hg-close-pill{transition:transform .25s cubic-bezier(.2,.7,.2,1),background-color .3s,color .3s,border-color .3s}\n.hg-close-pill:hover{transform:translateY(-1px)}\n.hg-close-pill:focus-visible,.hg-foot a:focus-visible{outline:2px solid ${HG.cobalt} !important;outline-offset:3px;border-radius:6px}\n.hg-foot a{background-image:linear-gradient(currentColor,currentColor);background-size:0 1px;background-repeat:no-repeat;background-position:0 100%;transition:background-size .3s cubic-bezier(.2,.7,.2,1),color .3s}\n.hg-foot a:hover{background-size:100% 1px;color:${HG.ink}}\n@media (prefers-reduced-motion: reduce){.hg-close-pill,.hg-foot a{transition:none}}\n`;\n\n/**\n * The end of the page. A last call to action set big, with the holo pill\n * between its words and two buttons (the main one to the plans, the other\n * to the sign-up); then the footer: the mark and a one-line promise, three\n * columns of real links, and the copyright with a way back up.\n */\nexport function HoloSiteFooter({\n  brand = \"viberdy\",\n  promise = \"Premium React components in every style, built to be pasted.\",\n  call = \"Ready when **you are.**\",\n  primary = { label: \"See the plans\", href: \"#pricing\" },\n  secondary = { label: \"Get drop emails\", href: \"#updates\" },\n  columns = HG_FOOTER_COLUMNS,\n  legal = \"© 2026 viberdy. All rights reserved.\",\n  className,\n  style,\n}: {\n  brand?: string;\n  promise?: string;\n  /** **bold** marks the loud half. */\n  call?: string;\n  primary?: HgLink;\n  secondary?: HgLink;\n  columns?: HgFooterColumn[];\n  legal?: string;\n  className?: string;\n  style?: CSSProperties;\n}) {\n  const parts = call.split(\"**\");\n  return (\n    <footer className={\"@container relative w-full \" + (className ?? \"\")} style={{ background: HG.ground, color: HG.ink, fontFamily: HG_FONT, ...style }}>\n      <style>{HG_CLOSE_CSS}</style>\n      <div className=\"relative overflow-hidden px-[5.5cqw] pt-[7cqw] pb-[8cqw]\">\n        <div\n          aria-hidden\n          className=\"pointer-events-none absolute inset-0\"\n          style={{ background: \"radial-gradient(40% 60% at 70% 40%, rgba(255,120,190,0.12), transparent 70%), radial-gradient(35% 50% at 85% 70%, rgba(60,90,255,0.12), transparent 70%)\" }}\n        />\n        <h2 className=\"relative text-[clamp(40px,8.4cqw,128px)] leading-[0.98] tracking-[-0.045em]\">\n          {parts.map((t, i) => (\n            <span key={i} style={{ fontWeight: i % 2 ? 700 : 300 }}>\n              {t}\n            </span>\n          ))}\n          <span aria-hidden className=\"ml-[0.18em] inline-block h-[0.62em] w-[1.9em] overflow-hidden rounded-full align-[-0.04em]\">\n            <HoloArt kind=\"foil\" seed={8} className=\"h-full w-full\" />\n          </span>\n        </h2>\n        <div className=\"relative mt-[3.4cqw] flex flex-wrap gap-3\">\n          <a href={hgSafeHref(primary.href)} className=\"hg-close-pill inline-flex h-12 items-center gap-2 rounded-full px-6 text-[14px] font-semibold text-white\" style={{ background: HG.ink }}>\n            {primary.label}\n            <HgAsterisk className=\"h-3.5 w-3.5\" stroke={2.2} />\n          </a>\n          <a\n            href={hgSafeHref(secondary.href)}\n            className=\"hg-close-pill inline-flex h-12 items-center rounded-full px-6 text-[14px] font-semibold\"\n            style={{ border: \"1px solid rgba(21,22,27,0.16)\", background: \"rgba(255,255,255,0.55)\" }}\n          >\n            {secondary.label}\n          </a>\n        </div>\n      </div>\n      <div className=\"hg-foot px-[5.5cqw] pt-[4.5cqw] pb-8\" style={{ background: HG.paper, borderTop: \"1px solid rgba(21,22,27,0.08)\" }}>\n        <div className=\"grid grid-cols-2 gap-x-6 gap-y-10 @[760px]:grid-cols-[1.6fr_1fr_1fr_1fr]\">\n          <div className=\"col-span-2 @[760px]:col-span-1\">\n            <a href=\"#top\" className=\"inline-flex items-center gap-2 text-[17px] font-semibold tracking-[-0.02em]\" style={{ backgroundImage: \"none\" }}>\n              <HgVMark className=\"h-[1.3em] w-[1.3em]\" style={{ color: HG.cobalt }} />\n              {brand}\n            </a>\n            <p className=\"mt-3 max-w-[26ch] text-[13.5px] leading-snug\" style={{ color: HG.inkSoft }}>\n              {promise}\n            </p>\n          </div>\n          {columns.map((c) => (\n            <nav key={c.title} aria-label={c.title}>\n              <h3 className=\"text-[11px] font-semibold tracking-[0.16em] uppercase\" style={{ color: HG.inkMute }}>\n                {c.title}\n              </h3>\n              <ul className=\"mt-4 flex flex-col gap-2.5\">\n                {c.links.map((l) => (\n                  <li key={l.label}>\n                    <a href={hgSafeHref(l.href)} className=\"text-[13.5px]\" style={{ color: \"rgba(21,22,27,0.72)\" }}>\n                      {l.label}\n                    </a>\n                  </li>\n                ))}\n              </ul>\n            </nav>\n          ))}\n        </div>\n        <div className=\"mt-[4cqw] flex items-center justify-between gap-4 pt-6 text-[12px]\" style={{ borderTop: \"1px solid rgba(21,22,27,0.08)\", color: HG.inkMute }}>\n          <span>{legal}</span>\n          <a href=\"#top\" className=\"font-medium\" style={{ color: \"rgba(21,22,27,0.72)\" }}>\n            Back to top ↑\n          </a>\n        </div>\n      </div>\n    </footer>\n  );\n}\n","type":"registry:component","target":"components/viberdy/holo-site-footer.tsx"}],"meta":{"tier":"free","tags":["footer","cta","closing section","links","glass","iridescent","minimal"],"href":"https://viberdy.dev/library/holo-site-footer","aiPrompt":"Build a React + Tailwind page ending, `HoloSiteFooter`, in one \"use client\" file with no dependencies. It is a `<footer>` in two stacked parts: a last call to action set very big with a holo glass pill sitting between its words and two buttons under it, then the real footer: the mark with a one-line promise, three columns of links, and the copyright line with a way back up. The only picture is the pill, painted in code by a hand-written WebGL2 ray marcher (no photos or video). Nothing in it is scroll-driven or timed; it is static and calm by design.\n\nRendering engine. One shared offscreen WebGL2 context for the whole page (kept under a `Symbol.for` key on globalThis). `requestHoloArt(kind, w, h, seed, focus)` renders each picture once per (scene, size bucketed up to 32 px and clamped 32 to 2400, seed, focus) and caches the promise. Jobs queue; each draws a full-screen triangle with the scissor test in bands of `max(16, floor(120000 / width))` rows, one band per animation frame, then copies to a plain 2D canvas, so nothing ray-marches per frame. `HoloArt` is an `aria-hidden` box showing a CSS gradient stand-in until the render lands (and forever without WebGL2), then fading the canvas in over 700 ms; it measures `offsetWidth/Height` (re-measuring only after its box has held still for 220 ms), waits until within 600px of the viewport (via an exported `useHgSeen` IntersectionObserver hook rooted at the nearest scrolling ancestor) and renders at `min(2, devicePixelRatio) * quality`. The shader has a shared prelude (SDF primitives, a thin-film function giving an oil-on-water rainbow) and a studio environment: a lavender-to-white sweep with crisp rectangular softboxes (white overhead, cobalt left, hot pink right, orange bounce low). Marching is 120 steps; glass uses Schlick fresnel at index 1.48, a refracted interior march for thickness, tint absorption, a tight specular and ambient occlusion; chrome reflects the studio; then ACES, gamma 2.2 and a half-LSB grain over a near-white backdrop with two faint coloured blooms. The scene used here is `foil`: a close-up fat twisted torus of violet, pink, cobalt and orange foil glass, a chrome ball and a small glass ring, which stretches sideways to fill a wide frame; the seed turns it (seed 8 here). The same file carries the kit's other scenes, unused here.\n\nShared pieces. `HG_FONT` is `var(--font-urbanist, \"Urbanist\"), \"Outfit\", ui-sans-serif, system-ui, sans-serif`. The palette `HG` is ground #eef0f5, paper #f7f8fb, ink #15161b, soft ink rgba(21,22,27,.62), muted ink rgba(21,22,27,.42), night #0d0e11, cobalt #2b46ff, violet #7b5cff, pink #ff6fb5, coral #ff4a4a, orange #ff8a1f. `HgAsterisk` is the eight-spoke asterisk SVG (24 by 24 viewBox, path `M12 3v18M3 12h18M5.6 5.6l12.8 12.8M18.4 5.6 5.6 18.4`, round caps, currentColor). `HgVMark` is a 32 by 32 rounded-square (radius 9) in currentColor with a white V cut into it. `hgSafeHref` lets through only `#` anchors, single-slash site paths and http, https or mailto URLs; backslashes and anything else become \"#\".\n\nLayout. The root `<footer>` is `@container relative w-full`, ground #eef0f5, ink #15161b, Urbanist then Outfit. Part one (padding `7cqw` top, `8cqw` bottom, `5.5cqw` sides, `overflow-hidden`) has a faint pink radial wash at 70%/40% and a faint cobalt one at 85%/70%, then an `h2` at `clamp(40px, 8.4cqw, 128px)`, line-height 0.98, tracking -0.045em. The `call` string is split on `**`: even-numbered pieces are weight 300 and odd-numbered pieces are weight 700, so the default \"Ready when **you are.**\" reads quiet then loud. After the text sits an `aria-hidden` inline-block pill, 0.62em tall and 1.9em wide, fully rounded, `overflow-hidden`, left margin 0.18em, aligned -0.04em, filled with the `foil` scene. Under the heading (margin-top `3.4cqw`, wrapping row, 12px gap) are two 48px full-pill links: the primary is solid ink with white 14px semibold text followed by a small heavy asterisk; the secondary is transparent white at 55% with a 16% ink border. Part two sits on paper #f7f8fb with a top hairline, padding `4.5cqw` top, `5.5cqw` sides, 32px bottom. Its grid is two columns with gaps 24px by 40px, and from a container width of 760px becomes `1.6fr 1fr 1fr 1fr`. The first cell (full width on narrow) is a link to `#top` showing the cobalt V mark and the brand name (17px semibold), over the promise (13.5px, soft ink, max 26ch). Each link column is a `<nav>` with `aria-label` set to its title, an uppercase 11px semibold title with 0.16em tracking in muted ink, and a list of 13.5px links in ink at 72%, 10px apart. Below, 4cqw down, a hairline row holds the legal line (12px, muted) on the left and a \"Back to top\" link with an up arrow on the right, linking to `#top` (the host page provides that anchor).\n\nInteraction. Footer links show an underline that sweeps in from the left (a 1px gradient background growing from 0 to 100% over .3s `cubic-bezier(.2,.7,.2,1)`, the colour deepening to ink); the two call buttons lift 1px on hover. Keyboard focus shows a 2px cobalt outline with 3px offset. Under `prefers-reduced-motion: reduce` those transitions are removed.\n\nAccessibility: the pill art is `aria-hidden`, headings are real (`h2`, then an `h3` per column), and each column is a labelled `nav`.\n\nProps: `brand` (\"viberdy\"), `promise` (\"Premium React components in every style, built to be pasted.\"), `call` (\"Ready when **you are.**\"), `primary` (`{ label: \"See the plans\", href: \"#pricing\" }`), `secondary` (`{ label: \"Get drop emails\", href: \"#updates\" }`), `columns` (array of `{ title, links: [{ label, href }] }`; defaults Library with All components /library, Styles /styles, Templates /templates and Pricing /pricing; Kits with Holo Gloss /styles/holo-gloss, All kits /styles, Docs /docs and License /license; Elsewhere with X https://x.com/viberdy, GitHub https://github.com/viberdy-dev/ui, Terms /terms and Privacy /privacy), `legal` (\"© 2026 viberdy. All rights reserved.\"), `className`, `style`.","license":"https://viberdy.dev/license"}}