{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"brass-seal-confirm-delete-dialog-in-webgl-where-a-heavy-card-slides-onto-a-leather-desk-mat-under-a-lamp-and-a-stamp-presses-red-wax","type":"registry:block","title":"Brass Seal Confirm Delete Dialog in WebGL Where a Heavy Card Slides onto a Leather Desk Mat Under a Lamp and a Stamp Presses Red Wax","description":"Free React confirm delete dialog drawn in WebGL: a letterpress card slides onto a leather desk mat and a brass seal presses red wax when you confirm.","dependencies":[],"files":[{"path":"components/we-inc/brass-seal-confirm-delete-dialog-in-webgl-where-a-heavy-card-slides-onto-a-leather-desk-mat-under-a-lamp-and-a-stamp-presses-red-wax.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\n\n// Every word printed on the card. Nothing is deleted: confirming only plays the seal.\nconst card = {\n  trigger: \"Delete this ledger\",\n  eyebrow: \"Archive / Folio 7\",\n  title: \"Delete the Harbour Street ledger?\",\n  body: \"Every page filed under it goes with it, and there is no drawer to fetch it back from.\",\n  seal: \"Seal here\",\n  cancel: \"Keep it\",\n  confirm: \"Seal and delete\",\n  done: \"Sealed. This is a demo, so nothing was deleted.\",\n  kept: \"Kept. The ledger stays on file.\",\n};\nconst WAX: [number, number, number] = [0.19, 0.006, 0.008]; // the wax, linear RGB\nconst PAPER: [number, number, number] = [0.8, 0.745, 0.63]; // the card stock, linear RGB\nconst LEATHER: [number, number, number] = [0.026, 0.0125, 0.0085]; // the desk mat, linear RGB\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';\nconst U = 200; // css pixels to one card unit, for the layer of real elements\nconst CT = 0.011; // half the thickness of the card\nconst SC = 1.55; // size of the seal\n\nconst VERT = `ATTR vec2 aPos; void main(){ gl_Position = vec4(aPos, 0.0, 1.0); }`;\nconst TONE = `\nvec3 curve(vec3 x){ return clamp(x * (2.51 * x + 0.03) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); }\nvec3 tone(vec3 x){ x *= 1.05; float m = max(max(x.r, x.g), max(x.b, 1e-4)); vec3 h = x * (curve(vec3(m)).r / m); return pow(mix(curve(x), h, 0.5), vec3(1.0 / 2.2)); }\n`;\n\nconst SCENE = `\nprecision highp float;\nuniform vec2 uRes; uniform vec4 uJit; uniform float uSeed; uniform float uDirect;\nuniform vec3 uCam; uniform vec3 uFw; uniform vec3 uRt; uniform vec3 uUp; uniform float uFoc; uniform vec2 uShift; uniform float uFocusD;\nuniform vec3 uCard; uniform vec2 uHalf; uniform vec2 uSeal; uniform float uWax; uniform float uWaxOn; uniform float uCardOn;\nuniform vec3 uStamp; uniform mat3 uSRot; uniform vec4 uMat; uniform vec4 uHov;\nuniform vec3 uWaxC; uniform vec3 uPaper; uniform vec3 uLeather;\nuniform sampler2D uLab;\nconst float CT = ${CT}; const float SC = ${SC};\nconst vec3 LAMP = vec3(-3.4, 5.6, -3.2);\nconst vec3 LAMPC = vec3(1.0, 0.78, 0.52);\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); }\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); }\nfloat cells(vec2 x){ vec2 i = floor(x), f = fract(x); float m = 1.0;\n  for (int y = -1; y <= 1; y++) for (int k = -1; k <= 1; k++) { vec2 g = vec2(float(k), float(y)); vec2 o = vec2(h21(i + g), h21(i + g + 17.31)); vec2 r = g + o * 0.85 - f; m = min(m, dot(r, r)); }\n  return sqrt(m); }\nvec2 ry(vec2 v, float a){ float c = cos(a), s = sin(a); return vec2(c * v.x + s * v.y, -s * v.x + c * v.y); }\nfloat sdRR(vec2 p, vec2 h, float r){ vec2 d = abs(p) - h + r; return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - r; }\nfloat sdCyl(vec3 p, float ra, float h, float rb){ vec2 d = vec2(length(p.xz) - ra + rb, abs(p.y) - h + rb); return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - rb; }\nfloat sdEll(vec3 p, vec3 r){ float k0 = length(p / r); float k1 = length(p / (r * r)); return k0 * (k0 - 1.0) / max(k1, 1e-5); }\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); }\nvec3 cardLocal(vec3 p){ vec3 q = p - vec3(uCard.x, CT, uCard.y); q.xz = ry(q.xz, -uCard.z); return q; }\nfloat sdCard(vec3 p){\n  if (uCardOn < 0.5) return 1e3;\n  vec3 q = cardLocal(p);\n  vec2 w = vec2(sdRR(q.xz, uHalf - 0.004, 0.05), abs(q.y) - CT + 0.004);\n  return min(max(w.x, w.y), 0.0) + length(max(w, 0.0)) - 0.004;\n}\n// what the brass face leaves behind: a rim, a ring of beads and a saltire\nfloat motif(vec2 u){\n  float r = length(u);\n  float ring = 1.0 - smoothstep(0.035, 0.055, abs(r - 0.86));\n  float d1 = abs(u.x - u.y) * 0.7071, d2 = abs(u.x + u.y) * 0.7071;\n  float x = (1.0 - smoothstep(0.055, 0.085, min(d1, d2))) * smoothstep(0.56, 0.5, r);\n  float a = atan(u.y, u.x); float fa = fract(a / 6.28318 * 18.0) - 0.5;\n  float bead = 1.0 - smoothstep(0.03, 0.05, length(vec2(fa * 6.28318 / 18.0 * 0.7, r - 0.7)));\n  return max(ring, max(x, bead));\n}\nfloat sdWax(vec3 p){\n  if (uWaxOn < 0.5 || uCardOn < 0.5) return 1e3;\n  vec3 q = cardLocal(p);\n  vec3 w = vec3(q.x - uSeal.x, q.y - CT, q.z - uSeal.y);\n  if (length(w) > 0.9) return length(w) - 0.3;\n  float k = uWax;\n  float a = atan(w.z, w.x);\n  float wob = 1.0 + 0.05 * sin(3.0 * a + 1.3) + 0.035 * sin(5.0 * a + 0.4) + 0.02 * k * sin(9.0 * a + 2.0);\n  float R = mix(0.15, 0.24, k) * wob;\n  float dome = sdEll(w - vec3(0.0, -0.01, 0.0), vec3(R * 0.95, 0.082, R * 0.95));\n  float disc = sdCyl(w - vec3(0.0, 0.012, 0.0), R, 0.023, 0.017);\n  float d = mix(dome, disc, smoothstep(0.0, 0.75, k));\n  float r = length(w.xz);\n  float tw = smoothstep(0.004, 0.024, w.y);\n  float field = smoothstep(0.176, 0.163, r);\n  float depth = 0.0085 * smoothstep(0.5, 1.0, k);\n  d += depth * field * (1.0 - motif(w.xz / 0.168)) * tw;\n  // the wax squeezed out from under the face rolls up into a lip\n  d -= 0.006 * k * smoothstep(0.165, 0.19, r) * smoothstep(R, R - 0.05, r) * tw;\n  return d * 0.8;\n}\n// the seal: a brass face and collar, a turned neck, a brass ferrule and an ebony handle\nvec2 sdStamp(vec3 p){\n  vec3 s = uSRot * (p - uStamp) / SC;\n  float bs = length(s - vec3(0.0, 0.45, 0.0)); if (bs > 1.6) return vec2((bs - 0.62) * SC, 4.0);\n  float base = sdCyl(s - vec3(0.0, 0.035, 0.0), 0.135, 0.035, 0.009);\n  base = max(base, -(sdCyl(s - vec3(0.0, 0.058, 0.0), 0.15, 0.004, 0.002)));\n  float collar = sdCyl(s - vec3(0.0, 0.094, 0.0), 0.1, 0.026, 0.008);\n  float t = clamp((s.y - 0.12) / 0.3, 0.0, 1.0);\n  float rr = mix(0.068, 0.05, t) + 0.008 * sin(t * 3.14159);\n  float neck = max(length(s.xz) - rr, abs(s.y - 0.27) - 0.16);\n  float brass = smin(min(base, collar), neck, 0.02);\n  brass = min(brass, sdCyl(s - vec3(0.0, 0.455, 0.0), 0.064, 0.03, 0.01));\n  float wood = sdEll(s - vec3(0.0, 0.66, 0.0), vec3(0.118, 0.205, 0.118));\n  wood = smin(wood, max(length(s.xz) - 0.05, abs(s.y - 0.5) - 0.04), 0.03);\n  return brass < wood ? vec2(brass * SC, 4.0) : vec2(wood * SC, 5.0);\n}\nvec2 map(vec3 p){\n  vec2 r = vec2(sdCard(p), 2.0);\n  float w = sdWax(p); if (w < r.x) r = vec2(w, 3.0);\n  vec2 s = sdStamp(p); if (s.x < r.x) r = s;\n  return r;\n}\nvec3 nrm(vec3 p){\n  vec2 e = vec2(0.0007, -0.0007);\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}\nfloat shadow(vec3 ro, vec3 rd){\n  float res = 1.0, t = 0.01, ph = 1e10;\n  for (int i = 0; i < 72; i++) {\n    vec3 p = ro + rd * t; if (p.y > 2.4) break;\n    float h = map(p).x;\n    float y = h * h / (2.0 * ph); float d = sqrt(max(h * h - y * y, 0.0));\n    res = min(res, 7.0 * d / max(1e-4, t - y)); ph = h;\n    t += clamp(h, 0.004, 0.09); if (res < 0.002) break;\n  }\n  res = clamp(res, 0.0, 1.0);\n  return res * res * (3.0 - 2.0 * res);\n}\nfloat occ(vec3 p, vec3 n){\n  float o = 0.0, s = 1.0;\n  for (int i = 1; i <= 5; i++) { float h = 0.015 + 0.05 * float(i); o += (h - map(p + n * h).x) * s; s *= 0.62; }\n  return clamp(1.0 - 2.3 * o, 0.0, 1.0);\n}\nfloat lbox(vec3 rd, vec3 n, vec2 hs, float soft){\n  float dn = dot(rd, n); if (dn < 0.05) return 0.0;\n  vec3 u = normalize(cross(vec3(0.0, 1.0, 0.0), n)); vec3 v = cross(n, u);\n  vec2 q = vec2(dot(rd, u), dot(rd, v)) / dn; vec2 d = abs(q) - hs;\n  return smoothstep(soft, -soft, length(max(d, 0.0)) + min(max(d.x, d.y), 0.0));\n}\n// the study around the desk: dark panelling, the lamp's bulb and the inside of its shade, a tall window far to the right\nvec3 env(vec3 rd){\n  vec3 c = mix(vec3(0.03, 0.017, 0.011), vec3(0.05, 0.04, 0.035), smoothstep(-0.3, 0.6, rd.y));\n  vec3 l = normalize(LAMP);\n  float d = dot(rd, l);\n  c += LAMPC * 60.0 * smoothstep(0.9975, 0.9992, d);\n  c += LAMPC * vec3(1.0, 0.8, 0.55) * 1.6 * smoothstep(0.985, 0.996, d) * step(d, 0.9975);\n  c += vec3(0.55, 0.64, 0.8) * 1.4 * lbox(rd, normalize(vec3(0.95, 0.42, 0.1)), vec2(0.28, 0.5), 0.08);\n  c += vec3(0.95, 0.85, 0.7) * 0.5 * lbox(rd, normalize(vec3(-0.2, 0.9, 0.5)), vec2(0.6, 0.25), 0.3);\n  return c;\n}\nvec3 lampAt(vec3 p, out vec3 L){\n  vec3 dv = LAMP - p; float d2 = dot(dv, dv); L = dv * inversesqrt(d2);\n  float cone = dot(-L, normalize(vec3(0.1, -0.1, 0.25) - LAMP));\n  return LAMPC * 100.0 / d2 * mix(0.05, 1.0, smoothstep(0.9, 0.995, cone));\n}\n// how much the card shades the leather right beside it, light that never reaches under a heavy board\nfloat cardNear(vec3 p){\n  if (uCardOn < 0.5) return 1.0;\n  vec3 q = cardLocal(p);\n  float d = sdRR(q.xz, uHalf, 0.05);\n  return 1.0 - 0.55 * exp(-max(d, 0.0) / 0.035);\n}\nvec3 shadeDesk(vec3 p, vec3 rd){\n  vec2 m = p.xz - uMat.xy;\n  float e = sdRR(m, uMat.zw, 0.22);\n  vec3 L; vec3 li = lampAt(p, L);\n  vec3 n = vec3(0.0, 1.0, 0.0);\n  vec3 alb; float sp, gl;\n  if (e < 0.0) {\n    // pebbled leather: puffy cells with creases between them, a little lighter where it has been rubbed\n    float c0 = cells(p.xz * 30.0);\n    float cx = cells((p.xz + vec2(0.003, 0.0)) * 30.0), cz = cells((p.xz + vec2(0.0, 0.003)) * 30.0);\n    n = normalize(vec3(-(cx - c0) * 0.55, 1.0, -(cz - c0) * 0.55));\n    float rub = n2(p.xz * 1.3) * 0.6 + 0.4 * n2(p.xz * 5.0);\n    alb = uLeather * (0.75 + 0.5 * rub) * mix(0.55, 1.0, smoothstep(0.0, 0.5, c0));\n    // the rolled edge of the mat, and its stitching\n    float bev = smoothstep(-0.07, 0.0, e);\n    vec2 g = vec2(sdRR(m + vec2(0.01, 0.0), uMat.zw, 0.22) - e, sdRR(m + vec2(0.0, 0.01), uMat.zw, 0.22) - e) / 0.01;\n    n = normalize(n + vec3(g.x, 0.0, g.y) * bev * 1.4);\n    float st = abs(e + 0.12);\n    float dash = step(0.38, fract((p.x + p.z) * 11.0));\n    alb = mix(alb, vec3(0.2, 0.12, 0.06), (1.0 - smoothstep(0.006, 0.011, st)) * dash);\n    alb *= 1.0 - 0.45 * (1.0 - smoothstep(0.0, 0.016, st)) * (1.0 - dash);\n    sp = 0.22; gl = 14.0;\n  } else {\n    // walnut beyond the mat, close grained, waxed\n    float gr = n2(vec2(p.x * 0.9, p.z * 14.0 + n2(p.xz * 1.7) * 6.0));\n    alb = mix(vec3(0.07, 0.033, 0.015), vec3(0.15, 0.075, 0.034), gr) * (0.9 + 0.2 * n2(p.xz * 40.0));\n    alb *= mix(0.35, 1.0, smoothstep(0.0, 0.09, e));\n    sp = 0.35; gl = 70.0;\n  }\n  float sh = shadow(p + vec3(0.0, 0.002, 0.0), L);\n  float ao = occ(p, vec3(0.0, 1.0, 0.0)) * cardNear(p);\n  sh *= mix(1.0, cardNear(p), 0.6);\n  vec3 h = normalize(L - rd);\n  float f = 0.04 + 0.96 * pow(1.0 - clamp(dot(-rd, n), 0.0, 1.0), 5.0);\n  vec3 col = alb * li * max(dot(n, L), 0.0) * sh;\n  col += li * sp * pow(max(dot(n, h), 0.0), gl) * sh * (0.3 + f);\n  col += alb * vec3(0.05, 0.045, 0.05) * ao + env(reflect(rd, n)) * f * 0.18 * ao;\n  return col;\n}\nvec3 shadeCard(vec3 p, vec3 n, vec3 rd){\n  vec3 q = cardLocal(p);\n  vec3 nl = n; nl.xz = ry(n.xz, -uCard.z);\n  vec3 L; vec3 li = lampAt(p, L);\n  vec3 alb = uPaper * (0.93 + 0.1 * n2(q.xz * 260.0) + 0.05 * n2(q.xz * 37.0));\n  float spec = 0.03, gl = 10.0;\n  if (nl.y > 0.85) {\n    vec2 uv = vec2((q.x + uHalf.x) / (2.0 * uHalf.x), (q.z + uHalf.y) / (2.0 * uHalf.y));\n    vec3 lb = texture2D(uLab, uv, -0.6).rgb;\n    // letterpress: the ink sits at the bottom of a shallow bite into the stock\n    vec2 dx = vec2(1.0 / 2048.0, 0.0), dz = vec2(0.0, 1.0 / 1400.0);\n    float hx = dot(texture2D(uLab, uv + dx * 1.5, 0.0).rgb - texture2D(uLab, uv - dx * 1.5, 0.0).rgb, vec3(1.0, 0.8, 0.0));\n    float hz = dot(texture2D(uLab, uv + dz * 1.5, 0.0).rgb - texture2D(uLab, uv - dz * 1.5, 0.0).rgb, vec3(1.0, 0.8, 0.0));\n    nl = normalize(vec3(hx * 0.22, 1.0, hz * 0.22));\n    // a control under the pointer or the focus ring is breathed on by the lamp\n    float hp = sdRR(q.xz - uHov.xy, uHov.zw, min(uHov.z, uHov.w));\n    alb *= 1.0 + 0.1 * uHov.w * step(0.001, uHov.z) * smoothstep(0.02, -0.01, hp);\n    vec3 ink = vec3(0.009, 0.008, 0.01) * (0.9 + 0.2 * n2(q.xz * 400.0));\n    vec3 red = uWaxC * 1.25 * (0.88 + 0.24 * n2(q.xz * 300.0));\n    alb = mix(alb, vec3(0.34, 0.3, 0.25), lb.b * 0.85);\n    alb = mix(alb, red, lb.g);\n    alb = mix(alb, ink, lb.r);\n    spec += 0.07 * max(lb.r, lb.g); gl = mix(10.0, 50.0, max(lb.r, lb.g));\n    // the corners of a heavy card are a touch soiled by fingers\n    float cn = sdRR(q.xz, uHalf, 0.05);\n    alb *= 1.0 - 0.06 * smoothstep(-0.25, 0.0, cn);\n  } else {\n    // the cut edge: layers of the board pressed together\n    alb *= 0.72 + 0.12 * sin(q.y * 1400.0);\n  }\n  n = nl; n.xz = ry(nl.xz, uCard.z);\n  float sh = shadow(p + n * 0.003, L);\n  float ao = occ(p, n);\n  float dif = max(dot(n, L), 0.0);\n  vec3 h = normalize(L - rd);\n  vec3 col = alb * li * dif * sh;\n  // light that soaks into the stock and comes back out a little warmer\n  col += alb * li * vec3(1.0, 0.75, 0.5) * 0.05 * sh;\n  col += li * spec * pow(max(dot(n, h), 0.0), gl) * sh;\n  col += alb * vec3(0.045, 0.043, 0.05) * ao;\n  return col;\n}\nvec3 shadeWax(vec3 p, vec3 n, vec3 rd){\n  vec3 L; vec3 li = lampAt(p, L);\n  vec3 q = cardLocal(p);\n  vec2 w = q.xz - uSeal;\n  float r = length(w);\n  float sh = shadow(p + n * 0.004, L);\n  float ao = occ(p, n);\n  float pressed = smoothstep(0.5, 1.0, uWax) * smoothstep(0.18, 0.16, r);\n  vec3 alb = uWaxC * (0.9 + 0.2 * n2(w * 40.0));\n  float dif = max(dot(n, L), 0.0);\n  vec3 col = alb * li * dif * sh;\n  // wax is translucent: the lamp glows through the thin edges and the body stays a deep, lit red\n  float thin = smoothstep(0.05, 0.0, q.y - CT);\n  col += uWaxC * vec3(1.5, 0.3, 0.18) * li * (0.08 + 0.3 * thin) * (0.4 + 0.6 * sh) * (0.5 + 0.5 * dot(n, L));\n  col += alb * vec3(0.08, 0.06, 0.06) * ao;\n  float f = 0.035 + 0.965 * pow(1.0 - clamp(dot(-rd, n), 0.0, 1.0), 5.0);\n  float gloss = mix(160.0, 30.0, pressed);\n  vec3 h = normalize(L - rd);\n  col += li * mix(1.1, 0.35, pressed) * pow(max(dot(n, h), 0.0), gloss) * sh;\n  // a shallow pool of colour where the body is thickest\n  col *= mix(1.0, 0.7, smoothstep(0.02, 0.07, q.y - CT) * (1.0 - pressed));\n  col += env(reflect(rd, n)) * f * mix(0.9, 0.35, pressed) * ao;\n  return col;\n}\nvec3 shadeStamp(vec3 p, vec3 n, vec3 rd, float id){\n  vec3 L; vec3 li = lampAt(p, L);\n  vec3 s = uSRot * (p - uStamp) / SC;\n  vec3 sn = uSRot * n;\n  float sh = shadow(p + n * 0.004, L);\n  float ao = occ(p, n);\n  vec3 h = normalize(L - rd);\n  vec3 r = reflect(rd, n);\n  if (id < 4.5) {\n    // brass, turned on a lathe: fine rings around the axis, darker where hands never reach\n    float rings = n2(vec2(s.y * 900.0, 0.5)) - 0.5;\n    vec3 nn = normalize(n + (uSRot * vec3(0.0, 1.0, 0.0)) * rings * 0.07 * (1.0 - abs(sn.y)));\n    vec3 f0 = vec3(0.95, 0.7, 0.34) * mix(0.62, 1.0, smoothstep(0.0, 0.2, s.y));\n    float fr = pow(1.0 - clamp(dot(-rd, nn), 0.0, 1.0), 5.0);\n    vec3 F = f0 + (1.0 - f0) * fr;\n    vec3 col = F * env(reflect(rd, nn)) * (0.5 + 0.5 * ao);\n    col += F * li * (1.6 * pow(max(dot(nn, h), 0.0), 90.0) + 0.12 * pow(max(dot(nn, h), 0.0), 8.0)) * sh;\n    return col;\n  }\n  vec3 alb = vec3(0.016, 0.011, 0.009) * (0.8 + 0.4 * n2(vec2(s.y * 60.0, atan(s.z, s.x) * 3.0)));\n  float f = 0.04 + 0.96 * pow(1.0 - clamp(dot(-rd, n), 0.0, 1.0), 5.0);\n  vec3 col = alb * li * max(dot(n, L), 0.0) * sh + alb * 0.2 * ao;\n  col += li * 0.9 * pow(max(dot(n, h), 0.0), 120.0) * sh + env(r) * f * ao;\n  return col;\n}\nvoid main(){\n  vec2 fc = gl_FragCoord.xy + uJit.xy;\n  vec2 uv = (fc - 0.5 * uRes) / uRes.y - uShift;\n  vec3 rd0 = normalize(uFw * uFoc + uRt * uv.x + uUp * uv.y);\n  vec3 fp = uCam + rd0 * (uFocusD / dot(rd0, uFw));\n  vec3 ro = uCam + uRt * uJit.z + uUp * uJit.w;\n  vec3 rd = normalize(fp - ro);\n  float tFloor = -ro.y / rd.y;\n  float t = max(0.0, (2.1 - ro.y) / rd.y);\n  vec2 hit = vec2(-1.0);\n  for (int i = 0; i < 120; i++) {\n    vec3 p = ro + rd * t;\n    vec2 d = map(p);\n    if (d.x < 0.0004) { hit = vec2(t, d.y); break; }\n    t += d.x * 0.92;\n    if (t > tFloor) break;\n  }\n  vec3 col;\n  if (hit.x > 0.0) {\n    vec3 p = ro + rd * hit.x; vec3 n = nrm(p);\n    if (hit.y < 2.5) col = shadeCard(p, n, rd);\n    else if (hit.y < 3.5) col = shadeWax(p, n, rd);\n    else col = shadeStamp(p, n, rd, hit.y);\n  } else {\n    col = shadeDesk(ro + rd * tFloor, rd);\n  }\n  col = min(col, vec3(30.0));\n  if (uDirect > 0.5) col = tone(col);\n  outC = vec4(col, 1.0);\n}\n`;\n\nconst POST = `\nprecision highp float;\nuniform sampler2D uAcc; uniform vec2 uRes; uniform float uGrain;\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  vec3 b = vec3(0.0);\n  for (int i = 0; i < 16; i++) {\n    float a = float(i) * 2.39996; float r = sqrt((float(i) + 0.5) / 16.0);\n    vec3 s = texture2D(uAcc, uv + vec2(cos(a), sin(a)) * r * 0.025 * vec2(uRes.y / uRes.x, 1.0)).rgb;\n    b += min(max(s - 1.4, 0.0), vec3(8.0)) * (1.0 - 0.6 * r);\n  }\n  c += b * 0.008;\n  vec2 q = (uv - vec2(0.42, 0.6)) * vec2(uRes.x / uRes.y, 1.0);\n  c *= 1.0 - 0.42 * smoothstep(0.35, 1.25, length(q));\n  c = tone(c);\n  c += (h21(gl_FragCoord.xy + uGrain * 91.7) - 0.5) * 0.022;\n  outC = vec4(c, 1.0);\n}\n`;\n\ntype Box = { x: number; y: number; w: number; h: number }; // card units from the card's top left corner\ntype Plan = { hx: number; hz: number; eyebrow: Box; title: Box; body: Box; cancel: Box; confirm: Box; seal: { x: number; y: number; r: number }; titleSize: number; bodySize: number; titleLines: string[]; bodyLines: string[] };\ntype V3 = [number, number, number];\n\nfunction planFor(hx: number, hz: number, measure: (text: string, font: string) => number): Plan {\n  const tall = hz > hx;\n  const pad = tall ? 0.19 : 0.24;\n  const W = 2 * hx, inner = W - 2 * pad;\n  const seal = { x: W - pad - 0.27, y: pad + 0.27, r: 0.27 };\n  const wrap = (text: string, font: string, max: number) => {\n    const out: string[] = []; let line = \"\";\n    for (const w of text.split(\" \")) { const t = line ? `${line} ${w}` : w; if (line && measure(t, font) > max) { out.push(line); line = w; } else line = t; }\n    out.push(line); return out;\n  };\n  const titleMax = tall ? inner : inner - 0.72;\n  let titleSize = tall ? 0.235 : 0.235, titleLines: string[] = [];\n  for (; titleSize > 0.1; titleSize -= 0.004) {\n    titleLines = wrap(card.title, `600 ${titleSize}px ${SERIF}`, titleMax);\n    if (titleLines.length <= (tall ? 3 : 2)) break;\n  }\n  const bodySize = tall ? 0.095 : 0.08;\n  const bodyMax = Math.min(tall ? inner : inner - 0.72, 1.85);\n  const bodyLines = wrap(card.body, `500 ${bodySize}px ${FONT}`, bodyMax);\n  const eyebrow = { x: pad, y: pad, w: tall ? inner - 0.6 : inner - 0.8, h: 0.06 };\n  const titleTop = tall ? seal.y + seal.r + 0.12 : pad + 0.2;\n  const titleH = titleLines.length * titleSize * 1.06;\n  const bodyTop = titleTop + titleH + 0.08;\n  const bodyH = bodyLines.length * bodySize * 1.5;\n  const bh = tall ? 0.24 : 0.2, gap = 0.08;\n  const bf = `600 ${tall ? 0.078 : 0.07}px ${FONT}`;\n  const by = 2 * hz - pad - bh;\n  let cw = measure(card.confirm, bf) + 0.32, kw = measure(card.cancel, bf) + 0.32;\n  if (tall) { cw = (inner - gap) * 0.56; kw = inner - gap - cw; }\n  const confirm = { x: W - pad - cw, y: by, w: cw, h: bh };\n  const cancel = { x: confirm.x - gap - kw, y: by, w: kw, h: bh };\n  return { hx, hz, titleSize, bodySize, titleLines, bodyLines, eyebrow, title: { x: pad, y: titleTop, w: titleMax, h: titleH }, body: { x: pad, y: bodyTop, w: bodyMax, h: bodyH }, cancel, confirm, seal };\n}\n\nexport default function BrassSealConfirmDeleteDialog() {\n  const stage = useRef<HTMLDivElement>(null);\n  const canvas = useRef<HTMLCanvasElement>(null);\n  const sheet = useRef<HTMLDivElement | null>(null);\n  const trigger = useRef<HTMLButtonElement>(null);\n  const keep = useRef<HTMLButtonElement>(null);\n  const [open, setOpen] = useState(true);\n  const [shown, setShown] = useState<\"wait\" | \"gl\" | \"still\">(\"wait\");\n  const [plan, setPlan] = useState<Plan | null>(null);\n  const [note, setNote] = useState(\"\");\n  const [sealed, setSealed] = useState(false);\n  const byUser = useRef(false);\n  const api = useRef<{ open: () => void; cancel: () => void; confirm: () => void; hover: (b: Box | null) => void; matrix: string } | null>(null);\n\n  useEffect(() => {\n    const box = stage.current, cv = canvas.current;\n    if (!box || !cv) 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      if (!gl.getShaderParameter(sh, gl.COMPILE_STATUS)) { console.warn(gl.getShaderInfoLog(sh)); return null; }\n      return sh;\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 names = [\"uRes\", \"uJit\", \"uSeed\", \"uDirect\", \"uCam\", \"uFw\", \"uRt\", \"uUp\", \"uFoc\", \"uShift\", \"uFocusD\", \"uCard\", \"uHalf\", \"uSeal\", \"uWax\", \"uWaxOn\", \"uCardOn\", \"uStamp\", \"uSRot\", \"uMat\", \"uHov\", \"uWaxC\", \"uPaper\", \"uLeather\", \"uLab\"];\n    const su = Object.fromEntries(names.map((n) => [n, gl.getUniformLocation(scene, n)]));\n    const pu = post ? Object.fromEntries([\"uAcc\", \"uRes\", \"uGrain\"].map((n) => [n, gl.getUniformLocation(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 texLab = gl.createTexture();\n    gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, texLab);\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.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    const aniso = gl.getExtension(\"EXT_texture_filter_anisotropic\");\n    if (aniso) gl.texParameterf(gl.TEXTURE_2D, aniso.TEXTURE_MAX_ANISOTROPY_EXT, 8);\n    const acc = canAcc ? gl.createTexture() : null;\n    const fbo = canAcc ? gl.createFramebuffer() : null;\n\n    let W = 0, H = 0, scale = 1, cssW = 1, cssH = 1, hx = 1.55, hz = 1.0;\n    let rest: V3 = [2.2, 0, -0.4], below = 6, left = -6;\n    const mat = [0, 0, 20, 20];\n    let pl: Plan | null = null;\n    const s = {\n      cx: 0, cz: 0, cyaw: 0, vx: 0, vz: 0, vyaw: 0, tx: 0, tz: 0, tyaw: 0, on: true, leaving: false,\n      st: [0, 0, 0] as V3, tilt: [0, 0], tiltV: [0, 0], seq: -1, wax: 0, waxOn: true,\n      hov: [0, 0, 0, 0], hovS: 0, hovB: null as Box | null, px: 0, py: 0, lx: 0, ly: 0,\n      count: 0, fresh: true, frame: 0, slow: 0, visible: true, raf: 0, last: 0, t0: 0, touched: false, demoAt: 0, first: true, closeAt: 0,\n    };\n\n    // The camera looks down at the desk from above and in front, like someone sitting at it.\n    const EL = 0.98, DIST = 10.5;\n    const view = (lx: number, ly: number) => {\n      const aspect = cssW / cssH;\n      const az = lx * 0.035, el = EL + ly * 0.02;\n      const tgt: V3 = [0, 0, 0];\n      const cam: V3 = [tgt[0] + DIST * Math.sin(az) * Math.cos(el), DIST * Math.sin(el), tgt[2] + DIST * Math.cos(az) * Math.cos(el)];\n      const n = Math.hypot(cam[0] - tgt[0], cam[1], cam[2] - tgt[2]);\n      const fw: V3 = [(tgt[0] - cam[0]) / n, -cam[1] / n, (tgt[2] - cam[2]) / n];\n      let rt: V3 = [-fw[2], 0, fw[0]];\n      const rn = Math.hypot(rt[0], rt[2]); rt = [rt[0] / rn, 0, rt[2] / rn];\n      const up: V3 = [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      return { cam, fw, rt, up, foc: 1, shift: [0, 0], aspect };\n    };\n    type View = ReturnType<typeof view>;\n    const raw = (v: View, p: number[]) => {\n      const d = [p[0] - v.cam[0], p[1] - v.cam[1], p[2] - v.cam[2]];\n      const z = d[0] * v.fw[0] + d[1] * v.fw[1] + d[2] * v.fw[2];\n      return [(d[0] * v.rt[0] + d[1] * v.rt[1] + d[2] * v.rt[2]) / z, (d[0] * v.up[0] + d[1] * v.up[1] + d[2] * v.up[2]) / z];\n    };\n    let fit = { foc: 1, shift: [0, 0] };\n    const framed = (lx: number, ly: number) => { const v = view(lx, ly); v.foc = fit.foc; v.shift = fit.shift; return v; };\n    const project = (v: View, p: number[]) => {\n      const r = raw(v, p);\n      const ux = r[0] * v.foc + v.shift[0], uy = r[1] * v.foc + v.shift[1];\n      return [cssW / 2 + ux * cssH, cssH / 2 - uy * cssH];\n    };\n    const onDesk = (v: View, ux: number, uy: number) => {\n      const a = (ux - v.shift[0]) / v.foc, b = (uy - v.shift[1]) / v.foc;\n      const d = [0, 1, 2].map((k) => v.fw[k] + v.rt[k] * a + v.up[k] * b);\n      const t = -v.cam[1] / d[1];\n      return [v.cam[0] + d[0] * t, v.cam[2] + d[2] * t];\n    };\n    const toWorld = (lx: number, lz: number, cx = s.cx, cz = s.cz, yaw = s.cyaw): V3 => {\n      const c = Math.cos(yaw), sn = Math.sin(yaw);\n      // inverse of ry(v, -yaw)\n      return [cx + c * lx - sn * lz, 0, cz + sn * lx + c * lz];\n    };\n\n    const labCv = document.createElement(\"canvas\");\n    const ruler = document.createElement(\"canvas\").getContext(\"2d\");\n    const measure = (text: string, font: string) => {\n      if (!ruler) return text.length * 0.05;\n      ruler.font = font.replace(/([\\d.]+)px/, (_, n) => `${Number(n) * 100}px`);\n      return ruler.measureText(text).width / 100;\n    };\n    // Printing plate: ink in red, the printed vermilion in green, the grey rules in blue.\n    const paintCard = () => {\n      const p = planFor(hx, hz, measure);\n      const u = 2048 / (2 * hx);\n      labCv.width = 2048; labCv.height = Math.round(2 * hz * u);\n      const g = labCv.getContext(\"2d\") as (CanvasRenderingContext2D & { letterSpacing?: string }) | null;\n      if (!g) return p;\n      g.fillStyle = \"#000\"; g.fillRect(0, 0, labCv.width, labCv.height);\n      g.globalCompositeOperation = \"lighter\"; g.textBaseline = \"alphabetic\"; g.textAlign = \"left\";\n      const R = \"#ff0000\", G = \"#00ff00\", B = \"#0000ff\";\n      const pill = (b: Box) => { const r = b.h / 2; g.beginPath(); g.moveTo((b.x + r) * u, b.y * u); g.arcTo((b.x + b.w) * u, b.y * u, (b.x + b.w) * u, (b.y + b.h) * u, r * u); g.arcTo((b.x + b.w) * u, (b.y + b.h) * u, b.x * u, (b.y + b.h) * u, r * u); g.arcTo(b.x * u, (b.y + b.h) * u, b.x * u, b.y * u, r * u); g.arcTo(b.x * u, b.y * u, (b.x + b.w) * u, b.y * u, r * u); g.closePath(); };\n      g.fillStyle = G; g.fillRect(p.eyebrow.x * u, (p.eyebrow.y + 0.012) * u, 0.034 * u, 0.034 * u);\n      const es = hz > hx ? 0.064 : 0.05;\n      g.fillStyle = R; g.letterSpacing = `${0.2 * es * u}px`; g.font = `700 ${es * u}px ${FONT}`;\n      g.fillText(card.eyebrow.toUpperCase(), (p.eyebrow.x + 0.075) * u, (p.eyebrow.y + 0.046) * u);\n      g.fillStyle = B; g.fillRect(p.eyebrow.x * u, (p.eyebrow.y + 0.11) * u, (p.eyebrow.w) * u, 0.006 * u);\n      g.fillStyle = R; g.letterSpacing = `${-0.022 * p.titleSize * u}px`; g.font = `600 ${p.titleSize * u}px ${SERIF}`;\n      p.titleLines.forEach((l, k) => g.fillText(l, p.title.x * u, (p.title.y + p.titleSize * 0.82 + k * p.titleSize * 1.06) * u));\n      g.letterSpacing = \"0px\"; g.font = `500 ${p.bodySize * u}px ${FONT}`;\n      p.bodyLines.forEach((l, k) => g.fillText(l, p.body.x * u, (p.body.y + p.bodySize * 1.0 + k * p.bodySize * 1.5) * u));\n      // the place for the seal: a ring of fine dashes and two words beneath it\n      g.strokeStyle = B; g.lineWidth = 0.007 * u; g.setLineDash([0.02 * u, 0.018 * u]);\n      g.beginPath(); g.arc(p.seal.x * u, p.seal.y * u, p.seal.r * u, 0, Math.PI * 2); g.stroke(); g.setLineDash([]);\n      g.fillStyle = B; g.textAlign = \"center\"; g.letterSpacing = `${0.2 * 0.036 * u}px`; g.font = `600 ${0.036 * u}px ${FONT}`;\n      g.fillText(card.seal.toUpperCase(), p.seal.x * u, (p.seal.y + p.seal.r + 0.07) * u);\n      const fs = hz > hx ? 0.078 : 0.07;\n      g.font = `600 ${fs * u}px ${FONT}`; g.letterSpacing = `${-0.005 * fs * u}px`;\n      g.fillStyle = G; pill(p.confirm); g.fill();\n      g.globalCompositeOperation = \"destination-out\"; g.fillStyle = \"#000\";\n      g.fillText(card.confirm, (p.confirm.x + p.confirm.w / 2) * u, (p.confirm.y + p.confirm.h / 2 + fs * 0.36) * u);\n      g.globalCompositeOperation = \"lighter\";\n      const i = 0.005; g.strokeStyle = R; g.lineWidth = 0.009 * u;\n      pill({ x: p.cancel.x + i, y: p.cancel.y + i, w: p.cancel.w - 2 * i, h: p.cancel.h - 2 * i }); g.stroke();\n      g.fillStyle = R; g.fillText(card.cancel, (p.cancel.x + p.cancel.w / 2) * u, (p.cancel.y + p.cancel.h / 2 + fs * 0.36) * u);\n      g.globalCompositeOperation = \"source-over\";\n      gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, texLab);\n      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, labCv);\n      gl.generateMipmap(gl.TEXTURE_2D);\n      return p;\n    };\n\n    const layout = () => {\n      const aspect = cssW / cssH;\n      const tall = aspect < 0.8;\n      if (tall) { hx = 1.0; hz = 1.42; } else { hx = 1.55; hz = 1.0; }\n      pl = paintCard();\n      rest = tall ? [hx - 0.5, 0, -hz - 0.7] : [hx + 0.85, 0, -0.3];\n      // fit the lens to the card and the seal standing beside it\n      const v = view(0, 0);\n      const pts: number[][] = [];\n      for (const [x, z] of [[-hx, -hz], [hx, -hz], [-hx, hz], [hx, hz]]) pts.push([x, 0, z]);\n      for (let a = 0; a < 8; a++) pts.push([rest[0] + Math.cos(a) * 0.18, 0, rest[2] + Math.sin(a) * 0.18]);\n      pts.push([rest[0], 0.88 * SC, rest[2]]);\n      const r = pts.map((p) => raw(v, p));\n      const x0 = Math.min(...r.map((q) => q[0])), x1 = Math.max(...r.map((q) => q[0]));\n      const y0 = Math.min(...r.map((q) => q[1])), y1 = Math.max(...r.map((q) => q[1]));\n      const foc = Math.min((tall ? 0.86 : 0.8) * aspect / (x1 - x0), (tall ? 0.74 : 0.76) / (y1 - y0));\n      fit = { foc, shift: [-foc * (x0 + x1) / 2, -foc * (y0 + y1) / 2 - 0.035] };\n      const fv = framed(0, 0);\n      // the far edge of the mat runs across the top of the frame, with walnut beyond it\n      const far = Math.min(onDesk(fv, 0, 0.43)[1], Math.min(-hz, rest[2] - 0.25) - 0.3);\n      mat[0] = 0; mat[1] = far + 9; mat[2] = 30; mat[3] = 9;\n      below = onDesk(fv, 0, -0.5)[1] + hz + 0.6;\n      left = onDesk(fv, -0.5 * aspect, 0)[0] - hx - 1.0;\n      if (!s.on) { s.cz = below; s.tz = below; }\n      if (s.seq < 0) s.st = [...rest];\n      setPlan(pl);\n      s.count = 0; s.fresh = true;\n    };\n    const size = () => {\n      const r = box.getBoundingClientRect();\n      const changed = Math.abs(r.width - cssW) > 0.5 || Math.abs(r.height - cssH) > 0.5;\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) {\n        W = w; H = h; cv.width = W; cv.height = H;\n        if (gl2 && acc && fbo) {\n          gl.activeTexture(gl.TEXTURE3); 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      if (changed) layout();\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    // The real dialog rides the card: the flat transform that best fits the four corners of its printed face.\n    const pin = (v: View) => {\n      const w = 2 * hx * U, h = 2 * hz * U;\n      const [tl, tr, bl, br] = [[-hx, -hz], [hx, -hz], [-hx, hz], [hx, hz]].map(([x, z]) => { const p = toWorld(x, z); return project(v, [p[0], 2 * CT, p[2]]); });\n      const a = (tr[0] - tl[0] + br[0] - bl[0]) / (2 * w), b = (tr[1] - tl[1] + br[1] - bl[1]) / (2 * w);\n      const c = (bl[0] - tl[0] + br[0] - tr[0]) / (2 * h), d = (bl[1] - tl[1] + br[1] - tr[1]) / (2 * h);\n      const mx = (tl[0] + tr[0] + bl[0] + br[0]) / 4, my = (tl[1] + tr[1] + bl[1] + br[1]) / 4;\n      const css = `matrix(${[a, b, c, d, mx - (a * w) / 2 - (c * h) / 2, my - (b * w) / 2 - (d * h) / 2].map((n) => n.toFixed(5)).join(\",\")})`;\n      if (api.current) api.current.matrix = css;\n      if (sheet.current) sheet.current.style.transform = css;\n    };\n    const stampRot = () => {\n      // a small lean toward where it is going: about x by the forward lean, about z by the sideways one\n      const ax = s.tilt[1], az = -s.tilt[0];\n      const cx = Math.cos(ax), sx = Math.sin(ax), cz = Math.cos(az), sz = Math.sin(az);\n      // R = Rx * Rz written row by row; read as columns by the shader it becomes its transpose, which takes world points into the seal's frame\n      return [cz, -sz, 0, cx * sz, cx * cz, -sx, sx * sz, sx * cz, cx];\n    };\n\n    const draw = (alpha: number, sample: number) => {\n      const v = framed(s.lx, s.ly);\n      pin(v);\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.06 : 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.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, texLab);\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);\n      gl.uniform1f(su.uDirect, canAcc ? 0 : 1);\n      gl.uniform3f(su.uCam, v.cam[0], v.cam[1], v.cam[2]);\n      gl.uniform3f(su.uFw, v.fw[0], v.fw[1], v.fw[2]); gl.uniform3f(su.uRt, v.rt[0], v.rt[1], v.rt[2]); gl.uniform3f(su.uUp, v.up[0], v.up[1], v.up[2]);\n      gl.uniform1f(su.uFoc, v.foc); gl.uniform2f(su.uShift, v.shift[0], v.shift[1]);\n      const fd = (0 - v.cam[0]) * v.fw[0] + (0.02 - v.cam[1]) * v.fw[1] + (0 - v.cam[2]) * v.fw[2];\n      gl.uniform1f(su.uFocusD, fd);\n      gl.uniform3f(su.uCard, s.cx, s.cz, s.cyaw);\n      gl.uniform2f(su.uHalf, hx, hz);\n      if (pl) gl.uniform2f(su.uSeal, pl.seal.x - hx, pl.seal.y - hz);\n      gl.uniform1f(su.uWax, s.wax); gl.uniform1f(su.uWaxOn, s.waxOn ? 1 : 0); gl.uniform1f(su.uCardOn, s.on || s.leaving ? 1 : 0);\n      gl.uniform3f(su.uStamp, s.st[0], s.st[1], s.st[2]);\n      gl.uniformMatrix3fv(su.uSRot, false, stampRot());\n      gl.uniform4f(su.uMat, mat[0], mat[1], mat[2], mat[3]);\n      gl.uniform4f(su.uHov, s.hov[0], s.hov[1], s.hov[2], s.hovS * s.hov[3]);\n      gl.uniform3f(su.uWaxC, WAX[0], WAX[1], WAX[2]); gl.uniform3f(su.uPaper, PAPER[0], PAPER[1], PAPER[2]); gl.uniform3f(su.uLeather, LEATHER[0], LEATHER[1], LEATHER[2]);\n      gl.uniform1i(su.uLab, 0);\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.activeTexture(gl.TEXTURE3); gl.bindTexture(gl.TEXTURE_2D, acc);\n        gl.uniform1i(pu.uAcc, 3); gl.uniform2f(pu.uRes, W, H);\n        gl.uniform1f(pu.uGrain, still ? 1 : s.frame % 64);\n        gl.drawArrays(gl.TRIANGLES, 0, 3);\n      }\n    };\n\n    // where the seal travels when it is used: up, across, a breath, down hard, hold, up, home\n    const path = () => {\n      if (!pl) return [];\n      const w = toWorld(pl.seal.x - hx, pl.seal.y - hz);\n      const touch = 2 * CT + 0.075, press = 2 * CT + 0.033;\n      return [\n        { t: 0, p: [rest[0], 0, rest[2]], e: 0 },\n        { t: 0.3, p: [rest[0], 0.36, rest[2]], e: 0 },\n        { t: 0.82, p: [w[0], 0.42, w[2]], e: 0 },\n        { t: 1.02, p: [w[0], 0.52, w[2]], e: 0 },\n        { t: 1.15, p: [w[0], touch, w[2]], e: 1 },\n        { t: 1.32, p: [w[0], press, w[2]], e: 2 },\n        { t: 1.72, p: [w[0], press, w[2]], e: 0 },\n        { t: 2.0, p: [w[0], 0.36, w[2]], e: 2 },\n        { t: 2.58, p: [rest[0], 0.26, rest[2]], e: 0 },\n        { t: 2.86, p: [rest[0], 0, rest[2]], e: 1 },\n      ] as { t: number; p: V3; e: number }[];\n    };\n    const sample = (keys: { t: number; p: V3; e: number }[], t: number): V3 => {\n      for (let i = 1; i < keys.length; i++) {\n        if (t <= keys[i].t) {\n          const a = keys[i - 1], b = keys[i];\n          const k = Math.max(0, Math.min(1, (t - a.t) / (b.t - a.t)));\n          const e = b.e === 1 ? k * k * k : b.e === 2 ? 1 - Math.pow(1 - k, 3) : k * k * (3 - 2 * k);\n          return [a.p[0] + (b.p[0] - a.p[0]) * e, a.p[1] + (b.p[1] - a.p[1]) * e, a.p[2] + (b.p[2] - a.p[2]) * e];\n        }\n      }\n      return [...keys[keys.length - 1].p];\n    };\n\n    const openCard = () => {\n      if (s.on && !s.leaving) return;\n      s.on = true; s.leaving = false; s.wax = 0; s.waxOn = true;\n      if (still) { s.cx = 0; s.cz = 0; s.cyaw = 0; s.vx = s.vz = s.vyaw = 0; }\n      else { s.cx = 0.35; s.cz = below; s.cyaw = -0.16; s.vx = 0; s.vz = -2; s.vyaw = 0; }\n      s.tx = 0; s.tz = 0; s.tyaw = 0; wake();\n    };\n    const away = (x: number, z: number, yaw: number) => {\n      s.leaving = true; s.tx = x; s.tz = z; s.tyaw = yaw;\n      if (still) { s.on = false; s.leaving = false; s.cx = x; s.cz = z; }\n      wake();\n    };\n    const cancel = () => { if (s.seq >= 0 || !s.on || s.leaving) return; away(0.4, below, 0.14); };\n    const confirm = () => {\n      if (s.seq >= 0 || !s.on || s.leaving) return;\n      if (still) { s.wax = 1; s.count = 0; s.fresh = true; s.closeAt = performance.now() + 1100; wake(); return; }\n      s.seq = 0; wake();\n    };\n    const hover = (b: Box | null) => {\n      s.hovB = b;\n      if (b) s.hov = [b.x + b.w / 2 - hx, b.y + b.h / 2 - hz, b.w / 2, b.h / 2];\n      if (still) { s.hovS = b ? 1 : 0; s.count = 0; s.fresh = true; }\n      wake();\n    };\n    api.current = { open: openCard, cancel, confirm, hover, matrix: \"\" };\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 + 4200; }\n\n      // the self-running demo starts from the finished card, seals it, files it, and deals a fresh one\n      if (!still && !s.touched && now > s.demoAt && s.seq < 0) {\n        if (s.on && !s.leaving) { confirm(); s.demoAt = now + 4600; }\n        else if (!s.on) { openCard(); setOpen(true); s.demoAt = now + 5200; }\n      }\n      if (still && s.closeAt && now > s.closeAt) { s.closeAt = 0; away(left, -0.3, 0); s.count = 0; s.fresh = true; }\n\n      let moving = false, speed = 0;\n      if (!still) {\n        if (s.seq < 0) for (let k = 0; k < 2; k++) s.tiltV[k] += -s.tilt[k] * 55 * dt;\n        if (s.seq >= 0) {\n          s.seq += dt;\n          const keys = path();\n          const prev = s.st;\n          s.st = sample(keys, s.seq);\n          const vx = (s.st[0] - prev[0]) / Math.max(dt, 1e-3), vz = (s.st[2] - prev[2]) / Math.max(dt, 1e-3);\n          s.tiltV[0] += (Math.max(-0.16, Math.min(0.16, vx * 0.05)) - s.tilt[0]) * 55 * dt;\n          s.tiltV[1] += (Math.max(-0.16, Math.min(0.16, vz * 0.05)) - s.tilt[1]) * 55 * dt;\n          const touch = 2 * CT + 0.075, press = 2 * CT + 0.033;\n          if (s.seq > 1.0 && s.seq < 1.8) s.wax = Math.max(s.wax, Math.max(0, Math.min(1, (touch - s.st[1]) / (touch - press))));\n          if (s.seq > 2.0 && !s.leaving) away(left, -0.25, 0.32);\n          if (s.seq > keys[keys.length - 1].t) { s.seq = -1; s.st = [...rest]; }\n        }\n        for (let k = 0; k < 2; k++) { s.tiltV[k] -= s.tiltV[k] * 13 * dt; s.tilt[k] += s.tiltV[k] * dt; }\n        const steps = 4, h = dt / steps;\n        const kS = s.leaving ? 30 : 42, cS = s.leaving ? 9 : 8.6;\n        for (let i = 0; i < steps; i++) {\n          s.vx += (kS * (s.tx - s.cx) - cS * s.vx) * h; s.cx += s.vx * h;\n          s.vz += (kS * (s.tz - s.cz) - cS * s.vz) * h; s.cz += s.vz * h;\n          s.vyaw += (kS * (s.tyaw - s.cyaw) - cS * s.vyaw) * h; s.cyaw += s.vyaw * h;\n        }\n        if (s.leaving && Math.abs(s.cx - s.tx) < 0.05 && Math.abs(s.cz - s.tz) < 0.05) { s.on = false; s.leaving = false; }\n        const hs = (s.hovB ? 1 : 0) - s.hovS;\n        s.hovS += hs * (1 - Math.exp(-dt * 12));\n        s.lx += (s.px - s.lx) * (1 - Math.exp(-dt * 3)); s.ly += (s.py - s.ly) * (1 - Math.exp(-dt * 3));\n        speed = Math.abs(s.vx) + Math.abs(s.vz) + Math.abs(s.vyaw) * 2 + (s.seq >= 0 ? 1 : 0) + Math.abs(hs) * 0.3 + Math.abs(s.px - s.lx) * 2 + Math.abs(s.py - s.ly) * 2 + Math.abs(s.tiltV[0]) + Math.abs(s.tiltV[1]);\n        moving = speed > 0.004;\n      }\n\n      if (s.fresh || !canAcc) { draw(1, 0); s.fresh = false; s.count = 1; }\n      else if (moving) { draw(Math.min(0.9, 0.3 + speed * 0.5), 1 + (s.frame % 64)); s.count = 4; }\n      else if (s.count < 48) { 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 > 40 && scale > 0.5) { scale *= 0.82; s.slow = 0; size(); }\n\n      if (moving || s.count < 48 || (!still && !s.touched) || s.closeAt) s.raf = requestAnimationFrame(frame);\n    };\n    const wake = () => { if (!s.raf && s.visible) { s.last = 0; s.raf = requestAnimationFrame(frame); } };\n\n    size();\n    const ro = new ResizeObserver(() => { size(); 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    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; wake();\n    };\n    const leave = () => { s.px = 0; s.py = 0; wake(); };\n    const touch = () => { s.touched = true; };\n    box.addEventListener(\"pointermove\", move);\n    box.addEventListener(\"pointerleave\", leave);\n    box.addEventListener(\"pointerdown\", touch);\n    box.addEventListener(\"keydown\", touch);\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      box.removeEventListener(\"pointermove\", move); box.removeEventListener(\"pointerleave\", leave);\n      box.removeEventListener(\"pointerdown\", touch); box.removeEventListener(\"keydown\", touch);\n      cv.removeEventListener(\"webglcontextlost\", lost);\n      api.current = null;\n    };\n  }, []);\n\n  useEffect(() => {\n    if (!byUser.current) return;\n    if (open) keep.current?.focus(); else trigger.current?.focus();\n  }, [open]);\n\n  const still = shown === \"still\";\n  const change = (to: boolean, how: \"cancel\" | \"confirm\" | \"open\") => {\n    byUser.current = true;\n    if (how === \"open\") { api.current?.open(); setSealed(false); setNote(\"\"); }\n    if (how === \"cancel\") { api.current?.cancel(); setNote(card.kept); }\n    if (how === \"confirm\") {\n      api.current?.confirm(); setNote(card.done);\n      if (still) { setSealed(true); window.setTimeout(() => { setOpen(false); }, 1100); return; }\n    }\n    setOpen(to);\n  };\n  const keys = (e: React.KeyboardEvent<HTMLDivElement>) => {\n    if (e.key === \"Escape\") { e.preventDefault(); change(false, \"cancel\"); return; }\n    if (e.key !== \"Tab\") return;\n    const list = Array.from(e.currentTarget.querySelectorAll<HTMLElement>(\"button\"));\n    if (!list.length) return;\n    const at = list.indexOf(document.activeElement as HTMLElement);\n    e.preventDefault();\n    list[(at + (e.shiftKey ? -1 : 1) + list.length) % list.length].focus();\n  };\n\n  const gl = !still && !!plan;\n  const at = (b: Box | undefined) => (gl && b ? { position: \"absolute\" as const, left: b.x * U, top: b.y * U, width: b.w * U, height: b.h * U } : undefined);\n  const lit = (b: Box | undefined) => ({\n    onPointerEnter: () => api.current?.hover(b ?? null), onPointerLeave: () => api.current?.hover(null),\n    onFocus: () => api.current?.hover(b ?? null), onBlur: () => api.current?.hover(null),\n  });\n  const ring = \"outline-none focus-visible:ring-2 focus-visible:ring-[#f3e6cf] focus-visible:ring-offset-4 focus-visible:ring-offset-[#2a1712]\";\n\n  return (\n    <section className=\"relative isolate overflow-hidden bg-[#140b08] text-[#f3e6cf]\" style={{ fontFamily: FONT }}>\n      <style>{`@keyframes brass-seal-lamp { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }`}</style>\n      <div\n        ref={stage}\n        className=\"relative h-[700px] w-full sm:h-[min(720px,62vw)] sm:min-h-[600px]\"\n        style={{ background: \"radial-gradient(120% 90% at 34% 38%, #3a2016 0%, #1c0f0b 55%, #0d0706 100%)\" }}\n        onPointerDown={(e) => { const t = e.target as HTMLElement; if (open && !t.closest(\"[role=dialog]\") && !t.closest(\"button\")) change(false, \"cancel\"); }}\n      >\n        <canvas ref={canvas} aria-hidden=\"true\" className={`absolute inset-0 h-full w-full transition-opacity duration-700 motion-reduce:transition-none ${shown === \"gl\" ? \"opacity-100\" : \"opacity-0\"}`} />\n\n        {still && (\n          <div aria-hidden=\"true\" className=\"absolute inset-0 overflow-hidden\">\n            <div className=\"absolute inset-x-0 top-0 h-[12%] bg-[linear-gradient(180deg,#2a150b,#4a2614_70%,#1a0c07)]\" />\n            <div className=\"absolute inset-x-0 top-[12%] bottom-0 bg-[radial-gradient(70%_60%_at_36%_42%,#4a2a1e_0%,#26140f_55%,#120a08_100%)]\" />\n            <div className=\"absolute inset-x-0 top-[12%] h-[3px] bg-[#6a4330]/60\" />\n            <div className=\"absolute inset-x-0 top-[calc(12%+18px)] border-t border-dashed border-[#7a5236]/70\" />\n            <div className=\"absolute inset-0 bg-[radial-gradient(40%_35%_at_30%_30%,rgba(255,196,120,0.18),transparent_70%)]\" />\n            <div className=\"absolute inset-0 bg-[radial-gradient(38%_34%_at_32%_34%,rgba(255,200,130,0.12),transparent_70%)] motion-safe:animate-[brass-seal-lamp_5s_ease-in-out_infinite]\" />\n            {!open && <div className=\"absolute right-[12%] top-[34%] hidden h-24 w-14 sm:block\"><span className=\"absolute bottom-0 left-1/2 h-4 w-16 -translate-x-1/2 rounded-[50%] bg-gradient-to-b from-[#e6b866] to-[#7a5422] shadow-[0_10px_18px_rgba(0,0,0,0.6)]\" /><span className=\"absolute bottom-3 left-1/2 h-12 w-3 -translate-x-1/2 bg-gradient-to-r from-[#7a5422] via-[#f0cd84] to-[#6a4518]\" /><span className=\"absolute -top-2 left-1/2 h-14 w-11 -translate-x-1/2 rounded-[50%] bg-[radial-gradient(circle_at_35%_30%,#4a3a32,#0e0907_70%)]\" /></div>}\n          </div>\n        )}\n\n        <div className={`absolute left-5 top-5 transition-opacity duration-300 motion-reduce:transition-none sm:left-9 sm:top-8 ${open ? \"pointer-events-none opacity-0\" : \"opacity-100\"}`}>\n          <button\n            ref={trigger}\n            type=\"button\"\n            aria-haspopup=\"dialog\"\n            aria-expanded={open}\n            tabIndex={open ? -1 : 0}\n            onClick={() => change(true, \"open\")}\n            className=\"inline-flex h-12 items-center gap-2.5 rounded-full bg-[#f1e6d2] pl-5 pr-4 text-[14px] font-semibold tracking-[-0.01em] text-[#2a1712] shadow-[0_14px_30px_-12px_rgba(0,0,0,0.8),inset_0_-2px_0_rgba(42,23,18,0.15)] outline-none transition-transform duration-200 hover:-translate-y-0.5 focus-visible:ring-2 focus-visible:ring-[#f3e6cf] focus-visible:ring-offset-2 focus-visible:ring-offset-[#1c0f0b] active:translate-y-0 motion-reduce:transition-none\"\n          >\n            {card.trigger}\n            <svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" className=\"h-5 w-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"M4 6h12M8 6V4h4v2M6 6l1 10h6l1-10\" /></svg>\n          </button>\n        </div>\n\n        {open && (\n          <div\n            ref={(el) => { sheet.current = el; if (el && gl && api.current?.matrix) el.style.transform = api.current.matrix; }}\n            role=\"dialog\"\n            aria-modal=\"true\"\n            aria-labelledby=\"brass-seal-dialog-title\"\n            aria-describedby=\"brass-seal-dialog-body\"\n            onKeyDown={keys}\n            className={gl\n              ? \"absolute left-0 top-0 origin-top-left text-transparent\"\n              : still\n                ? \"absolute left-1/2 top-[54%] w-[min(90%,640px)] -translate-x-1/2 -translate-y-1/2 rounded-[10px] bg-[#e9dcc2] p-6 text-[#1d1512] shadow-[0_1px_0_#fffaf0_inset,0_-2px_0_#bfae8e_inset,0_2px_2px_rgba(0,0,0,0.5),18px_34px_48px_-10px_rgba(0,0,0,0.75)] sm:p-10\"\n                : \"sr-only\"}\n            style={gl && plan ? { width: 2 * plan.hx * U, height: 2 * plan.hz * U } : undefined}\n          >\n            {!gl && (\n              <div aria-hidden=\"true\" className=\"absolute right-6 top-6 h-24 w-24 sm:right-10 sm:top-10\">\n                <span className=\"absolute inset-0 rounded-full border border-dashed border-[#8d7d63]\" />\n                {!sealed && <span className=\"absolute inset-6 rounded-[46%_54%_48%_52%] bg-[radial-gradient(circle_at_38%_32%,#e04a44,#8e1014_55%,#560709)] shadow-[0_4px_6px_rgba(60,0,0,0.45),inset_0_-3px_4px_rgba(40,0,0,0.5)]\" />}\n                {sealed && <span className=\"absolute inset-1 rounded-[46%_54%_50%_50%] bg-[radial-gradient(circle_at_40%_35%,#c0282a,#7d0d10_60%,#4c0608)] shadow-[0_3px_6px_rgba(60,0,0,0.5),inset_0_2px_3px_rgba(255,160,150,0.35)]\"><span className=\"absolute inset-3 rounded-full border-2 border-[#5e0709]/80 shadow-[inset_0_1px_2px_rgba(0,0,0,0.5)]\" /></span>}\n              </div>\n            )}\n            <p className={gl ? \"absolute whitespace-nowrap text-[10px] uppercase\" : \"flex items-center gap-2.5 text-[11px] font-semibold uppercase tracking-[0.22em] text-[#3b2c24]\"} style={at(plan?.eyebrow)}>\n              {!gl && <span aria-hidden=\"true\" className=\"h-2 w-2 bg-[#a3161a]\" />}{card.eyebrow}\n            </p>\n            <h2 id=\"brass-seal-dialog-title\" className={gl ? \"absolute leading-[1.06]\" : \"mt-6 max-w-[calc(100%-7rem)] text-[30px] font-medium leading-[1.06] tracking-[-0.02em] sm:mt-8 sm:text-[44px]\"} style={gl && plan ? { ...at(plan.title), fontSize: plan.titleSize * U, fontFamily: SERIF } : { fontFamily: SERIF }}>{card.title}</h2>\n            <p id=\"brass-seal-dialog-body\" className={gl ? \"absolute leading-[1.5]\" : \"mt-4 max-w-[26rem] text-[15px] leading-[1.55] text-[#3b2c24] sm:text-[16px]\"} style={gl && plan ? { ...at(plan.body), fontSize: plan.bodySize * U } : undefined}>{card.body}</p>\n            <div className={gl ? \"\" : \"mt-8 flex justify-end gap-3 sm:mt-12\"}>\n              <button ref={keep} type=\"button\" onClick={() => change(false, \"cancel\")} {...lit(plan?.cancel)} className={gl ? `rounded-full text-[14px] ${ring}` : `h-12 flex-1 whitespace-nowrap rounded-full border border-[#1d1512] px-5 text-[15px] font-semibold text-[#1d1512] transition-colors hover:bg-black/5 motion-reduce:transition-none sm:flex-none ${ring}`} style={at(plan?.cancel)}>{card.cancel}</button>\n              <button type=\"button\" onClick={() => change(false, \"confirm\")} {...lit(plan?.confirm)} className={gl ? `rounded-full text-[14px] ${ring}` : `h-12 flex-1 whitespace-nowrap rounded-full bg-[#a3161a] px-5 text-[15px] font-semibold text-[#fbf1e2] transition-colors hover:bg-[#8a1216] motion-reduce:transition-none sm:flex-none ${ring}`} style={at(plan?.confirm)}>{card.confirm}</button>\n            </div>\n          </div>\n        )}\n\n        <p className=\"pointer-events-none absolute bottom-4 left-5 text-[11px] font-medium uppercase tracking-[0.22em] text-[#e9d6b8]/70 sm:bottom-7 sm:left-9\">Demo only. Nothing is deleted.</p>\n        <p aria-live=\"polite\" className=\"sr-only\">{note}</p>\n      </div>\n    </section>\n  );\n}\n"}]}
