{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"glass-prism-that-splits-a-beam-carrying-one-sentence-into-a-homepage-made-of-light","type":"registry:block","title":"Glass Prism That Splits a Beam Carrying One Sentence into a Homepage Made of Light","description":"A torch holding one sentence fires a beam into a glass prism, and the fan of blue light paints a homepage band by band. Copy the React code or HTML free.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/glass-prism-that-splits-a-beam-carrying-one-sentence-into-a-homepage-made-of-light.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\n\n/** The sentence that goes in and the page that comes out. `rows` are the bottom edges of the five bands the light paints. */\nconst site = {\n  sentence: \"A florist in Porto that delivers bouquets on Sundays.\",\n  brand: \"Ramo Flores\",\n  links: [\"Bouquets\", \"Weddings\", \"Visit\"],\n  headline: [\"Sundays,\", \"in bloom.\"],\n  photo: { src: \"https://images.pexels.com/photos/31074939/pexels-photo-31074939.jpeg?auto=compress&cs=tinysrgb&w=700\", alt: \"White tulips wrapped in brown paper in a shaft of sunlight\" },\n  chips: [\"Tied by hand\", \"Seasonal stems\", \"Porto and Gaia\"],\n  cta: \"Send a bouquet\",\n  note: \"Order by Friday noon\",\n};\n\nconst BLUE = \"#4F98FB\";\nconst INK = \"#0B0D12\";\n// Design pixels; the scene is scaled to fit.\nconst SCENE_W = 900;\nconst SCENE_H = 520;\nconst BEAM_Y = 262;\nconst LENS_X = 232;\nconst PAGE_X = 604;\nconst PAGE_Y = 96;\nconst PAGE_W = 274;\nconst PAGE_H = 334;\nconst ROWS = [0, 42, 138, 238, 286, PAGE_H]; // band edges down the page\nconst TINTS = [\"234,243,255\", \"190,217,254\", \"140,188,252\", \"79,152,251\", \"52,116,224\"];\nconst CX = 372;\nconst CY = 285;\nconst SIDE = 204;\nconst DIM = 0.055; // how much of the page you can make out with the light off\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst ease = (t: number) => 1 - Math.pow(1 - clamp(t, 0, 1), 3);\ntype P = { x: number; y: number };\n\nfunction cross(p: P, d: P, a: P, b: P): P {\n  const ex = b.x - a.x;\n  const ey = b.y - a.y;\n  const den = d.x * ey - d.y * ex;\n  const t = ((a.x - p.x) * ey - (a.y - p.y) * ex) / (den || 1e-6);\n  return { x: p.x + d.x * t, y: p.y + d.y * t };\n}\n\nexport default function PrismHomepage() {\n  const reduce = useReducedMotion();\n  const wrapRef = useRef<HTMLDivElement>(null);\n  const sceneRef = useRef<HTMLDivElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const pageRef = useRef<HTMLDivElement>(null);\n  const [lit, setLit] = useState(true);\n  const sim = useRef({ on: true, since: -900, level: 0.6, rot: 0, trot: 0, next: 0, held: false, user: false, mask: \"\", redraw: () => {} });\n\n  useEffect(() => {\n    const wrap = wrapRef.current;\n    const scene = sceneRef.current;\n    const canvas = canvasRef.current;\n    const page = pageRef.current;\n    if (!wrap || !scene || !canvas || !page) return;\n    const ctx = canvas.getContext(\"2d\");\n    if (!ctx) return;\n    const s = sim.current;\n    const DPR = 2;\n    canvas.width = SCENE_W * DPR;\n    canvas.height = SCENE_H * DPR;\n    let raf = 0;\n    let visible = true;\n    let last = performance.now();\n    s.since = last - 900;\n    s.next = last + 6400;\n    const h = SIDE * 0.866;\n    const motes = Array.from({ length: 44 }, (_, i) => ({ u: (i * 0.618) % 1, v: (i * 0.377 + 0.13) % 1, sp: 0.012 + ((i * 7) % 10) * 0.0022, ph: i * 1.7 }));\n\n    const measure = () => {\n      const sc = clamp((wrap.clientWidth - 20) / SCENE_W, 0.36, 1.24);\n      wrap.style.height = `${Math.round(SCENE_H * sc)}px`;\n      scene.style.transform = `translateX(-50%) scale(${sc.toFixed(4)})`;\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(wrap);\n\n    const geo = (rot: number) => {\n      const th = (rot * Math.PI) / 180;\n      const rotp = (x: number, y: number): P => ({ x: CX + x * Math.cos(th) - y * Math.sin(th), y: CY + x * Math.sin(th) + y * Math.cos(th) });\n      const A = rotp(0, (-h * 2) / 3);\n      const B = rotp(-SIDE / 2, h / 3);\n      const C = rotp(SIDE / 2, h / 3);\n      const E = cross({ x: LENS_X, y: BEAM_Y }, { x: 1, y: 0 }, A, B);\n      const inside = (6 + rot * 0.7) * (Math.PI / 180);\n      const X = cross(E, { x: Math.cos(inside), y: Math.sin(inside) }, A, C);\n      return { A, B, C, E, X };\n    };\n    const X0 = geo(0).X;\n\n    const draw = (now: number) => {\n      const L = s.level;\n      const { A, B, C, E, X } = geo(s.rot);\n      // where each edge of the fan lands on the page, and how bright each band is\n      const lean = s.rot * 2.3 * (Math.PI / 180);\n      const hits = ROWS.map((r) => {\n        const a = Math.atan2(PAGE_Y + r - X0.y, PAGE_X - X0.x) + lean;\n        return X.y + Math.tan(a) * (PAGE_X - X.x);\n      });\n      const t = now - s.since;\n      const alpha = TINTS.map((_, i) => (reduce ? (s.on ? 1 : 0) : s.on ? ease((t - 260 - i * 150) / 620) : 1 - ease(t / 320)));\n\n      // the page is only as visible as the light falling on it\n      const at = (k: number, d: number) => `${(hits[k] - PAGE_Y + d).toFixed(1)}px`;\n      const lv = alpha.map((a) => (DIM + (1 - DIM) * a).toFixed(3));\n      const stops: string[] = [`rgba(0,0,0,${DIM}) 0px`, `rgba(0,0,0,${DIM}) ${at(0, -14)}`, `rgba(0,0,0,${lv[0]}) ${at(0, -3)}`];\n      for (let i = 1; i < 5; i++) stops.push(`rgba(0,0,0,${lv[i - 1]}) ${at(i, -5)}`, `rgba(0,0,0,${lv[i]}) ${at(i, 5)}`);\n      stops.push(`rgba(0,0,0,${lv[4]}) ${at(5, 3)}`, `rgba(0,0,0,${DIM}) ${at(5, 14)}`);\n      const mask = `linear-gradient(180deg, ${stops.join(\", \")})`;\n      if (mask !== s.mask) {\n        s.mask = mask;\n        page.style.setProperty(\"-webkit-mask-image\", mask);\n        page.style.setProperty(\"mask-image\", mask);\n      }\n      scene.style.setProperty(\"--L\", L.toFixed(3));\n\n      ctx.setTransform(DPR, 0, 0, DPR, 0, 0);\n      ctx.clearRect(0, 0, SCENE_W, SCENE_H);\n      ctx.lineCap = \"round\";\n\n      // the beam from the torch to the glass\n      ctx.globalCompositeOperation = \"lighter\";\n      const flick = reduce ? 1 : 0.94 + 0.06 * Math.sin(now / 90);\n      for (const [w, a] of [[26, 0.05], [10, 0.14], [3, 0.98]] as const) {\n        ctx.strokeStyle = `rgba(226,238,255,${(a * L * flick).toFixed(3)})`;\n        ctx.lineWidth = w;\n        ctx.beginPath();\n        ctx.moveTo(LENS_X, BEAM_Y);\n        ctx.lineTo(E.x, E.y);\n        ctx.stroke();\n      }\n      // a faint reflection thrown off the first face\n      const refl = ctx.createLinearGradient(E.x, E.y, E.x - 70, E.y - 150);\n      refl.addColorStop(0, `rgba(200,222,255,${(0.22 * L).toFixed(3)})`);\n      refl.addColorStop(1, \"rgba(200,222,255,0)\");\n      ctx.strokeStyle = refl;\n      ctx.lineWidth = 1.4;\n      ctx.beginPath();\n      ctx.moveTo(E.x, E.y);\n      ctx.lineTo(E.x - 70, E.y - 150);\n      ctx.stroke();\n\n      // the fan\n      for (let i = 0; i < 5; i++) {\n        if (alpha[i] <= 0.004) continue;\n        const g = ctx.createLinearGradient(X.x, 0, PAGE_X, 0);\n        g.addColorStop(0, `rgba(${TINTS[i]},${(0.9 * alpha[i]).toFixed(3)})`);\n        g.addColorStop(0.3, `rgba(${TINTS[i]},${(0.5 * alpha[i]).toFixed(3)})`);\n        g.addColorStop(1, `rgba(${TINTS[i]},${(0.3 * alpha[i]).toFixed(3)})`);\n        ctx.fillStyle = g;\n        ctx.shadowColor = `rgba(${TINTS[i]},${(0.55 * alpha[i]).toFixed(3)})`;\n        ctx.shadowBlur = 36;\n        ctx.beginPath();\n        ctx.moveTo(X.x, X.y);\n        ctx.lineTo(PAGE_X, hits[i]);\n        ctx.lineTo(PAGE_X, hits[i + 1]);\n        ctx.closePath();\n        ctx.fill();\n        ctx.shadowBlur = 0;\n        ctx.strokeStyle = `rgba(${TINTS[i]},${(0.5 * alpha[i]).toFixed(3)})`;\n        ctx.lineWidth = 0.8;\n        ctx.beginPath();\n        ctx.moveTo(X.x, X.y);\n        ctx.lineTo(PAGE_X, hits[i]);\n        ctx.stroke();\n        // the bright edge where this band meets the sheet\n        ctx.strokeStyle = `rgba(${TINTS[i]},${(0.9 * alpha[i]).toFixed(3)})`;\n        ctx.lineWidth = 2;\n        ctx.beginPath();\n        ctx.moveTo(PAGE_X, hits[i] + 1);\n        ctx.lineTo(PAGE_X, hits[i + 1] - 1);\n        ctx.stroke();\n      }\n      // dust in the light\n      for (const m of motes) {\n        const u = reduce ? m.u : (m.u + (now / 1000) * m.sp) % 1;\n        const x = X.x + 14 + (PAGE_X - X.x - 18) * u;\n        const k = (x - X.x) / (PAGE_X - X.x);\n        const top = X.y + (hits[0] - X.y) * k;\n        const bot = X.y + (hits[5] - X.y) * k;\n        const v = clamp(m.v + (reduce ? 0 : 0.03 * Math.sin(now / 1700 + m.ph)), 0.02, 0.98);\n        const band = Math.min(4, Math.floor(v * 5));\n        const tw = reduce ? 0.6 : 0.45 + 0.55 * Math.sin(now / 420 + m.ph) ** 2;\n        ctx.fillStyle = `rgba(240,246,255,${(0.75 * alpha[band] * tw).toFixed(3)})`;\n        ctx.beginPath();\n        ctx.arc(x, top + (bot - top) * v, 0.9 + (m.ph % 1) * 0.7, 0, 6.3);\n        ctx.fill();\n      }\n\n      // the prism: a block of glass with a little depth\n      ctx.globalCompositeOperation = \"source-over\";\n      const off = { x: 24, y: -15 };\n      const back = [A, B, C].map((p) => ({ x: p.x + off.x, y: p.y + off.y }));\n      const path = (pts: P[]) => {\n        ctx.beginPath();\n        ctx.moveTo(pts[0].x, pts[0].y);\n        for (let i = 1; i < pts.length; i++) ctx.lineTo(pts[i].x, pts[i].y);\n        ctx.closePath();\n      };\n      path(back);\n      ctx.fillStyle = \"rgba(130,165,235,0.09)\";\n      ctx.fill();\n      ctx.strokeStyle = \"rgba(190,214,255,0.22)\";\n      ctx.lineWidth = 1;\n      ctx.stroke();\n      // right-hand side face, where the light leaves\n      path([A, C, back[2], back[0]]);\n      const side = ctx.createLinearGradient(A.x, A.y, C.x, C.y);\n      side.addColorStop(0, \"rgba(225,238,255,0.42)\");\n      side.addColorStop(0.6, `rgba(120,170,250,${(0.10 + 0.16 * L).toFixed(3)})`);\n      side.addColorStop(1, \"rgba(90,130,210,0.06)\");\n      ctx.fillStyle = side;\n      ctx.fill();\n      // front face\n      path([A, B, C]);\n      const face = ctx.createLinearGradient(B.x, B.y, (A.x + C.x) / 2 + 30, (A.y + C.y) / 2);\n      face.addColorStop(0, \"rgba(222,235,255,0.34)\");\n      face.addColorStop(0.42, \"rgba(110,140,205,0.10)\");\n      face.addColorStop(0.7, \"rgba(60,84,140,0.10)\");\n      face.addColorStop(1, \"rgba(170,204,255,0.26)\");\n      ctx.fillStyle = face;\n      ctx.fill();\n      // facets seen through the glass: the far edges, bent\n      const mid = (p: P, q: P, k: number): P => ({ x: p.x + (q.x - p.x) * k, y: p.y + (q.y - p.y) * k });\n      path([mid(A, B, 0.34), mid(B, C, 0.3), mid(B, C, 0.52), mid(A, C, 0.2)]);\n      ctx.fillStyle = \"rgba(255,255,255,0.055)\";\n      ctx.fill();\n      path([mid(A, C, 0.62), mid(B, C, 0.78), C]);\n      ctx.fillStyle = \"rgba(8,10,18,0.28)\";\n      ctx.fill();\n      path([B, mid(B, A, 0.2), mid(B, C, 0.16)]);\n      ctx.fillStyle = \"rgba(8,10,18,0.22)\";\n      ctx.fill();\n\n      ctx.save();\n      path([A, B, C]);\n      ctx.clip();\n      ctx.globalCompositeOperation = \"lighter\";\n      // light spreading on its way through\n      const thru = ctx.createLinearGradient(E.x, E.y, X.x, X.y);\n      thru.addColorStop(0, `rgba(240,246,255,${(0.9 * L).toFixed(3)})`);\n      thru.addColorStop(1, `rgba(120,176,252,${(0.55 * L).toFixed(3)})`);\n      ctx.fillStyle = thru;\n      const nx = -(X.y - E.y);\n      const ny = X.x - E.x;\n      const nl = Math.hypot(nx, ny) || 1;\n      ctx.beginPath();\n      ctx.moveTo(E.x, E.y - 1.4);\n      ctx.lineTo(X.x + (nx / nl) * 7, X.y + (ny / nl) * 7);\n      ctx.lineTo(X.x - (nx / nl) * 7, X.y - (ny / nl) * 7);\n      ctx.lineTo(E.x, E.y + 1.4);\n      ctx.closePath();\n      ctx.fill();\n      for (const [p, r, a] of [[E, 58, 0.5], [X, 74, 0.6]] as const) {\n        const g = ctx.createRadialGradient(p.x, p.y, 0, p.x, p.y, r);\n        g.addColorStop(0, `rgba(190,216,255,${(a * L).toFixed(3)})`);\n        g.addColorStop(1, \"rgba(190,216,255,0)\");\n        ctx.fillStyle = g;\n        ctx.fillRect(p.x - r, p.y - r, r * 2, r * 2);\n      }\n      // a soft streak of room light lying along the left face\n      const sA = { x: A.x + (B.x - A.x) * 0.12 + 13, y: A.y + (B.y - A.y) * 0.12 + 6 };\n      const sB = { x: A.x + (B.x - A.x) * 0.8 + 13, y: A.y + (B.y - A.y) * 0.8 + 6 };\n      ctx.strokeStyle = \"rgba(255,255,255,0.10)\";\n      ctx.lineWidth = 9;\n      ctx.beginPath();\n      ctx.moveTo(sA.x, sA.y);\n      ctx.lineTo(sB.x, sB.y);\n      ctx.stroke();\n      ctx.restore();\n\n      ctx.globalCompositeOperation = \"source-over\";\n      // chamfer line just inside the front face\n      const gx = (A.x + B.x + C.x) / 3;\n      const gy = (A.y + B.y + C.y) / 3;\n      path([A, B, C].map((p) => ({ x: gx + (p.x - gx) * 0.84, y: gy + (p.y - gy) * 0.84 })));\n      ctx.strokeStyle = \"rgba(255,255,255,0.16)\";\n      ctx.lineWidth = 1;\n      ctx.stroke();\n      for (const [p, q] of [[A, back[0]], [C, back[2]], [B, back[1]]] as const) {\n        ctx.strokeStyle = \"rgba(200,220,255,0.3)\";\n        ctx.beginPath();\n        ctx.moveTo(p.x, p.y);\n        ctx.lineTo(q.x, q.y);\n        ctx.stroke();\n      }\n      const edge = (p: P, q: P, c0: string, c1: string, w: number) => {\n        const g = ctx.createLinearGradient(p.x, p.y, q.x, q.y);\n        g.addColorStop(0, c0);\n        g.addColorStop(1, c1);\n        ctx.strokeStyle = g;\n        ctx.lineWidth = w;\n        ctx.beginPath();\n        ctx.moveTo(p.x, p.y);\n        ctx.lineTo(q.x, q.y);\n        ctx.stroke();\n      };\n      edge(A, B, \"rgba(255,255,255,1)\", \"rgba(190,214,255,0.55)\", 2.2);\n      edge(A, C, \"rgba(255,255,255,0.8)\", `rgba(120,176,252,${(0.4 + 0.5 * L).toFixed(3)})`, 1.8);\n      edge(B, C, \"rgba(170,198,245,0.35)\", \"rgba(220,234,255,0.8)\", 2);\n      ctx.globalCompositeOperation = \"lighter\";\n      for (const [p, r, a] of [[A, 16, 0.5], [E, 12, 0.9 * L], [X, 16, 0.9 * L]] as const) {\n        const g = ctx.createRadialGradient(p.x, p.y, 0, p.x, p.y, r);\n        g.addColorStop(0, `rgba(255,255,255,${a.toFixed(3)})`);\n        g.addColorStop(1, \"rgba(255,255,255,0)\");\n        ctx.fillStyle = g;\n        ctx.fillRect(p.x - r, p.y - r, r * 2, r * 2);\n      }\n      ctx.globalCompositeOperation = \"source-over\";\n    };\n\n    const tick = (now: number) => {\n      const dt = Math.min(0.033, (now - last) / 1000);\n      last = now;\n      if (reduce) {\n        s.level = s.on ? 1 : 0;\n        s.rot = 0;\n      } else {\n        s.level += ((s.on ? 1 : 0) - s.level) * Math.min(1, dt * 9);\n        const idle = Math.sin(now / 2300) * 0.6;\n        s.rot += (s.trot + idle - s.rot) * Math.min(1, dt * 6);\n        if (!s.user && !s.held && now > s.next) {\n          s.on = !s.on;\n          s.since = now;\n          s.next = now + (s.on ? 7200 : 1100);\n          setLit(s.on);\n        }\n      }\n      draw(now);\n      if (visible && !reduce) raf = requestAnimationFrame(tick);\n    };\n    s.redraw = () => tick(performance.now());\n\n    const io = new IntersectionObserver(([e]) => {\n      const was = visible;\n      visible = e.isIntersecting;\n      if (visible && !was) {\n        last = performance.now();\n        raf = requestAnimationFrame(tick);\n      }\n    });\n    io.observe(wrap);\n    raf = requestAnimationFrame(tick);\n\n    const move = (e: PointerEvent) => {\n      const r = wrap.getBoundingClientRect();\n      s.trot = clamp(((e.clientY - r.top) / r.height - 0.5) * 2, -1, 1) * 6;\n    };\n    const leave = () => {\n      s.trot = 0;\n    };\n    wrap.addEventListener(\"pointermove\", move);\n    wrap.addEventListener(\"pointerdown\", move);\n    wrap.addEventListener(\"pointerleave\", leave);\n\n    return () => {\n      cancelAnimationFrame(raf);\n      ro.disconnect();\n      io.disconnect();\n      wrap.removeEventListener(\"pointermove\", move);\n      wrap.removeEventListener(\"pointerdown\", move);\n      wrap.removeEventListener(\"pointerleave\", leave);\n    };\n  }, [reduce]);\n\n  const toggle = () => {\n    const s = sim.current;\n    s.on = !s.on;\n    s.since = performance.now();\n    s.user = !s.on;\n    s.next = s.since + 9000;\n    setLit(s.on);\n    if (reduce) s.redraw();\n  };\n  const hold = (v: boolean) => () => {\n    sim.current.held = v;\n    if (!v) sim.current.next = performance.now() + 3000;\n  };\n\n  const sans = '\"Inter Tight\", \"Inter\", ui-sans-serif, system-ui, sans-serif';\n  const row = (i: number) => ({ top: ROWS[i], height: ROWS[i + 1] - ROWS[i] });\n\n  return (\n    <section className=\"relative overflow-hidden bg-[#0B0D12]\" style={{ fontFamily: sans }} onMouseEnter={hold(true)} onMouseLeave={hold(false)}>\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ background: \"radial-gradient(52% 70% at 42% 44%, #1a1f2b 0%, #10131a 48%, #0B0D12 100%)\" }} />\n      <div ref={wrapRef} className=\"relative mx-auto mt-4 w-full max-w-[1120px] overflow-hidden sm:mt-6\" style={{ height: SCENE_H }}>\n        <div ref={sceneRef} className=\"absolute left-1/2 top-0 select-none\" style={{ width: SCENE_W, height: SCENE_H, transformOrigin: \"50% 0\", transform: \"translateX(-50%)\", perspective: \"1300px\", perspectiveOrigin: \"70% 50%\", [\"--L\" as string]: 0.6 }}>\n          {/* light bouncing off the sheet into the room */}\n          <div aria-hidden=\"true\" className=\"absolute rounded-full\" style={{ left: PAGE_X - 120, top: PAGE_Y - 70, width: PAGE_W + 240, height: PAGE_H + 140, background: \"radial-gradient(closest-side, rgba(79,152,251,0.20), rgba(79,152,251,0))\", opacity: \"var(--L)\" as unknown as number }} />\n\n          {/* the torch that carries the sentence */}\n          <div aria-hidden=\"true\" className=\"absolute\" style={{ left: 4, top: BEAM_Y - 35, width: LENS_X - 4, height: 70 }}>\n            <div className=\"absolute inset-0 rounded-full\" style={{ background: \"linear-gradient(180deg, #5a606c 0%, #343842 9%, #1c1f27 38%, #12141a 62%, #23262f 90%, #0a0b0f 100%)\", boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -1px 0 rgba(0,0,0,0.8), 0 0 0 1px rgba(0,0,0,0.6)\" }} />\n            <div className=\"absolute inset-y-[9px] left-[12px] right-[56px] overflow-hidden rounded-full\" style={{ background: \"linear-gradient(180deg, #06070a, #0e1016)\", boxShadow: \"inset 0 2px 4px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.10)\" }}>\n              <p className=\"absolute inset-y-0 left-[16px] right-[8px] flex items-center text-[11.5px] font-bold leading-[1.2] tracking-[-0.01em] text-white/90\">{site.sentence}</p>\n            </div>\n            <div className=\"absolute inset-y-[3px] right-[36px] w-[12px]\" style={{ backgroundImage: \"repeating-linear-gradient(90deg, rgba(0,0,0,0.7) 0 1.5px, rgba(255,255,255,0.16) 1.5px 3px), linear-gradient(180deg, #6b717d, #1c1f27 40%, #0c0d11 70%, #2b2f39)\" }} />\n            <div className=\"absolute right-[4px] top-1/2 h-[26px] w-[26px] -translate-y-1/2 rounded-full\" style={{ background: \"radial-gradient(circle at 50% 50%, #ffffff 0%, #cfe2ff 30%, #4F98FB 62%, #153a78 100%)\", boxShadow: \"0 0 0 2px #090a0d, 0 0 0 3px rgba(255,255,255,0.22)\" }}>\n              <div className=\"absolute -inset-5 rounded-full\" style={{ background: \"radial-gradient(closest-side, rgba(170,205,255,0.75), rgba(79,152,251,0))\", opacity: \"var(--L)\" as unknown as number }} />\n              <div className=\"absolute inset-0 rounded-full bg-[#06070a]\" style={{ opacity: \"calc(0.86 - var(--L) * 0.86)\" as unknown as number }} />\n            </div>\n          </div>\n\n          {/* the sheet the light falls on */}\n          <div className=\"absolute\" style={{ left: PAGE_X, top: PAGE_Y, width: PAGE_W, height: PAGE_H, transformOrigin: \"0 50%\", transform: \"rotateY(17deg)\", transformStyle: \"preserve-3d\" }}>\n            <div aria-hidden=\"true\" className=\"absolute inset-0 rounded-[6px]\" style={{ background: \"#12151c\", boxShadow: \"inset 0 0 0 1px rgba(255,255,255,0.07), 18px 26px 50px rgba(0,0,0,0.65)\" }} />\n            <div ref={pageRef} className=\"absolute inset-0 overflow-hidden rounded-[6px] bg-[#F6F4EF]\">\n              <div className=\"absolute inset-x-[18px] flex items-center justify-between\" style={row(0)}>\n                <span className=\"flex items-center gap-[6px] text-[11.5px] font-extrabold tracking-[-0.02em]\" style={{ color: INK }}>\n                  <span aria-hidden=\"true\" className=\"h-[8px] w-[8px] rounded-full\" style={{ background: BLUE }} />\n                  {site.brand}\n                </span>\n                <span className=\"flex gap-[10px] text-[8.5px] font-bold text-neutral-700\">\n                  {site.links.map((l) => (\n                    <span key={l}>{l}</span>\n                  ))}\n                </span>\n              </div>\n              <h2 className=\"absolute inset-x-[18px] flex flex-col justify-center text-[40px] font-black leading-[0.92] tracking-[-0.055em]\" style={{ ...row(1), color: INK }}>\n                {site.headline.map((l) => (\n                  <span key={l} className=\"block\">\n                    {l}\n                  </span>\n                ))}\n              </h2>\n              <div className=\"absolute inset-x-[18px] overflow-hidden rounded-[4px] bg-[#231b12]\" style={{ top: ROWS[2] + 3, height: ROWS[3] - ROWS[2] - 6 }}>\n                <img src={site.photo.src} alt={site.photo.alt} width={232} height={94} draggable={false} className=\"h-full w-full object-cover\" style={{ objectPosition: \"60% 58%\" }} />\n              </div>\n              <ul className=\"absolute inset-x-[18px] flex items-center gap-[6px]\" style={row(3)}>\n                {site.chips.map((c) => (\n                  <li key={c} className=\"flex h-[26px] flex-1 items-center justify-center rounded-full border border-neutral-900/80 text-[8px] font-extrabold tracking-[-0.01em]\" style={{ color: INK }}>\n                    {c}\n                  </li>\n                ))}\n              </ul>\n              <div className=\"absolute inset-x-[18px] flex items-center gap-[10px]\" style={{ ...row(4), paddingBottom: 6 }}>\n                <span className=\"inline-flex h-[30px] items-center gap-[6px] rounded-full px-[14px] text-[10.5px] font-extrabold tracking-[-0.01em]\" style={{ background: BLUE, color: INK }}>\n                  {site.cta}\n                  <svg aria-hidden=\"true\" width=\"10\" height=\"10\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                    <path d=\"M4 10h12M11 5l5 5-5 5\" />\n                  </svg>\n                </span>\n                <span className=\"text-[8.5px] font-bold text-neutral-700\">{site.note}</span>\n              </div>\n              {/* the light thins out as it crosses the sheet */}\n              <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ background: \"linear-gradient(90deg, rgba(190,216,255,0.16) 0%, rgba(255,255,255,0) 22%, rgba(11,13,18,0.12) 70%, rgba(11,13,18,0.34) 100%)\" }} />\n            </div>\n          </div>\n\n          <canvas ref={canvasRef} aria-hidden=\"true\" className=\"pointer-events-none absolute left-0 top-0\" style={{ width: SCENE_W, height: SCENE_H }} />\n        </div>\n      </div>\n\n      <div className=\"relative mx-auto flex w-full max-w-[1000px] flex-col items-start gap-4 px-5 pb-7 pt-2 sm:flex-row sm:items-center sm:justify-between sm:px-8 sm:pb-10\">\n        <p className=\"max-w-[440px] text-[14px] font-semibold leading-snug tracking-[-0.01em] text-white/85\">\n          <span className=\"mb-1 block font-mono text-[10px] font-bold uppercase tracking-[0.28em]\" style={{ color: BLUE }}>\n            One sentence in\n          </span>\n          {site.sentence}\n        </p>\n        <button\n          type=\"button\"\n          onClick={toggle}\n          aria-pressed={lit}\n          className=\"inline-flex h-11 shrink-0 items-center gap-2 rounded-full border border-white/15 bg-white/[0.06] px-5 text-[13px] font-bold tracking-[-0.01em] text-white transition hover:bg-white/[0.14] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#4F98FB]\"\n        >\n          <span aria-hidden=\"true\" className=\"h-2 w-2 rounded-full\" style={{ background: lit ? BLUE : \"rgba(255,255,255,0.4)\", boxShadow: lit ? `0 0 10px ${BLUE}` : \"none\" }} />\n          {lit ? \"Cut the light\" : \"Send the light\"}\n        </button>\n      </div>\n    </section>\n  );\n}\n"}]}
