{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"enamel-house-name-plate-screwed-to-a-sunlit-painted-door-where-a-typed-address-sets-letter-by-letter-and-a-blue-dot-lights","type":"registry:block","title":"Enamel House Name Plate Screwed to a Sunlit Painted Door Where a Typed Address Sets Letter by Letter and a Blue Dot Lights","description":"Free React and WebGL domain input: each typed letter is set into a white enamel plate on a sunlit black door, then a brass screw drives home and a blue dot lights.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/enamel-house-name-plate-screwed-to-a-sunlit-painted-door-where-a-typed-address-sets-letter-by-letter-and-a-blue-dot-lights.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\n\n/** Names the self-playing demo sets on the plate, one after another. The first is on the door when the piece opens. */\nconst NAMES = [\"lindenbakery\", \"harbourswim\", \"fernandfig\"];\nconst SUFFIX = \".example\";\n/** Longest name the plate will take. */\nconst MAX_NAME = 16;\n/** Seconds after the last key before the loose screw is driven home. */\nconst SETTLE_AFTER = 1.1;\n\nconst BLUE = \"#4F98FB\";\nconst INK = \"#0B0D12\";\nconst PAPER = \"#F6F4EF\";\nconst WALL = \"#D9D1C4\";\nconst FONT = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, sans-serif';\n/** Lowest and highest render scale (canvas pixels per CSS pixel). The loop steps down when frames run slow. */\nconst MIN_SCALE = 0.6001;\nconst MAX_SCALE = 1.5001;\n/** Size of the lettering texture laid into the enamel. */\nconst TEX_W = 1024;\nconst TEX_H = 256;\n\n/* ---------- shaders ---------- */\n\nconst VERT = `#version 300 es\nin vec2 a; out vec2 vUv;\nvoid main(){ vUv = a * 0.5 + 0.5; gl_Position = vec4(a, 0.0, 1.0); }`;\n\nconst SCENE = `#version 300 es\nprecision highp float;\nin vec2 vUv; out vec4 o;\nuniform vec2 uRes;\nuniform vec3 uCam, uTarget;\nuniform float uFov, uTime;\nuniform float uTilt;   // how far the plate hangs off true, turning on its left screw\nuniform float uStand;  // how far the plate stands off the door\nuniform float uOut;    // how far the right screw is backed out\nuniform vec2 uTurn;    // the angle of each screw's slot\nuniform float uDot;    // the blue enamel dot: 0 dark, 1 lit\nuniform sampler2D uInk, uRelief;\n\nconst vec3 SUNC = vec3(1.0, 0.83, 0.62);\nconst vec3 BLUE = vec3(0.078, 0.30, 0.97);\nconst vec2 PC = vec2(0.0, 0.2);      // centre of the plate on the door\nconst vec2 HS = vec2(1.45, 0.4);     // half size of the plate\nconst float TH = 0.02;              // half thickness of the plate\nconst vec2 PIV = vec2(-1.31, 0.0);   // the left screw, which the plate hangs from\nconst vec2 DOTP = vec2(1.08, 0.0);   // the dot, after the lettering\nconst vec2 FX = vec2(-1.2, 1.0);     // the lettered field, left and right\nconst float FY = 0.27;               // and its half height\nvec3 gL; float gPix, gDist;\n\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), 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 fbm(vec2 p){ return 0.5 * n2(p) + 0.25 * n2(p * 2.03 + 1.7) + 0.125 * n2(p * 4.01 + 3.1) + 0.0625 * n2(p * 8.1 + 5.3); }\n\nfloat rb2(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 ext(float d2, float z, float h, float bev){ vec2 w = vec2(d2, abs(z) - h) + bev; return min(max(w.x, w.y), 0.0) + length(max(w, 0.0)) - bev; }\nmat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, s, -s, c); }\n\n// world to the plate's own frame: x along it, y up it, z out from its back face\nvec3 toPlate(vec3 p){\n  vec3 q = vec3(p.xy - PC - PIV, p.z);\n  q.xy = rot(uTilt) * q.xy;\n  q.xy += PIV;\n  q.z -= uStand;\n  return q;\n}\n\nfloat screw(vec3 q, vec2 c, float out_, float turn){\n  vec3 s = q - vec3(c, 2.0 * TH + out_);\n  // a domed brass head, its slot, and the shank that shows while it is backed out\n  float d = max(length(s + vec3(0.0, 0.0, 0.034)) - 0.064, -s.z);\n  vec2 sl = rot(turn) * s.xy;\n  d = max(d, -max(max(abs(sl.x) - 0.09, abs(sl.y) - 0.008), 0.017 - s.z));\n  float sh = max(length(s.xy) - 0.021, max(-q.z - uStand, s.z));\n  return min(d, sh);\n}\n\nvec2 map(vec3 p){\n  vec2 res = vec2(1e5, 0.0);\n  // the painted architraves either side of the door\n  for (int i = 0; i < 2; i++){\n    float sx = i == 0 ? -1.0 : 1.0;\n    vec2 q = vec2((p.x - sx * 2.3) * sx, p.z);\n    float d = rb2(q - vec2(0.0, 0.05), vec2(0.17, 0.05), 0.012);\n    d = min(d, rb2(q - vec2(-0.05, 0.1), vec2(0.1, 0.035), 0.03));\n    d = min(d, rb2(q - vec2(0.07, 0.11), vec2(0.035, 0.03), 0.028));\n    if (d < res.x) res = vec2(d, 1.0);\n  }\n  vec3 q = toPlate(p);\n  float bound = length(vec3(q.xy, q.z * 4.0)) - 1.7;\n  if (bound > 0.3) return vec2(min(res.x, bound), res.x < bound ? res.y : 0.0);\n  // the enamelled steel plate with a rolled edge\n  float d = ext(rb2(q.xy, HS, 0.1), q.z - TH, TH, 0.011);\n  if (d < res.x) res = vec2(d, 2.0);\n  d = min(screw(q, PIV, 0.0, uTurn.x), screw(q, vec2(-PIV.x, 0.0), uOut * 0.075, uTurn.y));\n  if (d < res.x) res = vec2(d, 3.0);\n  return res;\n}\nvec3 normal(vec3 p){\n  vec2 e = vec2(1.0, -1.0) * 0.0006;\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 march(vec3 ro, vec3 rd, float far){\n  float t = 0.0; vec2 h = vec2(0.0);\n  for (int i = 0; i < 120; i++){\n    h = map(ro + rd * t);\n    if (h.x < 0.0003 * (1.0 + t * 0.3) || t > far) break;\n    t += h.x * 0.9;\n  }\n  return vec2(t, (t > far || h.x > 0.01) ? 0.0 : h.y);\n}\nfloat softShadow(vec3 ro, vec3 rd){\n  float res = 1.0, t = 0.006;\n  for (int i = 0; i < 36; i++){\n    float h = map(ro + rd * t).x;\n    res = min(res, 14.0 * h / t);\n    t += clamp(h, 0.006, 0.15);\n    if (res < 0.004 || t > 2.5) 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 = 0; i < 5; i++){\n    float h = 0.006 + 0.07 * float(i) / 4.0;\n    o += (h - map(p + n * h).x) * s;\n    s *= 0.75;\n  }\n  return clamp(1.0 - 4.0 * o, 0.0, 1.0);\n}\n\n// The street in front of the door: open sky, a pale terrace across the road, warm paving.\nvec3 env(vec3 rd){\n  float y = rd.y;\n  vec3 sky = mix(vec3(0.62, 0.74, 0.9), vec3(0.95, 0.94, 0.9), smoothstep(0.7, 0.05, y)) * 1.5;\n  vec3 c = mix(vec3(0.3, 0.26, 0.22), sky, smoothstep(-0.04, 0.03, y));\n  float roofs = 0.1 + 0.05 * step(0.5, fract(rd.x * 2.3)) + 0.03 * n2(vec2(rd.x * 9.0, 1.0));\n  float ter = smoothstep(0.004, -0.004, y - roofs) * smoothstep(-0.03, 0.0, y);\n  float win = smoothstep(0.3, 0.6, n2(vec2(rd.x * 9.0, y * 12.0))) * 0.35;\n  c = mix(c, mix(vec3(0.95, 0.86, 0.72), vec3(0.3, 0.3, 0.32), win) * 1.1, ter);\n  return c;\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// Leaves from a tree out of shot throw a moving dapple, mostly over the upper left.\nfloat leaves(vec3 p){\n  vec2 w = p.xy - gL.xy / gL.z * p.z;\n  vec2 s = vec2(sin(uTime * 0.35) * 0.05 + sin(uTime * 0.9) * 0.012, cos(uTime * 0.27) * 0.035);\n  // the shadow of the porch roof: a long soft diagonal across the top of the door, broken up by leaves at its edge\n  float edge = (w.y - 1.25) + 0.42 * (w.x + 1.0);\n  float br = fbm(w * 2.2 + s + vec2(3.1, 7.7)) - 0.5;\n  float roof = smoothstep(-0.09, 0.09, edge + br * 0.22);\n  // and a few coins of light that get through the leaves inside it\n  float coins = smoothstep(0.7, 0.74, n2(w * 7.0 + s * 4.0 + 11.0)) * smoothstep(0.5, 0.65, fbm(w * 1.3 + 4.0)) * 0.8;\n  return mix(1.0, 0.07 + coins * 0.0, roof);\n}\n\nvec3 sunLight(vec3 p, vec3 n, bool hq){\n  float d = dot(n, gL);\n  if (d <= 0.0) return vec3(0.0);\n  float v = leaves(p);\n  if (v > 0.01 && hq) v *= softShadow(p + n * 0.002, gL);\n  return SUNC * 3.1 * d * v;\n}\nvec3 fill(vec3 n, float ao){\n  // the open sky in front, warm bounce off the paving, the lit terrace opposite\n  vec3 c = vec3(0.34, 0.4, 0.5) * (0.55 + 0.45 * n.y) * max(n.z * 0.6 + 0.4, 0.0) + vec3(0.32, 0.25, 0.18) * max(-n.y, 0.0) * 0.8 + vec3(0.2, 0.17, 0.14) * max(n.z, 0.0);\n  return c * ao;\n}\nvec3 dotGlow(vec3 p){\n  vec3 dp = vec3(PC + DOTP, 2.0 * TH + uStand);\n  float d = length(p - dp);\n  return BLUE * uDot * 0.05 / (d * d + 0.03);\n}\n\n// The raised and fielded panels of the door, as a relief height.\nfloat panelH(vec2 p){\n  vec2 q = vec2(abs(p.x) - 0.96, p.y);\n  float d = min(rb2(q - vec2(0.0, 2.2), vec2(0.84, 1.35), 0.02), rb2(q - vec2(0.0, -2.05), vec2(0.84, 1.6), 0.02));\n  if (d > 0.0) return 0.0;\n  float groove = -0.014 * smoothstep(0.0, -0.012, d) * smoothstep(-0.05, -0.035, d);\n  float bevel = 0.026 * smoothstep(-0.06, -0.24, d);\n  return groove + bevel - 0.008;\n}\n\nvec3 planeShade(vec3 p, vec3 rd, float t){\n  float ax = abs(p.x);\n  vec3 n = vec3(0.0, 0.0, 1.0);\n  float nv = max(dot(n, -rd), 0.0);\n  if (ax < 2.13){\n    // the door: gloss paint in near black, laid on with a brush\n    float e = 0.004;\n    float h = panelH(p.xy);\n    vec2 g = vec2(panelH(p.xy + vec2(e, 0.0)) - h, panelH(p.xy + vec2(0.0, e)) - h) / e;\n    float brushV = n2(vec2(p.x * 260.0, p.y * 3.0)), brushH = n2(vec2(p.x * 3.0, p.y * 260.0));\n    float onRail = step(abs(p.y - 0.2), 0.62) * step(ax, 1.8);\n    float br = (mix(brushV, brushH, onRail) - 0.5) * 0.5;\n    vec3 nn = normalize(vec3(-g * 1.0 + mix(vec2(br * 0.012, 0.0), vec2(0.0, br * 0.012), onRail), 1.0));\n    float groove = smoothstep(-0.006, -0.02, h - (h > -0.0081 ? -0.008 : h)) ;\n    float ao = occ(p + nn * 0.001, nn) * (1.0 - 0.5 * smoothstep(-0.008, -0.02, h));\n    float gap = smoothstep(2.095, 2.11, ax);\n    vec3 alb = vec3(0.021, 0.023, 0.029) * (0.95 + 0.1 * n2(p.xy * 3.0));\n    vec3 sl = sunLight(p, nn, true);\n    vec3 col = alb * (sl + fill(nn, ao));\n    vec3 r = reflect(rd, nn);\n    float F = 0.04 + 0.96 * pow(1.0 - max(dot(nn, -rd), 0.0), 5.0);\n    col += env(r) * F * ao * 0.5 * (0.75 + 0.5 * smoothstep(-2.0, 2.0, p.y));\n    col += SUNC * 3.1 * pow(max(dot(r, gL), 0.0), 120.0) * 4.0 * length(sl) / 3.1;\n    col += dotGlow(p) * 0.06;\n    return col * (1.0 - 0.9 * gap);\n  }\n  // lime-washed plaster\n  float b = fbm(p.xy * 4.0);\n  float b2 = n2(p.xy * 37.0);\n  float e = 0.01;\n  vec3 nn = normalize(vec3((fbm((p.xy + vec2(e, 0.0)) * 4.0) - b) / e * 0.05 + (b2 - 0.5) * 0.1, (fbm((p.xy + vec2(0.0, e)) * 4.0) - b) / e * 0.05, 1.0));\n  vec3 alb = vec3(0.8, 0.76, 0.69) * (0.92 + 0.1 * b + 0.04 * b2);\n  float ao = occ(p + nn * 0.001, nn);\n  return alb * (sunLight(p, nn, true) + fill(nn, ao));\n}\n\nvec3 shade(vec3 p, vec3 n, float id, vec3 rd){\n  float ao = occ(p, n);\n  vec3 r = reflect(rd, n);\n  float nv = max(dot(n, -rd), 0.0);\n  if (id < 1.5){\n    // the architraves, in warm white eggshell paint\n    vec3 alb = vec3(0.84, 0.81, 0.75) * (0.97 + 0.05 * n2(p.yz * vec2(3.0, 60.0)));\n    vec3 col = alb * (sunLight(p, n, true) + fill(n, ao));\n    col += env(r) * (0.03 + 0.25 * pow(1.0 - nv, 5.0)) * ao;\n    return col;\n  }\n  if (id < 2.5){\n    vec3 q = toPlate(p);\n    vec3 nl = n;\n    vec3 alb = vec3(0.8, 0.78, 0.735);\n    float gloss = 1.0;\n    float inkA = 0.0, wet = 0.0;\n    if (q.z > 2.0 * TH - 0.004 && n.z > 0.2){\n      // the face: the lettering, a fine border rule and the dot\n      vec2 uv = vec2((q.x - FX.x) / (FX.y - FX.x), (FY - q.y) / (2.0 * FY));\n      if (uv.x > 0.0 && uv.x < 1.0 && uv.y > 0.0 && uv.y < 1.0){\n        vec4 k = texture(uInk, uv);\n        inkA = k.r; wet = k.g;\n        vec2 e = vec2(1.5 / ${TEX_W}.0, 1.5 / ${TEX_H}.0);\n        float h0 = texture(uRelief, uv).r;\n        vec2 g = vec2(texture(uRelief, uv + vec2(e.x, 0.0)).r - h0, texture(uRelief, uv - vec2(0.0, e.y)).r - h0);\n        vec2 tilt = rot(-uTilt) * (-g * (1.4 + 2.2 * wet));\n        nl = normalize(n + vec3(tilt, 0.0));\n      }\n      float pw = max(0.004, gDist * gPix * 0.8);\n      float rule = smoothstep(pw, pw * 0.4, abs(rb2(q.xy, HS - 0.075, 0.05)) - 0.003);\n      inkA = max(inkA, rule);\n      float dd = length(q.xy - DOTP);\n      float dotM = smoothstep(0.052, 0.046, dd);\n      alb = mix(alb, vec3(0.022, 0.025, 0.032), inkA);\n      vec3 dotC = mix(vec3(0.03, 0.07, 0.2), BLUE * 0.9, uDot);\n      alb = mix(alb, dotC, dotM);\n      if (dotM > 0.0) nl = normalize(n + vec3(rot(-uTilt) * (q.xy - DOTP) * 7.0 * dotM, 0.0));\n      // the plate is very slightly domed, so the sky slides across it\n      nl = normalize(nl + vec3(rot(-uTilt) * (q.xy / HS) * vec2(0.05, 0.12), 0.0));\n      // the enamel is a glass: a faint ripple in its surface\n      nl = normalize(nl + vec3(n2(q.xy * 60.0) - 0.5, n2(q.xy * 60.0 + 9.0) - 0.5, 0.0) * 0.012);\n      vec3 col = alb * (sunLight(p, nl, true) * mix(1.0, 0.9, inkA) + fill(nl, ao));\n      vec3 rr = reflect(rd, nl);\n      float F = 0.045 + 0.955 * pow(1.0 - max(dot(nl, -rd), 0.0), 5.0);\n      float sv = leaves(p);\n      col += env(rr) * F * (0.9 + 0.6 * wet);\n      col += SUNC * 3.1 * pow(max(dot(rr, gL), 0.0), 260.0) * 30.0 * sv;\n      col = mix(col, BLUE * (0.15 + 1.25 * uDot * (0.92 + 0.08 * sin(uTime * 2.2))) + env(rr) * F, dotM * 0.92);\n      col += dotGlow(p) * (1.0 - dotM) * mix(1.0, 0.25, inkA);\n      return col;\n    }\n    // the rolled edge and the back: the same enamel, a touch greyer where it is thin over the steel\n    alb = vec3(0.78, 0.76, 0.72);\n    vec3 col = alb * (sunLight(p, n, true) + fill(n, ao));\n    col += env(r) * (0.045 + 0.955 * pow(1.0 - nv, 5.0));\n    col += SUNC * 3.1 * pow(max(dot(r, gL), 0.0), 200.0) * 20.0 * leaves(p);\n    return col;\n  }\n  // brass screw heads, a little worn\n  vec3 f0 = vec3(0.95, 0.74, 0.42) * (0.88 + 0.12 * n2(p.xy * 200.0));\n  vec3 col = fres(f0, nv) * (env(r) * (0.35 + 0.65 * ao) + SUNC * 3.1 * pow(max(dot(r, gL), 0.0), 50.0) * 5.0 * leaves(p));\n  col += f0 * sunLight(p, n, true) * 0.08;\n  return col;\n}\n\nvec3 aces(vec3 x){ return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); }\n\nvoid main(){\n  gL = normalize(vec3(-0.62, 0.6, 0.5));\n  gPix = 2.0 * tan(uFov * 0.5) / uRes.y;\n  vec2 uv = (gl_FragCoord.xy - 0.5 * uRes) / uRes.y;\n  vec3 fw = normalize(uTarget - uCam), rgt = normalize(cross(fw, vec3(0.0, 1.0, 0.0))), up = cross(rgt, fw);\n  vec3 rd = normalize(fw + (uv.x * rgt + uv.y * up) * 2.0 * tan(uFov * 0.5));\n  vec3 ro = uCam;\n  float tp = rd.z < -1e-4 ? -ro.z / rd.z : 1e5;\n  // start the march just in front of anything that stands proud of the door\n  float t0 = rd.z < -1e-4 ? max(0.0, (0.25 - ro.z) / rd.z) : 0.0;\n  vec2 hit = march(ro + rd * t0, rd, tp - t0);\n  float t; vec3 col;\n  if (hit.y > 0.5){\n    t = t0 + hit.x; vec3 p = ro + rd * t; gDist = t;\n    col = shade(p, normal(p), hit.y, rd);\n  } else {\n    t = tp; gDist = t;\n    col = planeShade(ro + rd * tp, rd, tp);\n  }\n  col *= 0.6;\n  col = aces(col);\n  col = pow(col, vec3(1.0 / 2.2));\n  o = vec4(col, clamp(t / 24.0, 0.0, 1.0));\n}`;\n\nconst POST = `#version 300 es\nprecision highp float;\nin vec2 vUv; out vec4 o;\nuniform sampler2D uSrc;\nuniform vec2 uRes;\nuniform float uFocus, uTime;\nfloat hash(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }\nvoid main(){\n  vec4 c0 = texture(uSrc, vUv);\n  float z = c0.a * 24.0;\n  {\n    vec2 e = 1.0 / uRes; vec3 L = vec3(0.299, 0.587, 0.114);\n    float nw = dot(textureLod(uSrc, vUv + vec2(-e.x, -e.y), 0.0).rgb, L), ne = dot(textureLod(uSrc, vUv + vec2(e.x, -e.y), 0.0).rgb, L);\n    float sw = dot(textureLod(uSrc, vUv + vec2(-e.x, e.y), 0.0).rgb, L), se = dot(textureLod(uSrc, vUv + e, 0.0).rgb, L), lm = dot(c0.rgb, L);\n    float lo = min(lm, min(min(nw, ne), min(sw, se))), hi = max(lm, max(max(nw, ne), max(sw, se)));\n    vec2 dir = vec2(-((nw + ne) - (sw + se)), (nw + sw) - (ne + se));\n    float rcp = 1.0 / (min(abs(dir.x), abs(dir.y)) + max((nw + ne + sw + se) * 0.03125, 0.0078));\n    dir = clamp(dir * rcp, -8.0, 8.0) * e;\n    vec3 a = 0.5 * (textureLod(uSrc, vUv + dir * (1.0 / 3.0 - 0.5), 0.0).rgb + textureLod(uSrc, vUv + dir * (2.0 / 3.0 - 0.5), 0.0).rgb);\n    vec3 b = a * 0.5 + 0.25 * (textureLod(uSrc, vUv - dir * 0.5, 0.0).rgb + textureLod(uSrc, vUv + dir * 0.5, 0.0).rgb);\n    float lb = dot(b, L);\n    c0.rgb = (lb < lo || lb > hi) ? a : b;\n  }\n  float px = uRes.y / 720.0;\n  float coc = clamp(abs(z - uFocus) / max(z, 0.1) * 26.0 - 0.5, 0.0, 6.0) * px;\n  vec3 acc = c0.rgb; float ws = 1.0;\n  float j = hash(gl_FragCoord.xy) * 6.283;\n  float lod = log2(max(coc / 3.0, 1.0));\n  for (int i = 0; i < 12; i++){\n    float fi = (float(i) + 0.5) / 12.0;\n    float a = float(i) * 2.39996 + j;\n    vec2 off = vec2(cos(a), sin(a)) * sqrt(fi) * coc / uRes;\n    vec4 s = textureLod(uSrc, vUv + off, lod);\n    float w = 1.0 + 4.0 * pow(max(s.r, max(s.g, s.b)), 6.0);\n    acc += s.rgb * w; ws += w;\n  }\n  vec3 col = acc / ws;\n  vec3 bl = textureLod(uSrc, vUv, 3.0).rgb * 0.35 + textureLod(uSrc, vUv, 4.5).rgb * 0.35 + textureLod(uSrc, vUv, 6.0).rgb * 0.3;\n  col += bl * bl * 0.08;\n  vec2 v = vUv - vec2(0.6, 0.5);\n  col *= 1.0 - dot(v, v) * 0.42;\n  float g = hash(gl_FragCoord.xy + fract(uTime) * 91.7) - 0.5;\n  col += g * 0.02 * (1.0 - 0.4 * col);\n  o = vec4(col, 1.0);\n}`;\n\n/* ---------- small motion helpers ---------- */\n\ntype Spring = { x: number; v: number; t: number; k: number; c: number };\nconst spring = (x: number, k: number, c: number): Spring => ({ x, v: 0, t: x, k, c });\nconst stepSpring = (s: Spring, dt: number) => {\n  s.v += (-s.k * (s.x - s.t) - s.c * s.v) * dt;\n  s.x += s.v * dt;\n};\nconst clean = (s: string) => s.toLowerCase().replace(/[^a-z0-9-]/g, \"\").slice(0, MAX_NAME);\n\ntype Glyph = { ch: string; x: number; tx: number; born: number; dying: number; suffix: boolean };\n\nexport default function EnamelHouseNamePlate() {\n  const reduce = useReducedMotion();\n  const [name, setName] = useState(NAMES[0]);\n  const [fixed, setFixed] = useState(true);\n  const [ready, setReady] = useState(false);\n  const rootRef = useRef<HTMLElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  // The render loop owns the scene. React talks to it through this handle.\n  const api = useRef<{ type: (s: string, byHand: boolean) => void; fix: () => void; stopDemo: () => void } | null>(null);\n\n  useEffect(() => {\n    const root = rootRef.current;\n    const canvas = canvasRef.current;\n    if (!root || !canvas) return;\n    const gl = canvas.getContext(\"webgl2\", { antialias: false, alpha: false, powerPreference: \"high-performance\" });\n    if (!gl) return;\n\n    const compile = (type: number, src: string) => {\n      const s = gl.createShader(type)!;\n      gl.shaderSource(s, src);\n      gl.compileShader(s);\n      if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s) || \"shader\");\n      return s;\n    };\n    const link = (fs: string) => {\n      const p = gl.createProgram()!;\n      gl.attachShader(p, compile(gl.VERTEX_SHADER, VERT));\n      gl.attachShader(p, compile(gl.FRAGMENT_SHADER, fs));\n      gl.bindAttribLocation(p, 0, \"a\");\n      gl.linkProgram(p);\n      if (!gl.getProgramParameter(p, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(p) || \"link\");\n      return p;\n    };\n    let scene: WebGLProgram;\n    let post: WebGLProgram;\n    try {\n      scene = link(SCENE);\n      post = link(POST);\n    } catch (e) {\n      console.error(e);\n      return;\n    }\n    const U = (p: WebGLProgram, n: string) => gl.getUniformLocation(p, n);\n    const su = Object.fromEntries(\n      [\"uRes\", \"uCam\", \"uTarget\", \"uFov\", \"uTime\", \"uTilt\", \"uStand\", \"uOut\", \"uTurn\", \"uDot\", \"uInk\", \"uRelief\"].map((n) => [n, U(scene, n)]),\n    );\n    const pu = Object.fromEntries([\"uSrc\", \"uRes\", \"uFocus\", \"uTime\"].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);\n    gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);\n\n    /* ---- the lettering, drawn in 2D and laid into the enamel ---- */\n    const ink = document.createElement(\"canvas\");\n    ink.width = TEX_W;\n    ink.height = TEX_H;\n    const relief = document.createElement(\"canvas\");\n    relief.width = TEX_W;\n    relief.height = TEX_H;\n    const ic = ink.getContext(\"2d\")!;\n    const rc = relief.getContext(\"2d\")!;\n    const mkTex = () => {\n      const t = gl.createTexture()!;\n      gl.bindTexture(gl.TEXTURE_2D, t);\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      return t;\n    };\n    const inkTex = mkTex();\n    const reliefTex = mkTex();\n\n    let clock = 0;\n    let glyphs: Glyph[] = [];\n    let size = 0;\n    let sizeT = 0;\n    const fontOf = (px: number, suffix: boolean) => `${suffix ? 600 : 800} ${px}px ${FONT}`;\n    const layout = () => {\n      const live = glyphs.filter((g) => g.dying < 0);\n      // fit the line inside the field, never larger than a set cap height\n      ic.font = fontOf(100, false);\n      let w = 0;\n      const adv = live.map((g) => {\n        ic.font = fontOf(100, g.suffix);\n        const a = ic.measureText(g.ch).width - 3.5;\n        w += a;\n        return a;\n      });\n      sizeT = Math.min(118, (TEX_W * 0.94 * 100) / Math.max(w, 1));\n      let x = (TEX_W - (w * sizeT) / 100) / 2;\n      live.forEach((g, i) => {\n        g.tx = x;\n        x += (adv[i] * sizeT) / 100;\n      });\n    };\n    const setText = (nm: string, instant: boolean) => {\n      const full = nm + SUFFIX;\n      const live = glyphs.filter((g) => g.dying < 0);\n      let k = 0;\n      while (k < live.length && k < full.length && live[k].ch === full[k] && live[k].suffix === k >= nm.length) k++;\n      const keep = live.slice(0, k);\n      live.slice(k).forEach((g) => (g.dying = instant ? clock - 10 : clock));\n      const fresh: Glyph[] = [];\n      for (let i = k; i < full.length; i++) {\n        const suffix = i >= nm.length;\n        // the suffix letters are already on the plate; only the name's letters are set fresh\n        const old = live.find((g, j) => j >= k && g.suffix && suffix && g.ch === full[i] && g.dying === clock);\n        if (old) {\n          old.dying = -1;\n          fresh.push(old);\n        } else fresh.push({ ch: full[i], x: 0, tx: 0, born: instant ? clock - 10 : clock + (fresh.length - 0) * 0, dying: -1, suffix });\n      }\n      glyphs = [...keep, ...fresh, ...glyphs.filter((g) => g.dying >= 0 && !fresh.includes(g))];\n      layout();\n      glyphs.forEach((g) => {\n        if (g.x === 0 || instant) g.x = g.tx;\n      });\n      if (instant || size === 0) size = sizeT;\n    };\n    // returns true while something is still moving\n    const paintText = () => {\n      let moving = Math.abs(size - sizeT) > 0.05;\n      const k = 1 - Math.exp(-dtLast * 14);\n      size += (sizeT - size) * k;\n      ic.fillStyle = \"#000\";\n      ic.fillRect(0, 0, TEX_W, TEX_H);\n      ic.textBaseline = \"alphabetic\";\n      const base = TEX_H / 2 + size * 0.36;\n      glyphs = glyphs.filter((g) => g.dying < 0 || clock - g.dying < 0.3);\n      for (const g of glyphs) {\n        if (g.dying < 0) {\n          if (Math.abs(g.tx - g.x) > 0.2) moving = true;\n          g.x += (g.tx - g.x) * k;\n        }\n        const age = clock - g.born;\n        let s = 1;\n        let a = 1;\n        let wet = 0;\n        if (g.dying >= 0) {\n          const d = (clock - g.dying) / 0.3;\n          a = 1 - d;\n          s = 1 + d * 0.25;\n          moving = true;\n        } else if (age < 1.6) {\n          // a bead of wet enamel lands, spreads past its shape and draws back in, then cures from gloss to satin\n          a = Math.min(1, age * 9);\n          s = 1 + 0.42 * Math.exp(-age * 10) * Math.cos(age * 26);\n          wet = Math.exp(-age * 2.4);\n          moving = true;\n        }\n        ic.font = fontOf(size, g.suffix);\n        const w = ic.measureText(g.ch).width;\n        ic.save();\n        ic.globalAlpha = Math.max(0, Math.min(1, a));\n        ic.translate(g.x + w / 2, base - size * 0.36);\n        ic.scale(s, s);\n        ic.fillStyle = `rgb(255,${Math.round(wet * 255)},0)`;\n        ic.fillText(g.ch, -w / 2, size * 0.36);\n        ic.restore();\n      }\n      // the relief: a softened copy, so the lettering stands a hair proud of the enamel with rounded shoulders\n      rc.fillStyle = \"#000\";\n      rc.fillRect(0, 0, TEX_W, TEX_H);\n      rc.filter = \"blur(3px)\";\n      rc.drawImage(ink, 0, 0);\n      rc.filter = \"none\";\n      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n      for (const [t, c] of [\n        [inkTex, ink],\n        [reliefTex, relief],\n      ] as const) {\n        gl.bindTexture(gl.TEXTURE_2D, t);\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);\n        gl.generateMipmap(gl.TEXTURE_2D);\n      }\n      return moving;\n    };\n    let dtLast = 0.016;\n\n    /* ---- the plate, its screws and the dot ---- */\n    const tilt = spring(0, 120, 14);\n    const stand = spring(0.012, 200, 22);\n    const out = spring(0, 60, 14);\n    const dot = spring(1, 90, 9);\n    const turn = [0.6, 2.2];\n    let drive = 0; // seconds left while the right screw is being driven home\n    let isFixed = true;\n    let textDirty = true;\n    let dirty = true;\n    let cues: { at: number; fn: () => void }[] = [];\n    const at = (delay: number, fn: () => void) => {\n      cues.push({ at: clock + delay, fn });\n      cues.sort((a, b) => a.at - b.at);\n    };\n    let current = NAMES[0];\n    let settleAt = Infinity;\n\n    const loosen = () => {\n      if (!isFixed) return;\n      isFixed = false;\n      setFixed(false);\n      dot.t = 0;\n      out.t = 1;\n      stand.t = 0.04;\n      tilt.k = 26;\n      tilt.c = 1.6;\n      tilt.t = -0.022;\n      if (reduce) {\n        for (const s of [dot, out, stand, tilt]) ((s.x = s.t), (s.v = 0));\n      }\n    };\n    const fix = () => {\n      settleAt = Infinity;\n      if (isFixed) return;\n      isFixed = true;\n      if (reduce) {\n        out.x = out.t = 0;\n        stand.x = stand.t = 0.012;\n        tilt.x = tilt.t = 0;\n        dot.x = dot.t = 1;\n        setFixed(true);\n        dirty = true;\n        return;\n      }\n      // the right screw is driven home, which pulls the plate level and tight to the door, then the dot lights\n      drive = 0.75;\n      out.t = 0;\n      tilt.k = 120;\n      tilt.c = 13;\n      tilt.t = 0;\n      at(0.62, () => {\n        stand.t = 0.012;\n        stand.v -= 0.06;\n      });\n      at(0.95, () => {\n        dot.t = 1;\n        dot.v += 6;\n        setFixed(true);\n      });\n    };\n    const type = (s: string) => {\n      const nm = clean(s);\n      if (nm === current) return;\n      const added = nm.length > current.length;\n      loosen();\n      current = nm;\n      setName(nm);\n      setText(nm, !!reduce);\n      textDirty = true;\n      dirty = true;\n      // a letter landing knocks the loose plate on its screw\n      if (!reduce) tilt.v += added ? 0.1 : -0.06;\n      settleAt = nm.length ? clock + SETTLE_AFTER : Infinity;\n    };\n\n    // the self-playing demo: hold the finished plate, then take the name off letter by letter and set the next one\n    let demo = !reduce;\n    let demoIdx = 0;\n    let demoNext = 3.4;\n    const demoStep = () => {\n      const goal = NAMES[(demoIdx + 1) % NAMES.length];\n      if (!isFixed || current !== goal) {\n        if (goal.startsWith(current) && current !== goal) {\n          type(goal.slice(0, current.length + 1));\n          demoNext = clock + 0.12 + Math.random() * 0.1;\n        } else if (current.length && !goal.startsWith(current)) {\n          type(current.slice(0, -1));\n          demoNext = clock + 0.055;\n        } else if (current === goal) {\n          demoNext = clock + 0.2;\n        }\n        if (current === goal) {\n          settleAt = clock + 0.5;\n          demoIdx = (demoIdx + 1) % NAMES.length;\n          demoNext = clock + 0.5 + 1.0 + 5.2;\n        }\n      }\n    };\n    const stopDemo = () => {\n      demo = false;\n    };\n    api.current = {\n      type: (s, byHand) => {\n        if (byHand) stopDemo();\n        type(s);\n        kick();\n      },\n      fix: () => {\n        stopDemo();\n        fix();\n        kick();\n      },\n      stopDemo,\n    };\n    setText(current, true);\n\n    /* ---- render target ---- */\n    const fbo = gl.createFramebuffer();\n    const fbTex = gl.createTexture()!;\n    gl.bindTexture(gl.TEXTURE_2D, fbTex);\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    let scale = Math.min(MAX_SCALE, Math.max(1, window.devicePixelRatio || 1));\n    let cssW = 1;\n    let cssH = 1;\n    let phone = false;\n    let bw = 0;\n    let bh = 0;\n    const resize = () => {\n      const r = canvas.getBoundingClientRect();\n      cssW = Math.max(1, r.width);\n      cssH = Math.max(1, r.height);\n      phone = cssW < 768;\n      // never more than about 1.6 million pixels through the ray marcher\n      const s = Math.min(scale, Math.sqrt(1.6e6 / (cssW * cssH)));\n      const w = Math.round(cssW * s);\n      const h = Math.round(cssH * s);\n      if (w !== bw || h !== bh) {\n        bw = w;\n        bh = h;\n        canvas.width = w;\n        canvas.height = h;\n        gl.bindTexture(gl.TEXTURE_2D, fbTex);\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, w, h, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n        gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fbTex, 0);\n      }\n      dirty = true;\n    };\n    resize();\n\n    const cam = { ax: 0, ay: 0, tx: 0, ty: 0 };\n    let time = 0;\n    const draw = () => {\n      const wide = cssW / cssH;\n      const tgt = phone ? [0, 0.62, 0] : [-1.25, 0.12, 0];\n      const az = (phone ? 0.12 : 0.22) + cam.ax * 0.06 + Math.sin(time * 0.17) * 0.01;\n      const el = (phone ? 0.04 : 0.06) - cam.ay * 0.035 + Math.sin(time * 0.23 + 1) * 0.004;\n      const fov = 0.5;\n      const half = Math.tan(fov / 2);\n      const dist = phone ? Math.max(9, 1.78 / (half * wide)) : 8.3 * Math.max(1, 1.78 / wide);\n      const camPos = [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\n      gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n      gl.viewport(0, 0, bw, bh);\n      gl.useProgram(scene);\n      gl.uniform2f(su.uRes, bw, bh);\n      gl.uniform3f(su.uCam, camPos[0], camPos[1], camPos[2]);\n      gl.uniform3f(su.uTarget, tgt[0], tgt[1], tgt[2]);\n      gl.uniform1f(su.uFov, fov);\n      gl.uniform1f(su.uTime, time);\n      gl.uniform1f(su.uTilt, tilt.x);\n      gl.uniform1f(su.uStand, Math.max(0.002, stand.x));\n      gl.uniform1f(su.uOut, Math.max(0, out.x));\n      gl.uniform2f(su.uTurn, turn[0], turn[1]);\n      gl.uniform1f(su.uDot, Math.max(0, Math.min(1.25, dot.x)));\n      gl.activeTexture(gl.TEXTURE1);\n      gl.bindTexture(gl.TEXTURE_2D, inkTex);\n      gl.uniform1i(su.uInk, 1);\n      gl.activeTexture(gl.TEXTURE2);\n      gl.bindTexture(gl.TEXTURE_2D, reliefTex);\n      gl.uniform1i(su.uRelief, 2);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n      gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n      gl.viewport(0, 0, bw, bh);\n      gl.useProgram(post);\n      gl.activeTexture(gl.TEXTURE0);\n      gl.bindTexture(gl.TEXTURE_2D, fbTex);\n      gl.generateMipmap(gl.TEXTURE_2D);\n      gl.uniform1i(pu.uSrc, 0);\n      gl.uniform2f(pu.uRes, bw, bh);\n      gl.uniform1f(pu.uFocus, Math.hypot(camPos[0], camPos[1] - 0.2, camPos[2]));\n      gl.uniform1f(pu.uTime, reduce ? 0 : time);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n    };\n\n    let raf = 0;\n    let last = 0;\n    let onScreen = true;\n    let slow = 0;\n    let first = true;\n    const frame = (now: number) => {\n      raf = 0;\n      const raw = last ? (now - last) / 1000 : 0.016;\n      last = now;\n      const dt = Math.min(raw, 0.1);\n      dtLast = dt;\n      if (reduce) {\n        clock += dt;\n        if (clock > settleAt) fix();\n        if (textDirty) {\n          paintText();\n          textDirty = false;\n        }\n        if (dirty) {\n          dirty = false;\n          draw();\n        }\n      } else {\n        clock += dt;\n        time += dt;\n        while (cues.length && cues[0].at <= clock) cues.shift()!.fn();\n        if (clock > settleAt) fix();\n        if (demo && clock > demoNext) demoStep();\n        if (drive > 0) {\n          drive = Math.max(0, drive - dt);\n          turn[1] += dt * 22 * Math.min(1, drive * 4 + 0.15);\n        }\n        if (out.x > 0.05 && out.v > 0) turn[1] -= dt * 12;\n        for (let n = 0; n < 4; n++) {\n          const h = dt / 4;\n          stepSpring(tilt, h);\n          stepSpring(stand, h);\n          stepSpring(out, h);\n          stepSpring(dot, h);\n        }\n        if (textDirty) textDirty = paintText();\n        const kc = 1 - Math.exp(-dt * 3.2);\n        cam.ax += (cam.tx - cam.ax) * kc;\n        cam.ay += (cam.ty - cam.ay) * kc;\n        draw();\n        // step the resolution down if this machine cannot hold the frame rate\n        if (raw > 0.03) slow++;\n        else slow = Math.max(0, slow - 1);\n        if (slow > 24 && scale > MIN_SCALE) {\n          scale = Math.max(MIN_SCALE, scale * 0.84);\n          slow = 0;\n          resize();\n        }\n      }\n      if (first) {\n        first = false;\n        setReady(true);\n      }\n      const pending = reduce && (dirty || textDirty || settleAt < Infinity);\n      if (onScreen && !document.hidden && (!reduce || pending)) raf = requestAnimationFrame(frame);\n    };\n    function kick() {\n      if (!raf && onScreen && !document.hidden) {\n        last = 0;\n        raf = requestAnimationFrame(frame);\n      }\n    }\n    const io = new IntersectionObserver(([e]) => {\n      onScreen = e.isIntersecting;\n      kick();\n    });\n    io.observe(root);\n    const ro = new ResizeObserver(() => {\n      resize();\n      kick();\n    });\n    ro.observe(canvas);\n    const onVis = () => kick();\n    document.addEventListener(\"visibilitychange\", onVis);\n    const onMove = (e: PointerEvent) => {\n      if (reduce) return;\n      const r = root.getBoundingClientRect();\n      cam.tx = Math.max(-1, Math.min(1, ((e.clientX - r.left) / r.width) * 2 - 1));\n      cam.ty = Math.max(-1, Math.min(1, ((e.clientY - r.top) / r.height) * 2 - 1));\n    };\n    const onLeave = () => {\n      cam.tx = 0;\n      cam.ty = 0;\n    };\n    root.addEventListener(\"pointermove\", onMove);\n    root.addEventListener(\"pointerleave\", onLeave);\n    const onLost = (e: Event) => {\n      e.preventDefault();\n      setReady(false);\n      cancelAnimationFrame(raf);\n      api.current = null;\n    };\n    canvas.addEventListener(\"webglcontextlost\", onLost);\n    kick();\n\n    return () => {\n      cancelAnimationFrame(raf);\n      io.disconnect();\n      ro.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVis);\n      root.removeEventListener(\"pointermove\", onMove);\n      root.removeEventListener(\"pointerleave\", onLeave);\n      canvas.removeEventListener(\"webglcontextlost\", onLost);\n      api.current = null;\n      gl.deleteTexture(fbTex);\n      gl.deleteTexture(inkTex);\n      gl.deleteTexture(reliefTex);\n      gl.deleteFramebuffer(fbo);\n      gl.deleteBuffer(quad);\n      gl.deleteProgram(scene);\n      gl.deleteProgram(post);\n    };\n  }, [reduce]);\n\n  const onType = (v: string) => {\n    if (api.current) api.current.type(v, true);\n    else {\n      setName(clean(v));\n      setFixed(false);\n    }\n  };\n  const onFix = () => {\n    if (api.current) api.current.fix();\n    else setFixed(true);\n  };\n\n  return (\n    <section ref={rootRef} className=\"relative isolate h-[700px] w-full overflow-hidden md:h-[720px]\" style={{ backgroundColor: WALL, fontFamily: FONT }}>\n      {/* The still: the same door and plate built from elements. Shown before the renderer starts and wherever it cannot run. */}\n      <div aria-hidden=\"true\" className={`absolute inset-0 transition-opacity duration-700 ${ready ? \"opacity-0\" : \"opacity-100\"}`} style={{ background: \"linear-gradient(120deg, #e6dfd2 0%, #d6cdbf 60%, #cbc1b2 100%)\" }}>\n        <div\n          className=\"absolute inset-y-0 left-[8%] right-[8%] md:left-[39%] md:right-[1.5%]\"\n          style={{ background: \"linear-gradient(100deg, #1c2027 0%, #0d0f14 45%, #15181e 100%)\", boxShadow: \"-14px 0 0 #e9e3d8, 14px 0 0 #e9e3d8, -30px 0 40px rgba(60,45,30,0.35)\" }}\n        >\n          <div className=\"absolute inset-x-[7%] top-0 h-[34%] rounded-b-[4px]\" style={{ boxShadow: \"inset 0 -2px 0 rgba(255,255,255,0.08), inset 0 0 0 10px rgba(0,0,0,0.25)\" }} />\n          <div className=\"absolute inset-x-[7%] bottom-0 h-[34%] rounded-t-[4px]\" style={{ boxShadow: \"inset 0 2px 0 rgba(255,255,255,0.08), inset 0 0 0 10px rgba(0,0,0,0.25)\" }} />\n          <div\n            className=\"absolute left-1/2 top-[61%] flex h-[64px] w-[88%] -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-[10px] md:top-[49%] md:h-[100px] md:w-[66%]\"\n            style={{ background: \"linear-gradient(170deg, #fbf9f4 0%, #ebe7df 100%)\", boxShadow: \"10px 14px 18px rgba(0,0,0,0.45), inset 0 0 0 5px #ebe7df, inset 0 0 0 6.5px #0B0D12\" }}\n          >\n            <span className=\"absolute left-[3%] h-4 w-4 rounded-full md:h-5 md:w-5\" style={{ background: \"radial-gradient(circle at 35% 30%, #f6dca0, #9a6a26)\" }} />\n            <span className=\"absolute right-[3%] h-4 w-4 rounded-full md:h-5 md:w-5\" style={{ background: \"radial-gradient(circle at 35% 30%, #f6dca0, #9a6a26)\" }} />\n            <span className=\"truncate px-10 text-[19px] tracking-[-0.04em] md:text-[30px]\" style={{ color: INK }}>\n              <b className=\"font-extrabold\">{name || \" \"}</b>\n              <span className=\"font-semibold\">{SUFFIX}</span>\n            </span>\n            <span className=\"absolute right-[9%] h-2.5 w-2.5 rounded-full md:h-3 md:w-3\" style={{ backgroundColor: fixed ? BLUE : \"#1d2a44\", boxShadow: fixed ? `0 0 14px ${BLUE}` : \"none\" }} />\n          </div>\n        </div>\n      </div>\n\n      <canvas ref={canvasRef} aria-hidden=\"true\" className={`absolute inset-0 h-full w-full transition-opacity duration-700 ${ready ? \"opacity-100\" : \"opacity-0\"}`} />\n\n      <div className=\"pointer-events-none absolute left-5 right-5 top-6 md:left-12 md:right-auto md:top-12 md:max-w-[400px]\">\n        <p className=\"text-[10px] font-semibold uppercase tracking-[0.22em] text-[#F6F4EF]/70 md:text-[11px] md:text-[#0B0D12]/60\">\n          Your own address <span className=\"mx-1.5 opacity-50\">/</span> On the door\n        </p>\n        <h2 className=\"mt-2 text-[44px] font-extrabold leading-[0.92] tracking-[-0.055em] text-[#F6F4EF] md:mt-4 md:text-[76px] md:text-[#0B0D12]\">\n          Put your name on the door.\n        </h2>\n        <p className=\"mt-3 max-w-[300px] text-[15px] font-medium leading-snug tracking-tight text-[#F6F4EF]/80 md:mt-5 md:text-[17px] md:text-[#0B0D12]/75\">\n          Type the name you want people to find you by. Each letter is set into the enamel, then the plate is screwed down.\n        </p>\n      </div>\n\n      <form\n        className=\"absolute inset-x-5 bottom-5 md:inset-x-auto md:bottom-12 md:left-12 md:w-[400px]\"\n        onSubmit={(e) => {\n          e.preventDefault();\n          onFix();\n        }}\n      >\n        <label htmlFor=\"house-plate-name\" className=\"sr-only\">\n          Site address, before .example\n        </label>\n        <div className=\"flex h-14 items-center rounded-full pl-5 pr-1.5 shadow-[0_18px_40px_-18px_rgba(40,30,20,0.55)] ring-1 ring-black/10 focus-within:ring-2 focus-within:ring-[#0B0D12]\" style={{ backgroundColor: PAPER }}>\n          <input\n            id=\"house-plate-name\"\n            value={name}\n            onChange={(e) => onType(e.target.value)}\n            onFocus={() => api.current?.stopDemo()}\n            maxLength={MAX_NAME}\n            autoComplete=\"off\"\n            autoCapitalize=\"none\"\n            spellCheck={false}\n            className=\"w-0 min-w-0 flex-1 bg-transparent text-[17px] font-bold tracking-tight outline-none placeholder:text-black/35\"\n            style={{ color: INK }}\n            placeholder=\"yourname\"\n          />\n          <span className=\"pr-3 text-[17px] font-semibold tracking-tight\" style={{ color: \"rgba(11,13,18,0.5)\" }}>\n            {SUFFIX}\n          </span>\n          <button\n            type=\"submit\"\n            disabled={!name}\n            className=\"flex h-11 shrink-0 items-center gap-2 rounded-full px-4 text-[15px] font-bold tracking-tight transition-[transform,background-color,box-shadow] duration-300 hover:scale-[1.03] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0B0D12] focus-visible:ring-offset-2 active:scale-95 disabled:opacity-50 motion-reduce:transition-none\"\n            style={fixed ? { backgroundColor: INK, color: PAPER } : { backgroundColor: BLUE, color: INK, boxShadow: \"0 10px 24px -10px rgba(79,152,251,0.8), inset 0 1px 0 rgba(255,255,255,0.45)\" }}\n          >\n            <span className=\"h-2 w-2 rounded-full\" aria-hidden=\"true\" style={{ backgroundColor: fixed ? BLUE : INK, boxShadow: fixed ? `0 0 8px ${BLUE}` : \"none\" }} />\n            {fixed ? \"On the door\" : \"Screw it on\"}\n          </button>\n        </div>\n      </form>\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {fixed && name ? `${name}${SUFFIX} is screwed to the door.` : \"\"}\n      </p>\n    </section>\n  );\n}\n"}]}
