{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"ray-marched-oak-groove-stepper-with-a-steel-ball-that-rolls-to-turned-brass-posts-in-raking-window-light","type":"registry:block","title":"Ray-Marched Oak Groove Stepper with a Steel Ball That Rolls to Turned Brass Posts in Raking Window Light","description":"Free React stepper: a steel ball rolls along a groove in an oak block to brass posts, ray-marched in WebGL in low window light.","dependencies":[],"files":[{"path":"components/we-inc/ray-marched-oak-groove-stepper-with-a-steel-ball-that-rolls-to-turned-brass-posts-in-raking-window-light.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\n\n// The steps. Each one is a turned brass post standing beside the groove.\nconst steps = [\n  { name: \"Survey\", when: \"Week 1\", title: \"We measure the room\", body: \"We come and measure the room, the light and the way people move round the table, then agree a size to the millimetre.\" },\n  { name: \"Drawings\", when: \"Weeks 2 to 3\", title: \"Drawn at full size\", body: \"Full-size drawings on brown paper, so you can lay the outline on your floor and walk round it before a board is cut.\" },\n  { name: \"Timber\", when: \"Week 4\", title: \"Boards from one tree\", body: \"We pick the boards by hand, from one tree where we can, and stack them to settle in the workshop for a fortnight.\" },\n  { name: \"Making\", when: \"Weeks 5 to 9\", title: \"One maker, start to end\", body: \"Every joint is cut and fitted by the same pair of hands, then three coats of hard wax oil go on with a cloth.\" },\n  { name: \"Delivery\", when: \"Week 10\", title: \"Carried in and levelled\", body: \"Two of us bring it, carry it in and level the feet on your floor, and we stay until it stands without a rock.\" },\n];\nconst START = 2; // the step it opens on\nconst WORKSHOP = \"Aldmoor Joinery\";\nconst JOB = \"Commission 214, an ash dining table\";\nconst FONT = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif';\nconst SERIF = '\"Iowan Old Style\", \"Palatino Linotype\", Palatino, \"Book Antiqua\", Georgia, serif';\n\n// Scene units. Posts stand at PX0, PX0 + PDX, ... along the block.\nconst PX0 = -3.6, PDX = 1.8, PZ = -0.36, TOP = 0.56;\nconst N = steps.length;\nconst LIFT = 0.17; // how far a post rises from its sleeve when the ball reaches it\nconst END = 4.27; // the ball's centre cannot pass this: the groove ends there\nconst postX = (i: number) => PX0 + i * PDX * (4 / Math.max(1, N - 1));\n\nconst VERT = `ATTR vec2 aPos; void main(){ gl_Position = vec4(aPos, 0.0, 1.0); }`;\nconst TONE = `\nvec3 tone(vec3 x){ x *= 0.9; vec3 a = x * (2.51 * x + 0.03); vec3 b = x * (2.43 * x + 0.59) + 0.14; return pow(clamp(a / b, 0.0, 1.0), vec3(1.0 / 2.2)); }\n`;\n\n// The photograph: a block of pale oak with a groove milled down it, brass posts turned on a lathe,\n// a polished steel ball, all on a chalk floor in low sun that comes through a window behind the set.\nconst SCENE = `\nprecision highp float;\nuniform vec2 uRes; uniform vec4 uJit; uniform float uSeed;\nuniform vec3 uCam; uniform vec3 uTgt; uniform float uFoc; uniform vec2 uShift; uniform float uFocus;\nuniform float uBall; uniform vec4 uLiftA; uniform float uLiftB; uniform vec3 uL;\nuniform sampler2D uTex; uniform float uDirect;\nconst float TOP = ${TOP.toFixed(2)}; const float BX = 4.7; const float BZ = 0.8;\nconst float GZ = 0.16; const float GY = 0.66; const float RG = 0.24; const float GX = 4.3;\nconst float RB = 0.21; const float BY = 0.63;\nconst float PZ = ${PZ.toFixed(2)}; const float PX0 = ${PX0.toFixed(2)}; const float PDX = ${(PDX * (4 / Math.max(1, N - 1))).toFixed(4)}; const float NP = ${(N - 1).toFixed(1)};\nconst vec3 SUN = vec3(1.0, 0.86, 0.68);\nconst vec3 BRASS = vec3(0.92, 0.68, 0.33);\n${TONE}\nfloat h11(float p){ p = fract(p * 0.1031); p *= p + 33.33; p *= p + p; return fract(p); }\nfloat h21(vec2 p){ vec3 q = fract(vec3(p.xyx) * 0.1031); q += dot(q, q.yzx + 33.33); return fract((q.x + q.y) * q.z); }\nfloat n1(float x){ float i = floor(x); float f = fract(x); f = f * f * (3.0 - 2.0 * f); return mix(h11(i), h11(i + 1.0), f); }\nfloat n2(vec2 x){ vec2 i = floor(x); vec2 f = fract(x); f = f * f * (3.0 - 2.0 * f);\n  return mix(mix(h21(i), h21(i + vec2(1.0, 0.0)), f.x), mix(h21(i + vec2(0.0, 1.0)), h21(i + vec2(1.0, 1.0)), f.x), f.y); }\n\nfloat sdBox(vec3 p, vec3 b, float r){ vec3 q = abs(p) - b + r; return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0) - r; }\nfloat sd2Box(vec2 p, vec2 b, float r){ vec2 q = abs(p) - b + r; return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r; }\nfloat smin(float a, float b, float k){ float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0); return mix(b, a, h) - k * h * (1.0 - h); }\n\n// ---- the oak block with its groove ----\nfloat block(vec3 p){\n  float d = sdBox(p - vec3(0.0, TOP * 0.5, 0.0), vec3(BX, TOP * 0.5, BZ), 0.035);\n  vec3 g = p - vec3(clamp(p.x, -GX, GX), GY, GZ);\n  return max(d, RG - length(g));\n}\n// ---- the brass posts: a fixed flanged sleeve and a turned stem that rises out of it ----\nfloat lift(float i){ return i < 0.5 ? uLiftA.x : i < 1.5 ? uLiftA.y : i < 2.5 ? uLiftA.z : i < 3.5 ? uLiftA.w : uLiftB; }\nfloat postP(vec2 q, float L){\n  float d = sd2Box(q - vec2(0.0, 0.016), vec2(0.165, 0.016), 0.008);\n  d = smin(d, sd2Box(q - vec2(0.0, 0.1), vec2(0.082, 0.1), 0.01), 0.03);\n  d = min(d, length(q - vec2(0.088, 0.165)) - 0.016);\n  float y = q.y - L;\n  float rs = 0.046 - 0.01 * clamp((y - 0.1) / 0.8, 0.0, 1.0);\n  d = min(d, sd2Box(vec2(q.x, y - 0.45), vec2(rs, 0.49), 0.0));\n  d = smin(d, length(vec2(q.x - 0.052, y - 0.47)) - 0.02, 0.014);\n  d = smin(d, length(vec2(q.x - 0.046, y - 0.86)) - 0.015, 0.01);\n  d = smin(d, length(vec2(q.x, y - 1.0)) - 0.1, 0.035);\n  d = smin(d, length(vec2(q.x, y - 1.11)) - 0.022, 0.02);\n  return d;\n}\nfloat posts(vec3 p){\n  float db = sdBox(p - vec3(0.0, TOP + 0.7, PZ), vec3(4.0, 0.72, 0.22), 0.0);\n  if (db > 0.08) return db;\n  float fi = clamp(floor((p.x - PX0) / PDX + 0.5), 0.0, NP);\n  vec2 q = vec2(length(p.xz - vec2(PX0 + fi * PDX, PZ)), p.y - TOP);\n  return postP(q, lift(fi));\n}\nvec2 map(vec3 p){\n  float a = block(p); float b = posts(p);\n  return a < b ? vec2(a, 1.0) : vec2(b, 2.0);\n}\nvec3 calcN(vec3 p){\n  vec2 e = vec2(0.0009, -0.0009);\n  return normalize(e.xyy * map(p + e.xyy).x + e.yyx * map(p + e.yyx).x + e.yxy * map(p + e.yxy).x + e.xxx * map(p + e.xxx).x);\n}\nvec2 boxSpan(vec3 ro, vec3 rd, vec3 lo, vec3 hi){\n  vec3 inv = 1.0 / (rd + vec3(1e-6)); vec3 a = (lo - ro) * inv; vec3 b = (hi - ro) * inv;\n  vec3 mn = min(a, b); vec3 mx = max(a, b);\n  return vec2(max(max(mn.x, mn.y), max(mn.z, 0.0)), min(mx.x, min(mx.y, mx.z)));\n}\n\n// ---- the ball, exactly ----\nvec3 BC(){ return vec3(uBall, BY, GZ); }\nfloat ballHit(vec3 ro, vec3 rd){\n  vec3 oc = ro - BC(); float b = dot(oc, rd); float c = dot(oc, oc) - RB * RB; float h = b * b - c;\n  if (h < 0.0) return -1.0;\n  return -b - sqrt(h);\n}\nfloat ballSoft(vec3 ro, vec3 rd){\n  vec3 oc = ro - BC(); float b = dot(oc, rd);\n  if (b > 0.0) return 1.0;\n  float c = dot(oc, oc) - RB * RB; float h = b * b - c;\n  float d = sqrt(max(0.0, RB * RB - h)) - RB; float t = -b - sqrt(max(h, 0.0));\n  return smoothstep(0.0, 1.0, 5.0 * d / max(t, 1e-3));\n}\n\n// ---- light ----\n// The sun comes in through a tall window with glazing bars behind the set; the bars throw soft stripes.\nfloat gobo(vec3 p){\n  vec3 u = normalize(cross(uL, vec3(0.0, 1.0, 0.0))); vec3 v = cross(u, uL);\n  vec2 w = vec2(dot(p, u), dot(p, v));\n  float bx = abs(fract(w.x / 4.6 + 0.62) - 0.5) * 4.6;\n  float by = abs(fract(w.y / 3.6 + 0.2) - 0.5) * 3.6;\n  float bars = smoothstep(0.03, 0.2, bx) * smoothstep(0.03, 0.18, by);\n  return bars * smoothstep(8.5, 6.0, abs(w.x));\n}\nfloat shadow(vec3 ro){\n  float bs = ballSoft(ro, uL);\n  vec2 tb = boxSpan(ro, uL, vec3(-4.8, -0.01, -0.9), vec3(4.8, 1.8, 0.9));\n  if (tb.x > tb.y) return bs;\n  float res = 1.0; float t = max(tb.x, 0.015);\n  for (int i = 0; i < 36; i++) {\n    float h = map(ro + uL * t).x;\n    res = min(res, 18.0 * h / t);\n    t += clamp(h, 0.015, 0.3);\n    if (res < 0.002 || t > tb.y) break;\n  }\n  res = clamp(res, 0.0, 1.0);\n  return res * res * (3.0 - 2.0 * res) * bs;\n}\nfloat calcAO(vec3 p, vec3 n){\n  float o = 0.0; float s = 1.0;\n  for (int i = 1; i <= 5; i++) {\n    float h = 0.015 + 0.06 * float(i); vec3 q = p + n * h;\n    float d = min(min(map(q).x, q.y), length(q - BC()) - RB);\n    o += (h - d) * s; s *= 0.72;\n  }\n  return clamp(1.0 - 1.9 * o, 0.0, 1.0);\n}\n// What a shiny surface sees: a warm room, a pale ceiling and the bright window with its bars.\nvec3 sky(vec3 r, float rough, float vis){\n  vec3 c = mix(vec3(0.95, 0.88, 0.78), vec3(0.78, 0.82, 0.9), smoothstep(-0.05, 0.9, r.y)) * 0.9;\n  // the room behind the camera is unlit: a dark band of walls and shelves low on the horizon\n  float away = smoothstep(-0.15, 0.7, dot(normalize(r.xz + vec2(1e-4)), normalize(uCam.xz - uTgt.xz)));\n  c = mix(c, vec3(0.07, 0.06, 0.05), away * smoothstep(0.9, 0.25, r.y) * 0.94);\n  // and a pale strip of ceiling light high above\n  c += vec3(1.0, 0.97, 0.92) * 1.6 * smoothstep(0.9, 0.97, r.y) * (1.0 - rough);\n  float k = dot(r, uL);\n  if (k > 0.05) {\n    vec3 u = normalize(cross(uL, vec3(0.0, 1.0, 0.0))); vec3 v = cross(u, uL);\n    vec2 w = vec2(dot(r, u), dot(r, v)) / k;\n    float s = 0.015 + rough * 0.7;\n    vec2 a = abs(w) - vec2(0.36, 0.5);\n    float win = smoothstep(s, -s, a.x) * smoothstep(s, -s, a.y);\n    float bars = smoothstep(0.012, 0.016 + s, abs(w.x)) * smoothstep(0.012, 0.016 + s, abs(w.y - 0.1));\n    c += SUN * 16.0 * win * mix(bars, 1.0, smoothstep(0.06, 0.35, rough)) * vis;\n  }\n  if (r.y < 0.0) c = mix(c, vec3(0.7, 0.62, 0.52), smoothstep(0.0, -0.12, r.y));\n  return c;\n}\nvec3 lighting(vec3 p, vec3 n, float occ, out float sh){\n  sh = shadow(p + n * 0.004) * gobo(p);\n  float ndl = max(dot(n, uL), 0.0);\n  vec3 amb = mix(vec3(0.56, 0.5, 0.44), vec3(0.66, 0.7, 0.8), 0.5 + 0.5 * n.y) * occ * 0.8;\n  vec3 bounce = vec3(0.62, 0.5, 0.38) * clamp(0.5 - 0.5 * n.y, 0.0, 1.0) * 0.3 * occ;\n  return SUN * 2.7 * ndl * sh + amb * 0.72 + bounce;\n}\nvec3 fres(vec3 f0, float c){ return f0 + (1.0 - f0) * pow(1.0 - clamp(c, 0.0, 1.0), 5.0); }\n\n// ---- materials ----\nvec3 oakAlb(vec3 p){\n  float w = n2(vec2(p.x * 0.12, p.z * 1.2)) * 0.9 + n2(vec2(p.x * 0.4, p.z * 3.0)) * 0.15;\n  float r = length(vec2(p.y + 1.7, p.z * 1.1 + 0.55 + 0.22 * sin(p.x * 0.31 + 1.0) + w * 0.12));\n  float ring = fract(r * 9.0);\n  float late = smoothstep(0.62, 0.74, ring) * smoothstep(0.98, 0.86, ring);\n  float pores = n2(vec2(p.x * 0.9, (p.z + p.y) * 320.0)) * 0.55 + n2(vec2(p.x * 0.35, (p.z + p.y) * 70.0)) * 0.45;\n  float thin = smoothstep(0.025, 0.0, abs(ring - 0.6)) + 0.6 * smoothstep(0.02, 0.0, abs(ring - 0.3));\n  vec3 a = vec3(0.7, 0.48, 0.28);\n  a = mix(a, vec3(0.46, 0.28, 0.14), late * 0.6 + thin * 0.45);\n  a *= 0.84 + 0.24 * pores;\n  return a;\n}\nvec3 shadeOak(vec3 p, vec3 n, vec3 rd, float occ){\n  vec3 a = oakAlb(p);\n  float rough = 0.62;\n  float inG = 1.0 - smoothstep(RG - 0.004, RG + 0.012, length(p - vec3(clamp(p.x, -GX, GX), GY, GZ)));\n  a *= mix(1.0, 0.88, inG); rough = mix(rough, 0.14, inG);\n  float ink = 0.0; float inlay = 0.0;\n  if (n.y > 0.9 && p.z > 0.38 && p.z < 0.78) {\n    vec4 tx = texture2D(uTex, vec2((p.x + BX) / (2.0 * BX), (p.z - 0.38) / 0.4));\n    ink = tx.r; inlay = tx.g;\n  }\n  a = mix(a, vec3(0.16, 0.09, 0.05), ink * 0.9);\n  float sh; vec3 L = lighting(p, n, occ, sh);\n  vec3 col = a * L;\n  vec3 r = reflect(rd, n);\n  float F = 0.03 + 0.97 * pow(1.0 - clamp(dot(-rd, n), 0.0, 1.0), 5.0);\n  col += F * sky(r, rough, sh) * (0.35 + 0.65 * occ) * (1.0 - ink * 0.7) * 0.4;\n  if (inlay > 0.01) col = mix(col, fres(BRASS, dot(-rd, n)) * (sky(r, 0.2, sh) * 0.7 + BRASS * L * 0.25), inlay);\n  return col;\n}\nvec3 shadeBrass(vec3 p, vec3 n, vec3 rd, float occ){\n  float ring = n1(p.y * 850.0) * 0.6 + n1(p.y * 210.0 + 4.0) * 0.4;\n  vec3 nn = normalize(n + vec3(0.0, (ring - 0.5) * 0.06, 0.0));\n  vec3 r = reflect(rd, nn);\n  float sh = shadow(p + n * 0.005) * gobo(p);\n  float rough = 0.08 + 0.1 * ring;\n  vec3 e = sky(r, rough, sh);\n  // looking down, the brass sees the oak it stands on\n  // looking down and toward the camera it sees the dark room; steeply down, the oak it stands on\n  float facing = smoothstep(-0.3, 0.5, dot(normalize(r.xz + vec2(1e-4)), normalize(uCam.xz - uTgt.xz)));\n  if (r.y < 0.15) e = mix(e, vec3(0.05, 0.045, 0.04), facing * smoothstep(0.15, -0.05, r.y) * 0.9);\n  if (r.y < -0.3) e = mix(e, vec3(0.5, 0.34, 0.2) * (0.6 + 1.2 * sh), smoothstep(-0.3, -0.6, r.y));\n  vec3 c = fres(BRASS, dot(-rd, nn)) * e * (0.4 + 0.6 * occ);\n  c += BRASS * SUN * 0.25 * max(dot(n, uL), 0.0) * sh;\n  return c;\n}\nvec3 floorCol(vec3 p, float t){\n  float g = n2(p.xz * 2.0) * 0.5 + n2(p.xz * 19.0) * 0.5;\n  vec3 a = vec3(0.86, 0.8, 0.72) * (0.96 + 0.06 * g);\n  float occ = 0.45 + 0.55 * smoothstep(0.0, 0.55, map(p + vec3(0.0, 0.03, 0.0)).x);\n  occ *= 0.6 + 0.4 * smoothstep(0.0, 0.5, length(p - BC()) - RB);\n  float sh; vec3 L = lighting(p, vec3(0.0, 1.0, 0.0), occ, sh);\n  return a * L;\n}\nvec3 backdrop(vec3 rd){ return mix(vec3(1.25, 1.14, 1.0), vec3(0.95, 0.88, 0.78), smoothstep(-0.2, 0.3, rd.y)); }\nvec3 shadeFloor(vec3 p, float t, vec3 rd){\n  return mix(floorCol(p, t), backdrop(rd), smoothstep(10.0, 34.0, t));\n}\n// A short second trace for the mirror ball: it really sees the groove, the posts and the floor.\nvec3 traceSimple(vec3 ro, vec3 rd){\n  float tf = rd.y < 0.0 ? -ro.y / rd.y : 1e9;\n  float t = 0.01; float hit = -1.0; float m = 0.0;\n  for (int i = 0; i < 48; i++) {\n    vec2 h = map(ro + rd * t);\n    if (h.x < 0.0015) { hit = t; m = h.y; break; }\n    t += h.x; if (t > min(tf, 12.0)) break;\n  }\n  if (hit > 0.0) {\n    vec3 p = ro + rd * hit; vec3 n = calcN(p);\n    if (m < 1.5) { float sh; vec3 L = lighting(p, n, 0.75, sh); return oakAlb(p) * L * mix(1.0, 0.88, step(p.y, TOP - 0.01)); }\n    vec3 r = reflect(rd, n); float sh = shadow(p + n * 0.01);\n    return fres(BRASS, dot(-rd, n)) * sky(r, 0.12, sh) * 0.9;\n  }\n  if (tf < 1e8) return shadeFloor(ro + rd * tf, tf, rd);\n  return sky(rd, 0.0, 1.0);\n}\nvec3 shadeBall(vec3 p, vec3 rd){\n  vec3 n = normalize(p - BC());\n  vec3 r = reflect(rd, n);\n  vec3 c = traceSimple(p + n * 0.003, r);\n  return fres(vec3(0.62, 0.63, 0.66), dot(-rd, n)) * c;\n}\n\nvoid main(){\n  vec2 fc = gl_FragCoord.xy + uJit.xy;\n  vec2 uv = (fc - 0.5 * uRes) / uRes.y - uShift;\n  vec3 fw = normalize(uTgt - uCam); vec3 rt = normalize(cross(fw, vec3(0.0, 1.0, 0.0))); vec3 up = cross(rt, fw);\n  vec3 rd = normalize(fw * uFoc + rt * uv.x + up * uv.y);\n  vec3 ro = uCam;\n  vec3 fp = ro + rd * (uFocus / dot(rd, fw));\n  ro += rt * uJit.z + up * uJit.w; rd = normalize(fp - ro);\n  float tf = rd.y < 0.0 ? -ro.y / rd.y : 1e9;\n  vec2 tb = boxSpan(ro, rd, vec3(-4.85, -0.01, -0.95), vec3(4.85, 1.85, 0.95));\n  float t = -1.0; float m = 0.0;\n  if (tb.x < tb.y) {\n    float s = tb.x;\n    for (int i = 0; i < 110; i++) {\n      vec2 h = map(ro + rd * s);\n      if (h.x < 0.0004 * s) { t = s; m = h.y; break; }\n      s += h.x; if (s > tb.y) break;\n    }\n  }\n  float tbl = ballHit(ro, rd);\n  vec3 col;\n  if (tbl > 0.0 && (t < 0.0 || tbl < t)) col = shadeBall(ro + rd * tbl, rd);\n  else if (t > 0.0) {\n    vec3 p = ro + rd * t; vec3 n = calcN(p); float occ = calcAO(p, n);\n    col = m < 1.5 ? shadeOak(p, n, rd, occ) : shadeBrass(p, n, rd, occ);\n  }\n  else if (tf < 1e8) col = shadeFloor(ro + rd * tf, tf, rd);\n  else col = backdrop(rd);\n  col = min(col, vec3(24.0));\n  if (uDirect > 0.5) col = tone(col);\n  outC = vec4(col, 1.0);\n}\n`;\n\n// Developing: a little bloom off the window highlights, the filmic curve, a soft vignette, grain.\nconst POST = `\nprecision highp float;\nuniform sampler2D uAcc; uniform vec2 uRes; uniform float uGrain; uniform vec2 uCentre;\n${TONE}\nfloat h21(vec2 p){ vec3 q = fract(vec3(p.xyx) * 0.1031); q += dot(q, q.yzx + 33.33); return fract((q.x + q.y) * q.z); }\nvoid main(){\n  vec2 uv = gl_FragCoord.xy / uRes;\n  vec3 c = texture2D(uAcc, uv).rgb;\n  vec2 px = 1.0 / uRes;\n  vec3 nb = texture2D(uAcc, uv + vec2(px.x, 0.0)).rgb + texture2D(uAcc, uv - vec2(px.x, 0.0)).rgb + texture2D(uAcc, uv + vec2(0.0, px.y)).rgb + texture2D(uAcc, uv - vec2(0.0, px.y)).rgb;\n  c = max(c + (c - nb * 0.25) * 0.4, 0.0);\n  vec3 b = vec3(0.0);\n  for (int i = 0; i < 20; i++) {\n    float a = float(i) * 2.39996; float r = sqrt((float(i) + 0.5) / 20.0);\n    vec3 s = texture2D(uAcc, uv + vec2(cos(a), sin(a)) * r * 0.02 * vec2(uRes.y / uRes.x, 1.0)).rgb;\n    b += min(max(s - 2.2, 0.0), vec3(6.0)) * (1.0 - 0.6 * r);\n  }\n  c += b * 0.01 * vec3(1.0, 0.92, 0.8);\n  vec2 q = (uv - uCentre) * vec2(uRes.x / uRes.y, 1.0);\n  c *= 1.0 - 0.22 * smoothstep(0.35, 1.25, length(q));\n  c = tone(c);\n  c += (h21(gl_FragCoord.xy + uGrain * 91.7) - 0.5) * 0.018;\n  outC = vec4(c, 1.0);\n}\n`;\n\n// The numerals burnt into the deck and the brass line inlaid at each stop, drawn once as a flat plan.\n// Red is the burnt ink, green the brass.\nfunction deckPrint() {\n  const W = 2048, Hh = 128, BX = 4.7;\n  const cv = document.createElement(\"canvas\");\n  cv.width = W; cv.height = Hh;\n  const g = cv.getContext(\"2d\");\n  if (!g) return cv;\n  g.fillStyle = \"#000\"; g.fillRect(0, 0, W, Hh);\n  const pxOf = (x: number) => ((x + BX) / (2 * BX)) * W;\n  for (let i = 0; i < N; i++) {\n    const x = pxOf(postX(i));\n    g.fillStyle = \"#0f0\"; g.fillRect(x - 2.5, 0, 5, Hh * 0.3);\n    g.fillStyle = \"#f00\"; g.textAlign = \"center\"; g.textBaseline = \"middle\";\n    g.font = `600 ${Hh * 0.42}px ${FONT}`;\n    g.save(); g.translate(x, Hh * 0.64); g.scale(1, 1.9); g.fillText(String(i + 1).padStart(2, \"0\"), 0, 0); g.restore();\n  }\n  return cv;\n}\n\n// No WebGL: the same set from the front, built from gradients.\nconst STILL_BOX = \"absolute inset-x-6 top-[22%] h-[220px] sm:inset-x-12 lg:inset-x-auto lg:left-[37%] lg:right-[5%] lg:top-[48%]\";\nfunction Still({ act }: { act: number }) {\n  return (\n    <div aria-hidden=\"true\" className={STILL_BOX}>\n      <div className=\"absolute inset-x-0 bottom-0 h-[70px] rounded-[6px]\" style={{ background: \"linear-gradient(180deg, #e9cfa6 0%, #d8b382 30%, #b98d5c 100%)\", boxShadow: \"0 30px 40px -12px rgba(90,60,30,0.35), inset 0 2px 0 rgba(255,245,225,0.8)\" }}>\n        <div className=\"absolute inset-x-[4%] top-[18px] h-[14px] rounded-full\" style={{ background: \"linear-gradient(180deg, #8d6640 0%, #c79b68 100%)\", boxShadow: \"inset 0 3px 4px rgba(60,35,15,0.5)\" }} />\n      </div>\n      {steps.map((s, i) => (\n        <div key={s.name} className=\"absolute bottom-[58px] w-[14px] -translate-x-1/2 rounded-t-full\" style={{ left: `${8 + i * (84 / (N - 1))}%`, height: i === act ? 128 : 112, background: \"linear-gradient(90deg, #8a6424 0%, #f6dc9a 40%, #c49440 70%, #7a561c 100%)\" }}>\n          <div className=\"absolute -top-[14px] left-1/2 h-[24px] w-[24px] -translate-x-1/2 rounded-full\" style={{ background: \"radial-gradient(circle at 40% 32%, #fff6d8 0%, #e2b85e 35%, #8f6620 100%)\" }} />\n        </div>\n      ))}\n      <div className=\"absolute bottom-[34px] h-[30px] w-[30px] -translate-x-1/2 rounded-full transition-[left] duration-700 ease-[cubic-bezier(0.3,1.4,0.5,1)] motion-reduce:transition-none\" style={{ left: `${8 + act * (84 / (N - 1))}%`, background: \"radial-gradient(circle at 38% 30%, #ffffff 0%, #d6d9de 18%, #7a7f87 50%, #2b2e33 78%, #b49a76 100%)\" }} />\n    </div>\n  );\n}\n\nexport default function OakGrooveStepper() {\n  const stage = useRef<HTMLDivElement>(null);\n  const canvas = useRef<HTMLCanvasElement>(null);\n  const hit = useRef<HTMLDivElement>(null);\n  const tags = useRef<(HTMLButtonElement | null)[]>([]);\n  const [act, setAct] = useState(START);\n  const [shown, setShown] = useState<\"wait\" | \"gl\" | \"still\">(\"wait\");\n  const actRef = useRef(START);\n  const api = useRef<{ go: (i: number, fromUser: boolean) => void } | null>(null);\n\n  useEffect(() => {\n    const box = stage.current, cv = canvas.current, pad = hit.current;\n    if (!box || !cv || !pad) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const opts = { antialias: false, alpha: false, powerPreference: \"high-performance\" as const };\n    const gl2 = cv.getContext(\"webgl2\", opts) as WebGL2RenderingContext | null;\n    const gl = (gl2 ?? cv.getContext(\"webgl\", opts)) as WebGLRenderingContext | null;\n    if (!gl) { setShown(\"still\"); return; }\n    const canAcc = !!gl2 && (!!gl2.getExtension(\"EXT_color_buffer_float\") || !!gl2.getExtension(\"EXT_color_buffer_half_float\"));\n    const info = gl.getExtension(\"WEBGL_debug_renderer_info\");\n    const renderer = info ? String(gl.getParameter(info.UNMASKED_RENDERER_WEBGL)) : \"\";\n    const software = /swiftshader|llvmpipe|software|basic render/i.test(renderer);\n    const still = reduce || software;\n\n    const head = gl2 ? \"#version 300 es\\n#define ATTR in\\n\" : \"#define ATTR attribute\\n\";\n    const fhead = gl2 ? \"#version 300 es\\n#define texture2D texture\\nprecision highp float;\\nout vec4 outC;\\n\" : \"#define outC gl_FragColor\\n\";\n    const compile = (type: number, src: string) => {\n      const sh = gl.createShader(type);\n      if (!sh) return null;\n      gl.shaderSource(sh, src); gl.compileShader(sh);\n      return gl.getShaderParameter(sh, gl.COMPILE_STATUS) ? sh : null;\n    };\n    const link = (frag: string) => {\n      const v = compile(gl.VERTEX_SHADER, head + VERT), f = compile(gl.FRAGMENT_SHADER, fhead + frag);\n      const p = gl.createProgram();\n      if (!v || !f || !p) return null;\n      gl.attachShader(p, v); gl.attachShader(p, f); gl.bindAttribLocation(p, 0, \"aPos\"); gl.linkProgram(p);\n      return gl.getProgramParameter(p, gl.LINK_STATUS) ? p : null;\n    };\n    const scene = link(SCENE), post = canAcc ? link(POST) : null;\n    if (!scene || (canAcc && !post)) { setShown(\"still\"); return; }\n    const U = (p: WebGLProgram, n: string) => gl.getUniformLocation(p, n);\n    const su = Object.fromEntries([\"uRes\", \"uJit\", \"uSeed\", \"uCam\", \"uTgt\", \"uFoc\", \"uShift\", \"uFocus\", \"uBall\", \"uLiftA\", \"uLiftB\", \"uL\", \"uTex\", \"uDirect\"].map((n) => [n, U(scene, n)]));\n    const pu = post ? Object.fromEntries([\"uAcc\", \"uRes\", \"uGrain\", \"uCentre\"].map((n) => [n, U(post, n)])) : {};\n\n    const quad = gl.createBuffer();\n    gl.bindBuffer(gl.ARRAY_BUFFER, quad);\n    gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n    gl.enableVertexAttribArray(0); gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n    const tex = gl.createTexture();\n    gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, tex);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, deckPrint());\n    gl.generateMipmap(gl.TEXTURE_2D);\n    const aniso = gl.getExtension(\"EXT_texture_filter_anisotropic\");\n    if (aniso) gl.texParameterf(gl.TEXTURE_2D, aniso.TEXTURE_MAX_ANISOTROPY_EXT, 8);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_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\n    const acc = canAcc ? gl.createTexture() : null;\n    const fbo = canAcc ? gl.createFramebuffer() : null;\n    let W = 0, H = 0, scale = 1, cssW = 1, cssH = 1;\n    const x0 = postX(START);\n    const s = {\n      x: x0, v: 0, target: x0, lift: steps.map((_, i) => (i === START ? LIFT : 0)), lv: steps.map(() => 0),\n      px: 0, py: 0, sx: 0, sy: 0, sun: 0, count: 0, fresh: true, frame: 0, slow: 0,\n      visible: true, raf: 0, last: 0, t0: 0, touched: false, demoAt: 0, first: true,\n    };\n    const size = () => {\n      const r = box.getBoundingClientRect();\n      cssW = Math.max(1, r.width); cssH = Math.max(1, r.height);\n      const dpr = Math.min(software ? 1 : 1.5, window.devicePixelRatio || 1) * scale;\n      const k = Math.min(1, Math.sqrt(1.3e6 / (cssW * cssH * dpr * dpr)));\n      const w = Math.max(2, Math.round(cssW * dpr * k)), h = Math.max(2, Math.round(cssH * dpr * k));\n      if (w === W && h === H) return;\n      W = w; H = h; cv.width = W; cv.height = H;\n      if (gl2 && acc && fbo) {\n        gl.activeTexture(gl.TEXTURE1); gl.bindTexture(gl.TEXTURE_2D, acc);\n        gl2.texImage2D(gl.TEXTURE_2D, 0, gl2.RGBA16F, W, H, 0, gl.RGBA, gl2.HALF_FLOAT, 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, fbo);\n        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, acc, 0);\n        gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n      }\n      s.count = 0; s.fresh = true;\n    };\n    const halton = (i: number, b: number) => { let f = 1, r = 0; while (i > 0) { f /= b; r += f * (i % b); i = Math.floor(i / b); } return r; };\n\n    // A long lens, low and to the left, so the block runs away from it toward the window light.\n    const camera = () => {\n      const wide = cssW >= 1024, aspect = cssW / cssH;\n      const el = (wide ? 0.36 : 0.62) - s.sy * 0.015, az = (wide ? -0.62 : -0.62) + s.sx * 0.05, dist = 15;\n      const tgt = wide ? [0.3, 0.55, 0.0] : [0.0, 0.6, 0.0];\n      const cam = [tgt[0] + dist * Math.sin(az) * Math.cos(el), tgt[1] + dist * Math.sin(el), tgt[2] + dist * Math.cos(az) * Math.cos(el)];\n      const foc = wide ? 2.25 * Math.min(1, aspect / 1.6) : 0.98 * Math.min(1.6, aspect / 0.54);\n      const fw = [tgt[0] - cam[0], tgt[1] - cam[1], tgt[2] - cam[2]];\n      const fl = Math.hypot(fw[0], fw[1], fw[2]); fw[0] /= fl; fw[1] /= fl; fw[2] /= fl;\n      const rt = [-fw[2], 0, fw[0]]; const rl = Math.hypot(rt[0], rt[2]); rt[0] /= rl; rt[2] /= 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 shift = wide ? [0.175 * aspect, -0.215] : [0.02, 0.12];\n      return { cam, tgt, fw, rt, up, foc, shift, wide };\n    };\n    type Cam = ReturnType<typeof camera>;\n    // Where a point in the scene lands on the screen, in CSS pixels.\n    const project = (c: Cam, p: number[]) => {\n      const d = [p[0] - c.cam[0], p[1] - c.cam[1], p[2] - c.cam[2]];\n      const z = d[0] * c.fw[0] + d[1] * c.fw[1] + d[2] * c.fw[2];\n      const x = (c.foc * (d[0] * c.rt[0] + d[1] * c.rt[1] + d[2] * c.rt[2])) / z + c.shift[0];\n      const y = (c.foc * (d[0] * c.up[0] + d[1] * c.up[1] + d[2] * c.up[2])) / z + c.shift[1];\n      return [cssW / 2 + x * cssH, cssH / 2 - y * cssH];\n    };\n    const placeTags = (c: Cam) => {\n      for (let i = 0; i < N; i++) {\n        const el = tags.current[i];\n        if (!el) continue;\n        const [x, y] = project(c, [postX(i), TOP + 1.3 + s.lift[i], PZ]);\n        el.style.transform = `translate(${x.toFixed(1)}px, ${y.toFixed(1)}px) translate(-50%, -100%)`;\n        el.style.opacity = \"1\";\n      }\n    };\n\n    const draw = (alpha: number, sample: number) => {\n      const c = camera();\n      placeTags(c);\n      const jx = sample ? halton(sample, 2) - 0.5 : 0, jy = sample ? halton(sample, 3) - 0.5 : 0;\n      const la = halton(sample, 5) * Math.PI * 2, lr = sample ? Math.sqrt(halton(sample, 7)) * 0.07 : 0;\n      gl.useProgram(scene);\n      gl.bindFramebuffer(gl.FRAMEBUFFER, canAcc ? fbo : null);\n      gl.viewport(0, 0, W, H);\n      if (canAcc && alpha < 1) { gl.enable(gl.BLEND); gl.blendColor(0, 0, 0, alpha); gl.blendFunc(gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_ALPHA); } else gl.disable(gl.BLEND);\n      gl.uniform2f(su.uRes, W, H);\n      gl.uniform4f(su.uJit, canAcc ? jx : 0, canAcc ? jy : 0, canAcc ? Math.cos(la) * lr : 0, canAcc ? Math.sin(la) * lr : 0);\n      gl.uniform1f(su.uSeed, canAcc && sample ? (sample * 0.61803) % 1 || 0.5 : 0);\n      gl.uniform3f(su.uCam, c.cam[0], c.cam[1], c.cam[2]); gl.uniform3f(su.uTgt, c.tgt[0], c.tgt[1], c.tgt[2]);\n      gl.uniform1f(su.uFoc, c.foc);\n      gl.uniform2f(su.uShift, c.shift[0], c.shift[1]);\n      // focus rides on the ball\n      gl.uniform1f(su.uFocus, (s.x - c.cam[0]) * c.fw[0] + (0.61 - c.cam[1]) * c.fw[1] + (0.16 - c.cam[2]) * c.fw[2]);\n      gl.uniform1f(su.uBall, s.x);\n      gl.uniform4f(su.uLiftA, s.lift[0] ?? 0, s.lift[1] ?? 0, s.lift[2] ?? 0, s.lift[3] ?? 0);\n      gl.uniform1f(su.uLiftB, s.lift[4] ?? 0);\n      const sa = -0.9, sz = -0.24 + s.sun, sl = Math.hypot(sa, 0.36, sz);\n      gl.uniform3f(su.uL, sa / sl, 0.36 / sl, sz / sl);\n      gl.uniform1i(su.uTex, 0);\n      gl.uniform1f(su.uDirect, canAcc ? 0 : 1);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n      if (canAcc && post) {\n        gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n        gl.disable(gl.BLEND);\n        gl.useProgram(post);\n        gl.uniform1i(pu.uAcc, 1); gl.uniform2f(pu.uRes, W, H);\n        gl.uniform1f(pu.uGrain, still ? 1 : s.frame % 64);\n        gl.uniform2f(pu.uCentre, c.wide ? 0.6 : 0.5, c.wide ? 0.4 : 0.66);\n        gl.drawArrays(gl.TRIANGLES, 0, 3);\n      }\n    };\n\n    const go = (i: number, fromUser: boolean) => {\n      const k = Math.max(0, Math.min(N - 1, i));\n      if (fromUser) s.touched = true;\n      s.target = postX(k);\n      if (k !== actRef.current) { actRef.current = k; setAct(k); }\n      if (reduce) { s.x = s.target; s.v = 0; s.lift = steps.map((_, j) => (j === k ? LIFT : 0)); s.lv = steps.map(() => 0); s.count = 0; }\n      wake();\n    };\n    api.current = { go };\n\n    const frame = (now: number) => {\n      s.raf = 0;\n      if (!s.visible) return;\n      const dtRaw = s.last ? (now - s.last) / 1000 : 0.016;\n      const dt = Math.min(0.033, dtRaw);\n      s.last = now; s.frame++;\n      if (!s.t0) { s.t0 = now; s.demoAt = now + 3600; }\n\n      // the self-running demo: it opens settled on a step, holds, then walks the steps until touched\n      if (!still && !s.touched && now > s.demoAt) {\n        const order = [3, 4, 1, 0, 2];\n        go(order[Math.floor((now - s.t0 - 3600) / 3000) % order.length] ?? START, false);\n        s.demoAt = now + 3000;\n      }\n\n      let moving = false;\n      if (!reduce) {\n        const sub = 4, h = dt / sub;\n        for (let k = 0; k < sub; k++) {\n          // a heavy ball: it can only push so hard, so it builds speed, runs past and rolls back\n          const a = Math.max(-26, Math.min(26, 30 * (s.target - s.x) - 5.2 * s.v));\n          s.v += a * h; s.x += s.v * h;\n          // the milled end of the groove: it knocks the ball back with most of its speed gone\n          if (Math.abs(s.x) > END) { s.x = Math.sign(s.x) * END; if (s.v * s.x > 0) s.v *= -0.3; }\n          for (let i = 0; i < N; i++) {\n            const here = Math.abs(s.x - postX(i)) < 0.22 && Math.abs(postX(i) - s.target) < 0.01;\n            s.lv[i] += (260 * ((here ? LIFT : 0) - s.lift[i]) - 15 * s.lv[i]) * h;\n            s.lift[i] += s.lv[i] * h;\n          }\n        }\n        if (Math.abs(s.v) > 0.002 || Math.abs(s.target - s.x) > 0.0005 || s.lv.some((v) => Math.abs(v) > 0.002)) moving = true;\n        else { s.x = s.target; s.v = 0; }\n      }\n      if (!still) {\n        s.sx += (s.px - s.sx) * (1 - Math.exp(-dt * 3)); s.sy += (s.py - s.sy) * (1 - Math.exp(-dt * 3));\n        s.sun = Math.sin((now - s.t0) / 1000 * 0.22) * 0.12 + s.sx * 0.06;\n        moving = true;\n      }\n\n      const fast = Math.abs(s.v) > 0.3;\n      if (s.fresh || !canAcc) { draw(1, 0); s.fresh = false; s.count = 1; }\n      else if (moving) { draw(fast ? 0.6 : still ? 0.5 : 0.12, 1 + (s.frame % 64)); s.count = still ? 1 : 6; }\n      else if (s.count < 40) { s.count++; draw(1 / s.count, s.count); }\n      if (s.first) { s.first = false; setShown(\"gl\"); }\n\n      if (!still && dtRaw > 0.026) s.slow++; else s.slow = Math.max(0, s.slow - 2);\n      if (s.slow > 45 && scale > 0.5) { scale *= 0.82; s.slow = 0; size(); }\n\n      if (moving || s.count < 40 || (!still && !s.touched)) s.raf = requestAnimationFrame(frame);\n    };\n    const wake = () => { if (!s.raf && s.visible) { s.last = 0; s.raf = requestAnimationFrame(frame); } };\n\n    size();\n    placeTags(camera());\n    const ro = new ResizeObserver(() => { size(); placeTags(camera()); wake(); });\n    ro.observe(box);\n    const io = new IntersectionObserver(([e]) => { s.visible = e.isIntersecting && !document.hidden; if (s.visible) wake(); }, { threshold: 0.05 });\n    io.observe(box);\n    const vis = () => { s.visible = !document.hidden; if (s.visible) wake(); };\n    document.addEventListener(\"visibilitychange\", vis);\n\n    // A press anywhere on the block sends the ball to the nearest post.\n    const down = (e: PointerEvent) => {\n      const r = box.getBoundingClientRect(), c = camera();\n      let best = 0, bd = 1e9;\n      for (let i = 0; i < N; i++) {\n        const [x, y] = project(c, [postX(i), TOP + 0.4, PZ]);\n        const d = Math.hypot(x - (e.clientX - r.left), (y - (e.clientY - r.top)) * 0.5);\n        if (d < bd) { bd = d; best = i; }\n      }\n      go(best, true);\n    };\n    const move = (e: PointerEvent) => {\n      const r = box.getBoundingClientRect();\n      s.px = ((e.clientX - r.left) / r.width) * 2 - 1; s.py = ((e.clientY - r.top) / r.height) * 2 - 1;\n      if (!still) wake();\n    };\n    const leave = () => { s.px = 0; s.py = 0; };\n    pad.addEventListener(\"pointerdown\", down);\n    box.addEventListener(\"pointermove\", move);\n    box.addEventListener(\"pointerleave\", leave);\n    const lost = (e: Event) => { e.preventDefault(); setShown(\"still\"); };\n    cv.addEventListener(\"webglcontextlost\", lost);\n    wake();\n\n    return () => {\n      cancelAnimationFrame(s.raf); ro.disconnect(); io.disconnect();\n      document.removeEventListener(\"visibilitychange\", vis);\n      pad.removeEventListener(\"pointerdown\", down); box.removeEventListener(\"pointermove\", move);\n      box.removeEventListener(\"pointerleave\", leave); cv.removeEventListener(\"webglcontextlost\", lost);\n      api.current = null;\n    };\n  }, []);\n\n  const choose = (i: number) => {\n    if (api.current) api.current.go(i, true); else { actRef.current = i; setAct(i); }\n  };\n  const keys = (e: React.KeyboardEvent, i: number) => {\n    const next = e.key === \"ArrowRight\" || e.key === \"ArrowDown\" ? i + 1 : e.key === \"ArrowLeft\" || e.key === \"ArrowUp\" ? i - 1 : e.key === \"Home\" ? 0 : e.key === \"End\" ? N - 1 : -9;\n    if (next === -9) return;\n    e.preventDefault();\n    const k = Math.max(0, Math.min(N - 1, next));\n    choose(k);\n    tags.current[k]?.focus();\n  };\n  const step = steps[act];\n  const gl = shown === \"gl\";\n\n  return (\n    <section className=\"relative isolate overflow-hidden bg-[#efe9df] text-[#1b1712]\" style={{ fontFamily: FONT }}>\n      <div ref={stage} className=\"relative mx-auto h-[720px] w-full max-w-[1600px] lg:h-[760px]\" style={{ background: \"radial-gradient(90% 80% at 60% 60%, #f6f1e8 0%, #ece4d6 60%, #ddd2c0 100%)\" }}>\n        <canvas ref={canvas} aria-hidden=\"true\" className={`absolute inset-0 h-full w-full transition-opacity duration-700 motion-reduce:transition-none ${gl ? \"opacity-100\" : \"opacity-0\"}`} />\n        {shown === \"still\" && <Still act={act} />}\n        <div ref={hit} className=\"absolute inset-x-0 top-0 h-[58%] cursor-pointer lg:inset-y-0 lg:left-[28%] lg:h-auto\" />\n\n        <div className=\"pointer-events-none absolute inset-x-0 bottom-0 px-6 pb-8 sm:px-10 lg:bottom-auto lg:top-0 lg:px-16 lg:pt-14\">\n          <p className=\"text-[11px] font-medium uppercase tracking-[0.32em] text-[#1b1712]/60\">{WORKSHOP}<span className=\"mx-2 text-[#1b1712]/30\">/</span><span className=\"hidden sm:inline\">{JOB}</span><span className=\"sm:hidden\">No. 214</span></p>\n          <div aria-live=\"polite\" className=\"mt-5 lg:mt-9\">\n            <p className=\"flex items-baseline gap-3 text-[13px] font-medium tabular-nums tracking-[-0.01em] text-[#9a6a1f]\">\n              <span>Step {String(act + 1).padStart(2, \"0\")} of {String(N).padStart(2, \"0\")}</span>\n              <span className=\"h-px w-8 bg-[#9a6a1f]/40\" />\n              <span>{step.when}</span>\n            </p>\n            <h2 className=\"mt-3 max-w-[9.5ch] text-[44px] font-semibold leading-[0.92] tracking-[-0.045em] sm:text-[58px] lg:text-[76px]\">{step.title}</h2>\n            <p className=\"mt-4 max-w-[25rem] text-[17px] italic leading-snug text-[#1b1712]/75 lg:mt-6 lg:text-[21px]\" style={{ fontFamily: SERIF }}>{step.body}</p>\n          </div>\n        </div>\n\n        <ol aria-label=\"Commission steps\" className={`pointer-events-none ${shown === \"still\" ? STILL_BOX : \"absolute inset-0\"}`}>\n          {steps.map((s, i) => {\n            const on = i === act;\n            const fallback = { left: `${8 + i * (84 / (N - 1))}%`, top: on ? \"6px\" : \"22px\" };\n            return (\n              <li key={s.name}>\n                <button\n                  ref={(el) => { tags.current[i] = el; }}\n                  type=\"button\"\n                  onClick={() => choose(i)}\n                  onKeyDown={(e) => keys(e, i)}\n                  aria-current={on ? \"step\" : undefined}\n                  tabIndex={on ? 0 : -1}\n                  className={`pointer-events-auto absolute left-0 top-0 flex min-h-[40px] flex-col items-center rounded-md px-2 pb-2 pt-1 text-center opacity-0 outline-none transition-colors duration-300 focus-visible:ring-2 focus-visible:ring-[#9a6a1f] focus-visible:ring-offset-2 focus-visible:ring-offset-[#efe9df] motion-reduce:transition-none ${on ? \"text-[#1b1712]\" : \"text-[#1b1712]/55 hover:text-[#1b1712]\"}`}\n                  style={shown === \"still\" ? { ...fallback, opacity: 1, transform: \"translate(-50%, -100%)\" } : undefined}\n                >\n                  <span className={`text-[12px] font-semibold tabular-nums tracking-[0.04em] ${on ? \"text-[#9a6a1f]\" : \"\"}`}>{String(i + 1).padStart(2, \"0\")}</span>\n                  <span className=\"hidden text-[15px] font-medium tracking-[-0.02em] sm:block\">{s.name}</span>\n                </button>\n              </li>\n            );\n          })}\n        </ol>\n      </div>\n    </section>\n  );\n}\n"}]}
