{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"paper-homepage-model-under-a-glass-bell-jar-on-a-sunlit-table-that-lifts-away-when-you-go-live-and-raises-a-blue-flag","type":"registry:block","title":"Paper Homepage Model Under a Glass Bell Jar on a Sunlit Table That Lifts Away When You Go Live and Raises a Blue Flag","description":"Free React and WebGL go live control: a white card model of a homepage waits under a glass bell jar until a button lifts it off and a blue flag runs up.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/paper-homepage-model-under-a-glass-bell-jar-on-a-sunlit-table-that-lifts-away-when-you-go-live-and-raises-a-blue-flag.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\n\n/** The two states, as the words beside the model and the label on the button. */\nconst STATES = {\n  draft: { word: \"Draft\", line: \"Kept under glass while you work on it.\", action: \"Go live\" },\n  live: { word: \"Live\", line: \"Out in the open for anyone with the address.\", action: \"Cover it again\" },\n};\n\nconst BLUE = \"#4F98FB\";\nconst INK = \"#0B0D12\";\nconst PAPER = \"#F6F4EF\";\nconst STAGE = \"#E7DFD2\";\nconst FONT = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, sans-serif';\n/** Seconds the self-playing demo holds the live model, and the covered one, before switching. */\nconst HOLD_LIVE = 6.0;\nconst HOLD_DRAFT = 3.0;\n/** Seconds the jar takes to travel between the model and its place on the table. */\nconst LIFT_TIME = 1.55;\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\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 vec3 uJar;   // where the bell jar stands, relative to resting on the model's base\nuniform float uSun;  // 0 a cloud over the sun, 1 full sun\nuniform float uFlag; // how far up its pole the flag has been run\nuniform float uWind; // 0 the still air under the glass, 1 a breeze from the open window\n\nconst vec3 SUNC = vec3(1.0, 0.84, 0.64);\nconst vec3 BLUE = vec3(0.078, 0.314, 0.965);\nconst float Y0 = 0.14, S = 0.152, R = 1.05, YC = 1.14, WALL = -4.4;\nvec3 gL; float gSun, 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); }\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 y, float h, float bev){ vec2 w = vec2(d2, abs(y) - h) + bev; return min(max(w.x, w.y), 0.0) + length(max(w, 0.0)) - bev; }\nfloat box(vec3 p, vec3 b, float r){ vec3 q = abs(p) - b + r; return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0) - r; }\n// a folded card block standing on the sheet: centre, half size across the sheet, height\nfloat blk(vec3 p, vec2 c, vec2 hs, float h){ return box(p - vec3(c.x, S + h * 0.5, c.y), vec3(hs.x, h * 0.5, hs.y), 0.004); }\n\nconst vec3 POLE = vec3(0.53, 0.672, -0.17);\n\nvec3 toFlag(vec3 p){\n  vec3 f = p - POLE - vec3(0.0, 0.1 + uFlag * 0.4, 0.0);\n  // with no air moving the flag hangs against its pole; in the breeze it stands out and ripples\n  float a = (1.0 - uWind) * 1.32;\n  f.xy = vec2(cos(a) * f.x - sin(a) * f.y, sin(a) * f.x + cos(a) * f.y);\n  float u = clamp(f.x / 0.26, 0.0, 1.0);\n  f.z -= uWind * u * (0.022 * sin(f.x * 21.0 - uTime * 7.5) + 0.01 * sin(f.x * 37.0 - uTime * 11.0 + 1.0));\n  f.y += uWind * u * u * 0.018 * sin(uTime * 3.1);\n  return f;\n}\n\nvec2 map(vec3 p){\n  float bound = length(p - vec3(0.0, 0.45, 0.0)) - 1.45;\n  if (bound > 0.25) return vec2(bound, 0.0);\n  // the turned walnut base\n  float r = length(p.xz);\n  vec2 res = vec2(ext(r - 1.2, p.y - Y0 * 0.5, Y0 * 0.5, 0.03), 1.0);\n  // the card sheet and the blocks of the page folded up from card\n  float d = box(p - vec3(0.0, Y0 + 0.006, 0.0), vec3(0.76, 0.0062, 0.52), 0.0045);\n  d = min(d, blk(p, vec2(0.0, -0.41), vec2(0.68, 0.045), 0.055));\n  d = min(d, blk(p, vec2(-0.31, -0.13), vec2(0.35, 0.1), 0.3));\n  d = min(d, blk(p, vec2(-0.37, 0.065), vec2(0.29, 0.035), 0.1));\n  d = min(d, blk(p, vec2(0.37, -0.1), vec2(0.27, 0.16), 0.52));\n  for (int i = 0; i < 3; i++) d = min(d, blk(p, vec2(-0.48 + 0.48 * float(i), 0.34), vec2(0.2, 0.09), 0.14));\n  if (d < res.x) res = vec2(d, 2.0);\n  // the button, in blue card\n  vec3 q = p - vec3(-0.52, S + 0.035, 0.19);\n  d = ext(rb2(q.xz, vec2(0.12, 0.04), 0.04), q.y, 0.035, 0.006);\n  if (d < res.x) res = vec2(d, 3.0);\n  // a brass pin for a flagpole, with a ball on top\n  vec3 pp = p - POLE;\n  d = max(length(pp.xz) - 0.0075, abs(pp.y - 0.27) - 0.27);\n  d = min(d, length(pp - vec3(0.0, 0.552, 0.0)) - 0.016);\n  if (d < res.x) res = vec2(d, 4.0);\n  vec3 f = toFlag(p);\n  d = box(f - vec3(0.13, -0.08, 0.0), vec3(0.13, 0.08, 0.0022), 0.001) * 0.6;\n  if (d < res.x) res = vec2(d, 5.0);\n  return res;\n}\nvec3 normal(vec3 p){\n  vec2 e = vec2(1.0, -1.0) * 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}\nvec2 march(vec3 ro, vec3 rd, float far){\n  float t = 0.0; vec2 h = vec2(0.0);\n  for (int i = 0; i < 110; i++){\n    h = map(ro + rd * t);\n    if (h.x < 0.0004 * (1.0 + t * 0.3) || t > far) break;\n    t += h.x * 0.92;\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.012;\n  for (int i = 0; i < 30; i++){\n    float h = map(ro + rd * t).x;\n    res = min(res, 9.0 * h / t);\n    t += clamp(h, 0.01, 0.2);\n    if (res < 0.004 || t > 3.0) 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.01 + 0.09 * float(i) / 4.0;\n    o += (h - map(p + n * h).x) * s;\n    s *= 0.78;\n  }\n  return clamp(1.0 - 3.0 * o, 0.0, 1.0);\n}\n\n// The window the sun comes through, out of shot on the left: its bars throw shadows across everything.\nfloat panes(vec2 w, float s){\n  float frame = smoothstep(s, -s, max(abs(w.x) - 3.0, abs(w.y) - 2.4));\n  float gx = abs(fract(w.x * 0.5) - 0.5) * 2.0;\n  float gy = abs(fract(w.y / 4.8 + 0.5) - 0.5) * 4.8;\n  return frame * smoothstep(0.05 - s, 0.05 + s, gx) * smoothstep(0.06 - s, 0.06 + s, gy);\n}\nfloat win(vec3 p){\n  float t = (-7.0 - p.x) / gL.x;\n  vec3 q = p + gL * t;\n  return panes(vec2(q.z - 2.5, q.y - 4.9), 0.012 * t + 0.02);\n}\n\n// The bell jar, as a thin shell: a cylinder wall, a dome and a knob. Returns the near and far hit.\nvec2 jarHit(vec3 ro, vec3 rd, out vec3 n1, out vec3 n2o){\n  vec3 o = ro - uJar;\n  float tn = 1e9, tf = -1.0;\n  n1 = vec3(0.0, 1.0, 0.0); n2o = n1;\n  float a = dot(rd.xz, rd.xz), b = dot(o.xz, rd.xz), c = dot(o.xz, o.xz) - R * R;\n  float h = b * b - a * c;\n  if (h > 0.0 && a > 1e-6){\n    h = sqrt(h);\n    for (int i = 0; i < 2; i++){\n      float t = (-b + (i == 0 ? -h : h)) / a;\n      float y = o.y + rd.y * t;\n      if (t > 1e-3 && y > Y0 && y < YC){\n        vec2 xz = (o.xz + rd.xz * t) / R; vec3 n = vec3(xz.x, 0.0, xz.y);\n        if (t < tn){ tn = t; n1 = n; }\n        if (t > tf){ tf = t; n2o = n; }\n      }\n    }\n  }\n  vec3 oc = o - vec3(0.0, YC, 0.0);\n  b = dot(oc, rd); c = dot(oc, oc) - R * R; h = b * b - c;\n  if (h > 0.0){\n    h = sqrt(h);\n    for (int i = 0; i < 2; i++){\n      float t = -b + (i == 0 ? -h : h);\n      vec3 q = oc + rd * t;\n      if (t > 1e-3 && q.y >= 0.0){\n        vec3 n = q / R;\n        if (t < tn){ tn = t; n1 = n; }\n        if (t > tf){ tf = t; n2o = n; }\n      }\n    }\n  }\n  vec3 ok = o - vec3(0.0, YC + R + 0.06, 0.0);\n  b = dot(ok, rd); c = dot(ok, ok) - 0.085 * 0.085; h = b * b - c;\n  if (h > 0.0){\n    float t = -b - sqrt(h);\n    if (t > 1e-3 && t < tn){ tn = t; n1 = (ok + rd * t) / 0.085; if (tf < 0.0){ tf = t; n2o = n1; } }\n  }\n  return vec2(tn, tf);\n}\n// How much sunlight gets through the jar on its way to p: glass seen edge on bends light away, just inside the edge it gathers.\nfloat jarT(vec3 p){\n  vec3 n1, n2; vec2 h = jarHit(p, gL, n1, n2);\n  float T = 1.0;\n  if (h.x < 1e8){\n    float c = abs(dot(n1, gL));\n    T *= mix(0.45, 0.9, smoothstep(0.0, 0.45, c)) + 0.22 * smoothstep(0.1, 0.3, c) * smoothstep(0.6, 0.3, c);\n    if (h.y > h.x + 1e-3){\n      c = abs(dot(n2, gL));\n      T *= mix(0.45, 0.9, smoothstep(0.0, 0.45, c)) + 0.22 * smoothstep(0.1, 0.3, c) * smoothstep(0.6, 0.3, c);\n    }\n  }\n  return T;\n}\n\n// The room: warm plaster all round, a bright window on the left.\nvec3 env(vec3 ro, vec3 rd){\n  vec3 c = mix(vec3(0.16, 0.13, 0.1), vec3(0.5, 0.45, 0.39), smoothstep(-0.3, 0.7, rd.y));\n  c += vec3(0.25, 0.2, 0.15) * smoothstep(0.2, -0.6, rd.z) * smoothstep(-0.2, 0.3, rd.y);\n  if (rd.x < -0.02){\n    float t = (-7.0 - ro.x) / rd.x;\n    vec3 q = ro + rd * t;\n    c = mix(c, vec3(1.5, 1.6, 1.78) * 3.2, panes(vec2(q.z - 2.5, q.y - 4.9), 0.03));\n  }\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\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 = win(p);\n  if (v > 0.001 && hq) v *= softShadow(p + n * 0.003, gL);\n  if (v > 0.001) v *= jarT(p);\n  return SUNC * gSun * d * v;\n}\nvec3 fill(vec3 n, float ao){\n  // skylight from the window, warm bounce from the table, the plaster round about\n  vec3 c = vec3(0.34, 0.37, 0.43) * max(-n.x * 0.7 + n.y * 0.3, 0.0) + vec3(0.3, 0.22, 0.15) * max(-n.y, 0.0) + vec3(0.24, 0.21, 0.18) * (0.6 + 0.4 * n.y);\n  return c * ao;\n}\n\nvec3 shade(vec3 p, vec3 n, float id, vec3 rd, bool hq){\n  float ao = hq ? occ(p, n) : 1.0;\n  vec3 sl = sunLight(p, n, hq);\n  vec3 r = reflect(rd, n);\n  float nv = max(dot(n, -rd), 0.0);\n  if (id < 1.5){\n    // walnut, oiled and waxed\n    float rr = length(p.xz);\n    float g = fbm(vec2(p.x * 3.0 + fbm(p.xz * 2.0) * 1.5, p.z * 38.0 + p.y * 30.0));\n    vec3 alb = mix(vec3(0.07, 0.034, 0.016), vec3(0.17, 0.085, 0.04), g);\n    float groove = smoothstep(0.022, 0.006, abs(rr - 1.07)) * step(0.9, n.y);\n    alb *= 1.0 - 0.45 * groove;\n    alb *= 1.0 + 0.5 * smoothstep(0.004, 0.0, abs(rr - 1.049)) * step(0.9, n.y);\n    vec3 col = alb * (sl + fill(n, ao));\n    float f = 0.04 + 0.96 * pow(1.0 - nv, 5.0);\n    col += env(p, r) * f * ao * 0.8 * (1.0 - groove);\n    col += SUNC * gSun * pow(max(dot(r, gL), 0.0), 90.0) * 3.0 * length(sl) / max(gSun, 0.01);\n    return col;\n  }\n  if (id < 3.5){\n    // card: a faint tooth, slightly warmer where it faces away from the sun because light comes through it\n    vec3 alb = id < 2.5 ? vec3(0.79, 0.77, 0.72) : BLUE * vec3(0.95, 0.9, 0.8);\n    float tooth = n2(p.xy * 420.0 + p.z * 310.0) * 0.5 + n2(p.zy * 380.0 + p.x * 200.0) * 0.5;\n    alb *= 1.0 + 0.07 * (tooth - 0.5) * clamp(0.0015 / (gDist * gPix), 0.0, 1.0);\n    if (id < 2.5){\n      float ink = 0.0;\n      float lw = max(0.0035, gDist * gPix * 0.9);\n      if (n.z > 0.9 && p.y > S + 0.012){\n        // pencil marks on the faces: headline rules on the hero block, a picture frame on the tall block, icons on the cards\n        vec2 f = p.xy;\n        if (p.z > -0.04 && p.z < -0.02 && f.x < -0.0){\n          float row = mod(f.y - S - 0.05, 0.075);\n          ink = smoothstep(lw, lw * 0.3, abs(row - 0.03)) * step(f.x, -0.12 + 0.12 * step(0.11, f.y - S)) * step(-0.62, f.x) * step(f.y, S + 0.27) * step(S + 0.04, f.y);\n        }\n        if (p.z > 0.05 && p.x > 0.08){\n          vec2 c = f - vec2(0.37, S + 0.28);\n          float fr = abs(rb2(c, vec2(0.2, 0.19), 0.015));\n          float hill = abs(c.y + 0.08 - 0.12 * max(0.0, 1.0 - abs(c.x + 0.05) * 3.0)) ;\n          ink = max(smoothstep(lw, lw * 0.3, fr), smoothstep(lw, lw * 0.3, hill) * step(abs(c.x), 0.19) * step(c.y, 0.18));\n          ink = max(ink, smoothstep(lw, lw * 0.3, abs(length(c - vec2(0.1, 0.09)) - 0.035)));\n        }\n        if (p.z > 0.42){\n          float cx = mod(f.x + 0.72, 0.48) - 0.24;\n          vec2 c = vec2(cx, f.y - S);\n          ink = max(smoothstep(lw, lw * 0.3, abs(length(c - vec2(-0.11, 0.09)) - 0.022)), smoothstep(lw, lw * 0.3, abs(c.y - 0.04)) * step(-0.14, c.x) * step(c.x, 0.06));\n        }\n      }\n      alb = mix(alb, vec3(0.26, 0.25, 0.25), ink * 0.85 * min(1.0, 0.0045 / lw));\n    }\n    vec3 col = alb * (sl + fill(n, ao));\n    // light passing through thin card on the side away from the sun\n    col += alb * vec3(1.0, 0.9, 0.72) * gSun * 0.1 * max(-dot(n, gL), 0.0) * win(p) * ao;\n    col += env(p, r) * (0.025 + 0.2 * pow(1.0 - nv, 5.0)) * ao;\n    return col;\n  }\n  if (id < 4.5){\n    vec3 col = fres(vec3(0.92, 0.72, 0.38), nv) * (env(p, r) * (0.4 + 0.6 * ao) + SUNC * gSun * pow(max(dot(r, gL), 0.0), 60.0) * 6.0 * win(p));\n    return col;\n  }\n  // the flag: blue card, lit from behind as well as in front\n  vec3 f = toFlag(p);\n  vec3 alb = BLUE * (0.96 + 0.06 * n2(f.xy * 300.0));\n  float d = abs(dot(n, gL));\n  float v = win(p) * (hq ? softShadow(p + n * 0.004 * sign(dot(n, gL)), gL) : 1.0) * jarT(p);\n  vec3 col = alb * (SUNC * gSun * d * v * mix(0.55, 1.0, step(0.0, dot(n, gL))) + fill(n, ao) * 0.9);\n  col += env(p, r) * 0.03;\n  return col;\n}\n\nvec3 tableShade(vec3 p, vec3 rd, float t){\n  vec3 n = vec3(0.0, 1.0, 0.0);\n  // pale oak, the grain running left to right\n  float w = fbm(vec2(p.x * 0.35, p.z * 6.0 + fbm(p.xz * vec2(0.4, 1.6)) * 4.0));\n  float fine = n2(vec2(p.x * 2.0, p.z * 90.0));\n  vec3 alb = mix(vec3(0.42, 0.27, 0.15), vec3(0.6, 0.43, 0.27), w) * (0.92 + 0.12 * fine);\n  float near = step(t, 30.0);\n  float rb = length(p.xz);\n  float ao = clamp(0.3 + 0.7 * smoothstep(1.17, 1.5, rb), 0.0, 1.0);\n  float dj = length(p.xz - uJar.xz) - R;\n  float onTable = smoothstep(-0.05, -0.12, uJar.y);\n  ao *= 1.0 - onTable * 0.55 * exp(-abs(dj) * 26.0);\n  float sv = win(p);\n  if (sv > 0.001 && near > 0.5 && rb < 4.5) sv *= softShadow(p + n * 0.002, gL);\n  if (sv > 0.001) sv *= jarT(p);\n  vec3 col = alb * (SUNC * gSun * gL.y * sv + fill(n, ao) * 0.95);\n  // satin oil finish: the window in the wood, softened\n  float f = 0.035 + 0.965 * pow(1.0 - max(dot(n, -rd), 0.0), 5.0);\n  vec3 rr = reflect(rd, normalize(n + vec3(fine - 0.5, 0.0, w - 0.5) * 0.05));\n  col += env(p, rr) * f * 0.45 * ao;\n  col += SUNC * gSun * sv * pow(max(dot(rr, gL), 0.0), 40.0) * 0.6;\n  return col;\n}\nvec3 wallShade(vec3 p){\n  vec3 alb = vec3(0.7, 0.64, 0.56) * (0.94 + 0.08 * fbm(p.xy * 3.0));\n  vec3 n = vec3(0.0, 0.0, 1.0);\n  float sv = win(p) * max(dot(n, gL), 0.0);\n  float base = smoothstep(0.0, 0.8, p.y);\n  return alb * (SUNC * gSun * sv + vec3(0.25, 0.22, 0.19) * (0.55 + 0.45 * base));\n}\n\nvec3 glass(vec3 col, vec3 p, vec3 n, vec3 rd){\n  if (dot(n, rd) > 0.0) n = -n;\n  float c = max(dot(n, -rd), 0.0);\n  float F = 0.04 + 0.96 * pow(1.0 - c, 5.0);\n  float lip = smoothstep(0.06, 0.01, p.y - uJar.y - Y0);\n  vec3 tint = pow(vec3(0.975, 0.99, 0.985), vec3(1.0 / max(c, 0.1) + lip * 8.0));\n  vec3 r = reflect(rd, n);\n  vec3 refl = env(p, r) + SUNC * gSun * pow(max(dot(r, gL), 0.0), 900.0) * 40.0;\n  F = min(1.0, F + lip * 0.25);\n  return col * (1.0 - F) * tint + refl * F;\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.78, 0.47, 0.4));\n  gSun = mix(0.85, 3.6, uSun);\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  vec3 n1, n2;\n  vec2 jh = jarHit(ro, rd, n1, n2);\n  // glass bends what is behind it a little, most near its edges\n  vec3 rdo = rd;\n  if (jh.x < 1e8) rdo = normalize(rd + (n1 * dot(n1, rd) - rd * 0.0) * 0.035);\n  float tf = rdo.y < -1e-4 ? -ro.y / rdo.y : 1e5;\n  float tw = rdo.z < -1e-4 ? (WALL - ro.z) / rdo.z : 1e5;\n  vec2 hit = march(ro, rdo, min(min(tf, tw), 30.0));\n  float t; vec3 col;\n  if (hit.y > 0.5 && hit.x < min(tf, tw)){\n    t = hit.x; vec3 p = ro + rdo * t; gDist = t;\n    col = shade(p, normal(p), hit.y, rdo, true);\n  } else if (tf < tw){\n    t = tf; col = tableShade(ro + rdo * tf, rdo, tf);\n  } else {\n    t = tw; col = wallShade(ro + rdo * tw);\n  }\n  // sunbeams through the window, in the air\n  {\n    float tm = min(t, 16.0), acc = 0.0, j = h21(gl_FragCoord.xy + fract(uTime) * 17.0);\n    for (int i = 0; i < 10; i++){\n      vec3 q = ro + rd * tm * (float(i) + j) / 10.0;\n      acc += win(q) * smoothstep(0.0, 0.6, q.y);\n    }\n    col += SUNC * gSun * acc / 10.0 * tm * 0.0045;\n  }\n  if (jh.y > 0.0 && jh.y < t && jh.y > jh.x + 1e-3) col = glass(col, ro + rd * jh.y, n2, rd);\n  if (jh.x < t) col = glass(col, ro + rd * jh.x, n1, rd);\n  col *= 0.62;\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) * (z < uFocus ? 8.0 : 6.0) - 0.6, 0.0, 7.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 < 14; i++){\n    float fi = (float(i) + 0.5) / 14.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.09;\n  vec2 v = vUv - vec2(0.55, 0.5);\n  col *= 1.0 - dot(v, v) * 0.45;\n  float g = hash(gl_FragCoord.xy + fract(uTime) * 91.7) - 0.5;\n  col += g * 0.022 * (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 ease = (x: number) => (x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2);\nconst smooth = (a: number, b: number, x: number) => {\n  const t = Math.max(0, Math.min(1, (x - a) / (b - a)));\n  return t * t * (3 - 2 * t);\n};\n\nexport default function BellJarGoLiveModel() {\n  const reduce = useReducedMotion();\n  const [live, setLive] = 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<{ toggle: () => 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([\"uRes\", \"uCam\", \"uTarget\", \"uFov\", \"uTime\", \"uJar\", \"uSun\", \"uFlag\", \"uWind\"].map((n) => [n, U(scene, 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 moving parts; the piece opens on the finished, live state\n    const jar = { p: 1, to: 1 };\n    const bounce = spring(0, 260, 9);\n    const sun = spring(1, 40, 11);\n    const flag = spring(1, 70, 9);\n    const wind = spring(1, 30, 8);\n    const cam = { ax: 0, ay: 0, tx: 0, ty: 0 };\n    let isLive = true;\n    let demo = !reduce;\n    let clock = 0;\n    let time = 0;\n    let idleAt = HOLD_LIVE;\n    let wake = Infinity;\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\n    const settle = (on: boolean) => {\n      cues = [];\n      jar.p = jar.to = on ? 1 : 0;\n      const set = (s: Spring, v: number) => ((s.x = s.t = v), (s.v = 0));\n      set(bounce, 0);\n      set(sun, on ? 1 : 0);\n      set(flag, on ? 1 : 0);\n      set(wind, on ? 1 : 0);\n      dirty = true;\n    };\n    const toggle = () => {\n      const next = !isLive;\n      isLive = next;\n      if (reduce) {\n        setLive(next);\n        settle(next);\n        return;\n      }\n      cues = [];\n      if (next) {\n        // the jar comes up off its seat, the sun comes out as it clears, then the flag is run up\n        jar.to = 1;\n        at(LIFT_TIME * 0.3, () => {\n          sun.t = 1;\n          setLive(true);\n        });\n        at(LIFT_TIME * 0.55, () => (wind.t = 1));\n        at(LIFT_TIME * 0.62, () => (flag.t = 1));\n      } else {\n        // the flag comes down first, then the glass goes back over and the room dims\n        flag.t = 0;\n        wind.t = 0;\n        at(0.35, () => (jar.to = 0));\n        at(0.35 + LIFT_TIME * 0.75, () => {\n          sun.t = 0;\n          setLive(false);\n        });\n      }\n    };\n    const quiet = () => {\n      demo = false;\n      idleAt = Infinity;\n      wake = clock + 14;\n    };\n    api.current = {\n      toggle: () => {\n        quiet();\n        toggle();\n        kick();\n      },\n    };\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 draw = () => {\n      const wide = cssW / cssH;\n      // where the jar is set down on the table, and where the camera stands\n      const land = phone ? [0.6, -3.2] : [1.4, -3.0];\n      const tgt = phone ? [0.3, 0.85, -1.5] : [-0.3, 0.72, -1.0];\n      const az = (phone ? 0.3 : 0.4) + cam.ax * 0.07 + Math.sin(time * 0.19) * 0.012;\n      const el = (phone ? 0.36 : 0.27) - cam.ay * 0.04 + Math.sin(time * 0.27 + 1) * 0.005;\n      const fov = phone ? 0.52 : 0.42;\n      const dist = phone ? 13.5 : 9.6 * Math.max(1, 1.75 / 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      // the jar's path: straight up off its seat, across, and down onto the table\n      const u = ease(Math.max(0, Math.min(1, jar.p)));\n      const across = smooth(0.22, 0.82, u);\n      const lift = 1.42 * (smooth(0, 0.3, u) - smooth(0.72, 1, u)) + 1.42 * smooth(0.72, 1, u) * 0;\n      const jx = land[0] * across;\n      const jz = land[1] * across;\n      const jy = lift - 0.14 * smooth(0.72, 1, u) + bounce.x;\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.uniform3f(su.uJar, jx, jy, jz);\n      gl.uniform1f(su.uSun, Math.max(0, Math.min(1.1, sun.x)));\n      gl.uniform1f(su.uFlag, Math.max(-0.05, Math.min(1.08, flag.x)));\n      gl.uniform1f(su.uWind, Math.max(0, Math.min(1.1, wind.x)));\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      const f = [0.1 - camPos[0], 0.45 - camPos[1], 0 - camPos[2]];\n      gl.uniform1f(pu.uFocus, Math.hypot(f[0], f[1], f[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      if (reduce) {\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 > wake) {\n          wake = Infinity;\n          demo = true;\n          idleAt = clock + 1.5;\n        }\n        if (demo && clock > idleAt) {\n          toggle();\n          idleAt = clock + (isLive ? HOLD_LIVE + LIFT_TIME : HOLD_DRAFT + LIFT_TIME + 0.35);\n        }\n        if (jar.p !== jar.to) {\n          const before = jar.p;\n          jar.p += Math.sign(jar.to - jar.p) * Math.min(Math.abs(jar.to - jar.p), dt / LIFT_TIME);\n          // glass set down on wood: a small knock back up\n          if (jar.p === jar.to && before !== jar.to) bounce.v += 0.32;\n        }\n        for (let n = 0; n < 4; n++) {\n          const h = dt / 4;\n          stepSpring(bounce, h);\n          stepSpring(sun, h);\n          stepSpring(flag, h);\n          stepSpring(wind, h);\n        }\n        if (bounce.x < 0) {\n          bounce.x = 0;\n          bounce.v = Math.abs(bounce.v) * 0.3;\n        }\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      if (onScreen && !document.hidden && (!reduce || dirty)) 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.deleteFramebuffer(fbo);\n      gl.deleteBuffer(quad);\n      gl.deleteProgram(scene);\n      gl.deleteProgram(post);\n    };\n  }, [reduce]);\n\n  const press = () => {\n    if (api.current) api.current.toggle();\n    else setLive((v) => !v);\n  };\n  const state = live ? STATES.live : STATES.draft;\n  const curve = [0.2, 0.9, 0.2, 1] as const;\n\n  return (\n    <section ref={rootRef} className=\"relative isolate h-[680px] w-full overflow-hidden md:h-[720px]\" style={{ backgroundColor: STAGE, fontFamily: FONT }}>\n      <style>{`\n        @keyframes bell-jar-go-live-flag { 0%, 100% { transform: skewY(0deg) scaleX(1) } 50% { transform: skewY(-5deg) scaleX(0.94) } }\n        @keyframes bell-jar-go-live-sun { 0%, 100% { opacity: 0.75 } 50% { opacity: 1 } }\n        .bell-jar-go-live-flag { transform-origin: 0 50%; animation: bell-jar-go-live-flag 1.1s ease-in-out infinite }\n        .bell-jar-go-live-sun { animation: bell-jar-go-live-sun 2.4s ease-in-out infinite }\n        @media (prefers-reduced-motion: reduce) { .bell-jar-go-live-flag, .bell-jar-go-live-sun { animation: none } }\n      `}</style>\n      {/* The still: the same scene 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(180deg, #d9cfbf 0%, #e3d9c9 54%, #b98f62 54.2%, #a87d52 100%)\" }}>\n        <div className=\"bell-jar-go-live-sun absolute inset-0\" style={{ background: \"linear-gradient(115deg, rgba(255,240,214,0.55) 0%, rgba(255,240,214,0) 46%)\" }} />\n        <div className=\"absolute isolate left-1/2 top-[50%] w-[300px] -translate-x-1/2 md:left-[64%] md:top-[44%] md:w-[420px]\">\n          {/* walnut base */}\n          <div className=\"absolute left-0 right-0 top-[150px] h-[70px] rounded-[50%] md:top-[205px] md:h-[96px]\" style={{ background: \"radial-gradient(70% 70% at 40% 35%, #5a301a 0%, #2a140a 70%)\", boxShadow: \"0 30px 40px -18px rgba(60,30,10,0.6)\" }} />\n          {/* card blocks */}\n          <div className=\"absolute left-[16%] top-[70px] h-[100px] w-[38%] rounded-[3px] md:top-[95px] md:h-[136px]\" style={{ background: \"linear-gradient(90deg, #f3efe6 0%, #ddd6c9 100%)\", boxShadow: \"6px 8px 14px rgba(70,50,30,0.25)\" }} />\n          <div className=\"absolute left-[56%] top-[24px] h-[146px] w-[28%] rounded-[3px] md:top-[30px] md:h-[200px]\" style={{ background: \"linear-gradient(90deg, #faf7f0 0%, #e2dbcf 100%)\", boxShadow: \"6px 8px 14px rgba(70,50,30,0.25)\" }} />\n          <div className=\"absolute left-[14%] top-[150px] h-[16px] w-[18%] rounded-full md:top-[206px] md:h-[22px]\" style={{ backgroundColor: BLUE }} />\n          {/* flag */}\n          <div className=\"absolute left-[80%] top-[-62px] h-[86px] w-[2px] bg-[#b08a4a] md:top-[-86px] md:h-[118px]\" />\n          <div className={`absolute left-[80.5%] h-[24px] w-[42px] md:h-[30px] md:w-[56px] ${live ? \"bell-jar-go-live-flag \" : \"\"}${live ? \"top-[-60px] md:top-[-84px]\" : \"top-[0px] md:top-[2px]\"}`} style={{ backgroundColor: BLUE, clipPath: \"polygon(0 0, 100% 12%, 92% 55%, 100% 92%, 0 100%)\" }} />\n          {/* the jar, over the model or set down beside it */}\n          <div\n            className=\"absolute top-[-110px] h-[300px] w-[106%] rounded-t-[50%] md:top-[-150px] md:h-[410px]\"\n            style={{\n              left: live ? \"58%\" : \"-3%\",\n              transform: live ? \"translateY(-70px) scale(0.56)\" : \"none\",\n              zIndex: live ? -1 : 1,\n              transformOrigin: \"50% 100%\",\n              border: \"1.5px solid rgba(255,255,255,0.65)\",\n              background: \"linear-gradient(90deg, rgba(255,255,255,0.32) 0%, rgba(255,255,255,0.04) 18%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.22) 92%, rgba(255,255,255,0.05) 100%)\",\n              boxShadow: \"inset 0 0 26px rgba(255,255,255,0.35)\",\n            }}\n          />\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 top-6 md:left-12 md:top-12\">\n        <p className=\"text-[10px] font-semibold uppercase tracking-[0.22em] md:text-[11px]\" style={{ color: \"rgba(11,13,18,0.55)\" }}>\n          Under glass <span className=\"mx-1.5\" style={{ color: \"rgba(11,13,18,0.3)\" }}>/</span> Draft to live\n        </p>\n        <div className=\"relative mt-1 h-[84px] w-[300px] overflow-hidden md:mt-3 md:h-[128px] md:w-[380px] lg:h-[160px] lg:w-[440px]\">\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            <motion.h2\n              key={state.word}\n              initial={reduce ? { opacity: 0 } : { y: \"62%\", opacity: 0 }}\n              animate={{ y: \"0%\", opacity: 1 }}\n              exit={reduce ? { opacity: 0 } : { y: \"-46%\", opacity: 0 }}\n              transition={reduce ? { duration: 0.01 } : { y: { type: \"spring\", stiffness: 240, damping: 21 }, opacity: { duration: 0.3, ease: curve } }}\n              className=\"absolute left-0 top-0 text-[84px] font-extrabold leading-[1] tracking-[-0.065em] md:text-[124px] lg:text-[156px]\"\n              style={{ color: INK }}\n            >\n              {state.word}\n            </motion.h2>\n          </AnimatePresence>\n        </div>\n        <p className=\"mt-1 max-w-[260px] text-[15px] font-medium leading-snug tracking-tight md:mt-2 md:max-w-[300px] md:text-[17px]\" style={{ color: \"rgba(11,13,18,0.68)\" }}>\n          {state.line}\n        </p>\n      </div>\n\n      <div className=\"absolute inset-x-5 bottom-5 flex items-center justify-between gap-4 md:inset-x-auto md:bottom-12 md:left-12\">\n        <button\n          type=\"button\"\n          onClick={press}\n          aria-pressed={live}\n          aria-label={live ? \"Live. Press to cover the page with the glass again\" : \"Draft. Press to take the glass off and go live\"}\n          className=\"flex h-12 items-center gap-2.5 rounded-full pl-5 pr-6 text-[15px] font-bold tracking-tight transition-[transform,background-color,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 focus-visible:ring-offset-[#E7DFD2] active:scale-95 motion-reduce:transition-none\"\n          style={live ? { backgroundColor: PAPER, color: INK, boxShadow: \"0 10px 24px -12px rgba(60,40,20,0.5), inset 0 0 0 1px rgba(11,13,18,0.12)\" } : { backgroundColor: BLUE, color: INK, boxShadow: \"0 14px 30px -10px rgba(79,152,251,0.75), inset 0 1px 0 rgba(255,255,255,0.45)\" }}\n        >\n          <svg viewBox=\"0 0 20 20\" className={`h-5 w-5 transition-transform duration-300 motion-reduce:transition-none ${live ? \"rotate-180\" : \"\"}`} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n            <path d=\"M10 16V4M5 9l5-5 5 5\" />\n          </svg>\n          {state.action}\n        </button>\n      </div>\n      <p className=\"sr-only\" aria-live=\"polite\">\n        The page is {live ? \"live\" : \"a draft\"}. {state.line}\n      </p>\n    </section>\n  );\n}\n"}]}
