{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"vinyl-record-sleeve-testimonials-in-webgl-on-a-sunlit-shelf-where-the-chosen-record-slides-half-out-and-catches-light-in-its-grooves","type":"registry:block","title":"Vinyl Record Sleeve Testimonials in WebGL on a Sunlit Shelf Where the Chosen Record Slides Half Out and Catches Light in Its Grooves","description":"Free testimonial section in WebGL: three record sleeves lean on a sunlit oak shelf, and the chosen one lifts its black disc half out beside a large quote.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/vinyl-record-sleeve-testimonials-in-webgl-on-a-sunlit-shelf-where-the-chosen-record-slides-half-out-and-catches-light-in-its-grooves.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\n\n/** One record per speaker. The cover photo is printed on the sleeve; `label` is the paper label in the middle of the disc. */\nconst records = [\n  {\n    quote: \"They listened to the whole brief before touching a single pixel.\",\n    name: \"Noor Halvorsen\",\n    role: \"Owner, Halvorsen Ceramics\",\n    src: \"https://images.pexels.com/photos/11608677/pexels-photo-11608677.jpeg?auto=compress&cs=tinysrgb&w=900\",\n    alt: \"Woman with a dark bob and a large earring looking back over her shoulder against a violet and orange backdrop\",\n    tone: \"#5b3bb4\",\n    label: \"#e9a23b\",\n  },\n  {\n    quote: \"Our booking page finally sounds like us, not like a template.\",\n    name: \"Desmond Okafor\",\n    role: \"Founder, Low Tide Barbers\",\n    src: \"https://images.pexels.com/photos/37580515/pexels-photo-37580515.jpeg?auto=compress&cs=tinysrgb&w=900\",\n    alt: \"Young man with swept-back hair and a green overshirt smiling against a deep red backdrop\",\n    tone: \"#a3201d\",\n    label: \"#e2c98f\",\n  },\n  {\n    quote: \"The site went live on Friday. Monday's calls were all new faces.\",\n    name: \"Adaeze Calderwood\",\n    role: \"Director, Calderwood Physio\",\n    src: \"https://images.pexels.com/photos/30774062/pexels-photo-30774062.jpeg?auto=compress&cs=tinysrgb&w=900\",\n    alt: \"Woman with a full afro, a patterned head tie and hoop earrings standing in front of dark green trees\",\n    tone: \"#2f4a2c\",\n    label: \"#d8452f\",\n  },\n];\n\nconst N = records.length;\nconst KICKER = \"Played on repeat\"; // small label above the quote\nconst HOLD_MS = 6400; // rest before the next record is pulled by itself\nconst SLIDE = 0.158; // how far the disc rises out of its sleeve, in metres (half a 12 inch record)\nconst SLIDE_PULL = 58; // spring strength of the sliding disc; higher arrives sooner\nconst SLIDE_DRAG = 8.6; // lower lets the disc overshoot further before it settles\nconst TIP_KICK = 0.75; // how hard the chosen sleeve rocks off the wall when its record is pulled\nconst SERIF = '\"New York\", ui-serif, \"Iowan Old Style\", \"Palatino Linotype\", Palatino, Georgia, serif';\nconst GROTESK = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, sans-serif';\nconst INK = \"#2b1a10\";\n\n// Sleeves in metres: a 12 inch sleeve is 31.5 cm square. Each leans back until its top meets the wall.\nconst HS = 0.1575;\nconst HT = 0.0034;\nconst XS = [-0.338, 0.0, 0.338];\nconst LEANS = [0.15, 0.115, 0.165];\nconst YAWS = [0.05, -0.025, 0.06];\nconst CAM_Z = 2.0;\nconst TEX = 768;\n\nconst mod = (a: number, n: number) => ((a % n) + n) % n;\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\n\nconst FS = `#version 300 es\nprecision highp float;\nprecision highp sampler2DArray;\nuniform vec3 uCam, uRt, uUp, uFw;\nuniform float uTan, uAspect, uFocus, uAperture;\nuniform vec2 uRes;\nuniform int uSS;\nuniform vec3 uSC[3], uSU[3], uSV[3], uSN[3];\nuniform float uLift[3], uSpin[3];\nuniform vec3 uL;\nuniform vec4 uWin;\nuniform sampler2DArray uTex;\nout vec4 o;\nconst float HS = ${HS.toFixed(4)}, HT = ${HT.toFixed(4)}, DR = 0.1505, LR = 0.051;\nconst vec3 SUN = vec3(1.0, 0.82, 0.6) * 3.0;\nconst vec3 AMB = vec3(0.46, 0.4, 0.36) * 0.66;\nconst vec3 WALL = vec3(0.6, 0.48, 0.36);\nconst vec3 OAK = vec3(0.40, 0.235, 0.12);\nconst vec3 SHC = vec3(0.0, -0.019, 0.13), SHH = vec3(6.0, 0.019, 0.13);\nconst vec3 KEY2 = vec3(0.62, 0.62, 0.48);\nvec3 Lu, Lv;\n\nfloat ign(vec2 p) { return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715)))); }\nfloat hash(vec2 p) { p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); }\nfloat vnoise(vec2 p) {\n  vec2 i = floor(p), f = fract(p); f = f * f * (3.0 - 2.0 * f);\n  return mix(mix(hash(i), hash(i + vec2(1, 0)), f.x), mix(hash(i + vec2(0, 1)), hash(i + vec2(1, 1)), f.x), f.y);\n}\nfloat fbm(vec2 p) { return 0.5 * vnoise(p) + 0.25 * vnoise(p * 2.03 + 7.3) + 0.125 * vnoise(p * 4.1 + 1.7) + 0.0625 * vnoise(p * 8.3); }\nfloat sbox(vec2 p, vec2 h, float s) { vec2 d = smoothstep(h + s, h - s, abs(p)); return d.x * d.y; }\nfloat sdBox(vec3 p, vec3 b) { vec3 q = abs(p) - b; return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0); }\n\nfloat boxHit(vec3 ro, vec3 rd, vec3 h, out vec3 n) {\n  vec3 inv = 1.0 / rd;\n  vec3 t1 = (-h - ro) * inv, t2 = (h - ro) * inv;\n  vec3 tn = min(t1, t2), tf = max(t1, t2);\n  float a = max(max(tn.x, tn.y), tn.z), b = min(min(tf.x, tf.y), tf.z);\n  if (a > b || a < 0.0) return -1.0;\n  n = tn.x > tn.y && tn.x > tn.z ? vec3(-sign(rd.x), 0, 0) : tn.y > tn.z ? vec3(0, -sign(rd.y), 0) : vec3(0, 0, -sign(rd.z));\n  return a;\n}\nvec3 loc(vec3 v, int i) { return vec3(dot(v, uSU[i]), dot(v, uSV[i]), dot(v, uSN[i])); }\n\n// Nearest surface along a ray: 0 wall, 1 shelf, 2 sleeve, 3 disc.\nfloat trace(vec3 ro, vec3 rd, out int m, out vec3 n, out vec3 lp, out int k) {\n  float t = 1e9; m = -1; k = 0; n = vec3(0, 0, 1); lp = vec3(0);\n  if (rd.z < 0.0) { t = -ro.z / rd.z; m = 0; }\n  vec3 nn;\n  float ts = boxHit(ro - SHC, rd, SHH, nn);\n  if (ts > 0.0 && ts < t) { t = ts; m = 1; n = nn; lp = ro + rd * ts - SHC; }\n  for (int i = 0; i < 3; i++) {\n    vec3 lo = loc(ro - uSC[i], i), ld = loc(rd, i);\n    float tb = boxHit(lo, ld, vec3(HS, HS, HT), nn);\n    if (tb > 0.0 && tb < t) { t = tb; m = 2; k = i; n = uSU[i] * nn.x + uSV[i] * nn.y + uSN[i] * nn.z; lp = lo + ld * tb; lp.z = nn.z; }\n    if (uLift[i] > 0.004) {\n      float td = -lo.z / ld.z;\n      vec2 c = (lo + ld * td).xy - vec2(0.0, uLift[i]);\n      if (td > 0.0 && td < t && dot(c, c) < DR * DR) { t = td; m = 3; k = i; n = uSN[i] * (ld.z < 0.0 ? 1.0 : -1.0); lp = vec3(c, 0.0); }\n    }\n  }\n  return t;\n}\nbool blocked(vec3 ro, vec3 rd) {\n  vec3 nn;\n  if (boxHit(ro - SHC, rd, SHH, nn) > 0.0) return true;\n  for (int i = 0; i < 3; i++) {\n    vec3 lo = loc(ro - uSC[i], i), ld = loc(rd, i);\n    if (boxHit(lo, ld, vec3(HS, HS, HT), nn) > 0.0) return true;\n    if (uLift[i] > 0.004) {\n      float td = -lo.z / ld.z;\n      vec2 c = (lo + ld * td).xy - vec2(0.0, uLift[i]);\n      if (td > 0.0 && dot(c, c) < DR * DR) return true;\n    }\n  }\n  return false;\n}\n// Two jittered rays toward a sun that comes through a window, so shadow edges have a penumbra.\nfloat sunShadow(vec3 P, float seed) {\n  float s = 0.0;\n  for (int j = 0; j < 2; j++) {\n    float a = 6.2832 * fract(seed + float(j) * 0.5);\n    float r = 0.022 * sqrt(fract(seed * 7.13 + float(j) * 0.37));\n    if (!blocked(P, normalize(uL + (Lu * cos(a) + Lv * sin(a)) * r))) s += 0.5;\n  }\n  return s;\n}\n// The window: four panes with glazing bars, cast as a slanted patch of sun on the wall and shelf.\nfloat gobo(vec3 P) {\n  vec2 g = vec2(dot(P, Lu), dot(P, Lv)) - uWin.xy;\n  float w = sbox(g, uWin.zw, 0.05);\n  float bars = (1.0 - 0.92 * smoothstep(0.03, 0.012, abs(g.x + 0.12))) * (1.0 - 0.92 * smoothstep(0.03, 0.012, abs(g.y - 0.12)));\n  return w * bars;\n}\nfloat occl(vec3 P) {\n  float ao = 1.0;\n  for (int i = 0; i < 3; i++) {\n    vec3 l = loc(P - uSC[i], i);\n    ao *= mix(0.42, 1.0, smoothstep(0.0, 0.07, sdBox(l, vec3(HS, HS + uLift[i] * 0.5, HT))));\n  }\n  return ao;\n}\n// What glossy things see when they look back into the room: warm walls, a bright window, a pale card.\nvec3 room(vec3 R, float soft) {\n  vec3 c = mix(vec3(0.18, 0.12, 0.08), vec3(0.7, 0.62, 0.52), smoothstep(-0.4, 0.7, R.y));\n  float f = dot(R, uL);\n  if (f > 0.0) {\n    vec2 a = vec2(dot(R, Lu), dot(R, Lv)) / f;\n    float win = sbox(a - vec2(0.05, 0.1), vec2(0.42, 0.3), mix(0.01, 0.25, soft));\n    win *= 1.0 - 0.9 * (1.0 - soft) * smoothstep(0.02, 0.008, abs(a.x - 0.0));\n    c += SUN * 2.6 * win;\n  }\n  c += vec3(1.0, 0.96, 0.9) * 1.1 * smoothstep(0.9 - soft * 0.2, 0.97, dot(R, normalize(KEY2)));\n  return c;\n}\n\nvec3 shadeWall(vec3 P, float seed) {\n  vec2 q = P.xy * vec2(6.0, 4.0);\n  float h0 = fbm(q), hx = fbm(q + vec2(0.04, 0)), hy = fbm(q + vec2(0, 0.04));\n  vec3 n = normalize(vec3(-(hx - h0) * 0.55, -(hy - h0) * 0.55, 1.0));\n  vec3 alb = WALL * (0.84 + 0.28 * fbm(P.xy * 1.3 + 3.0)) * (0.93 + 0.14 * h0);\n  float ao = occl(P) * (1.0 - 0.3 * exp(-abs(P.y) / 0.05)) * (P.y < 0.0 ? 0.8 : 1.0);\n  float lit = max(dot(n, uL), 0.0) * gobo(P);\n  if (lit > 0.001) lit *= sunShadow(P + n * 0.001, seed);\n  vec3 bounce = OAK * SUN * 0.16 * exp(-max(P.y, 0.0) / 0.12) * step(0.0, P.y);\n  return alb * (SUN * lit + AMB * ao + bounce);\n}\nvec3 shadeShelf(vec3 P, vec3 lp, vec3 n, vec3 V, float seed) {\n  bool top = n.y > 0.5;\n  vec2 gp = top ? vec2(P.x, P.z) : vec2(P.x, P.y);\n  float warp = fbm(gp * vec2(1.4, 18.0));\n  float g = fbm(vec2(gp.x * 2.4, gp.y * 90.0 + warp * 5.0));\n  vec3 alb = OAK * (0.62 + 0.62 * g) * (0.9 + 0.2 * vnoise(vec2(gp.x * 40.0, gp.y * 900.0)));\n  // a rounded front edge picks up a line of light\n  float edge = top ? smoothstep(0.122, 0.13, lp.z) : smoothstep(-0.008, 0.0, lp.y);\n  vec3 ns = normalize(mix(n, normalize(vec3(0, 0.7, 0.7)), edge * 0.85));\n  float ao = occl(P) * (top ? mix(0.55, 1.0, smoothstep(0.0, 0.06, P.z)) : 1.0);\n  float lit = max(dot(ns, uL), 0.0) * gobo(P);\n  if (lit > 0.001) lit *= sunShadow(P + n * 0.001, seed);\n  vec3 col = alb * (SUN * lit + AMB * ao);\n  float F = 0.04 + 0.96 * pow(1.0 - max(dot(ns, V), 0.0), 5.0);\n  col += room(reflect(-V, ns), 0.8) * F * 0.45 * ao;\n  col += SUN * lit * pow(max(dot(ns, normalize(uL + V)), 0.0), 40.0) * 0.18;\n  return col;\n}\nvec3 shadeSleeve(vec3 P, vec3 lp, vec3 n, int k, vec3 V, float seed) {\n  vec3 alb;\n  bool front = lp.z > 0.5;\n  vec2 xy = lp.xy;\n  if (front) {\n    alb = pow(texture(uTex, vec3(xy / (2.0 * HS) + 0.5, float(k))).rgb, vec3(2.2));\n    // ring wear where the record has pressed through, and soft scuffed corners\n    float r = length(xy);\n    float ring = smoothstep(0.009, 0.0, abs(r - 0.146)) * smoothstep(0.35, 0.8, fbm(xy * 40.0 + float(k) * 9.0));\n    float e = HS - max(abs(xy.x), abs(xy.y));\n    float wear = smoothstep(0.0045, 0.0, e) * (0.4 + 0.6 * vnoise(xy * 260.0));\n    alb = mix(alb, vec3(0.62, 0.58, 0.52), clamp(ring * 0.1 + wear * 0.6, 0.0, 1.0));\n  } else {\n    alb = vec3(0.6, 0.55, 0.47) * (0.9 + 0.2 * vnoise(xy * 400.0));\n  }\n  float ao = mix(0.6, 1.0, smoothstep(-HS, -HS + 0.05, xy.y));\n  float lit = max(dot(n, uL), 0.0) * gobo(P);\n  if (lit > 0.001) lit *= sunShadow(P + n * 0.0015, seed);\n  vec3 col = alb * (SUN * lit + AMB * ao * 1.15);\n  float F = 0.04 + 0.96 * pow(1.0 - max(dot(n, V), 0.0), 5.0);\n  col += room(reflect(-V, n), 0.55) * F * (front ? 0.6 : 0.2);\n  col += SUN * lit * pow(max(dot(n, normalize(uL + V)), 0.0), 70.0) * 0.12;\n  // the laminated print catches a broad, faint sheen, broken up by handling marks\n  if (front) col += SUN * lit * pow(max(dot(n, normalize(uL + V)), 0.0), 9.0) * 0.05 * (0.6 + 0.8 * fbm(xy * 18.0 + float(k)));\n  return col;\n}\nvec3 shadeDisc(vec3 P, vec3 lp, vec3 n, int k, vec3 V, float seed) {\n  vec2 p = lp.xy;\n  float r = length(p);\n  if (r < 0.0037) return vec3(0.004);\n  float lit = max(dot(n, uL), 0.0) * gobo(P);\n  if (lit > 0.001) lit *= sunShadow(P + n * 0.0015, seed);\n  float ao = occl(P) * 0.9 + 0.1;\n  if (r < LR) {\n    float s = uSpin[k];\n    vec2 q = mat2(cos(s), -sin(s), sin(s), cos(s)) * p;\n    vec3 alb = pow(texture(uTex, vec3(q / (2.0 * LR) + 0.5, float(k + 3))).rgb, vec3(2.2));\n    vec3 col = alb * (SUN * lit + AMB * ao);\n    float F = 0.04 + 0.96 * pow(1.0 - max(dot(n, V), 0.0), 5.0);\n    return col + room(reflect(-V, n), 0.7) * F * 0.3;\n  }\n  // grooves run round the centre, so light streaks across them along the radius\n  vec2 tl = vec2(-p.y, p.x) / r;\n  vec3 T = uSU[k] * tl.x + uSV[k] * tl.y;\n  float runout = smoothstep(0.062, 0.0605, r);\n  float gap = 0.0;\n  for (int b = 0; b < 4; b++) gap = max(gap, smoothstep(0.0011, 0.0004, abs(r - (0.078 + float(b) * 0.0165))));\n  float lead = smoothstep(0.1455, 0.1465, r);\n  float smoothBand = max(max(runout, gap), lead * 0.7);\n  float grooveTex = 0.75 + 0.25 * vnoise(vec2(r * 2600.0, 0.0)) ;\n  // each groove wall is a tiny slope facing in or out along the radius, so a light reflects off them\n  // only along the radius that lines up with the half vector: a thin bright streak through the centre\n  vec2 rad = p / r;\n  vec3 H = normalize(uL + V);\n  vec2 hl = vec2(dot(H, uSU[k]), dot(H, uSV[k]));\n  float slope = length(hl) / max(dot(H, n), 1e-3);\n  float al = abs(dot(rad, hl / max(length(hl), 1e-4)));\n  float aniso = (pow(al, 900.0) * 4.5 + pow(al, 60.0) * 0.35) * exp(-slope * slope / 0.5);\n  vec3 H2 = normalize(normalize(KEY2) + V);\n  vec2 hl2 = vec2(dot(H2, uSU[k]), dot(H2, uSV[k]));\n  float slope2 = length(hl2) / max(dot(H2, n), 1e-3);\n  float al2 = abs(dot(rad, hl2 / max(length(hl2), 1e-4)));\n  float aniso2 = (pow(al2, 500.0) * 1.6 + pow(al2, 40.0) * 0.12) * exp(-slope2 * slope2 / 0.5);\n  float ndl = max(dot(n, uL), 0.0);\n  vec3 col = vec3(0.011, 0.010, 0.010) * (SUN * lit + AMB * ao);\n  float F = 0.045 + 0.955 * pow(1.0 - max(dot(n, V), 0.0), 5.0);\n  vec3 R = reflect(-V, n);\n  col += room(R, mix(0.35, 0.02, smoothBand)) * F * mix(0.8, 1.15, smoothBand);\n  col += SUN * (lit / max(ndl, 0.05)) * ndl * aniso * grooveTex * (1.0 - smoothBand * 0.8) * 0.9;\n  col += vec3(1.0, 0.96, 0.9) * aniso2 * grooveTex * ao * (1.0 - smoothBand) * 0.9;\n  // a bevelled rim, and a little dust\n  col += room(R, 0.2) * 0.25 * smoothstep(DR - 0.0018, DR - 0.0003, r);\n  float dust = step(0.9992, hash(floor(p * 1600.0) + float(k) * 13.0));\n  col += vec3(0.5, 0.48, 0.45) * dust * (SUN * lit * 0.12 + AMB * 0.4);\n  return col;\n}\n\nvec3 tonemap(vec3 x) { x *= 0.72; return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); }\n\nvoid main() {\n  Lu = normalize(cross(uL, vec3(0.0, 1.0, 0.0)));\n  Lv = cross(Lu, uL);\n  vec3 acc = vec3(0.0);\n  float depth = 0.0;\n  int ss = uSS;\n  vec2 offs[4] = vec2[4](vec2(0.375, 0.125), vec2(0.875, 0.375), vec2(0.125, 0.625), vec2(0.625, 0.875));\n  int cnt = ss > 1 ? 4 : 1;\n  for (int s = 0; s < 4; s++) {\n    if (s >= cnt) break;\n    vec2 off = cnt == 1 ? vec2(0.5) : offs[s];\n    vec2 uv = (gl_FragCoord.xy - 0.5 + off) / uRes * 2.0 - 1.0;\n    vec3 rd = normalize(uFw + uRt * uv.x * uTan * uAspect + uUp * uv.y * uTan);\n    int m, k; vec3 n, lp;\n    float t = trace(uCam, rd, m, n, lp, k);\n    vec3 P = uCam + rd * t, V = -rd;\n    float seed = ign(gl_FragCoord.xy + vec2(float(s) * 17.0, float(s) * 5.0));\n    vec3 col;\n    if (m == 0) col = shadeWall(P, seed);\n    else if (m == 1) col = shadeShelf(P, lp, n, V, seed);\n    else if (m == 2) col = shadeSleeve(P, lp, n, k, V, seed);\n    else if (m == 3) col = shadeDisc(P, lp, n, k, V, seed);\n    else col = vec3(0.5);\n    acc += tonemap(col);\n    depth += dot(P - uCam, uFw);\n  }\n  acc /= float(cnt);\n  depth /= float(cnt);\n  float coc = clamp(uAperture * (1.0 - uFocus / max(depth, 0.05)), -1.0, 1.0);\n  o = vec4(pow(acc, vec3(1.0 / 2.2)), 0.5 + 0.5 * coc);\n}`;\n\nconst VS_FULL = `#version 300 es\nvoid main() { vec2 p = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2)); gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0); }`;\n\n// Lens and film: a small depth-of-field gather, a warm glow round the brightest highlights, vignette and grain.\nconst FS_OUT = `#version 300 es\nprecision highp float;\nuniform sampler2D uScene;\nuniform vec2 uPx;\nuniform float uMaxR, uTime;\nout vec4 o;\nfloat ign(vec2 p) { return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715)))); }\nvoid main() {\n  vec2 uv = gl_FragCoord.xy * uPx;\n  vec4 c0 = texture(uScene, uv);\n  float coc = abs(c0.a * 2.0 - 1.0);\n  vec3 acc = c0.rgb; float w = 1.0; vec3 glow = vec3(0.0);\n  float rot = 6.2832 * ign(gl_FragCoord.xy);\n  for (int k = 1; k < 16; k++) {\n    float r = sqrt(float(k) / 15.0);\n    float a = float(k) * 2.39996 + rot;\n    vec2 d = vec2(cos(a), sin(a)) * r;\n    vec4 s = texture(uScene, uv + d * coc * uMaxR * uPx);\n    float ws = smoothstep(0.0, 0.15, abs(s.a * 2.0 - 1.0) + 0.05);\n    acc += s.rgb * ws; w += ws;\n    vec3 g = texture(uScene, uv + d * uMaxR * 2.2 * uPx).rgb;\n    glow += max(g - 0.82, 0.0);\n  }\n  vec3 col = acc / w + glow * vec3(1.0, 0.8, 0.6) * 0.09;\n  vec2 q = uv - 0.5;\n  col *= 1.0 - 0.38 * dot(q, q);\n  col += (ign(gl_FragCoord.xy + fract(uTime) * 61.0) - 0.5) * 0.024;\n  o = vec4(col, 1.0);\n}`;\n\nfunction program(gl: WebGL2RenderingContext, vs: string, fs: string) {\n  const p = gl.createProgram()!;\n  for (const [type, src] of [[gl.VERTEX_SHADER, vs], [gl.FRAGMENT_SHADER, fs]] as const) {\n    const s = gl.createShader(type)!;\n    gl.shaderSource(s, src);\n    gl.compileShader(s);\n    if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s) || \"shader\");\n    gl.attachShader(p, s);\n  }\n  gl.linkProgram(p);\n  if (!gl.getProgramParameter(p, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(p) || \"link\");\n  return p;\n}\n\ntype Rec = (typeof records)[number];\n\n/** The printed front of a sleeve: the photo, cropped square, with the speaker's name set small in the corner. */\nfunction paintCover(ctx: CanvasRenderingContext2D, r: Rec, img: HTMLImageElement | null) {\n  ctx.fillStyle = r.tone;\n  ctx.fillRect(0, 0, TEX, TEX);\n  if (img) {\n    const s = Math.max(TEX / img.naturalWidth, TEX / img.naturalHeight);\n    const w = img.naturalWidth * s, h = img.naturalHeight * s;\n    ctx.drawImage(img, (TEX - w) / 2, (TEX - h) / 2, w, h);\n  }\n  ctx.fillStyle = \"rgba(255, 250, 240, 0.92)\";\n  ctx.font = `600 22px ${GROTESK}`;\n  ctx.textBaseline = \"alphabetic\";\n  ctx.textAlign = \"left\";\n  const name = r.name.toUpperCase().split(\"\").join(String.fromCharCode(8202));\n  ctx.fillText(name, 40, TEX - 44);\n  ctx.textAlign = \"right\";\n  ctx.font = `italic 24px ${SERIF}`;\n  ctx.fillText(\"Side A\", TEX - 40, TEX - 44);\n}\n\n/** The paper label: a flat colour, the name, a rim line and the centre hole marking. */\nfunction paintLabel(ctx: CanvasRenderingContext2D, r: Rec, index: number) {\n  ctx.fillStyle = \"#111\";\n  ctx.fillRect(0, 0, TEX, TEX);\n  const c = TEX / 2;\n  ctx.fillStyle = r.label;\n  ctx.beginPath();\n  ctx.arc(c, c, c - 2, 0, Math.PI * 2);\n  ctx.fill();\n  const ink = r.label === \"#e2c98f\" ? \"#2b1a10\" : \"#1d120b\";\n  ctx.strokeStyle = ink;\n  ctx.globalAlpha = 0.55;\n  ctx.lineWidth = 3;\n  ctx.beginPath();\n  ctx.arc(c, c, c - 40, 0, Math.PI * 2);\n  ctx.stroke();\n  ctx.globalAlpha = 1;\n  ctx.fillStyle = ink;\n  ctx.textAlign = \"center\";\n  ctx.textBaseline = \"middle\";\n  ctx.font = `italic 64px ${SERIF}`;\n  ctx.fillText(r.name.split(\" \")[0], c, c - 150);\n  ctx.font = `600 26px ${GROTESK}`;\n  ctx.fillText(r.name.split(\" \").slice(1).join(\" \").toUpperCase(), c, c - 92);\n  ctx.font = `600 22px ${GROTESK}`;\n  ctx.fillText(`33 RPM   ·   No. ${index + 1}`, c, c + 120);\n  ctx.font = `20px ${GROTESK}`;\n  ctx.fillText(r.role, c, c + 170);\n  ctx.fillStyle = \"rgba(0,0,0,0.25)\";\n  ctx.beginPath();\n  ctx.arc(c, c, 34, 0, Math.PI * 2);\n  ctx.fill();\n}\n\ntype Sim = {\n  index: number; queued: number; outAt: number; textIn: boolean;\n  out: number[]; outV: number[]; tip: number[]; tipV: number[]; spin: number[];\n  px: number; py: number; cx: number; cy: number;\n  paused: boolean; nextAuto: number; dirty: boolean; narrow: boolean;\n};\n\nfunction QuoteBody({ r, narrow }: { r: Rec; narrow: boolean }) {\n  return (\n    <figure className=\"m-0\" style={{ color: INK }}>\n      <p className=\"flex items-center gap-3 font-semibold uppercase\" style={{ fontFamily: GROTESK, fontSize: narrow ? 10.5 : 12, letterSpacing: \"0.26em\" }}>\n        <span aria-hidden=\"true\" className=\"inline-block h-px w-8 bg-current\" />\n        {KICKER}\n      </p>\n      <blockquote className=\"relative m-0 mt-5\" style={{ fontFamily: SERIF, fontSize: narrow ? 36 : 60, lineHeight: 1.0, letterSpacing: \"-0.035em\", fontWeight: 500, textWrap: \"balance\" } as React.CSSProperties}>\n        <span aria-hidden=\"true\" className=\"absolute\" style={{ transform: \"translateX(-0.46em)\" }}>\n          “\n        </span>\n        {r.quote}”\n      </blockquote>\n      <figcaption className={narrow ? \"mt-5\" : \"mt-9\"} style={{ fontFamily: GROTESK }}>\n        <span className=\"block font-semibold\" style={{ fontSize: narrow ? 15 : 19, letterSpacing: \"-0.01em\" }}>\n          {r.name}\n        </span>\n        <span className=\"mt-1 block font-medium uppercase\" style={{ fontSize: narrow ? 10 : 11.5, letterSpacing: \"0.2em\" }}>\n          {r.role}\n        </span>\n      </figcaption>\n    </figure>\n  );\n}\n\nexport default function RecordSleeveTestimonials() {\n  const reduce = useReducedMotion();\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const hitRefs = useRef<(HTMLButtonElement | null)[]>([]);\n  const [shown, setShown] = useState(0);\n  const [ink, setInk] = useState(true);\n  const [narrow, setNarrow] = useState(false);\n  const [mode, setMode] = useState<\"pending\" | \"gl\" | \"still\">(\"pending\");\n  const sim = useRef<Sim>({\n    index: 0, queued: -1, outAt: 0, textIn: true,\n    out: [1, 0, 0], outV: [0, 0, 0], tip: [0, 0, 0], tipV: [0, 0, 0], spin: [0.4, 1.9, 4.2],\n    px: 0, py: 0, cx: 0, cy: 0, paused: false, nextAuto: 0, dirty: true, narrow: false,\n  });\n\n  const pick = useCallback((i: number) => {\n    const s = sim.current;\n    s.nextAuto = performance.now() + HOLD_MS * 1.5;\n    s.dirty = true;\n    if (i === s.index) return;\n    s.queued = mod(i, N);\n    if (mode === \"still\") {\n      s.index = s.queued;\n      s.queued = -1;\n      setShown(s.index);\n    }\n  }, [mode]);\n\n  useEffect(() => {\n    const wrap = wrapRef.current;\n    if (!wrap) return;\n    const measure = () => {\n      const isNarrow = wrap.clientWidth / wrap.clientHeight < 1.1;\n      sim.current.narrow = isNarrow;\n      sim.current.dirty = true;\n      setNarrow(isNarrow);\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(wrap);\n    return () => ro.disconnect();\n  }, []);\n\n  useEffect(() => {\n    const wrap = wrapRef.current;\n    const canvas = canvasRef.current;\n    if (!wrap || !canvas) return;\n    const gl = canvas.getContext(\"webgl2\", { antialias: false, alpha: false, powerPreference: \"high-performance\" });\n    if (!gl) {\n      setMode(\"still\");\n      return;\n    }\n    const s = sim.current;\n    let prog: WebGLProgram, progOut: WebGLProgram;\n    try {\n      prog = program(gl, VS_FULL, FS);\n      progOut = program(gl, VS_FULL, FS_OUT);\n    } catch {\n      setMode(\"still\");\n      return;\n    }\n    setMode(\"gl\");\n\n    // covers in layers 0 to 2, disc labels in layers 3 to 5, all in sRGB\n    const tex = gl.createTexture();\n    gl.activeTexture(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D_ARRAY, tex);\n    gl.texStorage3D(gl.TEXTURE_2D_ARRAY, Math.floor(Math.log2(TEX)) + 1, gl.RGBA8, TEX, TEX, N * 2);\n    gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    const aniso = gl.getExtension(\"EXT_texture_filter_anisotropic\");\n    if (aniso) gl.texParameterf(gl.TEXTURE_2D_ARRAY, aniso.TEXTURE_MAX_ANISOTROPY_EXT, 8);\n    const scratch = document.createElement(\"canvas\");\n    scratch.width = TEX;\n    scratch.height = TEX;\n    const sctx = scratch.getContext(\"2d\")!;\n    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n    const upload = (layer: number) => {\n      gl.activeTexture(gl.TEXTURE0);\n      gl.bindTexture(gl.TEXTURE_2D_ARRAY, tex);\n      gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, layer, TEX, TEX, 1, gl.RGBA, gl.UNSIGNED_BYTE, scratch);\n      gl.generateMipmap(gl.TEXTURE_2D_ARRAY);\n      s.dirty = true;\n    };\n    let alive = true;\n    records.forEach((r, i) => {\n      paintLabel(sctx, r, i);\n      upload(N + i);\n      paintCover(sctx, r, null);\n      upload(i);\n      const img = new Image();\n      img.crossOrigin = \"anonymous\";\n      img.onload = () => {\n        if (!alive) return;\n        paintCover(sctx, r, img);\n        upload(i);\n      };\n      img.src = r.src;\n    });\n\n    const vao = gl.createVertexArray();\n    const sceneFbo = gl.createFramebuffer();\n    const sceneTex = gl.createTexture();\n    let W = 0, H = 0, cw = 1, ch = 1, scale = Math.min(window.devicePixelRatio || 1, 1.25), ss = 2;\n    const resize = () => {\n      cw = wrap.clientWidth;\n      ch = wrap.clientHeight;\n      let k = scale;\n      if (cw * ch * k * k > 1.5e6) k = Math.sqrt(1.5e6 / (cw * ch));\n      const w = Math.max(2, Math.round(cw * k)), h = Math.max(2, Math.round(ch * k));\n      s.dirty = true;\n      if (w === W && h === H) return;\n      W = w;\n      H = h;\n      canvas.width = W;\n      canvas.height = H;\n      gl.activeTexture(gl.TEXTURE1);\n      gl.bindTexture(gl.TEXTURE_2D, sceneTex);\n      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, W, H, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, sceneFbo);\n      gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, sceneTex, 0);\n    };\n    resize();\n    const ro = new ResizeObserver(resize);\n    ro.observe(wrap);\n\n    const locs = new Map<string, WebGLUniformLocation | null>();\n    const U = (p: WebGLProgram, n: string) => {\n      const key = (p === prog ? \"a\" : \"b\") + n;\n      if (!locs.has(key)) locs.set(key, gl.getUniformLocation(p, n));\n      return locs.get(key)!;\n    };\n    const sun = (() => {\n      const v = [-0.5, 0.62, 0.6];\n      const l = Math.hypot(v[0], v[1], v[2]);\n      return v.map((x) => x / l);\n    })();\n\n    /** Where each sleeve stands: its bottom back edge rests on the shelf, its top touches the wall. */\n    const pose = (i: number) => {\n      const lean = LEANS[i] + s.tip[i];\n      // with its record out, the sleeve slides forward on the shelf so the disc, not the sleeve, rests on the wall\n      const zb = Math.max(2 * HS * Math.sin(LEANS[i]), (HS + s.out[i] * SLIDE + 0.1505) * Math.sin(lean)) + 0.0015;\n      const cyw = Math.cos(YAWS[i]), syw = Math.sin(YAWS[i]);\n      const yaw = (v: number[]) => [v[0] * cyw + v[2] * syw, v[1], -v[0] * syw + v[2] * cyw];\n      const Uv = yaw([1, 0, 0]);\n      const Vv = yaw([0, Math.cos(lean), -Math.sin(lean)]);\n      const Nv = yaw([0, Math.sin(lean), Math.cos(lean)]);\n      const B = [XS[i], 0, zb];\n      const C = [0, 1, 2].map((a) => B[a] + Vv[a] * HS + Nv[a] * HT);\n      return { C, Uv, Vv, Nv };\n    };\n\n    const sc = new Float32Array(9), su = new Float32Array(9), sv = new Float32Array(9), sn = new Float32Array(9);\n    const lift = new Float32Array(3), spin = new Float32Array(3);\n\n    const draw = (t: number) => {\n      const aspect = cw / ch;\n      const needW = s.narrow ? 1.12 : 1.85;\n      const visW = Math.max(needW, (s.narrow ? 1.3 : 1.05) * aspect);\n      const visH = visW / aspect;\n      const shelfAt = s.narrow ? 0.8 : 0.84;\n      const ctrX = s.narrow ? 0 : -0.2 * visW;\n      const ctrY = (shelfAt - 0.5) * visH + 0.02;\n      const TAN = visH / 2 / CAM_Z;\n      const cam = [ctrX + s.cx * 0.12 + (reduce ? 0 : 0.02 * Math.sin(t * 0.23)), ctrY + 0.42 - s.cy * 0.06, CAM_Z];\n      let fw = [ctrX * 0.96 - cam[0], ctrY - cam[1], -cam[2]];\n      const fl = Math.hypot(fw[0], fw[1], fw[2]);\n      fw = fw.map((v) => v / fl);\n      let rt = [-fw[2], 0, fw[0]];\n      const rl = Math.hypot(rt[0], rt[2]);\n      rt = rt.map((v) => v / rl);\n      const up = [rt[1] * fw[2] - rt[2] * fw[1], rt[2] * fw[0] - rt[0] * fw[2], rt[0] * fw[1] - rt[1] * fw[0]];\n\n      const proj = (p: number[]) => {\n        const d = [p[0] - cam[0], p[1] - cam[1], p[2] - cam[2]];\n        const xv = d[0] * rt[0] + d[1] * rt[1] + d[2] * rt[2], yv = d[0] * up[0] + d[1] * up[1] + d[2] * up[2], zv = d[0] * fw[0] + d[1] * fw[1] + d[2] * fw[2];\n        return [cw * 0.5 * (1 + xv / (TAN * aspect * zv)), ch * 0.5 * (1 - yv / (TAN * zv))];\n      };\n      for (let i = 0; i < N; i++) {\n        const p = pose(i);\n        sc.set(p.C, i * 3);\n        su.set(p.Uv, i * 3);\n        sv.set(p.Vv, i * 3);\n        sn.set(p.Nv, i * 3);\n        lift[i] = s.out[i] * SLIDE;\n        spin[i] = s.spin[i];\n        // a clickable box over each sleeve and the part of its record that shows\n        const btn = hitRefs.current[i];\n        if (btn) {\n          const top = HS + lift[i] + (lift[i] > 0.01 ? HS * 0.95 : 0);\n          const corners = [[-HS, -HS], [HS, -HS], [HS, top], [-HS, top]].map(([x, y]) => proj([0, 1, 2].map((a) => p.C[a] + p.Uv[a] * x + p.Vv[a] * y)));\n          const xs = corners.map((c) => c[0]), ys = corners.map((c) => c[1]);\n          const l = Math.min(...xs), tp = Math.min(...ys);\n          btn.style.transform = `translate(${l}px, ${tp}px)`;\n          btn.style.width = `${Math.max(...xs) - l}px`;\n          btn.style.height = `${Math.max(...ys) - tp}px`;\n        }\n      }\n      const sel = pose(s.index);\n      const focusD = (sel.C[0] - cam[0]) * fw[0] + (sel.C[1] + 0.08 - cam[1]) * fw[1] + (sel.C[2] - cam[2]) * fw[2];\n\n      gl.bindFramebuffer(gl.FRAMEBUFFER, sceneFbo);\n      gl.viewport(0, 0, W, H);\n      gl.useProgram(prog);\n      gl.uniform3fv(U(prog, \"uCam\"), cam);\n      gl.uniform3fv(U(prog, \"uRt\"), rt);\n      gl.uniform3fv(U(prog, \"uUp\"), up);\n      gl.uniform3fv(U(prog, \"uFw\"), fw);\n      gl.uniform1f(U(prog, \"uTan\"), TAN);\n      gl.uniform1f(U(prog, \"uAspect\"), W / H);\n      gl.uniform2f(U(prog, \"uRes\"), W, H);\n      gl.uniform1i(U(prog, \"uSS\"), ss);\n      gl.uniform3fv(U(prog, \"uSC[0]\"), sc);\n      gl.uniform3fv(U(prog, \"uSU[0]\"), su);\n      gl.uniform3fv(U(prog, \"uSV[0]\"), sv);\n      gl.uniform3fv(U(prog, \"uSN[0]\"), sn);\n      gl.uniform1fv(U(prog, \"uLift[0]\"), lift);\n      gl.uniform1fv(U(prog, \"uSpin[0]\"), spin);\n      gl.uniform3fv(U(prog, \"uL\"), sun);\n      gl.uniform4fv(U(prog, \"uWin\"), s.narrow ? [0.06, 0.5, 0.85, 1.05] : [0.18, 0.08, 1.15, 0.62]);\n      gl.uniform1f(U(prog, \"uFocus\"), focusD);\n      gl.uniform1f(U(prog, \"uAperture\"), 1.1);\n      gl.uniform1i(U(prog, \"uTex\"), 0);\n      gl.bindVertexArray(vao);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n      gl.useProgram(progOut);\n      gl.uniform1i(U(progOut, \"uScene\"), 1);\n      gl.uniform2f(U(progOut, \"uPx\"), 1 / W, 1 / H);\n      gl.uniform1f(U(progOut, \"uMaxR\"), H * 0.012);\n      gl.uniform1f(U(progOut, \"uTime\"), reduce ? 0 : t);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n    };\n\n    /** One small step: discs slide on springs and stop against the sleeve bottom, sleeves rock off the wall and fall back. */\n    const physics = (dt: number, now: number) => {\n      if (s.queued >= 0 && s.out[s.index] < 0.6) {\n        s.index = s.queued;\n        s.queued = -1;\n        s.outAt = now + 160;\n        s.tipV[s.index] -= TIP_KICK;\n      }\n      for (let i = 0; i < N; i++) {\n        const goal = i === s.index && s.queued < 0 && now > s.outAt ? 1 : 0;\n        const before = s.out[i];\n        s.outV[i] += (SLIDE_PULL * (goal - s.out[i]) - SLIDE_DRAG * s.outV[i]) * dt;\n        s.out[i] += s.outV[i] * dt;\n        if (s.out[i] < 0) {\n          s.out[i] = 0;\n          if (s.outV[i] < -0.4) s.tipV[i] -= s.outV[i] * 0.08;\n          s.outV[i] *= -0.18;\n        }\n        s.spin[i] += (s.out[i] - before) * 1.6;\n        // gravity pulls the sleeve back toward the wall; it cannot pass through it\n        s.tipV[i] += 2.6 * dt;\n        s.tip[i] += s.tipV[i] * dt;\n        if (s.tip[i] > 0) {\n          s.tip[i] = 0;\n          s.tipV[i] = s.tipV[i] > 0.12 ? -s.tipV[i] * 0.32 : 0;\n        }\n        s.tip[i] = Math.max(s.tip[i], -0.09);\n      }\n      const now_out = s.out[s.index];\n      if (s.queued >= 0 && s.textIn) {\n        s.textIn = false;\n        setInk(false);\n      }\n      if (!s.textIn && s.queued < 0 && now_out > 0.45) {\n        s.textIn = true;\n        setShown(s.index);\n        setInk(true);\n      }\n    };\n\n    let raf = 0, visible = true, last = performance.now(), slow = 0, frames = 0;\n    s.nextAuto = last + HOLD_MS;\n    const tick = (now: number) => {\n      const real = now - last;\n      const dt = Math.min(0.05, real / 1000);\n      last = now;\n      if (!s.paused && !document.hidden && now > s.nextAuto && s.queued < 0) {\n        s.queued = mod(s.index + 1, N);\n        s.nextAuto = now + HOLD_MS;\n      }\n      if (reduce) {\n        if (s.queued >= 0) {\n          s.index = s.queued;\n          s.queued = -1;\n          setShown(s.index);\n          setInk(true);\n          s.dirty = true;\n        }\n        for (let i = 0; i < N; i++) {\n          s.out[i] = i === s.index ? 1 : 0;\n          s.tip[i] = 0;\n        }\n      } else {\n        const sub = Math.max(1, Math.ceil(dt / 0.004));\n        for (let i = 0; i < sub; i++) physics(dt / sub, now);\n        s.cx += (s.px - s.cx) * Math.min(1, dt * 3);\n        s.cy += (s.py - s.cy) * Math.min(1, dt * 3);\n      }\n      if (!reduce || s.dirty) {\n        draw(now / 1000);\n        s.dirty = false;\n        // measure, do not guess: drop the supersampling first, then the resolution, if frames run long\n        if (!reduce && ++frames > 24) {\n          slow = slow * 0.9 + (real > 22 ? 1 : 0) * 0.1;\n          if (slow > 0.6) {\n            if (ss > 1) ss = 1;\n            else if (scale > 0.55) {\n              scale *= 0.85;\n              resize();\n            }\n            slow = 0;\n            frames = 0;\n          }\n        }\n      }\n      if (visible) raf = requestAnimationFrame(tick);\n    };\n    const io = new IntersectionObserver(([e]) => {\n      const was = visible;\n      visible = e.isIntersecting;\n      if (visible && !was) {\n        last = performance.now();\n        frames = 0;\n        raf = requestAnimationFrame(tick);\n      }\n    });\n    io.observe(wrap);\n    raf = requestAnimationFrame(tick);\n\n    const move = (e: PointerEvent) => {\n      const r = wrap.getBoundingClientRect();\n      s.px = clamp(((e.clientX - r.left) / r.width) * 2 - 1, -1, 1);\n      s.py = clamp(((e.clientY - r.top) / r.height) * 2 - 1, -1, 1);\n      s.dirty = true;\n    };\n    const leave = () => {\n      s.px = 0;\n      s.py = 0;\n    };\n    wrap.addEventListener(\"pointermove\", move);\n    wrap.addEventListener(\"pointerleave\", leave);\n\n    return () => {\n      alive = false;\n      cancelAnimationFrame(raf);\n      ro.disconnect();\n      io.disconnect();\n      wrap.removeEventListener(\"pointermove\", move);\n      wrap.removeEventListener(\"pointerleave\", leave);\n      gl.getExtension(\"WEBGL_lose_context\")?.loseContext();\n    };\n  }, [reduce]);\n\n  const onKey = (e: React.KeyboardEvent) => {\n    const s = sim.current;\n    const cur = s.queued >= 0 ? s.queued : s.index;\n    if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") {\n      e.preventDefault();\n      pick(cur + 1);\n    } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") {\n      e.preventDefault();\n      pick(cur - 1);\n    }\n  };\n  const pause = (v: boolean) => () => {\n    sim.current.paused = v;\n    if (!v) sim.current.nextAuto = performance.now() + HOLD_MS;\n  };\n  const r = records[shown];\n  const label = \"text-[10px] font-semibold uppercase tracking-[0.26em] sm:text-[11px]\";\n\n  return (\n    <section className=\"relative overflow-hidden bg-[#c9b394]\" onFocus={pause(true)} onBlur={pause(false)} onPointerEnter={pause(true)} onPointerLeave={pause(false)}>\n      <style>{`@keyframes vinyl-sleeve-testimonials-ink { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } } .vinyl-sleeve-testimonials-ink { animation: vinyl-sleeve-testimonials-ink 680ms cubic-bezier(0.2, 0.7, 0.2, 1) both; } @media (prefers-reduced-motion: reduce) { .vinyl-sleeve-testimonials-ink { animation: none; } }`}</style>\n      <div\n        ref={wrapRef}\n        role=\"group\"\n        aria-roledescription=\"carousel\"\n        aria-label=\"Client testimonials shown as three record sleeves on a sunlit shelf. Choose a sleeve, or use the left and right arrow keys, to pull out that person's record and read their quote.\"\n        tabIndex={0}\n        onKeyDown={onKey}\n        className=\"relative h-[740px] w-full select-none outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[#2b1a10]/70 sm:h-[760px]\"\n      >\n        <canvas ref={canvasRef} aria-hidden=\"true\" className={`absolute inset-0 h-full w-full ${mode === \"still\" ? \"hidden\" : \"\"}`} />\n\n        {/* the still room, for browsers without WebGL 2 */}\n        {mode === \"still\" && (\n          <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ background: \"linear-gradient(160deg, #d8c3a3 0%, #c4ab88 60%, #b39874 100%)\" }}>\n            <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(118deg, transparent 30%, rgba(255,226,180,0.55) 30.5%, rgba(255,226,180,0.55) 78%, transparent 78.5%)\" }} />\n            <div className=\"absolute inset-x-0 h-[4%]\" style={{ top: \"80%\", background: \"linear-gradient(180deg, #8a5a33, #5e3a1f)\", boxShadow: \"0 18px 30px -10px rgba(50,25,5,0.55)\" }} />\n            <div className=\"absolute flex items-end gap-[2.4%]\" style={{ left: narrow ? \"8%\" : \"46%\", right: narrow ? \"8%\" : \"6%\", bottom: \"20%\" }}>\n              {records.map((rec, i) => (\n                <div key={rec.name} className=\"relative aspect-square flex-1\" style={{ transform: `perspective(900px) rotateX(${LEANS[i] * 57}deg)`, transformOrigin: \"bottom\" }}>\n                  {i === shown && <div className=\"absolute inset-x-[2%] -top-[50%] aspect-square rounded-full\" style={{ background: \"repeating-radial-gradient(circle, #141414 0 2px, #1d1d1d 2px 3px)\", boxShadow: \"0 0 0 1px #000\" }}><div className=\"absolute inset-[33%] rounded-full\" style={{ background: rec.label }} /></div>}\n                  <img src={rec.src} alt=\"\" width={900} height={900} className=\"relative h-full w-full object-cover\" style={{ background: rec.tone, boxShadow: \"14px 16px 26px -8px rgba(60,30,5,0.5)\" }} />\n                </div>\n              ))}\n            </div>\n          </div>\n        )}\n\n        {/* the quote, printed onto the wall: real text, multiplied so the sun and shade show through */}\n        <div\n          aria-live=\"polite\"\n          className={`pointer-events-none absolute ${narrow ? \"inset-x-6 top-[11%]\" : \"left-[6%] top-[15%] w-[36%] max-w-[540px]\"}`}\n          style={{ mixBlendMode: mode === \"gl\" ? \"multiply\" : \"normal\" }}\n        >\n          <div className=\"transition-opacity duration-300 motion-reduce:transition-none\" style={{ opacity: ink ? 1 : 0 }}>\n            <div key={shown} className=\"vinyl-sleeve-testimonials-ink\">\n              <QuoteBody r={r} narrow={narrow} />\n              <span className=\"sr-only\">Record sleeve photo: {r.alt}</span>\n            </div>\n          </div>\n        </div>\n\n        {/* invisible buttons laid over each sleeve, kept in place by the render loop */}\n        {mode === \"gl\" &&\n          records.map((rec, i) => (\n            <button\n              key={rec.name}\n              ref={(el) => {\n                hitRefs.current[i] = el;\n              }}\n              type=\"button\"\n              onClick={() => pick(i)}\n              aria-label={`Pull out ${rec.name}'s record`}\n              aria-pressed={shown === i}\n              className=\"absolute left-0 top-0 cursor-pointer rounded-sm bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-[#fff3e2] focus-visible:ring-offset-2 focus-visible:ring-offset-[#2b1a10]\"\n              style={{ width: 0, height: 0 }}\n            />\n          ))}\n\n        <div className=\"pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-between gap-4 p-5 sm:p-9\">\n          <p className={`${label} rounded-full bg-[#fff3e2]/85 px-4 py-2.5`} style={{ fontFamily: GROTESK, color: INK }}>\n            <span className=\"tabular-nums\">{String(shown + 1).padStart(2, \"0\")}</span>\n            <span className=\"mx-2 opacity-50\">/</span>\n            <span className=\"tabular-nums\">{String(N).padStart(2, \"0\")}</span>\n          </p>\n          <div className=\"pointer-events-auto flex gap-2\">\n            {records.map((rec, i) => (\n              <button\n                key={rec.name}\n                type=\"button\"\n                onClick={() => pick(i)}\n                aria-label={`Show ${rec.name}`}\n                aria-current={shown === i ? \"true\" : undefined}\n                className=\"grid h-11 w-11 place-items-center rounded-full border border-[#2b1a10]/25 bg-[#fff3e2]/75 transition hover:bg-[#fff3e2] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#2b1a10]\"\n              >\n                <span aria-hidden=\"true\" className=\"block h-4 w-4 rounded-full\" style={{ background: shown === i ? \"#151110\" : \"transparent\", border: \"1.5px solid #2b1a10\", boxShadow: shown === i ? `inset 0 0 0 4px ${rec.label}` : \"none\" }} />\n              </button>\n            ))}\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}
