{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"architects-plan-chest-where-add-a-page-slides-a-cream-card-sheet-out-of-a-slot-onto-a-sunlit-stack-with-a-blue-tab","type":"registry:block","title":"Architects Plan Chest Where Add a Page Slides a Cream Card Sheet out of a Slot onto a Sunlit Stack with a Blue Tab","description":"Free React and WebGL add page control: an ebonised plan chest feeds a cream card sheet out of its slot and lays it on a sunlit stack with a blue index tab.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/architects-plan-chest-where-add-a-page-slides-a-cream-card-sheet-out-of-a-slot-onto-a-sunlit-stack-with-a-blue-tab.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\n\n/** The pages of the site, in the order they are added. The first four are on the stack when it opens. */\nconst PAGES = [\"Home\", \"Menu\", \"About\", \"Contact\", \"Gallery\", \"Bookings\", \"Journal\", \"Events\"];\nconst START = 4;\n\nconst BLUE = \"#4F98FB\";\nconst INK = \"#0B0D12\";\nconst PAPER = \"#F6F4EF\";\nconst STAGE = \"#E4DCCF\";\nconst FONT = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, sans-serif';\n/** Seconds one sheet takes from the slot to the stack (or back). */\nconst MOVE_TIME = 1.7;\n/** Seconds the self-playing demo waits before its first sheet, and between sheets after that. */\nconst FIRST_HOLD = 4.2;\nconst HOLD = 2.6;\n/** Lowest and highest render scale (canvas pixels per CSS pixel). Above one the scene is supersampled. */\nconst MIN_SCALE = 0.6001;\nconst MAX_SCALE = 1.7001;\n/** How thick one sheet is, and how far apart they lie on the stack, in scene units. */\nconst HALF_T = 0.0085;\nconst PITCH = 0.0215;\nconst TOP = 0.6;\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 int uCount;      // sheets lying on the stack\nuniform int uBlue;       // which of them carries the blue tab (-1: the moving one has it)\nuniform vec4 uS[8];      // per sheet: offset x, offset z, turn, where its tab sits\nuniform float uMove;     // 1 while a sheet is travelling\nuniform vec3 uMP;        // the travelling sheet's centre\nuniform mat3 uMR;        // and its turn\nuniform vec2 uMB;        // its bend along its length, and a flutter across it\nuniform float uMTab;\nuniform vec2 uTop;       // the top sheet settling: a lift and a tip\n\nconst vec3 SUNC = vec3(1.0, 0.85, 0.66);\nconst float HT = ${HALF_T.toFixed(4)}, PITCH = ${PITCH.toFixed(4)}, TOP = ${TOP.toFixed(2)}, WALL = -4.6;\nconst vec2 SH = vec2(0.8, 0.58);\nvec3 gL; float gPix, gDist, gSoft = 0.04;\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); }\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\n// one sheet of card in its own frame, with its index tab standing off the right-hand edge\nfloat sheet(vec3 q, float tz){\n  float d = ext(rb2(q.xz, SH, 0.012), q.y, HT, 0.0025);\n  return min(d, ext(rb2(q.xz - vec2(SH.x + 0.035, tz), vec2(0.075, 0.08), 0.028), q.y, HT, 0.0025));\n}\nvec3 stackQ(vec3 p, int i){\n  vec4 s = uS[i];\n  vec3 q = p - vec3(s.x, TOP + HT + float(i) * PITCH, s.y);\n  if (i == uCount - 1){ q.y -= uTop.x; float a = uTop.y; q.yz = vec2(cos(a) * q.y + sin(a) * q.z, -sin(a) * q.y + cos(a) * q.z); }\n  float c = cos(s.z), sn = sin(s.z);\n  return vec3(c * q.x - sn * q.z, q.y, sn * q.x + c * q.z);\n}\nvec3 moveQ(vec3 p){\n  vec3 q = (p - uMP) * uMR;\n  q.y -= uMB.x * (q.z * q.z - 0.11) + uMB.y * sin(q.x * 3.2 + uTime * 9.0) * (q.x + 0.8);\n  return q;\n}\n\nvec2 map(vec3 p){\n  // the plan chest: ebonised wood, with a long slot across its front\n  vec2 res = vec2(box(p - vec3(0.0, 0.3, 0.0), vec3(1.25, 0.3, 0.9), 0.024), 1.0);\n  res.x = max(res.x, -box(p - vec3(0.0, 0.405, 0.9), vec3(0.9, 0.019, 0.32), 0.003));\n  res.x = max(res.x, -box(p - vec3(0.0, 0.02, 0.9), vec3(1.4, 0.022, 0.05), 0.0));\n  // brass: a pull and a label holder on the drawer below the slot\n  float d = box(p - vec3(0.32, 0.2, 0.912), vec3(0.17, 0.016, 0.022), 0.012);\n  d = min(d, max(box(p - vec3(-0.42, 0.2, 0.903), vec3(0.15, 0.058, 0.007), 0.004), -box(p - vec3(-0.42, 0.195, 0.912), vec3(0.135, 0.044, 0.01), 0.0)));\n  if (d < res.x) res = vec2(d, 2.0);\n  // the label card inside the holder\n  d = box(p - vec3(-0.42, 0.195, 0.903), vec3(0.136, 0.045, 0.004), 0.001);\n  if (d < res.x) res = vec2(d, 3.0);\n  // the stack of sheets on top\n  float top = TOP + float(uCount) * PITCH + 0.02;\n  float bnd = box(p - vec3(0.06, (TOP + top) * 0.5, 0.0), vec3(1.0, (top - TOP) * 0.5 + 0.03, 0.72), 0.0);\n  if (bnd < 0.03){\n    for (int i = 0; i < 8; i++){\n      if (i >= uCount) break;\n      d = sheet(stackQ(p, i), uS[i].w);\n      if (d < res.x) res = vec2(d, 10.0 + float(i));\n    }\n  } else if (bnd < res.x) res = vec2(bnd, 0.0);\n  if (uMove > 0.5){\n    d = sheet(moveQ(p), uMTab) * 0.7;\n    if (d < res.x) res = vec2(d, 30.0);\n  }\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 < 140; i++){\n    h = map(ro + rd * t);\n    if (abs(h.x) < 0.00025 * (1.0 + t * 0.4) || t > far) break;\n    t += h.x * 0.9;\n  }\n  return vec2(t, (t > far || h.x > 0.01 || h.y < 0.5) ? 0.0 : h.y);\n}\nfloat softShadow(vec3 ro, vec3 rd){\n  float res = 1.0, t = 0.008;\n  for (int i = 0; i < 34; i++){\n    float h = map(ro + rd * t).x;\n    res = min(res, 10.0 * h / t);\n    t += clamp(h, 0.006, 0.18);\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.006 + 0.08 * float(i) / 4.0;\n    o += (h - map(p + n * h).x) * s;\n    s *= 0.75;\n  }\n  return clamp(1.0 - 3.2 * o, 0.0, 1.0);\n}\n\n// the window out of shot on the left: its bars fall across the desk and the chest\nfloat panes(vec2 w, float s){\n  float frame = smoothstep(s, -s, max(abs(w.x) - 3.2, abs(w.y) - 2.6));\n  float gx = abs(fract(w.x * 0.5) - 0.5) * 2.0;\n  float gy = abs(fract(w.y / 5.2 + 0.5) - 0.5) * 5.2;\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 - 1.6, q.y - 5.0), 0.012 * t + 0.02);\n}\nvec3 env(vec3 ro, vec3 rd){\n  vec3 c = mix(vec3(0.17, 0.14, 0.11), vec3(0.52, 0.47, 0.41), smoothstep(-0.3, 0.7, 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.0, panes(vec2(q.z - 1.6, q.y - 5.0), gSoft));\n  }\n  return c;\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.002, gL);\n  return SUNC * 3.4 * d * v;\n}\nvec3 fill(vec3 n, float ao){\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\n// a pencilled page layout on the face of a sheet; each page gets its own arrangement\nfloat pageSketch(vec2 f, float k, float lw){\n  float ink = 0.0;\n  // menu rule along the top and a mark for the name\n  ink = max(ink, smoothstep(lw, lw * 0.3, abs(f.y + 0.47)) * step(abs(f.x), 0.7));\n  ink = max(ink, smoothstep(lw, lw * 0.3, abs(rb2(f - vec2(-0.6, -0.515), vec2(0.07, 0.022), 0.02))));\n  for (int j = 0; j < 3; j++) ink = max(ink, smoothstep(lw, lw * 0.3, abs(f.y + 0.515)) * step(abs(f.x - 0.3 - 0.13 * float(j)), 0.045));\n  float side = k < 0.5 ? -1.0 : 1.0;\n  // headline lines\n  for (int j = 0; j < 3; j++){\n    float y = -0.34 + 0.07 * float(j);\n    float len = j == 2 ? 0.22 : 0.4 - 0.08 * float(j);\n    ink = max(ink, smoothstep(lw * 1.8, lw * 0.5, abs(f.y - y)) * step(abs(f.x - ((side < 0.0 ? -0.7 : 0.06) + len)), len));\n  }\n  // a picture box with a hill and a sun\n  vec2 c = f - vec2(-side * 0.36, -0.22);\n  ink = max(ink, smoothstep(lw, lw * 0.3, abs(rb2(c, vec2(0.28, 0.17), 0.012))));\n  float hill = abs(c.y - 0.1 + 0.12 * max(0.0, 1.0 - abs(c.x + 0.06) * 3.2));\n  ink = max(ink, smoothstep(lw, lw * 0.3, hill) * step(abs(c.x), 0.28) * step(-0.17, c.y));\n  ink = max(ink, smoothstep(lw, lw * 0.3, abs(length(c - vec2(0.12, -0.07)) - 0.03)));\n  // a row of cards along the bottom, or text lines for even pages\n  if (fract(k * 3.7) < 0.5){\n    for (int j = 0; j < 3; j++) ink = max(ink, smoothstep(lw, lw * 0.3, abs(rb2(f - vec2(-0.47 + 0.47 * float(j), 0.3), vec2(0.2, 0.15), 0.02))));\n  } else {\n    for (int j = 0; j < 4; j++) ink = max(ink, smoothstep(lw, lw * 0.3, abs(f.y - 0.12 - 0.075 * float(j))) * step(abs(f.x), 0.66 - 0.2 * step(2.5, float(j))));\n    ink = max(ink, smoothstep(lw, lw * 0.3, abs(rb2(f - vec2(-0.5, 0.46), vec2(0.13, 0.04), 0.04))));\n  }\n  return ink;\n}\n\nvec3 shadePaper(vec3 p, vec3 n, vec3 q, vec3 nl, bool blueTab, float k, vec3 rd, float ao, vec3 sl){\n  bool tab = q.x > SH.x + 0.002;\n  vec3 alb = vec3(0.86, 0.82, 0.73);\n  if (tab) alb = blueTab ? vec3(0.072, 0.29, 0.92) : vec3(0.74, 0.69, 0.59);\n  float tooth = n2(q.xz * 520.0) * 0.5 + n2(q.zx * 330.0 + 7.0) * 0.5;\n  alb *= 1.0 + 0.08 * (tooth - 0.5) * clamp(0.0016 / (gDist * gPix), 0.0, 1.0);\n  // the cut edges are a shade warmer and darker than the faces\n  float face = smoothstep(0.6, 0.9, abs(nl.y));\n  alb *= mix(0.86, 1.0, face);\n  if (!tab && nl.y > 0.6){\n    float lw = max(0.0032, gDist * gPix * 0.85);\n    float ink = pageSketch(q.xz, k, lw);\n    alb = mix(alb, vec3(0.22, 0.21, 0.22), ink * 0.9 * min(1.0, 0.004 / lw));\n  }\n  vec3 col = alb * (sl + fill(n, ao));\n  // sun through the card from behind\n  col += alb * vec3(1.0, 0.88, 0.7) * 0.32 * max(-dot(n, gL), 0.0) * win(p) * ao;\n  vec3 r = reflect(rd, n);\n  float nv = max(dot(n, -rd), 0.0);\n  col += env(p, r) * (0.02 + 0.18 * pow(1.0 - nv, 5.0)) * ao;\n  return col;\n}\n\nvec3 shade(vec3 p, vec3 n, float id, vec3 rd){\n  float ao = occ(p, n);\n  vec3 sl = sunLight(p, n, true);\n  vec3 r = reflect(rd, n);\n  float nv = max(dot(n, -rd), 0.0);\n  if (id < 1.5){\n    // ebonised oak with a satin finish: the open grain still shows\n    vec2 g2 = abs(n.x) > 0.5 ? p.zy : (abs(n.z) > 0.5 ? p.xy : p.xz);\n    float g = fbm(vec2(g2.x * 2.5 + fbm(g2 * 3.0) * 1.2, g2.y * 40.0));\n    vec3 alb = mix(vec3(0.028, 0.026, 0.025), vec3(0.075, 0.062, 0.05), g);\n    float pore = smoothstep(0.62, 0.8, n2(vec2(g2.x * 30.0, g2.y * 300.0)));\n    alb *= 1.0 - 0.35 * pore;\n    // drawer seams on the front\n    float seam = n.z > 0.9 ? max(smoothstep(0.006, 0.0015, abs(p.y - 0.29)), smoothstep(0.006, 0.0015, abs(p.y - 0.1))) : 0.0;\n    alb *= 1.0 - 0.8 * seam;\n    vec3 col = alb * (sl + fill(n, ao));\n    float f = 0.04 + 0.96 * pow(1.0 - nv, 5.0);\n    vec3 rr = normalize(r + (vec3(n2(g2 * 40.0), 0.0, n2(g2.yx * 40.0)) - 0.5) * 0.06);\n    col += env(p, rr) * f * ao * 0.9 * (1.0 - seam);\n    col += SUNC * pow(max(dot(rr, gL), 0.0), 70.0) * 2.4 * length(sl) * (1.0 - pore * 0.5);\n    return col;\n  }\n  if (id < 2.5){\n    vec3 f0 = vec3(0.9, 0.7, 0.4);\n    vec3 F = f0 + (1.0 - f0) * pow(1.0 - nv, 5.0);\n    vec3 rr = normalize(r + (vec3(n2(p.xy * 300.0), n2(p.yx * 300.0), 0.0) - 0.5) * 0.04);\n    return F * (env(p, rr) * (0.35 + 0.65 * ao) + SUNC * pow(max(dot(rr, gL), 0.0), 50.0) * 7.0 * win(p) * softShadow(p + n * 0.003, gL)) + f0 * 0.04 * fill(n, ao);\n  }\n  if (id < 3.5){\n    vec3 alb = vec3(0.84, 0.8, 0.7);\n    vec2 f = p.xy - vec2(-0.42, 0.195);\n    float lw = max(0.0028, gDist * gPix * 0.8);\n    float ink = smoothstep(lw * 2.0, lw * 0.6, abs(f.y)) * step(abs(f.x), 0.07);\n    alb = mix(alb, vec3(0.2), ink * 0.7);\n    return alb * (sl + fill(n, ao)) * 0.9;\n  }\n  if (id < 25.0){\n    int i = int(id - 10.0 + 0.5);\n    vec3 q = stackQ(p, i);\n    return shadePaper(p, n, q, vec3(0.0, sign(q.y) * step(HT * 0.7, abs(q.y)), 0.0), i == uBlue, fract(float(i) * 0.618 + 0.2), rd, ao, sl);\n  }\n  vec3 q = moveQ(p);\n  return shadePaper(p, n, q, vec3(0.0, sign(q.y) * step(HT * 0.7, abs(q.y)), 0.0), true, fract(float(uCount) * 0.618 + 0.2), rd, ao, sl);\n}\n\nvec3 deskShade(vec3 p, vec3 rd, float t){\n  vec3 n = vec3(0.0, 1.0, 0.0);\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.44, 0.29, 0.16), vec3(0.62, 0.45, 0.28), w) * (0.92 + 0.12 * fine);\n  // contact shadow under the chest\n  vec2 e = abs(p.xz) - vec2(1.25, 0.9);\n  float dc = length(max(e, 0.0)) + min(max(e.x, e.y), 0.0);\n  float ao = clamp(0.25 + 0.75 * smoothstep(0.0, 0.4, dc), 0.0, 1.0);\n  float sv = win(p);\n  if (sv > 0.001 && t < 30.0 && dc < 3.5) sv *= softShadow(p + n * 0.002, gL);\n  vec3 col = alb * (SUNC * 3.4 * gL.y * sv + fill(n, ao) * 0.95);\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(0.0, 0.0, w - 0.5) * 0.04));\n  gSoft = 0.6;\n  col += env(p, rr) * f * 0.3 * ao;\n  gSoft = 0.04;\n  col += SUNC * sv * pow(max(dot(rr, gL), 0.0), 40.0) * 0.5;\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  float sv = win(p) * max(gL.z, 0.0);\n  return alb * (SUNC * 3.4 * sv + vec3(0.25, 0.22, 0.19) * (0.55 + 0.45 * smoothstep(0.0, 0.8, p.y)));\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.5, 0.36));\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 tf = rd.y < -1e-4 ? -ro.y / rd.y : 1e5;\n  float tw = rd.z < -1e-4 ? (WALL - ro.z) / rd.z : 1e5;\n  vec2 hit = march(ro, rd, 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 + rd * t; gDist = t;\n    col = shade(p, normal(p), hit.y, rd);\n  } else if (tf < tw){\n    t = tf; col = deskShade(ro + rd * tf, rd, tf);\n  } else {\n    t = tw; col = wallShade(ro + rd * tw);\n  }\n  // sunbeams 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 < 8; i++){\n      vec3 q = ro + rd * tm * (float(i) + j) / 8.0;\n      acc += win(q) * smoothstep(0.0, 0.6, q.y);\n    }\n    col += SUNC * 3.4 * acc / 8.0 * tm * 0.004;\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) * (z < uFocus ? 3.5 : 6.0) - 0.5, 0.0, 5.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 + 1.5 * 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.58, 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/* ---------- motion helpers ---------- */\n\nconst clamp01 = (x: number) => Math.max(0, Math.min(1, x));\nconst easeInOut = (x: number) => (x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2);\nconst easeOut = (x: number) => 1 - Math.pow(1 - x, 3);\n/** Each sheet lies a little askew, with its tab at its own height down the edge. */\nconst LAY = PAGES.map((_, i) => {\n  const r = (k: number) => {\n    const s = Math.sin(i * 12.9898 + k * 78.233) * 43758.5453;\n    return s - Math.floor(s);\n  };\n  return [(r(1) - 0.5) * 0.09, (r(2) - 0.5) * 0.07, (r(3) - 0.5) * 0.09, -0.42 + ((i * 0.19) % 0.76)];\n});\n\n/** Rotation from a turn about the vertical, a tip about the sheet's width and a roll along its length. */\nfunction rot(yaw: number, pitch: number, roll: number) {\n  const cy = Math.cos(yaw), sy = Math.sin(yaw), cp = Math.cos(pitch), sp = Math.sin(pitch), cr = Math.cos(roll), sr = Math.sin(roll);\n  // R = Ry * Rx * Rz, written column by column for WebGL\n  const Ry = [cy, 0, -sy, 0, 1, 0, sy, 0, cy];\n  const Rx = [1, 0, 0, 0, cp, sp, 0, -sp, cp];\n  const Rz = [cr, sr, 0, -sr, cr, 0, 0, 0, 1];\n  const mul = (a: number[], b: number[]) => {\n    const m = new Array(9).fill(0);\n    for (let c = 0; c < 3; c++) for (let r = 0; r < 3; r++) for (let k = 0; k < 3; k++) m[c * 3 + r] += a[k * 3 + r] * b[c * 3 + k];\n    return m;\n  };\n  return new Float32Array(mul(mul(Ry, Rx), Rz));\n}\n\n/** Where the travelling sheet is at u (0 inside the chest, 1 lying on the stack as sheet k). */\nfunction pose(u: number, k: number, time: number) {\n  const inside = [0, 0.405, 0.22];\n  const out = [0, 0.405, 1.62];\n  const lay = LAY[k];\n  const rest = [lay[0], TOP + HALF_T + k * PITCH, lay[1]];\n  if (u < 0.34) {\n    const a = easeInOut(u / 0.34);\n    return { p: [0, inside[1], inside[2] + (out[2] - inside[2]) * a], yaw: 0, pitch: 0, roll: 0, bend: 0, flut: 0 };\n  }\n  const b = (u - 0.34) / 0.66;\n  const e = easeInOut(b);\n  const arc = Math.sin(Math.PI * Math.pow(b, 0.8));\n  return {\n    p: [out[0] + (rest[0] - out[0]) * e, out[1] + (rest[1] - out[1]) * e + 0.62 * arc, out[2] + (rest[2] - out[2]) * e],\n    yaw: lay[2] * e + 0.22 * arc,\n    pitch: 0.42 * arc,\n    roll: -0.12 * arc,\n    bend: 0.22 * arc,\n    flut: 0.012 * arc * (0.6 + 0.4 * Math.sin(time * 3)),\n  };\n}\n\nexport default function PlanChestAddAPage() {\n  const reduce = useReducedMotion();\n  const [count, setCount] = useState(START);\n  const [busy, setBusy] = useState(false);\n  const [ready, setReady] = useState(false);\n  const rootRef = useRef<HTMLElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const api = useRef<{ add: () => void; remove: () => 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    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\", \"uCount\", \"uBlue\", \"uS\", \"uMove\", \"uMP\", \"uMR\", \"uMB\", \"uMTab\", \"uTop\"].map((n) => [n, U(scene, n)]));\n    const pu = Object.fromEntries([\"uSrc\", \"uRes\", \"uFocus\", \"uTime\"].map((n) => [n, U(post, n)]));\n    const sheets = new Float32Array(LAY.flat());\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    let n = START;\n    let move: { k: number; u: number; dir: 1 | -1 } | null = null;\n    // the top sheet settling after it lands: a cushion of air under it, then a small tip\n    const settle = { t: 99 };\n    const cam = { ax: 0, ay: 0, tx: 0, ty: 0 };\n    let demo = !reduce;\n    let clock = 0;\n    let time = 0;\n    let next = FIRST_HOLD;\n    let wake = Infinity;\n    let dirty = true;\n    let demoDir: 1 | -1 = 1;\n\n    const start = (dir: 1 | -1) => {\n      if (move) return false;\n      if (dir === 1 && n >= PAGES.length) return false;\n      if (dir === -1 && n <= 1) return false;\n      if (reduce) {\n        n += dir;\n        setCount(n);\n        dirty = true;\n        return true;\n      }\n      if (dir === 1) {\n        move = { k: n, u: 0, dir };\n      } else {\n        n -= 1;\n        move = { k: n, u: 1, dir };\n        setCount(n);\n      }\n      setBusy(true);\n      return true;\n    };\n    const quiet = () => {\n      demo = false;\n      next = Infinity;\n      wake = clock + 14;\n    };\n    api.current = {\n      add: () => {\n        quiet();\n        start(1);\n        kick();\n      },\n      remove: () => {\n        quiet();\n        start(-1);\n        kick();\n      },\n    };\n\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.25, 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.7 million pixels through the ray marcher\n      const s = Math.min(scale, Math.sqrt(1.7e6 / (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      const tgt = phone ? [0.1, 0.5, 0.45] : [-0.72, 0.5, 0.3];\n      const az = (phone ? 0.42 : 0.5) + cam.ax * 0.06 + Math.sin(time * 0.17) * 0.01;\n      const el = (phone ? 0.52 : 0.44) - cam.ay * 0.035 + Math.sin(time * 0.23 + 1) * 0.004;\n      const fov = phone ? 0.5 : 0.4;\n      const dist = phone ? 12.5 : 7.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\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.uniform4fv(su.uS, sheets);\n      const stackN = move ? move.k : n;\n      gl.uniform1i(su.uCount, stackN);\n      gl.uniform1i(su.uBlue, move ? -1 : n - 1);\n      // the sheet that has just landed floats down on its own air, then tips flat\n      const st = settle.t;\n      const lift = st < 1.2 ? 0.035 * Math.exp(-st * 7) * Math.abs(Math.cos(st * 13)) : 0;\n      const tip = st < 1.2 ? 0.05 * Math.exp(-st * 6) * Math.sin(st * 17) : 0;\n      gl.uniform2f(su.uTop, move ? 0 : lift, move ? 0 : tip);\n      if (move) {\n        const ps = pose(clamp01(move.u), move.k, time);\n        gl.uniform1f(su.uMove, 1);\n        gl.uniform3f(su.uMP, ps.p[0], ps.p[1], ps.p[2]);\n        gl.uniformMatrix3fv(su.uMR, false, rot(ps.yaw, ps.pitch, ps.roll));\n        gl.uniform2f(su.uMB, ps.bend, ps.flut);\n        gl.uniform1f(su.uMTab, LAY[move.k][3]);\n      } else {\n        gl.uniform1f(su.uMove, 0);\n        gl.uniform3f(su.uMP, 0, -5, 0);\n        gl.uniformMatrix3fv(su.uMR, false, rot(0, 0, 0));\n        gl.uniform2f(su.uMB, 0, 0);\n        gl.uniform1f(su.uMTab, 0);\n      }\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.05 - camPos[0], 0.65 - camPos[1], 0.2 - 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        settle.t += dt;\n        if (clock > wake) {\n          wake = Infinity;\n          demo = true;\n          next = clock + 1.5;\n        }\n        if (demo && !move && clock > next) {\n          if (n >= 6) demoDir = -1;\n          if (n <= START) demoDir = 1;\n          start(demoDir);\n          next = Infinity;\n        }\n        if (move) {\n          move.u += (move.dir * dt) / MOVE_TIME;\n          if (move.dir === 1 && move.u >= 1) {\n            n = move.k + 1;\n            move = null;\n            settle.t = 0;\n            setCount(n);\n            setBusy(false);\n            if (demo) next = clock + HOLD;\n          } else if (move.dir === -1 && move.u <= 0) {\n            move = null;\n            setBusy(false);\n            if (demo) next = clock + HOLD * 0.7;\n          }\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        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 add = () => {\n    if (api.current) api.current.add();\n    else setCount((c) => Math.min(PAGES.length, c + 1));\n  };\n  const remove = () => {\n    if (api.current) api.current.remove();\n    else setCount((c) => Math.max(1, c - 1));\n  };\n  const top = PAGES[count - 1];\n  const full = count >= PAGES.length;\n\n  return (\n    <section ref={rootRef} className=\"relative isolate h-[700px] w-full overflow-hidden md:h-[720px]\" style={{ backgroundColor: STAGE, fontFamily: FONT }}>\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, #d8cebf 0%, #e1d7c8 48%, #b48a5e 48.2%, #a07651 100%)\" }}>\n        <div className=\"absolute inset-0\" style={{ background: \"linear-gradient(112deg, rgba(255,240,214,0.55) 0%, rgba(255,240,214,0) 50%)\" }} />\n        <div className=\"absolute left-1/2 top-[52%] w-[300px] -translate-x-1/2 md:left-[66%] md:top-[44%] md:w-[440px]\">\n          <div className=\"absolute left-0 right-0 top-[60px] h-[120px] rounded-[6px] md:top-[80px] md:h-[170px]\" style={{ background: \"linear-gradient(180deg, #23201d 0%, #0f0e0d 100%)\", boxShadow: \"0 40px 50px -24px rgba(50,25,8,0.7)\" }}>\n            <div className=\"absolute left-[12%] right-[12%] top-[36%] h-[5px] rounded-full bg-black\" />\n            <div className=\"absolute left-[60%] top-[66%] h-[8px] w-[22%] rounded-full\" style={{ background: \"linear-gradient(180deg,#e8c27a,#9b7135)\" }} />\n          </div>\n          {Array.from({ length: Math.min(count, 8) }).map((_, i) => (\n            <div key={i} className=\"absolute left-[10%] h-[64px] w-[74%] rounded-[3px] md:h-[86px]\" style={{ top: 2 - i * 3, background: \"linear-gradient(180deg,#f3ecdc,#ddd3bf)\", boxShadow: \"0 1px 0 rgba(90,70,40,0.35)\", transform: `rotate(${(i % 3) - 1}deg)` }}>\n              <div className=\"absolute -right-[18px] h-[16px] w-[22px] rounded-r-[6px]\" style={{ top: 8 + ((i * 13) % 40), backgroundColor: i === count - 1 ? BLUE : \"#c9bda4\" }} />\n            </div>\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 right-5 top-6 md:left-12 md:right-auto md:top-12\">\n        <p className=\"text-[10px] font-semibold uppercase tracking-[0.22em] md:text-[11px]\" style={{ color: \"rgba(11,13,18,0.58)\" }}>\n          Plan chest <span className=\"mx-1.5\" style={{ color: \"rgba(11,13,18,0.3)\" }}>/</span> Pages of the site\n        </p>\n        <div className=\"relative mt-1 h-[84px] w-full overflow-hidden md:mt-3 md:h-[132px] md:w-[460px] lg:h-[164px] lg:w-[520px]\">\n          <AnimatePresence initial={false} mode=\"wait\">\n            <motion.h2\n              key={top}\n              initial={reduce ? { opacity: 0 } : { y: \"70%\", opacity: 0 }}\n              animate={{ y: \"0%\", opacity: 1 }}\n              exit={reduce ? { opacity: 0 } : { y: \"-30%\", opacity: 0 }}\n              transition={reduce ? { duration: 0.01 } : { y: { type: \"spring\", stiffness: 300, damping: 22 }, opacity: { duration: 0.18 } }}\n              className=\"absolute left-0 top-0 text-[72px] font-extrabold leading-[1] tracking-[-0.065em] md:text-[112px] lg:text-[138px]\"\n              style={{ color: INK }}\n            >\n              {top}\n            </motion.h2>\n          </AnimatePresence>\n        </div>\n        <ol className=\"mt-2 flex max-w-[340px] flex-wrap gap-x-3 gap-y-1 text-[14px] font-semibold tracking-tight md:mt-3 md:text-[15px]\" aria-label=\"Pages on the stack\">\n          {PAGES.slice(0, count).map((p, i) => (\n            <li key={p} className=\"flex items-center gap-1.5\" style={{ color: i === count - 1 ? INK : \"rgba(11,13,18,0.6)\" }}>\n              <span aria-hidden=\"true\" className=\"inline-block h-2 w-2 rounded-[2px]\" style={{ backgroundColor: i === count - 1 ? BLUE : \"rgba(11,13,18,0.28)\" }} />\n              {p}\n            </li>\n          ))}\n        </ol>\n      </div>\n\n      <div className=\"absolute inset-x-5 bottom-5 flex flex-wrap items-center gap-3 md:inset-x-auto md:bottom-12 md:left-12\">\n        <button\n          type=\"button\"\n          onClick={add}\n          disabled={full || busy}\n          aria-label={full ? \"Add a page. The plan chest is empty\" : `Add a page: ${PAGES[count]}`}\n          className=\"flex h-12 items-center gap-2.5 rounded-full pl-5 pr-6 text-[15px] font-bold tracking-tight transition-[transform,opacity] 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-[#E4DCCF] active:scale-95 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:scale-100 motion-reduce:transition-none\"\n          style={{ backgroundColor: BLUE, color: INK, boxShadow: \"0 14px 30px -10px rgba(79,152,251,0.7), inset 0 1px 0 rgba(255,255,255,0.45)\" }}\n        >\n          <svg viewBox=\"0 0 20 20\" className=\"h-5 w-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n            <path d=\"M10 4v12M4 10h12\" />\n          </svg>\n          Add a page\n        </button>\n        <button\n          type=\"button\"\n          onClick={remove}\n          disabled={count <= 1 || busy}\n          aria-label={`Put ${top} back in the chest`}\n          className=\"flex h-12 items-center rounded-full px-5 text-[15px] font-bold tracking-tight transition-[transform,opacity] 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-[#E4DCCF] active:scale-95 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:scale-100 motion-reduce:transition-none\"\n          style={{ 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)\" }}\n        >\n          Put one back\n        </button>\n      </div>\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {count} pages on the stack. The newest is {top}.\n      </p>\n    </section>\n  );\n}\n"}]}
