{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"monolith-footer","type":"registry:block","title":"Monolith footer","description":"A footer with your name machined into its foot as raised letters: bevelled, lit by one moving light, casting real shadows.","author":"Hairline UI","dependencies":[],"files":[{"path":"registry/monolith-footer.tsx","type":"registry:component","content":"// Hairline UI · monolith-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { FooterCaption, FooterLockup, FooterNav, plateColors, resolveColor, type FooterColumn, type FooterLink } from \"./footer-parts\";\nimport { createMonolithRenderer, readMonolithRgb, type MonolithRenderer, type Rgb } from \"./monolith-gl\";\nimport { useInteractionReducedMotion } from \"./ui-interaction-motion\";\n\n/*\n * A footer with the brand's name machined into its foot as a relief: bevelled letters\n * standing proud of the plate, casting real shadows. One light rakes across them; it\n * drifts on its own, follows the pointer, and swings to the column you're reading.\n */\n\nexport type MonolithLink = FooterLink;\nexport type MonolithColumn = FooterColumn;\n\nexport interface MonolithFooterProps {\n  /** Brand name: shown in the lockup and machined in relief across the foot. */\n  wordmark: string;\n  /** Optional logo beside the name. */\n  logo?: React.ReactNode;\n  /** One short line about the product. */\n  tagline?: string;\n  /** A contact link under the tagline, e.g. an email address. */\n  contact?: MonolithLink;\n  /** Link columns. */\n  columns?: MonolithColumn[];\n  /** \"auto\" follows the theme; \"dark\" keeps a dark plate on light pages too. */\n  tone?: \"auto\" | \"dark\";\n  /** The colour of the light's rim on the letters. Any CSS colour or token. Defaults to `var(--chart-2)`. */\n  accent?: string;\n  /** Copyright line. */\n  legal?: string;\n  /** Small links beside the copyright. */\n  legalLinks?: MonolithLink[];\n  className?: string;\n}\n\nconst NO_COLUMNS: MonolithColumn[] = [];\nconst NO_LINKS: MonolithLink[] = [];\nconst DEFAULT_ACCENT = \"var(--chart-2, var(--primary))\";\n\nfunction DefaultMark() {\n  return (\n    <svg viewBox=\"0 0 26 26\" className=\"size-[26px] shrink-0\" aria-hidden=\"true\">\n      <rect x=\"0.5\" y=\"0.5\" width=\"25\" height=\"25\" rx=\"6.5\" fill=\"color-mix(in oklab, currentColor 7%, transparent)\" stroke=\"color-mix(in oklab, currentColor 22%, transparent)\" />\n      <path d=\"M8 18V8h10v10Z\" fill=\"color-mix(in oklab, currentColor 16%, transparent)\" />\n      <path d=\"M8 8h10l-2.6 2.6H10.6Z\" fill=\"currentColor\" opacity=\"0.9\" />\n      <path d=\"M8 8l2.6 2.6v4.8L8 18Z\" fill=\"var(--fp-accent)\" />\n    </svg>\n  );\n}\n\nfunction drawReliefMask(ctx: CanvasRenderingContext2D, word: string, w: number, h: number, bayTop: number, bayH: number, dpr: number, family: string) {\n  // Opaque black ground: a transparent canvas is stored premultiplied, and WebGL would lift every\n  // faint pixel of the blurred height to full strength, flattening the bevel.\n  ctx.globalCompositeOperation = \"source-over\";\n  ctx.fillStyle = \"#000\";\n  ctx.fillRect(0, 0, w, h);\n  const label = word.trim() || \"Monolith\";\n  const setFont = (size: number) => {\n    ctx.font = `750 ${size}px ${family}`;\n    if (\"letterSpacing\" in ctx) {\n      (ctx as CanvasRenderingContext2D & { letterSpacing: string }).letterSpacing = `${(-0.045 * size).toFixed(2)}px`;\n    }\n  };\n  setFont(100);\n  const m = ctx.measureText(label);\n  const hRatio = (m.actualBoundingBoxAscent + m.actualBoundingBoxDescent) / 100 || 0.72;\n  const size = Math.max(24, Math.min((w * 0.9) / Math.max(0.5, m.width / 100), (bayH * 0.76) / hRatio));\n  setFont(size);\n  ctx.textAlign = \"center\";\n  ctx.textBaseline = \"middle\";\n  const cx = w * 0.5;\n  const cy = bayTop + bayH * 0.52;\n\n  ctx.save();\n  // The blur is the chamfer: about 4% of the letter size.\n  ctx.filter = `blur(${Math.max(3, Math.round(size * 0.04))}px)`;\n  ctx.fillStyle = \"rgb(0, 255, 0)\";\n  ctx.fillText(label, cx, cy);\n  ctx.restore();\n\n  ctx.save();\n  ctx.globalCompositeOperation = \"lighter\";\n  ctx.fillStyle = \"rgb(255, 0, 0)\";\n  ctx.fillText(label, cx, cy);\n  ctx.restore();\n}\n\nexport function MonolithFooter({\n  wordmark,\n  logo,\n  tagline,\n  contact,\n  columns = NO_COLUMNS,\n  tone = \"auto\",\n  accent = DEFAULT_ACCENT,\n  legal,\n  legalLinks = NO_LINKS,\n  className = \"\",\n}: MonolithFooterProps) {\n  const reduced = useInteractionReducedMotion();\n  const plateRef = React.useRef<HTMLDivElement>(null);\n  const canvasRef = React.useRef<HTMLCanvasElement>(null);\n  const bayRef = React.useRef<HTMLDivElement>(null);\n  const targetLightRef = React.useRef({ x: 0.5, y: 0.65, active: false });\n\n  React.useEffect(() => {\n    const plate = plateRef.current;\n    const canvas = canvasRef.current;\n    const bay = bayRef.current;\n    if (!plate || !canvas || !bay) return;\n\n    let renderer: MonolithRenderer | null = null;\n    try {\n      renderer = createMonolithRenderer(canvas);\n    } catch {\n      renderer = null;\n    }\n    if (!renderer) return;\n    const gl = renderer;\n\n    let raf = 0;\n    let visible = false;\n    let hidden = document.hidden;\n    let disposed = false;\n    let revealStart = -1;\n    let born = performance.now();\n    let lx = 0.5;\n    let ly = 0.65;\n    let lActive = 0;\n\n    const readColors = (): [Rgb, Rgb, Rgb, boolean] => {\n      const css = getComputedStyle(plate);\n      const paper = readMonolithRgb(css.backgroundColor, [0.065, 0.063, 0.06]);\n      const fg = readMonolithRgb(css.color, [0.94, 0.93, 0.91]);\n      const lum = 0.2126 * paper[0] + 0.7152 * paper[1] + 0.0722 * paper[2];\n      const isDark = tone === \"dark\" || lum < 0.42;\n      const accentRgb = readMonolithRgb(resolveColor(plate, \"var(--fp-accent)\"), isDark ? [0.84, 0.58, 0.36] : [0.58, 0.38, 0.21]);\n      return [paper, fg, accentRgb, isDark];\n    };\n\n    const measure = () => {\n      if (disposed) return;\n      const box = plate.getBoundingClientRect();\n      const bRect = bay.getBoundingClientRect();\n      const w = Math.max(1, box.width);\n      const h = Math.max(1, box.height);\n      const dpr = Math.min(window.devicePixelRatio || 1, 1.75);\n      const W = Math.round(w * dpr);\n      const H = Math.round(h * dpr);\n      const topFrac = Math.max(0.05, Math.min(0.92, (bRect.top - box.top) / h));\n      gl.layout(W, H, dpr, topFrac);\n\n      const mask = document.createElement(\"canvas\");\n      mask.width = W;\n      mask.height = H;\n      const mctx = mask.getContext(\"2d\");\n      if (mctx) {\n        const family = getComputedStyle(plate).fontFamily || \"system-ui, sans-serif\";\n        drawReliefMask(mctx, wordmark, W, H, (bRect.top - box.top) * dpr, bRect.height * dpr, dpr, family);\n        gl.mask(mask);\n      }\n      gl.colors(...readColors());\n      if (reduced) gl.draw(0.8, 1, 0.58, topFrac + 0.16, 1);\n    };\n\n    const frame = (now: number) => {\n      raf = 0;\n      if (disposed || !visible || hidden || reduced) return;\n      if (revealStart < 0) revealStart = now;\n      const reveal = 1 - Math.pow(1 - Math.min(1, (now - revealStart) / 1100), 3);\n      const t = (now - born) / 1000;\n      const tgt = targetLightRef.current;\n      lActive += ((tgt.active ? 1 : 0) - lActive) * 0.08;\n      if (tgt.active) {\n        lx += (tgt.x - lx) * 0.12;\n        ly += (tgt.y - ly) * 0.12;\n      }\n      gl.draw(t, reveal, lx, ly, lActive);\n      raf = requestAnimationFrame(frame);\n    };\n\n    const kick = () => {\n      if (!raf && visible && !hidden && !reduced && !disposed) raf = requestAnimationFrame(frame);\n    };\n\n    const start = () => {\n      if (disposed) return;\n      born = performance.now();\n      measure();\n      plate.dataset.ready = \"\";\n      kick();\n    };\n    if (document.fonts?.status === \"loaded\") start();\n    else document.fonts.ready.then(start, start);\n\n    const ro = new ResizeObserver(() => !disposed && plate.dataset.ready !== undefined && measure());\n    ro.observe(plate);\n\n    const io = new IntersectionObserver(\n      ([entry]) => {\n        visible = entry.isIntersecting;\n        if (visible && reduced) gl.draw(0.8, 1, 0.58, 0.68, 1);\n        else kick();\n      },\n      { threshold: 0.12 },\n    );\n    io.observe(plate);\n\n    const onVis = () => {\n      hidden = document.hidden;\n      if (!hidden) kick();\n    };\n    document.addEventListener(\"visibilitychange\", onVis);\n\n    const mo = new MutationObserver(() => {\n      gl.colors(...readColors());\n      if (reduced) gl.draw(0.8, 1, 0.58, 0.68, 1);\n    });\n    mo.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-theme\"] });\n\n    const onMove = (e: PointerEvent) => {\n      if (reduced || e.pointerType === \"touch\") return;\n      const r = plate.getBoundingClientRect();\n      targetLightRef.current = {\n        x: Math.max(0, Math.min(1, (e.clientX - r.left) / Math.max(1, r.width))),\n        y: Math.max(0, Math.min(1, (e.clientY - r.top) / Math.max(1, r.height))),\n        active: true,\n      };\n    };\n    const onLeave = () => {\n      targetLightRef.current = { ...targetLightRef.current, active: false };\n    };\n\n    plate.addEventListener(\"pointermove\", onMove);\n    plate.addEventListener(\"pointerleave\", onLeave);\n\n    return () => {\n      disposed = true;\n      cancelAnimationFrame(raf);\n      raf = 0;\n      ro.disconnect();\n      io.disconnect();\n      mo.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVis);\n      plate.removeEventListener(\"pointermove\", onMove);\n      plate.removeEventListener(\"pointerleave\", onLeave);\n      gl.dispose();\n      delete plate.dataset.ready;\n    };\n  }, [wordmark, tone, accent, reduced]);\n\n  const aimColumn = (el: HTMLElement | null) => {\n    const plate = plateRef.current;\n    if (!plate || reduced) return;\n    if (!el) {\n      targetLightRef.current = { ...targetLightRef.current, active: false };\n      return;\n    }\n    const pr = plate.getBoundingClientRect();\n    const er = el.getBoundingClientRect();\n    targetLightRef.current = {\n      x: Math.max(0, Math.min(1, (er.left + er.width * 0.5 - pr.left) / Math.max(1, pr.width))),\n      y: 0.62,\n      active: true,\n    };\n  };\n\n  return (\n    <footer className={`w-full max-w-[1200px] ${className}`}>\n      <div aria-hidden=\"true\" data-natural-width className=\"grid h-0\" style={{ gridTemplateColumns: \"minmax(0, 1200px)\" }} />\n      <div className=\"@container w-full\">\n        <div ref={plateRef} className=\"group/plate relative isolate touch-pan-y overflow-clip rounded-[28px]\" style={plateColors(tone === \"dark\", accent)}>\n          <canvas\n            ref={canvasRef}\n            aria-hidden=\"true\"\n            className=\"pointer-events-none absolute inset-0 -z-10 size-full opacity-0 transition-opacity duration-700 group-data-[ready]/plate:opacity-100\"\n          />\n\n          <div className=\"grid grid-cols-1 gap-x-10 gap-y-9 px-[max(20px,5cqi)] pt-[clamp(28px,4.5cqi,56px)] @[700px]:grid-cols-[minmax(0,1fr)_auto]\">\n            <FooterLockup logo={logo ?? <DefaultMark />} name={wordmark} tagline={tagline} contact={contact} />\n            <FooterNav columns={columns} onAim={aimColumn} />\n          </div>\n\n          {/* The relief. Until WebGL is ready, and without it, the name shows as faint type. */}\n          <div ref={bayRef} aria-hidden=\"true\" className=\"relative mt-[clamp(16px,3.5cqi,44px)] h-[clamp(150px,23cqi,290px)] w-full select-none\">\n            <p className=\"absolute inset-0 flex items-center justify-center text-[16cqi] font-bold tracking-[-0.045em] opacity-15 transition-opacity duration-700 group-data-[ready]/plate:opacity-0\">\n              {wordmark}\n            </p>\n          </div>\n\n          <FooterCaption legal={legal} links={legalLinks} className=\"relative px-[max(20px,5cqi)] pb-[clamp(18px,2.4cqi,26px)] pt-2 text-[color:var(--fp-muted)]\" />\n        </div>\n      </div>\n    </footer>\n  );\n}\n"},{"path":"registry/monolith-gl.ts","type":"registry:component","content":"// Hairline UI · monolith-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n/*\n * Relief lettering, in WebGL 1. The mask carries the name twice: the sharp face in red and a\n * blurred copy in green that serves as a height field. Its slope gives every letter a bevel lit\n * by one moving light; a short march toward the light casts each letter's shadow on the plate.\n * Dark plates get a fine brushed grain, light ones a stone grain.\n */\n\nexport type Rgb = [number, number, number];\n\nconst VERTEX = `attribute vec2 aPos;\nvoid main() { gl_Position = vec4(aPos, 0.0, 1.0); }`;\n\nconst FRAGMENT = `precision highp float;\nuniform sampler2D uMask;\nuniform vec2 uRes;\nuniform float uScale;\nuniform float uTime;\nuniform float uReveal;\nuniform vec2 uLight;\nuniform float uLightActive;\nuniform float uBayTop;\nuniform float uIsDark;\nuniform vec3 uPaper;\nuniform vec3 uInk;\nuniform vec3 uAccent;\n\nfloat hash(vec2 p) {\n  return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n}\n\nvoid main() {\n  vec2 uv = gl_FragCoord.xy / uRes;\n  float y = 1.0 - uv.y;\n\n  // Overhead studio light coordinates (sweeps lazily when idle, follows pointer when active)\n  vec2 idleLight = vec2(0.5 + 0.34 * sin(uTime * 0.40), uBayTop + (1.0 - uBayTop) * (0.28 + 0.1 * cos(uTime * 0.30)));\n  vec2 lightPos = mix(idleLight, uLight, uLightActive);\n  lightPos.x = mix(0.08, lightPos.x, uReveal);\n\n  float aspect = uRes.x / max(1.0, uRes.y);\n  vec2 delta = vec2((lightPos.x - uv.x) * aspect, lightPos.y - y);\n  float dist = length(delta);\n\n  // Subtle architectural gallery floor pool of light inside the lower relief bay\n  // No band: the light simply falls off with distance, so the plate stays one surface.\n  float inBay = smoothstep(uBayTop - 0.3, uBayTop + 0.12, y);\n  float pool = exp(-dist * dist * 3.0) * inBay * uReveal;\n\n  vec3 warmGlow = vec3(0.98, 0.92, 0.82);\n  vec3 floorBase = uPaper;\n  vec3 poolTint = uIsDark > 0.5\n    ? mix(uPaper, mix(uAccent, warmGlow, 0.28), 0.22)\n    : mix(uPaper, vec3(1.0, 0.99, 0.96), 0.58);\n  vec3 col = mix(floorBase, poolTint, pool * (uIsDark > 0.5 ? 0.95 : 0.78));\n\n  // Sample relief mask: R = crisp face, G = blurred bevel heightfield\n  vec4 m = texture2D(uMask, vec2(uv.x, y));\n  float face = m.r;\n\n  // A soft cast shadow: march toward the light, each pixel starting at its own random offset\n  // so the steps dissolve into a smooth falloff instead of stacked copies of the letters.\n  float shadow = 0.0;\n  if (inBay > 0.01 && face < 0.95) {\n    vec2 stepDir = normalize(vec2(lightPos.x - uv.x, (lightPos.y - y) * 1.15) + vec2(0.0001));\n    vec2 texStep = stepDir * vec2(0.0034, 0.0078);\n    float jitter = hash(gl_FragCoord.xy);\n    for (int i = 0; i < 14; i++) {\n      float fi = (float(i) + jitter) / 14.0;\n      vec2 sUv = clamp(vec2(uv.x, y) + texStep * (float(i) + jitter), 0.0, 1.0);\n      shadow += texture2D(uMask, sUv).r * (1.0 - fi * 0.8) * 0.14;\n    }\n    shadow = clamp(shadow, 0.0, 0.85) * (1.0 - face) * uReveal;\n    vec3 shadowCol = uIsDark > 0.5 ? uPaper * 0.25 : mix(uInk, uAccent, 0.12);\n    col = mix(col, shadowCol, shadow * (uIsDark > 0.5 ? 0.8 : 0.3));\n  }\n\n  // Sculpted 3D letter relief strictly masked to crisp letter silhouette (zero outer halo)\n  if (face > 0.02) {\n    vec2 e = vec2(2.2 * uScale / uRes.x, 2.2 * uScale / uRes.y);\n    float hL = texture2D(uMask, vec2(clamp(uv.x - e.x, 0.0, 1.0), y)).g;\n    float hR = texture2D(uMask, vec2(clamp(uv.x + e.x, 0.0, 1.0), y)).g;\n    float hU = texture2D(uMask, vec2(uv.x, clamp(y - e.y, 0.0, 1.0))).g;\n    float hD = texture2D(uMask, vec2(uv.x, clamp(y + e.y, 0.0, 1.0))).g;\n\n    vec3 normal = normalize(vec3((hL - hR) * 5.4, (hU - hD) * 5.4, 0.36));\n    // A high light: the faces catch it, the chamfers facing it flare, the far ones fall dark.\n    vec3 lightDir = normalize(vec3(delta.x, -delta.y, 0.95));\n    vec3 viewDir = vec3(0.0, 0.0, 1.0);\n    vec3 halfVec = normalize(lightDir + viewDir);\n\n    float ndl = max(0.0, dot(normal, lightDir));\n    float spec = pow(max(0.0, dot(normal, halfVec)), 30.0);\n    float bevelEdge = clamp(length(vec2(hL - hR, hU - hD)) * 3.9, 0.0, 1.0);\n\n    // CNC brushed titanium in dark, carved warm travertine stone in light\n    // Brushed metal on dark plates, pale stone on light ones: the faces always read apart from the plate.\n    vec3 bodyDark = uIsDark > 0.5\n      ? mix(uPaper, uInk, 0.16)\n      : mix(uPaper, uInk, 0.2);\n    vec3 bodyLit = uIsDark > 0.5\n      ? mix(uPaper, mix(uInk, uAccent, 0.22), 0.58)\n      : mix(uPaper, vec3(1.0), 0.85);\n    vec3 rimCol = uIsDark > 0.5\n      ? mix(uAccent, warmGlow, 0.5)\n      : mix(uAccent, vec3(1.0), 0.55);\n\n    vec3 letterCol = mix(bodyDark, bodyLit, clamp(0.1 + 0.9 * ndl * (0.55 + 0.45 * pool), 0.0, 1.0));\n    letterCol = mix(letterCol, rimCol, clamp((spec * 0.8 + bevelEdge * ndl * 0.35) * (0.4 + 0.6 * pool), 0.0, 1.0) * (uIsDark > 0.5 ? 1.0 : 0.6));\n    float undercut = max(0.0, -dot(normal, lightDir)) * bevelEdge;\n    letterCol = mix(letterCol, uIsDark > 0.5 ? vec3(0.015, 0.013, 0.012) : mix(uInk, uAccent, 0.22), undercut * (uIsDark > 0.5 ? 0.76 : 0.42));\n\n    float blend = smoothstep(0.08, 0.88, face) * uReveal;\n    col = mix(col, letterCol, blend);\n  }\n\n  // Anisotropic horizontal CNC brushed-titanium grain (dark) vs carved mineral travertine grain (light)\n  if (uIsDark > 0.5) {\n    float brushLine = (hash(vec2(floor(gl_FragCoord.y / max(1.0, uScale)), floor(gl_FragCoord.x / (36.0 * uScale)))) - 0.5) * 0.022;\n    float fineNoise = (hash(gl_FragCoord.xy) - 0.5) * 0.015;\n    col += brushLine + fineNoise;\n  } else {\n    float stone = (hash(floor(gl_FragCoord.xy / max(1.0, 1.5 * uScale))) - 0.5) * 0.022;\n    col += stone;\n  }\n\n  gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);\n}`;\n\nexport function readMonolithRgb(css: string, fallback: Rgb): Rgb {\n  if (typeof document === \"undefined\" || !css) return fallback;\n  const c = document.createElement(\"canvas\");\n  c.width = c.height = 1;\n  const ctx = c.getContext(\"2d\");\n  if (!ctx) return fallback;\n  ctx.fillStyle = css;\n  ctx.fillRect(0, 0, 1, 1);\n  const [r, g, b] = ctx.getImageData(0, 0, 1, 1).data;\n  return [r / 255, g / 255, b / 255];\n}\n\nexport function createMonolithRenderer(canvas: HTMLCanvasElement) {\n  const gl = canvas.getContext(\"webgl\", {\n    antialias: false,\n    alpha: false,\n    premultipliedAlpha: false,\n    preserveDrawingBuffer: false,\n    powerPreference: \"low-power\",\n  });\n  if (!gl) return null;\n\n  const compile = (type: number, source: string) => {\n    const s = gl.createShader(type)!;\n    gl.shaderSource(s, source);\n    gl.compileShader(s);\n    if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s) ?? \"shader\");\n    return s;\n  };\n\n  const program = gl.createProgram()!;\n  gl.attachShader(program, compile(gl.VERTEX_SHADER, VERTEX));\n  gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAGMENT));\n  gl.linkProgram(program);\n  if (!gl.getProgramParameter(program, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(program) ?? \"program\");\n  gl.useProgram(program);\n\n  const buffer = gl.createBuffer();\n  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n  const aPos = gl.getAttribLocation(program, \"aPos\");\n  gl.enableVertexAttribArray(aPos);\n  gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n  const maskTex = gl.createTexture();\n  gl.activeTexture(gl.TEXTURE0);\n  gl.bindTexture(gl.TEXTURE_2D, maskTex);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n  const u = (n: string) => gl.getUniformLocation(program, n);\n  const at = {\n    res: u(\"uRes\"),\n    scale: u(\"uScale\"),\n    time: u(\"uTime\"),\n    reveal: u(\"uReveal\"),\n    light: u(\"uLight\"),\n    lightActive: u(\"uLightActive\"),\n    bayTop: u(\"uBayTop\"),\n    isDark: u(\"uIsDark\"),\n    paper: u(\"uPaper\"),\n    ink: u(\"uInk\"),\n    accent: u(\"uAccent\"),\n  };\n  gl.uniform1i(u(\"uMask\"), 0);\n\n  return {\n    layout(width: number, height: number, dpr: number, bayTopFrac: number) {\n      canvas.width = width;\n      canvas.height = height;\n      gl.viewport(0, 0, width, height);\n      gl.uniform2f(at.res, width, height);\n      gl.uniform1f(at.scale, dpr);\n      gl.uniform1f(at.bayTop, bayTopFrac);\n    },\n    mask(image: HTMLCanvasElement) {\n      gl.activeTexture(gl.TEXTURE0);\n      gl.bindTexture(gl.TEXTURE_2D, maskTex);\n      gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n    },\n    colors(paper: Rgb, ink: Rgb, accent: Rgb, isDark: boolean) {\n      gl.uniform3f(at.paper, ...paper);\n      gl.uniform3f(at.ink, ...ink);\n      gl.uniform3f(at.accent, ...accent);\n      gl.uniform1f(at.isDark, isDark ? 1 : 0);\n    },\n    draw(time: number, reveal: number, lx: number, ly: number, active: number) {\n      gl.uniform1f(at.time, time);\n      gl.uniform1f(at.reveal, reveal);\n      gl.uniform2f(at.light, lx, ly);\n      gl.uniform1f(at.lightActive, active);\n      gl.drawArrays(gl.TRIANGLES, 0, 3);\n    },\n    dispose() {\n      gl.deleteTexture(maskTex);\n      gl.deleteBuffer(buffer);\n      gl.deleteProgram(program);\n    },\n  };\n}\n\nexport type MonolithRenderer = NonNullable<ReturnType<typeof createMonolithRenderer>>;\n"},{"path":"registry/footer-parts.tsx","type":"registry:component","content":"// Hairline UI · monolith-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { INTERACTION_FOCUS, INTERACTION_PRESS } from \"./ui-interaction-motion\";\n\n/*\n * The text of an art-led footer: brand lockup, link columns and small print.\n * It sits inside the picture, so it carries no panels, rules or labels of its own:\n * the plate sets the colours (--fp-fg, --fp-muted, --fp-accent) and the art does the rest.\n */\n\nexport interface FooterLink {\n  label: string;\n  href: string;\n}\n\nexport interface FooterColumn {\n  title: string;\n  links: FooterLink[];\n}\n\nexport const mixColor = (color: string, amount: number, into = \"transparent\") => `color-mix(in oklab, ${color} ${amount}%, ${into})`;\n\n/**\n * Plate colours. \"auto\" follows the theme (card in light, card in dark); \"night\" holds\n * a near-black plate tinted by the accent on any page, for art that only reads at night.\n */\nexport function plateColors(night: boolean, accent: string): React.CSSProperties {\n  return night\n    ? {\n        [\"--fp-accent\" as string]: accent,\n        [\"--fp-fg\" as string]: mixColor(\"white\", 94, accent),\n        [\"--fp-muted\" as string]: mixColor(\"white\", 60),\n        backgroundColor: mixColor(accent, 7, mixColor(\"white\", 5, \"black\")),\n        color: \"var(--fp-fg)\",\n        boxShadow: `0 0 0 1px ${mixColor(\"white\", 9)}, inset 0 1px 0 ${mixColor(\"white\", 9)}`,\n      }\n    : {\n        [\"--fp-accent\" as string]: accent,\n        [\"--fp-fg\" as string]: \"var(--card-foreground)\",\n        [\"--fp-muted\" as string]: \"var(--muted-foreground)\",\n        backgroundColor: \"var(--card)\",\n        color: \"var(--fp-fg)\",\n        boxShadow: \"0 0 0 1px var(--border)\",\n      };\n}\n\nexport function FooterLockup({\n  logo,\n  name,\n  tagline,\n  contact,\n  action,\n}: {\n  logo?: React.ReactNode;\n  name: string;\n  tagline?: string;\n  contact?: FooterLink;\n  action?: FooterLink;\n}) {\n  return (\n    <div className=\"flex max-w-[36ch] flex-col items-start gap-3.5\">\n      <div className=\"flex items-center gap-2.5\">\n        {logo}\n        <p className=\"text-[17px] font-semibold tracking-[-0.02em]\">{name}</p>\n      </div>\n      {tagline && <p className=\"text-pretty text-[14px] leading-6 text-[color:var(--fp-muted)]\">{tagline}</p>}\n      {contact && (\n        <a href={contact.href} className={`group/contact mt-1 inline-flex cursor-pointer items-center gap-1.5 rounded-sm text-[14px] font-medium ${INTERACTION_FOCUS}`}>\n          <span className=\"underline decoration-[color:var(--fp-muted)] decoration-1 underline-offset-[5px] transition-colors group-hover/contact:decoration-[color:var(--fp-accent)]\">\n            {contact.label}\n          </span>\n          <span aria-hidden=\"true\" className=\"transition-transform duration-200 group-hover/contact:translate-x-0.5\">\n            →\n          </span>\n        </a>\n      )}\n      {action && (\n        <a\n          href={action.href}\n          className={`group/action mt-1.5 inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-full px-4 text-[13.5px] font-medium ${INTERACTION_PRESS} ${INTERACTION_FOCUS}`}\n          style={{\n            backgroundColor: \"var(--fp-accent)\",\n            // The label picks its side from the accent itself, so any brand colour stays legible.\n            color: \"oklch(from var(--fp-accent) clamp(0.16, (0.68 - l) * 100, 0.985) calc(c * 0.25) h)\",\n          }}\n        >\n          {action.label}\n          <span aria-hidden=\"true\" className=\"transition-transform duration-200 group-hover/action:translate-x-0.5\">\n            →\n          </span>\n        </a>\n      )}\n    </div>\n  );\n}\n\n/**\n * Link columns. `onAim` reports the column the pointer or keyboard is in (null when it leaves),\n * so the picture can answer it.\n */\nexport function FooterNav({ columns, onAim }: { columns: FooterColumn[]; onAim?: (column: HTMLElement | null, index: number) => void }) {\n  if (!columns.length) return null;\n  return (\n    <nav\n      aria-label=\"Footer\"\n      onPointerLeave={() => onAim?.(null, -1)}\n      className=\"grid grid-cols-2 gap-x-[clamp(16px,4cqi,56px)] gap-y-7 @[440px]:grid-cols-[repeat(3,auto)]\"\n    >\n      {columns.map((col, index) => (\n        <div\n          key={col.title}\n          onPointerEnter={(e) => onAim?.(e.currentTarget, index)}\n          onFocus={(e) => onAim?.(e.currentTarget, index)}\n          onBlur={(e) => {\n            if (!e.currentTarget.contains(e.relatedTarget as Node | null)) onAim?.(null, -1);\n          }}\n          className=\"flex min-w-0 flex-col gap-2.5\"\n        >\n          <p className=\"text-[12px] text-[color:var(--fp-muted)]\">{col.title}</p>\n          <ul className=\"flex flex-col gap-1.5\">\n            {col.links.map((l) => (\n              <li key={l.label}>\n                <a\n                  href={l.href}\n                  className={`cursor-pointer rounded-sm text-[13.5px] transition-colors duration-150 hover:text-[color:var(--fp-accent)] @[480px]:text-[14px] ${INTERACTION_FOCUS}`}\n                >\n                  {l.label}\n                </a>\n              </li>\n            ))}\n          </ul>\n        </div>\n      ))}\n    </nav>\n  );\n}\n\n/** The small print, set as the picture's caption: no rule above it. */\nexport function FooterCaption({\n  legal,\n  links,\n  note,\n  className = \"\",\n}: {\n  legal?: string;\n  links: FooterLink[];\n  /** Anything that belongs beside the copyright, e.g. a local clock. */\n  note?: React.ReactNode;\n  className?: string;\n}) {\n  if (!legal && !links.length && !note) return null;\n  return (\n    <div className={`flex flex-wrap items-center justify-between gap-x-6 gap-y-2 text-[12.5px] ${className}`}>\n      {(legal || note) && (\n        <p className=\"flex flex-wrap items-center gap-x-3 gap-y-1\">\n          {legal && <span>{legal}</span>}\n          {note}\n        </p>\n      )}\n      {links.length > 0 && (\n        <ul className=\"flex flex-wrap gap-x-5 gap-y-1\">\n          {links.map((l) => (\n            <li key={l.label}>\n              <a href={l.href} className={`cursor-pointer rounded-sm opacity-80 transition-opacity hover:opacity-100 ${INTERACTION_FOCUS}`}>\n                {l.label}\n              </a>\n            </li>\n          ))}\n        </ul>\n      )}\n    </div>\n  );\n}\n\n/** A theme colour (any CSS colour, `var(...)` included) resolved to what the browser paints, for canvas and WebGL. */\nexport function resolveColor(host: HTMLElement, value: string): string {\n  const probe = document.createElement(\"span\");\n  probe.style.cssText = \"position:absolute;display:none\";\n  probe.style.color = value;\n  host.appendChild(probe);\n  const out = getComputedStyle(probe).color;\n  probe.remove();\n  return out;\n}\n"},{"path":"registry/ui-interaction-motion.ts","type":"registry:component","content":"// Hairline UI · monolith-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n'use client';\n\nimport * as React from 'react';\n\nexport const EASE_OUT = 'cubic-bezier(0.16, 1, 0.3, 1)';\nexport const EASE_SETTLE = 'cubic-bezier(0.22, 1.18, 0.36, 1)';\n/** Thrown things (indicators, thumbs): a slight overshoot on transform only. */\nexport const EASE_THROW = 'cubic-bezier(0.34, 1.36, 0.64, 1)';\n/**\n * The press every button primitive shares: a 3% give that eases in and settles back.\n * Tailwind v4's scale-* writes the `scale` property, so `scale` has to be in the list\n * or the press snaps.\n */\nexport const INTERACTION_PRESS =\n  'transition-[background-color,color,box-shadow,opacity,scale] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100';\nexport const INTERACTION_FOCUS ='focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background';\n\nconst query = '(prefers-reduced-motion: reduce)';\nconst subscribe = (notify: () => void) => {\n  const media = window.matchMedia(query);\n  media.addEventListener('change', notify);\n  return () => media.removeEventListener('change', notify);\n};\nexport const useInteractionReducedMotion = () => React.useSyncExternalStore(subscribe, () => window.matchMedia(query).matches, () => false);\n\nexport function useInteractionActivity<T extends Element>() {\n  const ref = React.useRef<T>(null);\n  const [visible, setVisible] = React.useState(false);\n  const [hidden, setHidden] = React.useState(false);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    const observer = new IntersectionObserver(([entry]) => setVisible(entry.isIntersecting));\n    observer.observe(el);\n    const visibility = () => setHidden(document.hidden);\n    visibility(); document.addEventListener('visibilitychange', visibility);\n    return () => { observer.disconnect(); document.removeEventListener('visibilitychange', visibility); };\n  }, []);\n  return { ref, active: visible && !hidden };\n}\n\nexport function interactionIcon(on: boolean, reduced: boolean): React.CSSProperties {\n  return { opacity: on ? 1 : 0, transform: on ? 'none' : 'scale(0.6)', filter: on ? 'blur(0px)' : 'blur(3px)', transition: reduced ? 'none' : `opacity 220ms ${EASE_OUT}, transform 380ms ${EASE_OUT}, filter 220ms ${EASE_OUT}` };\n}\n\n/** A raised object: one tight contact shadow, one short ambient, a hairline of light on its top edge. */\nexport const MATERIAL_LIFT =\n  'shadow-[0_1px_1.5px_rgb(0_0_0/0.07),0_3px_8px_-2px_rgb(0_0_0/0.1),inset_0_0.5px_0_rgb(255_255_255/0.8)] dark:shadow-[0_1px_2px_rgb(0_0_0/0.5),0_4px_10px_-2px_rgb(0_0_0/0.35),inset_0_0.5px_0_rgb(255_255_255/0.1)]';\n/** A trough something sits in, shaded from above, lit along its bottom edge. */\nexport const MATERIAL_RECESS =\n  'shadow-[inset_0_1px_2.5px_rgb(0_0_0/0.09),inset_0_-0.5px_0_rgb(255_255_255/0.7)] dark:shadow-[inset_0_1px_3px_rgb(0_0_0/0.45),inset_0_-0.5px_0_rgb(255_255_255/0.07)]';\n\nexport type SpringConfig = { stiffness: number; damping: number; mass?: number };\nexport interface Spring {\n  get(): number;\n  getVelocity(): number;\n  getTarget(): number;\n  /** Aim somewhere new from wherever it is now, keeping its speed. */\n  set(target: number): void;\n  /** Add speed (units per second), on top of what it already has. */\n  push(velocity: number): void;\n  /** Be there now, at rest. */\n  jump(value: number): void;\n  configure(config: SpringConfig): void;\n  stop(): void;\n}\n\n// Every moving spring on the page shares one frame loop, which sleeps when the last one rests. Each spring's onFrame runs\n// once per frame after all of them have stepped, so several springs that draw one shape paint it once.\nconst SPRING_STEP = 1 / 240;\ntype Running = { step: () => void };\nconst runningSprings = new Set<Running>();\nconst springPainters = new Set<() => void>();\nlet springFrame = 0;\nlet springLast = 0;\nlet springSpare = 0;\n\nfunction springTick(now: number) {\n  // A hidden tab stops the frames, so the first one back must not count the whole gap as time passed.\n  springSpare += Math.min((now - springLast) / 1000, 0.05);\n  springLast = now;\n  while (springSpare >= SPRING_STEP) {\n    runningSprings.forEach((spring) => spring.step());\n    springSpare -= SPRING_STEP;\n  }\n  const painters = [...springPainters];\n  springPainters.clear();\n  painters.forEach((paint) => paint());\n  springFrame = runningSprings.size ? requestAnimationFrame(springTick) : 0;\n}\n\nfunction wakeSprings(spring: Running) {\n  runningSprings.add(spring);\n  if (springFrame) return;\n  springSpare = 0;\n  springFrame = requestAnimationFrame((now) => {\n    springLast = now - 1000 / 60;\n    springTick(now);\n  });\n}\n\n/**\n * A spring that carries its speed: re-aim it mid-flight and it curves on from where it is, push it while it swings and the\n * push adds to the swing. Use it for anything that can be interrupted; a curve restarts from a standstill every time.\n * `onFrame` should write straight to the DOM. `precision` is how close counts as there, in the value's own units.\n */\nexport function createSpring(initial: number, config: SpringConfig, onFrame: () => void, precision = 0.01): Spring {\n  let value = initial;\n  let velocity = 0;\n  let target = initial;\n  let { stiffness, damping, mass = 1 } = config;\n  const running: Running = {\n    step() {\n      velocity += ((-stiffness * (value - target) - damping * velocity) / mass) * SPRING_STEP;\n      value += velocity * SPRING_STEP;\n      if (Math.abs(value - target) < precision && Math.abs(velocity) < precision * 10) {\n        value = target;\n        velocity = 0;\n        runningSprings.delete(running);\n      }\n      springPainters.add(onFrame);\n    },\n  };\n  return {\n    get: () => value,\n    getVelocity: () => velocity,\n    getTarget: () => target,\n    set(next) {\n      if (next === target && !runningSprings.has(running)) return;\n      target = next;\n      wakeSprings(running);\n    },\n    push(speed) {\n      velocity += speed;\n      wakeSprings(running);\n    },\n    jump(next) {\n      value = next;\n      target = next;\n      velocity = 0;\n      runningSprings.delete(running);\n      onFrame();\n    },\n    configure(next) {\n      ({ stiffness, damping, mass = 1 } = next);\n    },\n    stop() {\n      runningSprings.delete(running);\n    },\n  };\n}\n\n/** Sample recent movement rather than averaging a long drag and losing its release velocity. */\nexport type PointerSample = { x: number; time: number };\nexport function samplePointer(samples: PointerSample[], x: number, time: number) {\n  samples.push({ x, time });\n  while (samples.length > 2 && time - samples[0].time > 100) samples.shift();\n}\nexport function releaseVelocity(samples: PointerSample[], now: number) {\n  if (samples.length < 2 || now - samples[samples.length - 1].time > 100) return 0;\n  const first = samples[0], last = samples[samples.length - 1];\n  return (last.x - first.x) / Math.max(1, last.time - first.time);\n}\n\n/** Smooth Apple/rational rubber-band curve: continuous exponential-like resistance without linear kinks. */\nexport function rubberBand(overshoot: number, dimension = 320, constant = 0.55): number {\n  const d = dimension || 320;\n  const abs = Math.abs(overshoot);\n  return Math.sign(overshoot) * (1 - 1 / ((abs * constant) / d + 1)) * d;\n}\n\n/** Projects resting travel from release velocity (velocity in px/ms; time in seconds). */\nexport function projectInertia(distance: number, velocity: number, time = 0.12): number {\n  return distance + velocity * 1000 * time;\n}\n\n/** Smooths incoming release velocity toward a boundary so springs don't slam or clip into walls. */\nexport function softenVelocity(velocity: number, distanceToTarget: number, factor = 10): number {\n  const maxAllowed = Math.abs(distanceToTarget) * factor;\n  return Math.sign(velocity) * Math.min(Math.abs(velocity), maxAllowed);\n}\n\n/** A damped spring sampled by WAAPI: tuned for organic lightness with a hint of life (3% breath). */\nexport function springFrames(\n  from: number,\n  to: number,\n  velocity = 0,\n  duration = 480,\n  config: { omega?: number; damping?: number; steps?: number } = {},\n) {\n  const { omega = 16, damping = 0.74, steps = 36 } = config;\n  const damped = omega * Math.sqrt(Math.max(0.001, 1 - damping * damping));\n  const displacement = from - to;\n  const coefficient = (velocity * 1000 + damping * omega * displacement) / damped;\n  return Array.from({ length: steps + 1 }, (_, i) => {\n    const t = (i / steps) * (duration / 1000);\n    const value = to + Math.exp(-damping * omega * t) * (displacement * Math.cos(damped * t) + coefficient * Math.sin(damped * t));\n    return { value: i === steps ? to : value, offset: i / steps };\n  });\n}\n\n"}],"css":{},"docs":"Docs and live preview: https://hairlineui.com/blocks/monolith-footer. MIT licensed: https://hairlineui.com/license#components","meta":{"license":"MIT"}}