{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"fashion-print-carousel-in-webgl-with-standing-prints-that-rock-on-their-corners-over-a-mirror-floor","type":"registry:block","title":"Fashion Print Carousel in WebGL with Standing Prints That Rock on Their Corners over a Mirror Floor","description":"3D carousel in raw WebGL: tall fashion prints stand on a polished floor with reflections and soft shadows, and rock when moved. Free React and HTML code.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/fashion-print-carousel-in-webgl-with-standing-prints-that-rock-on-their-corners-over-a-mirror-floor.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\n\n/** The prints, in the order they come round. `focus` is the crop centre (0 to 1), `tone` shows until the photo arrives. */\nconst plates = [\n  { title: \"Tulle, scarlet\", src: \"https://images.pexels.com/photos/31167809/pexels-photo-31167809.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman with dark lipstick wrapped in a cloud of red tulle against a black backdrop\", focus: [0.5, 0.36], tone: \"#7a0f14\" },\n  { title: \"Pleats on oxblood\", src: \"https://images.pexels.com/photos/31422879/pexels-photo-31422879.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman in profile wearing a pale pink pleated dress against a deep red backdrop\", focus: [0.5, 0.4], tone: \"#5a0a12\" },\n  { title: \"Lacquer and paper\", src: \"https://images.pexels.com/photos/33798257/pexels-photo-33798257.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman in a glossy red dress and long red gloves holding a crumpled red paper flag\", focus: [0.5, 0.42], tone: \"#a3121a\" },\n  { title: \"The black fan\", src: \"https://images.pexels.com/photos/36900256/pexels-photo-36900256.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman in a white top holding a large black fan in front of a red backdrop\", focus: [0.5, 0.42], tone: \"#6e1410\" },\n  { title: \"Suit, carmine\", src: \"https://images.pexels.com/photos/38887203/pexels-photo-38887203.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman in a red trouser suit standing against a matching dark red backdrop\", focus: [0.5, 0.4], tone: \"#8a0f1c\" },\n  { title: \"Turn in crimson\", src: \"https://images.pexels.com/photos/31422870/pexels-photo-31422870.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman twirling in a red pleated dress on a red studio floor\", focus: [0.5, 0.5], tone: \"#6a0a14\" },\n  { title: \"Coat off the shoulder\", src: \"https://images.pexels.com/photos/21352928/pexels-photo-21352928.jpeg?auto=compress&cs=tinysrgb&w=900\", alt: \"Woman with a black coat slung over one shoulder against a hot pink and red backdrop\", focus: [0.5, 0.4], tone: \"#a80f3a\" },\n];\n\nconst N = plates.length;\nconst MASTHEAD = \"Rouge\"; // the wordmark in the top corner\nconst HOLD_MS = 3400; // rest between automatic turns\nconst SPRING = 34; // pull of the carriage toward the chosen print\nconst DAMPING = 7.6; // lower for more overshoot\nconst ROCK_GAIN = 0.072; // how hard a change of speed tips the prints\nconst TEX_W = 640;\nconst TEX_H = 904;\nconst SERIF = '\"Didot\", \"Bodoni 72\", \"Bodoni MT\", \"Playfair Display\", \"Libre Bodoni\", Georgia, serif';\nconst GROTESK = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, sans-serif';\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\n// Geometry of the set, in metres. A print is 1.06 wide and 1.5 tall and stands on its bottom edge.\nconst HX = 0.53;\nconst HY = 0.75;\nconst ALPHA = Math.atan(HX / HY); // lean at which a print would balance on one corner\nconst P2 = (3 * 9.81) / (4 * Math.hypot(HX, HY)); // rocking frequency squared of a slab this size\nconst RING = 3.4;\nconst STEP = 0.36;\n\nconst GLSL_HEAD = `#version 300 es\nprecision highp float;\nprecision highp sampler2DArray;\nconst int NP = 7;\nconst vec2 HS = vec2(${HX}, ${HY});\nconst float ZW = -3.7;\nconst vec3 LPOS = vec3(-2.7, 5.0, 5.6);\nconst vec3 LAIM = vec3(0.0, 0.7, 0.3);\nuniform vec3 uPc[7];\nuniform vec3 uPu[7];\nuniform vec3 uPv[7];\nuniform float uPl[7];\nuniform float uPk[7];\nuniform sampler2DArray uTex;\nuniform vec3 uCam, uRt, uUp, uFw;\nuniform float uTan, uAspect, uFocus, uAperture, uTime;\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.1 + 7.3) + 0.125 * vnoise(p * 4.3 + 1.7) + 0.0625 * vnoise(p * 8.9); }\n\nbool hitPanel(int i, vec3 ro, vec3 rd, out float t, out vec2 ab) {\n  vec3 n = cross(uPu[i], uPv[i]);\n  float d = dot(rd, n);\n  if (abs(d) < 1e-5) return false;\n  t = dot(uPc[i] - ro, n) / d;\n  if (t <= 1e-3) return false;\n  vec3 p = ro + rd * t - uPc[i];\n  ab = vec2(dot(p, uPu[i]), dot(p, uPv[i]));\n  return abs(ab.x) < HS.x && abs(ab.y) < HS.y;\n}\n\n// The key light: one big softbox high on the left, aimed at the middle print, falling off to the sides.\nvec3 keyAt(vec3 P, out vec3 l) {\n  vec3 d = LPOS - P;\n  float r2 = dot(d, d);\n  l = d * inversesqrt(r2);\n  float spot = smoothstep(0.86, 0.985, dot(-l, normalize(LAIM - LPOS)));\n  return vec3(1.0, 0.955, 0.9) * (72.0 * (0.1 + 0.9 * spot) / r2);\n}\nfloat keyVis(vec3 P, int skip, float seed) {\n  vec3 fw = normalize(LAIM - LPOS);\n  vec3 lt = normalize(cross(fw, vec3(0, 1, 0)));\n  vec3 lb = cross(lt, fw);\n  float v = 0.0;\n  for (int k = 0; k < 4; k++) {\n    float a = 6.2832 * fract(seed + float(k) * 0.618034);\n    float r = sqrt((float(k) + 0.5) / 4.0) * 0.85;\n    vec3 d = LPOS + (lt * cos(a) + lb * sin(a)) * r - P;\n    float occ = 0.0; float t; vec2 ab;\n    for (int i = 0; i < NP; i++) {\n      if (i == skip) continue;\n      if (hitPanel(i, P, d, t, ab) && t < 1.0) { occ = 1.0; break; }\n    }\n    v += 1.0 - occ;\n  }\n  return v / 4.0;\n}\n\n// What a mirror sees when it looks away from the wall: two softboxes behind and above the camera.\nvec3 studio(vec3 ro, vec3 rd) {\n  vec3 c = vec3(0.012, 0.01, 0.01);\n  if (rd.z > 0.0) {\n    // tall strip lights either side of the camera: they only show in a print that is turned toward them\n    float side = smoothstep(0.5, 0.62, abs(rd.x)) * smoothstep(0.96, 0.86, abs(rd.x));\n    float high = smoothstep(0.215, 0.25, rd.y) * smoothstep(0.7, 0.5, rd.y);\n    c += vec3(1.0, 0.95, 0.9) * 2.4 * side * high;\n  }\n  if (rd.y > 1e-4) {\n    vec3 p = ro + rd * ((6.5 - ro.y) / rd.y);\n    float m = smoothstep(-2.6, -1.8, p.x) * smoothstep(2.6, 1.8, p.x) * smoothstep(0.5, 1.3, p.z) * smoothstep(5.0, 4.2, p.z);\n    c += vec3(1.0, 0.93, 0.86) * 3.0 * m;\n  }\n  return c;\n}\n\n// The back wall: charcoal plaster with one pool of light low behind the middle print.\nvec3 wallCol(vec3 ro, vec3 rd, float lod) {\n  if (rd.z > -1e-4) return studio(ro, rd);\n  vec3 W = ro + rd * ((ZW - ro.z) / rd.z);\n  if (W.y < 0.0) return vec3(0.0);\n  vec3 l; vec3 key = keyAt(W, l);\n  float grain = 0.9 + 0.2 * fbm(W.xy * 3.0);\n  vec3 alb = vec3(0.026, 0.021, 0.022) * grain;\n  vec2 wq = (W.xy - vec2(-0.15, 0.7)) / vec2(2.5, 1.25);\n  float wash = exp(-pow(dot(wq, wq), 0.8) * 1.15);\n  vec3 c = alb * (key * max(l.z, 0.0) * 0.5 + vec3(1.0, 0.93, 0.88) * wash * 8.5 + 0.03);\n  c += vec3(1.0, 0.86, 0.78) * exp(-W.y / 0.05) * 0.1 * wash;\n  return c * smoothstep(8.0, 3.0, abs(W.x));\n}\n\nvec3 faceLight(int i, vec3 P) {\n  vec3 l; vec3 key = keyAt(P, l);\n  return (key * max(dot(cross(uPu[i], uPv[i]), l), 0.0) + vec3(0.07, 0.06, 0.06)) * uPk[i];\n}\nvec3 tonemap(vec3 x) { x *= 0.92; return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); }\nvec4 pack(vec3 col, float depth) {\n  float coc = clamp(uAperture * (1.0 - uFocus / max(depth, 0.05)), -1.0, 1.0);\n  return vec4(pow(tonemap(col), vec3(1.0 / 2.2)), 0.5 + 0.5 * coc);\n}\n`;\n\nconst VS_FULL = `#version 300 es\nout vec2 vUv;\nvoid main() { vec2 p = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2)); vUv = p; gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0); }`;\n\nconst FS_SET = `${GLSL_HEAD}\nin vec2 vUv;\nout vec4 o;\nvoid main() {\n  vec2 ndc = vUv * 2.0 - 1.0;\n  vec3 rd = normalize(uFw + uRt * (ndc.x * uTan * uAspect) + uUp * (ndc.y * uTan));\n  float seed = ign(gl_FragCoord.xy);\n  float tw = (ZW - uCam.z) / rd.z;\n  float tf = rd.y < -1e-4 ? -uCam.y / rd.y : 1e9;\n  if (tf > tw) { o = pack(wallCol(uCam, rd, 0.0), dot(rd, uFw) * tw); return; }\n  vec3 P = uCam + rd * tf;\n\n  // polished resin floor: dark, slightly wavy, with smudges that change how sharp the mirror is\n  float smudge = fbm(P.xz * 1.7 + 3.1);\n  float rough = 0.006 + 0.042 * smudge * smudge + 0.012 * vnoise(P.xz * vec2(3.0, 41.0));\n  vec2 wav = vec2(vnoise(P.xz * 2.3 + 11.0), vnoise(P.xz * 2.3 + 37.0)) - 0.5;\n  vec3 n = normalize(vec3(wav.x * 0.012, 1.0, wav.y * 0.012));\n\n  // the brass rail the prints ride on, inlaid flush\n  float rr = abs(length(P.xz - vec2(0.0, -${RING})) - ${RING});\n  float rr2 = abs(length(P.xz - vec2(0.0, -${RING})) - ${RING + 0.92});\n  float rail = max(smoothstep(0.011, 0.007, rr), smoothstep(0.011, 0.007, rr2));\n  rough = mix(rough, 0.03, rail);\n\n  // glossy reflection: a handful of rays through the rough mirror, each one finding a print, the wall or the softboxes\n  vec3 refl = vec3(0.0);\n  float far = 0.0;\n  for (int k = 0; k < 6; k++) {\n    float a = 6.2832 * fract(seed + float(k) * 0.618034);\n    float r = sqrt((float(k) + 0.5) / 6.0);\n    vec3 nn = normalize(n + vec3(cos(a), 0.0, sin(a)) * r * rough);\n    vec3 R = reflect(rd, nn);\n    float best = 1e9; int bi = -1; vec2 bab = vec2(0.0); float t; vec2 ab;\n    for (int i = 0; i < NP; i++) if (hitPanel(i, P, R, t, ab) && t < best) { best = t; bi = i; bab = ab; }\n    if (bi >= 0) {\n      float lod = log2(1.0 + best * rough * 260.0);\n      vec3 alb = textureLod(uTex, vec3(bab / HS * 0.5 + 0.5, uPl[bi]), lod).rgb;\n      refl += alb * faceLight(bi, P + R * best);\n      far += best;\n    } else { refl += wallCol(P, R, 1.0 + rough * 60.0); far += (ZW - P.z) / min(R.z, -0.05); }\n  }\n  refl /= 6.0;\n  far /= 6.0;\n\n  // light on the floor itself: the key with soft shadows, plus colour bounced off the nearest prints\n  vec3 l; vec3 key = keyAt(P, l);\n  vec3 dif = key * max(l.y, 0.0) * keyVis(P + vec3(0.0, 0.002, 0.0), -1, seed);\n  float ao = 1.0;\n  for (int i = 0; i < NP; i++) {\n    vec3 np = cross(uPu[i], uPv[i]);\n    vec3 q = uPc[i] - uPv[i] * (HS.y * 0.45);\n    vec3 d = P - q; float r2 = dot(d, d); vec3 dn = d * inversesqrt(r2);\n    float ff = abs(dot(np, dn)) * max(-dn.y, 0.0) / (0.35 + r2);\n    vec3 bounce = textureLod(uTex, vec3(0.5, 0.3, uPl[i]), 7.0).rgb;\n    dif += bounce * faceLight(i, q) * ff * (dot(np, dn) > 0.0 ? 1.5 : 0.25);\n    vec3 b0 = uPc[i] - uPv[i] * HS.y;\n    float h = clamp(dot(P - b0, uPu[i]), -HS.x, HS.x);\n    float dl = length(P - (b0 + uPu[i] * h));\n    ao *= 1.0 - 0.8 * exp(-dl / 0.05);\n  }\n  vec3 alb = mix(vec3(0.07, 0.05, 0.05), vec3(0.5, 0.33, 0.14), rail);\n  float F0 = mix(0.11, 0.75, rail);\n  float F = F0 + (1.0 - F0) * pow(1.0 - clamp(dot(-rd, n), 0.0, 1.0), 5.0);\n  vec3 col = alb * dif * ao * (1.0 - F) + refl * mix(vec3(1.0), vec3(1.0, 0.78, 0.42), rail) * F * (0.55 + 0.45 * ao);\n  // a mirror image focuses at the distance of the thing mirrored, not of the glass\n  float mirror = clamp(F * 2.2, 0.0, 1.0) * (1.0 - smoothstep(0.02, 0.07, rough));\n  o = pack(col, dot(rd, uFw) * (tf + far * mirror));\n}`;\n\nconst VS_PRINT = `#version 300 es\nprecision highp float;\nlayout(location = 0) in vec3 aPos;\nlayout(location = 1) in vec3 aNor;\nuniform vec3 uC, uU, uV, uCam, uRt, uUp, uFw;\nuniform float uTan, uAspect;\nout vec3 vW; out vec3 vL; out vec3 vN;\nvoid main() {\n  vec3 n = cross(uU, uV);\n  vW = uC + uU * aPos.x + uV * aPos.y + n * aPos.z;\n  vL = aPos; vN = aNor;\n  vec3 d = vW - uCam;\n  float z = dot(d, uFw);\n  gl_Position = vec4(dot(d, uRt) / (uTan * uAspect), dot(d, uUp) / uTan, (z * 60.1 - 12.0) / 59.9, z);\n}`;\n\nconst FS_PRINT = `${GLSL_HEAD}\nuniform vec3 uC, uU, uV;\nuniform int uIdx;\nin vec3 vW; in vec3 vL; in vec3 vN;\nout vec4 o;\nvoid main() {\n  vec3 pn = cross(uU, uV);\n  vec3 N = normalize(uU * vN.x + uV * vN.y + pn * vN.z);\n  vec3 V = normalize(uCam - vW);\n  float seed = ign(gl_FragCoord.xy);\n  vec3 l; vec3 key = keyAt(vW, l);\n  float vis = keyVis(vW + N * 0.004, uIdx, seed);\n  float gain = uPk[uIdx];\n  vec3 col;\n  if (vN.z > 0.5) {\n    // the photograph under a gloss laminate\n    vec2 uv = vL.xy / HS * 0.5 + 0.5;\n    vec3 alb = texture(uTex, vec3(uv, uPl[uIdx])).rgb;\n    alb = pow(alb, vec3(1.06)) * 1.04;\n    float foot = smoothstep(0.0, 0.5, vW.y);\n    col = alb * (key * max(dot(N, l), 0.0) * (0.25 + 0.75 * vis) + vec3(0.07, 0.06, 0.06)) * (0.84 + 0.16 * foot);\n    float F = 0.04 + 0.96 * pow(1.0 - max(dot(N, V), 0.0), 5.0);\n    vec3 wob = vec3(vnoise(vL.xy * 5.0), vnoise(vL.xy * 5.0 + 9.0), 0.0) - 0.5;\n    col += studio(vW, reflect(-V, normalize(N + (uU * wob.x + uV * wob.y) * 0.02))) * F;\n    float e = min(HS.x - abs(vL.x), HS.y - abs(vL.y));\n    col += vec3(1.0, 0.96, 0.9) * smoothstep(0.006, 0.0, e) * (0.1 + 0.5 * max(dot(N, l), 0.0)) * key * 0.22;\n  } else if (vN.z < -0.5) {\n    col = vec3(0.02, 0.018, 0.018) * (key * max(dot(N, l), 0.0) * vis + 0.3);\n  } else {\n    // the edge: a milled aluminium core that catches the softboxes\n    float brush = 0.8 + 0.4 * vnoise(vec2(vL.z * 900.0, (vL.x + vL.y) * 6.0));\n    vec3 R = reflect(-V, N);\n    col = vec3(0.78, 0.76, 0.74) * brush * (studio(vW, R) * 0.6 + wallCol(vW, R, 4.0) * 0.5 + key * max(dot(N, l), 0.0) * vis * 0.16 + 0.03);\n  }\n  o = pack(col * gain, dot(vW - uCam, uFw));\n}`;\n\nconst FS_LENS = `#version 300 es\nprecision highp float;\nuniform sampler2D uScene;\nuniform vec2 uPx;\nuniform float uMaxR;\nin vec2 vUv;\nout vec4 o;\nfloat ign(vec2 p) { return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715)))); }\nvoid main() {\n  vec4 c0 = texture(uScene, vUv);\n  float coc0 = abs(c0.a * 2.0 - 1.0);\n  vec3 lin0 = pow(c0.rgb, vec3(2.2));\n  float w0 = 1.0 / (1.03 - max(lin0.r, max(lin0.g, lin0.b)));\n  vec3 acc = lin0 * w0; float wsum = w0; float spread = coc0;\n  float rot = 6.2832 * ign(gl_FragCoord.xy);\n  // 40 taps over the whole blur disc, then 14 more packed into the middle so slightly soft edges stay clean\n  for (int k = 1; k < 54; k++) {\n    float r = k < 40 ? sqrt(float(k) / 40.0) * uMaxR : sqrt(float(k - 39) / 14.0) * min(uMaxR, 3.2);\n    float a = float(k) * 2.39996 + rot;\n    vec4 s = texture(uScene, vUv + vec2(cos(a), sin(a)) * r * uPx);\n    float sc = s.a * 2.0 - 1.0;\n    float cs = abs(sc);\n    if (sc > c0.a * 2.0 - 1.0) cs = min(cs, coc0 * 1.6 + 0.02);\n    vec3 lin = pow(s.rgb, vec3(2.2));\n    float w = smoothstep(r - 1.0, r + 1.0, cs * uMaxR) / (1.03 - max(lin.r, max(lin.g, lin.b)));\n    acc += lin * w; wsum += w; spread = max(spread, cs * step(0.5, w * 0.03 + smoothstep(r - 1.0, r + 1.0, cs * uMaxR)));\n  }\n  o = vec4(pow(acc / wsum, vec3(1.0 / 2.2)), spread);\n}`;\n\nconst FS_PRINTOUT = `#version 300 es\nprecision highp float;\nuniform sampler2D uScene;\nuniform vec2 uPx;\nuniform float uTime;\nin vec2 vUv;\nout vec4 o;\nfloat ign(vec2 p) { return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715)))); }\nvoid main() {\n  // tidy the blur where the lens pass was sparse, then vignette and film grain\n  vec4 c = texture(uScene, vUv);\n  float r = clamp(c.a * 4.0, 0.0, 1.0) * 1.5;\n  vec3 col = c.rgb * 4.0;\n  for (int k = 0; k < 8; k++) {\n    float a = float(k) * 0.7854;\n    col += texture(uScene, vUv + vec2(cos(a), sin(a)) * r * (k % 2 == 0 ? 1.0 : 1.9) * uPx).rgb;\n  }\n  col /= 12.0;\n  vec2 q = vUv - 0.5;\n  col *= 1.0 - 0.9 * dot(q, q);\n  col += (ign(gl_FragCoord.xy + fract(uTime) * 61.0) - 0.5) * 0.026;\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\n/** A thin box: 36 vertices of position + normal, in print-local units. */\nfunction boxMesh() {\n  const T = 0.016;\n  const faces: [number[], number[], number[]][] = [\n    [[0, 0, 1], [1, 0, 0], [0, 1, 0]],\n    [[0, 0, -1], [-1, 0, 0], [0, 1, 0]],\n    [[1, 0, 0], [0, 0, -1], [0, 1, 0]],\n    [[-1, 0, 0], [0, 0, 1], [0, 1, 0]],\n    [[0, 1, 0], [1, 0, 0], [0, 0, -1]],\n    [[0, -1, 0], [1, 0, 0], [0, 0, 1]],\n  ];\n  const half = [HX, HY, T];\n  const out: number[] = [];\n  for (const [n, a, b] of faces) {\n    for (const [s, t] of [[-1, -1], [1, -1], [1, 1], [-1, -1], [1, 1], [-1, 1]]) {\n      for (let c = 0; c < 3; c++) out.push((n[c] + a[c] * s + b[c] * t) * half[c]);\n      out.push(n[0], n[1], n[2]);\n    }\n  }\n  return new Float32Array(out);\n}\n\n/** Crop a photo to the print's shape around its focus point. */\nfunction coverDraw(ctx: CanvasRenderingContext2D, img: HTMLImageElement, focus: number[]) {\n  const s = Math.max(TEX_W / img.naturalWidth, TEX_H / img.naturalHeight);\n  const w = img.naturalWidth * s;\n  const h = img.naturalHeight * s;\n  ctx.drawImage(img, clamp(TEX_W / 2 - focus[0] * w, TEX_W - w, 0), clamp(TEX_H / 2 - focus[1] * h, TEX_H - h, 0), w, h);\n}\n\ntype Sim = {\n  pos: number; vel: number; goal: number; acc: number; accF: number;\n  rock: Float32Array; rockV: Float32Array; hist: Float32Array; histAt: number;\n  dragging: boolean; lastX: number; lastT: number; paused: boolean; nextAuto: number;\n  px: number; py: number; cx: number; cy: number; pull: number; focus: number; active: number; dirty: boolean;\n};\n\nexport default function StandingPrintCarousel() {\n  const reduce = useReducedMotion();\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const [active, setActive] = useState(0);\n  const [mode, setMode] = useState<\"pending\" | \"gl\" | \"still\">(\"pending\");\n  const sim = useRef<Sim>({\n    pos: 0, vel: 0, goal: 0, acc: 0, accF: 0,\n    rock: new Float32Array(N), rockV: new Float32Array(N), hist: new Float32Array(64), histAt: 0,\n    dragging: false, lastX: 0, lastT: 0, paused: false, nextAuto: 0,\n    px: 0, py: 0, cx: 0, cy: 0, pull: 0, focus: 5, active: 0, dirty: true,\n  });\n\n  const step = useCallback((dir: number) => {\n    const s = sim.current;\n    s.goal = Math.round(s.goal) + dir;\n    s.nextAuto = performance.now() + HOLD_MS * 2;\n    s.dirty = true;\n    if (mode === \"still\") setActive(mod(s.goal, N));\n  }, [mode]);\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 progSet: WebGLProgram, progPrint: WebGLProgram, progLens: WebGLProgram, progOut: WebGLProgram;\n    try {\n      progSet = program(gl, VS_FULL, FS_SET);\n      progPrint = program(gl, VS_PRINT, FS_PRINT);\n      progLens = program(gl, VS_FULL, FS_LENS);\n      progOut = program(gl, VS_FULL, FS_PRINTOUT);\n    } catch {\n      setMode(\"still\");\n      return;\n    }\n    setMode(\"gl\");\n\n    // the photographs, one layer each of an sRGB array texture so the light maths is linear\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_H)) + 1, gl.SRGB8_ALPHA8, TEX_W, TEX_H, N);\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_W;\n    scratch.height = TEX_H;\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_W, TEX_H, 1, gl.RGBA, gl.UNSIGNED_BYTE, scratch);\n      gl.generateMipmap(gl.TEXTURE_2D_ARRAY);\n      s.dirty = true;\n    };\n    let alive = true;\n    plates.forEach((p, i) => {\n      const g = sctx.createLinearGradient(0, 0, 0, TEX_H);\n      g.addColorStop(0, p.tone);\n      g.addColorStop(1, \"#150406\");\n      sctx.fillStyle = g;\n      sctx.fillRect(0, 0, TEX_W, TEX_H);\n      upload(i);\n      const img = new Image();\n      img.crossOrigin = \"anonymous\";\n      img.onload = () => {\n        if (!alive) return;\n        coverDraw(sctx, img, p.focus);\n        upload(i);\n      };\n      img.src = p.src;\n    });\n\n    const vao = gl.createVertexArray();\n    gl.bindVertexArray(vao);\n    const vbo = gl.createBuffer();\n    gl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n    gl.bufferData(gl.ARRAY_BUFFER, boxMesh(), gl.STATIC_DRAW);\n    gl.enableVertexAttribArray(0);\n    gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 24, 0);\n    gl.enableVertexAttribArray(1);\n    gl.vertexAttribPointer(1, 3, gl.FLOAT, false, 24, 12);\n    gl.bindVertexArray(null);\n    const emptyVao = gl.createVertexArray();\n\n    // multisampled scene target, resolved into a texture the lens pass reads (colour + blur size in alpha)\n    const msFbo = gl.createFramebuffer();\n    const msColor = gl.createRenderbuffer();\n    const msDepth = gl.createRenderbuffer();\n    const resFbo = gl.createFramebuffer();\n    const resTex = gl.createTexture();\n    const lensFbo = gl.createFramebuffer();\n    const lensTex = gl.createTexture();\n    let W = 0, H = 0, scale = Math.min(window.devicePixelRatio || 1, 1.5);\n    const samples = Math.min(4, gl.getParameter(gl.MAX_SAMPLES));\n    const resize = () => {\n      const cw = wrap.clientWidth, 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      if (w === W && h === H) return;\n      W = w;\n      H = h;\n      canvas.width = W;\n      canvas.height = H;\n      gl.bindRenderbuffer(gl.RENDERBUFFER, msColor);\n      gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.RGBA8, W, H);\n      gl.bindRenderbuffer(gl.RENDERBUFFER, msDepth);\n      gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.DEPTH_COMPONENT16, W, H);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, msFbo);\n      gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, msColor);\n      gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, msDepth);\n      for (const [unit, t, f] of [[gl.TEXTURE2, resTex, resFbo], [gl.TEXTURE3, lensTex, lensFbo]] as const) {\n        gl.activeTexture(unit);\n        gl.bindTexture(gl.TEXTURE_2D, t);\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_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, f);\n        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, t, 0);\n      }\n      s.dirty = true;\n    };\n    resize();\n    const ro = new ResizeObserver(resize);\n    ro.observe(wrap);\n\n    const U = (p: WebGLProgram, n: string) => gl.getUniformLocation(p, n);\n    const pc = new Float32Array(21), pu = new Float32Array(21), pv = new Float32Array(21), pl = new Float32Array(7), pk = new Float32Array(7);\n    const TAN = Math.tan((19 * Math.PI) / 180);\n\n    const shared = (p: WebGLProgram, cam: number[], rt: number[], up: number[], fw: number[], t: number) => {\n      gl.useProgram(p);\n      gl.uniform3fv(U(p, \"uPc\"), pc);\n      gl.uniform3fv(U(p, \"uPu\"), pu);\n      gl.uniform3fv(U(p, \"uPv\"), pv);\n      gl.uniform1fv(U(p, \"uPl\"), pl);\n      gl.uniform1fv(U(p, \"uPk\"), pk);\n      gl.uniform1i(U(p, \"uTex\"), 0);\n      gl.uniform3fv(U(p, \"uCam\"), cam);\n      gl.uniform3fv(U(p, \"uRt\"), rt);\n      gl.uniform3fv(U(p, \"uUp\"), up);\n      gl.uniform3fv(U(p, \"uFw\"), fw);\n      gl.uniform1f(U(p, \"uTan\"), TAN);\n      gl.uniform1f(U(p, \"uAspect\"), W / H);\n      gl.uniform1f(U(p, \"uFocus\"), s.focus);\n      gl.uniform1f(U(p, \"uAperture\"), 1.35);\n      gl.uniform1f(U(p, \"uTime\"), t);\n    };\n\n    const draw = (t: number) => {\n      // where every print stands this frame\n      const base = Math.round(s.pos) - 3;\n      let hero = 0;\n      for (let i = 0; i < 7; i++) {\n        const k = base + i;\n        const u = k - s.pos;\n        const layer = mod(k, N);\n        const ang = u * STEP;\n        const lift = 0.42 * Math.exp(-u * u * 2.2);\n        if (Math.abs(u) <= 0.5) hero = lift;\n        const bx = RING * Math.sin(ang), bz = -RING * (1 - Math.cos(ang)) + lift;\n        const yaw = ang * 0.92;\n        const ux = Math.cos(yaw), uz = -Math.sin(yaw);\n        const th = s.rock[layer];\n        const c = Math.cos(th), sn = Math.sin(th);\n        // rotate in the print's own plane about whichever bottom corner is on the floor\n        const rux = ux * c, ruy = -sn, ruz = uz * c;\n        const rvx = ux * sn, rvy = c, rvz = uz * sn;\n        const side = th >= 0 ? 1 : -1;\n        const pxv = bx + ux * HX * side, pzv = bz + uz * HX * side;\n        pc[i * 3] = pxv - rux * HX * side + rvx * HY;\n        pc[i * 3 + 1] = -ruy * HX * side + rvy * HY + 0.0015;\n        pc[i * 3 + 2] = pzv - ruz * HX * side + rvz * HY;\n        pu.set([rux, ruy, ruz], i * 3);\n        pv.set([rvx, rvy, rvz], i * 3);\n        pl[i] = layer;\n        pk[i] = clamp((3.4 - Math.abs(u)) / 0.9, 0, 1);\n      }\n      // camera: low, drifting a little, leaning with the pointer\n      const aspect = W / H;\n      const camZ = Math.max(3.78, 0.42 + 0.74 / (TAN * aspect)) + s.pull;\n      const drift = reduce ? 0 : 1;\n      const cam = [-0.46 + s.cx * 0.7 + drift * 0.12 * Math.sin(t * 0.31), 0.46 - s.cy * 0.16 + drift * 0.03 * Math.sin(t * 0.23 + 1), camZ];\n      const tx = 0, ty = 0.71, tz = 0;\n      let fw = [tx - cam[0], ty - cam[1], tz - 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      const want = (hero - cam[2]) * fw[2] + (0.75 - cam[1]) * fw[1] + (0 - cam[0]) * fw[0];\n      s.focus = reduce ? want : s.focus + (want - s.focus) * 0.09;\n\n      gl.bindFramebuffer(gl.FRAMEBUFFER, msFbo);\n      gl.viewport(0, 0, W, H);\n      gl.disable(gl.DEPTH_TEST);\n      gl.depthMask(false);\n      shared(progSet, cam, rt, up, fw, t);\n      gl.bindVertexArray(emptyVao);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n      gl.enable(gl.DEPTH_TEST);\n      gl.depthMask(true);\n      gl.clear(gl.DEPTH_BUFFER_BIT);\n      shared(progPrint, cam, rt, up, fw, t);\n      gl.bindVertexArray(vao);\n      for (let i = 0; i < 7; i++) {\n        if (pk[i] <= 0) continue;\n        gl.uniform3f(U(progPrint, \"uC\"), pc[i * 3], pc[i * 3 + 1], pc[i * 3 + 2]);\n        gl.uniform3f(U(progPrint, \"uU\"), pu[i * 3], pu[i * 3 + 1], pu[i * 3 + 2]);\n        gl.uniform3f(U(progPrint, \"uV\"), pv[i * 3], pv[i * 3 + 1], pv[i * 3 + 2]);\n        gl.uniform1i(U(progPrint, \"uIdx\"), i);\n        gl.drawArrays(gl.TRIANGLES, 0, 36);\n      }\n      gl.bindFramebuffer(gl.READ_FRAMEBUFFER, msFbo);\n      gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, resFbo);\n      gl.blitFramebuffer(0, 0, W, H, 0, 0, W, H, gl.COLOR_BUFFER_BIT, gl.NEAREST);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, lensFbo);\n      gl.disable(gl.DEPTH_TEST);\n      gl.useProgram(progLens);\n      gl.uniform1i(U(progLens, \"uScene\"), 2);\n      gl.uniform2f(U(progLens, \"uPx\"), 1 / W, 1 / H);\n      gl.uniform1f(U(progLens, \"uMaxR\"), H * 0.012);\n      gl.bindVertexArray(emptyVao);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n      gl.useProgram(progOut);\n      gl.uniform1i(U(progOut, \"uScene\"), 3);\n      gl.uniform2f(U(progOut, \"uPx\"), 1 / W, 1 / H);\n      gl.uniform1f(U(progOut, \"uTime\"), reduce ? 0 : t);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n    };\n\n    /** One small step of the carriage and of every print rocking on its corners. */\n    const physics = (dt: number) => {\n      if (!s.dragging) {\n        s.acc = SPRING * (s.goal - s.pos) - DAMPING * s.vel;\n        s.vel += s.acc * dt;\n        s.pos += s.vel * dt;\n      } else s.acc *= Math.exp(-dt * 14);\n      s.accF += (s.acc - s.accF) * Math.min(1, dt / 0.08);\n      s.histAt = (s.histAt + 1) & 63;\n      s.hist[s.histAt] = s.accF;\n      for (let j = 0; j < N; j++) {\n        // prints further from the middle hear about the shove a moment later, so the rocking travels outward\n        let u = mod(j - s.pos + N / 2, N) - N / 2;\n        u = Math.min(Math.abs(u), 3);\n        const a = clamp(s.hist[(s.histAt - Math.round(u * 14) + 64) & 63] * ROCK_GAIN, -1.5, 1.5);\n        let th = s.rock[j], om = s.rockV[j];\n        if (th === 0 && om === 0) {\n          if (Math.abs(a) > Math.tan(ALPHA)) om = -Math.sign(a) * 1e-4;\n          else continue;\n        }\n        const sg = th > 0 || (th === 0 && om > 0) ? 1 : -1;\n        const lean = ALPHA - sg * th;\n        om += P2 * (-sg * Math.sin(lean) - a * Math.cos(lean)) * dt;\n        om -= om * 0.25 * dt;\n        let nx = th + om * dt;\n        if (Math.abs(nx) > ALPHA * 0.34) {\n          nx = Math.sign(nx) * ALPHA * 0.34;\n          om *= -0.2;\n        }\n        if (th !== 0 && nx * th <= 0) {\n          // the lifted corner lands: lose energy, and either pivot onto the other corner or stay down\n          om *= 0.82;\n          nx = 0;\n          if (Math.abs(om) < 0.1 && Math.abs(a) < Math.tan(ALPHA)) om = 0;\n        }\n        s.rock[j] = nx;\n        s.rockV[j] = om;\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 (reduce) {\n        if (s.pos !== s.goal) s.dirty = true;\n        s.pos = s.goal;\n        s.vel = 0;\n      } else {\n        const sub = Math.max(1, Math.ceil(dt / 0.004));\n        for (let i = 0; i < sub; i++) physics(dt / sub);\n        s.cx += (s.px - s.cx) * Math.min(1, dt * 3.2);\n        s.cy += (s.py - s.cy) * Math.min(1, dt * 3.2);\n        s.pull += (0.11 * Math.min(Math.abs(s.vel), 4) - s.pull) * Math.min(1, dt * 4);\n        if (!s.paused && !s.dragging && !document.hidden && now > s.nextAuto) {\n          s.goal = Math.round(s.goal) + 1;\n          s.nextAuto = now + HOLD_MS;\n        }\n      }\n      const a = mod(Math.round(s.pos), N);\n      if (a !== s.active) {\n        s.active = a;\n        setActive(a);\n      }\n      if (!reduce || s.dirty) {\n        draw(now / 1000);\n        s.dirty = false;\n        // measure, do not guess: if the machine cannot hold the frame rate, render fewer pixels\n        if (!reduce && ++frames > 20) {\n          slow = slow * 0.92 + (real > 24 ? 1 : 0) * 0.08;\n          if (slow > 0.6 && scale > 0.5) {\n            scale *= 0.85;\n            slow = 0;\n            frames = 0;\n            resize();\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 down = (e: PointerEvent) => {\n      if (e.button !== 0) return;\n      s.dragging = true;\n      s.lastX = e.clientX;\n      s.lastT = performance.now();\n      s.vel = 0;\n      canvas.setPointerCapture(e.pointerId);\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      if (!s.dragging) return;\n      const now = performance.now();\n      const dn = -(e.clientX - s.lastX) / (r.height * 0.46);\n      const dt = Math.max(4, now - s.lastT) / 1000;\n      const v = dn / dt;\n      s.acc = clamp((v - s.vel) / dt, -60, 60);\n      s.vel = s.vel * 0.5 + v * 0.5;\n      s.pos += dn;\n      s.lastX = e.clientX;\n      s.lastT = now;\n      s.dirty = true;\n    };\n    const up = () => {\n      if (!s.dragging) return;\n      s.dragging = false;\n      s.vel = clamp(s.vel, -9, 9);\n      s.goal = Math.round(s.pos + s.vel * 0.22);\n      s.nextAuto = performance.now() + HOLD_MS * 2;\n    };\n    const leave = () => {\n      s.px = 0;\n      s.py = 0;\n    };\n    canvas.addEventListener(\"pointerdown\", down);\n    wrap.addEventListener(\"pointermove\", move);\n    canvas.addEventListener(\"pointerup\", up);\n    canvas.addEventListener(\"pointercancel\", up);\n    wrap.addEventListener(\"pointerleave\", leave);\n\n    return () => {\n      alive = false;\n      cancelAnimationFrame(raf);\n      ro.disconnect();\n      io.disconnect();\n      canvas.removeEventListener(\"pointerdown\", down);\n      wrap.removeEventListener(\"pointermove\", move);\n      canvas.removeEventListener(\"pointerup\", up);\n      canvas.removeEventListener(\"pointercancel\", up);\n      wrap.removeEventListener(\"pointerleave\", leave);\n      gl.getExtension(\"WEBGL_lose_context\")?.loseContext();\n    };\n  }, [reduce]);\n\n  const onKey = (e: React.KeyboardEvent) => {\n    if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") {\n      e.preventDefault();\n      step(1);\n    } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") {\n      e.preventDefault();\n      step(-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 btn = \"grid h-11 w-11 place-items-center rounded-full border border-white/20 bg-black/30 text-white backdrop-blur-sm transition hover:bg-white/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white\";\n\n  return (\n    <section className=\"relative overflow-hidden bg-[#0b0405]\" onFocus={pause(true)} onBlur={pause(false)}>\n      <div\n        ref={wrapRef}\n        role=\"group\"\n        aria-roledescription=\"carousel\"\n        aria-label=\"Seven fashion prints standing on a mirror floor. Use the left and right arrow keys to bring the next print forward.\"\n        tabIndex={0}\n        onKeyDown={onKey}\n        className=\"relative h-[600px] w-full select-none outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-white/70 sm:h-[780px]\"\n      >\n        <canvas ref={canvasRef} aria-hidden=\"true\" className={`absolute inset-0 h-full w-full cursor-grab touch-pan-y active:cursor-grabbing ${mode === \"still\" ? \"hidden\" : \"\"}`} />\n\n        {/* the same set built from plain images, for browsers without WebGL 2 */}\n        {mode === \"still\" && (\n          <div className=\"absolute inset-0 overflow-hidden\" style={{ background: \"radial-gradient(60% 46% at 50% 62%, #5a5050 0%, #2a2525 45%, #0b0a0a 100%)\" }}>\n            <style>{`@keyframes standing-print-carousel-drift { from { transform: translateX(-10px); } to { transform: translateX(10px); } } .standing-print-carousel-drift { animation: standing-print-carousel-drift 7s ease-in-out infinite alternate; } @media (prefers-reduced-motion: reduce) { .standing-print-carousel-drift { animation: none; } }`}</style>\n            <div className=\"absolute inset-x-0 bottom-0 top-[76%]\" style={{ background: \"linear-gradient(180deg, #171313 0%, #0b0a0a 100%)\" }} />\n            <div className=\"standing-print-carousel-drift absolute left-1/2 top-[15%] h-[61%]\" style={{ perspective: \"1400px\" }}>\n              {[-2, -1, 1, 2, 0].map((u) => {\n                const p = plates[mod(active + u, N)];\n                const x = u * 88 - 50;\n                const tf = `translateX(${x}%) translateZ(${-Math.abs(u) * 130}px) rotateY(${u * 20}deg)`;\n                return (\n                  <div key={mod(active + u, N)} className=\"absolute left-0 top-0 h-full transition-transform duration-700 ease-out motion-reduce:transition-none\" style={{ aspectRatio: \"1060 / 1500\", transform: tf, transformStyle: \"preserve-3d\", filter: u ? `blur(${Math.abs(u) * 2.5}px) brightness(${1 - Math.abs(u) * 0.28})` : undefined }}>\n                    <img src={p.src} alt={u === 0 ? p.alt : \"\"} width={900} height={1274} className=\"h-full w-full object-cover shadow-[0_0_0_1px_rgba(255,255,255,0.12)]\" style={{ background: p.tone, objectPosition: `${p.focus[0] * 100}% ${p.focus[1] * 100}%` }} />\n                    <div aria-hidden=\"true\" className=\"absolute left-0 top-full h-full w-full\" style={{ transform: \"scaleY(-1)\", backgroundImage: `url(\"${p.src}\")`, backgroundSize: \"cover\", backgroundPosition: `${p.focus[0] * 100}% ${p.focus[1] * 100}%`, backgroundColor: p.tone, opacity: 0.42, filter: \"blur(3px)\", maskImage: \"linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0) 62%)\", WebkitMaskImage: \"linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0) 62%)\" }} />\n                  </div>\n                );\n              })}\n            </div>\n          </div>\n        )}\n\n        <div className=\"pointer-events-none absolute inset-x-0 top-0 flex items-baseline justify-between p-5 text-white sm:p-9\">\n          <p className=\"text-[26px] italic leading-none sm:text-[30px]\" style={{ fontFamily: SERIF, letterSpacing: \"-0.03em\" }}>\n            {MASTHEAD}\n          </p>\n          <p className=\"text-[10px] font-medium uppercase tracking-[0.28em] text-white/60 sm:text-[11px]\" style={{ fontFamily: GROTESK }}>\n            Drag<span className=\"hidden sm:inline\">, or use the arrow keys</span>\n          </p>\n        </div>\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 aria-live=\"polite\" className=\"text-white\">\n            <span className=\"block text-[11px] font-medium uppercase tracking-[0.28em] text-white/70\" style={{ fontFamily: GROTESK }}>\n              <span className=\"tabular-nums text-white\">{String(active + 1).padStart(2, \"0\")}</span>\n              <span className=\"mx-2 text-white/40\">/</span>\n              <span className=\"tabular-nums\">{String(N).padStart(2, \"0\")}</span>\n              <span className=\"ml-4 hidden sm:inline\">Autumn portfolio</span>\n            </span>\n            <span className=\"mt-2 block text-[38px] italic leading-[0.92] sm:text-[76px]\" style={{ fontFamily: SERIF, letterSpacing: \"-0.035em\" }}>\n              {plates[active].title}\n            </span>\n            <span className=\"sr-only\">. {plates[active].alt}</span>\n          </p>\n          <div className=\"pointer-events-auto flex gap-2\">\n            <button type=\"button\" onClick={() => step(-1)} aria-label=\"Previous print\" className={btn}>\n              <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                <path d=\"M12 4l-6 6 6 6\" />\n              </svg>\n            </button>\n            <button type=\"button\" onClick={() => step(1)} aria-label=\"Next print\" className={btn}>\n              <svg aria-hidden=\"true\" width=\"18\" height=\"18\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                <path d=\"M8 4l6 6-6 6\" />\n              </svg>\n            </button>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}
