{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "velocity-ink",
  "title": "Velocity ink",
  "description": "Velocity ink is a production-ready controls component from BJORK UI, packaged for shadcn registries.",
  "dependencies": [
    "clsx",
    "framer-motion",
    "next-themes",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/bjork-ui/controls/velocity-ink.tsx",
      "content": "\"use client\";\n\nimport {\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useRef,\n  useState,\n  type CSSProperties,\n  type KeyboardEvent,\n  type PointerEvent,\n} from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { cn } from \"@/lib/utils\";\nimport { BJORK_PALETTE, type BjorkTone } from \"@/components/bjork-ui/_core/palette\";\nimport { cubicBezier, easeCss, springs } from \"@/components/bjork-ui/_core/motion\";\nimport { useBjorkTone } from \"@/components/bjork-ui/_core/tone\";\nimport { BJORK_SURFACE } from \"@/components/bjork-ui/_core/surface\";\nimport { LiveRegion } from \"@/components/bjork-ui/_core/a11y\";\nimport { sizeCanvas, useElementSize } from \"@/components/bjork-ui/_core/canvas\";\nimport { useVisibleLoop } from \"@/components/bjork-ui/_core/loop\";\n\nexport type InkPen = \"pen\" | \"brush\" | \"fineliner\";\n/** [x, y, tMs, pressure]. Pressure is 0 for non-pen pointers. */\nexport type InkPoint = [number, number, number, number];\n\nexport interface InkStroke {\n  pen: InkPen;\n  color: string;\n  points: InkPoint[];\n  /** Set for Shift-straightened strokes. They are drawn as a straight line at constant mid width. */\n  snapped?: boolean;\n}\n\nexport interface VelocityInkProps {\n  value?: InkStroke[];\n  defaultValue?: InkStroke[];\n  /** Fires on pointerup, undo, clear and typed input. Receives the strokes and an SVG string. */\n  onChange?: (strokes: InkStroke[], svg: string) => void;\n  onClear?: () => void;\n  pen?: InkPen;\n  defaultPen?: InkPen;\n  onPenChange?: (pen: InkPen) => void;\n  colors?: { ink?: string; accent?: string };\n  /** Overrides the [min, max] width of every pen. */\n  width?: [number, number];\n  /** Shift snaps to this many directions. 0 disables snapping. */\n  snapAngles?: 8 | 0;\n  guide?: \"signature\" | \"grid\" | \"none\";\n  toolbar?: boolean;\n  fallbackInput?: boolean;\n  readOnly?: boolean;\n  height?: number;\n  ariaLabel?: string;\n  tone?: BjorkTone;\n  attract?: boolean;\n  className?: string;\n}\n\ntype Range = [number, number];\ntype Xf = { s: number; ox: number; oy: number };\ninterface Dense {\n  x: number[];\n  y: number[];\n  w: number[];\n  length: number;\n}\ninterface Live {\n  id: number;\n  pen: InkPen;\n  color: string;\n  pts: InkPoint[];\n  drawn: number;\n  snapping: boolean;\n  left: number;\n  top: number;\n  lastT: number;\n}\n\n// Speed-driven width ranges. Fineliner is a constant 1.6, clamped into the range.\nconst PEN_RANGE: Record<InkPen, Range> = {\n  pen: [1.2, 4.2],\n  brush: [1.5, 9],\n  fineliner: [1.6, 1.6],\n};\nconst SPEED_SMOOTHING = 0.35;\nconst SAMPLE_STEP = 2;\nconst CAP_SEGMENTS = 12;\nconst LIVE_OVERLAP = 6; // dense samples repainted behind the tip, so the live seam never shows\nconst MIN_MOVE = 0.75;\nconst MIN_FRAME_MS = 1000 / 120;\nconst IDENTITY: Xf = { s: 1, ox: 0, oy: 0 };\n\nconst SIG_W = 560;\nconst SIG_H = 240;\nconst ATTRACT_IDLE_S = 4;\nconst ATTRACT_HOLD_MS = 2000;\nconst ATTRACT_FADE_MS = 300;\nconst CLEAR_MS = 180;\n\nconst pressable =\n  \"transition-[transform,background-color,color,opacity] duration-[140ms] ease-[cubic-bezier(0.23,1,0.32,1)] active:scale-[0.97] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--bjork-accent,#ec5c13)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--bjork-ring-offset,#121212)] disabled:opacity-40 disabled:active:scale-100\";\n\nfunction tok(name: string, fallback: string) {\n  return `var(--bjork-${name}, ${fallback})`;\n}\n\nfunction clamp(n: number, lo: number, hi: number) {\n  return Math.min(hi, Math.max(lo, n));\n}\n\nfunction r2(n: number) {\n  return Math.round(n * 100) / 100;\n}\n\nfunction rangeFor(pen: InkPen, override?: Range): Range {\n  return override ?? PEN_RANGE[pen];\n}\n\n// Width per raw sample. Speed is smoothed with an exponential average, and taper is applied at the stroke ends.\n// `live` skips the tail taper, because the tail is not known until pointerup.\nfunction widthsFor(stroke: InkStroke, [lo, hi]: Range, live: boolean): number[] {\n  const pts = stroke.points;\n  const n = pts.length;\n  const out = new Array<number>(n).fill((lo + hi) / 2);\n  if (stroke.snapped) return out;\n\n  let speed = 0;\n  for (let i = 0; i < n; i++) {\n    if (i > 0) {\n      const dt = Math.max(1, pts[i][2] - pts[i - 1][2]);\n      const raw = Math.hypot(pts[i][0] - pts[i - 1][0], pts[i][1] - pts[i - 1][1]) / dt;\n      speed = i === 1 ? raw : SPEED_SMOOTHING * raw + (1 - SPEED_SMOOTHING) * speed;\n    }\n    let w: number;\n    if (stroke.pen === \"fineliner\") w = clamp(1.6, lo, hi);\n    else if (stroke.pen === \"brush\") w = clamp(speed * 3.2, lo, hi);\n    else w = clamp(hi - speed * 1.6, lo, hi);\n    const pressure = pts[i][3];\n    if (pressure > 0) w *= 0.4 + pressure * 0.9;\n    out[i] = w;\n  }\n\n  // Sample 0 has no speed yet; give it the first measured width so fast strokes don't start fat.\n  if (n > 1) out[0] = out[1];\n\n  if (stroke.pen === \"brush\") {\n    for (let i = 0; i < n; i++) {\n      const head = i < 8 ? 0.3 + 0.7 * (i / 8) : 1;\n      const tailDistance = n - 1 - i;\n      const tail = !live && tailDistance < 8 ? 0.3 + 0.7 * (tailDistance / 8) : 1;\n      out[i] *= Math.min(head, tail);\n    }\n  }\n  return out;\n}\n\nfunction cr(p0: number, p1: number, p2: number, p3: number, u: number) {\n  return 0.5 * (2 * p1 + (-p0 + p2) * u + (2 * p0 - 5 * p1 + 4 * p2 - p3) * u * u + (-p0 + 3 * p1 - 3 * p2 + p3) * u * u * u);\n}\n\n// Catmull-Rom centreline with interpolated widths, resampled every SAMPLE_STEP px. Transformed by `xf`.\nfunction centreline(stroke: InkStroke, range: Range, live: boolean, xf: Xf): Dense {\n  const pts = stroke.points;\n  const n = pts.length;\n  const widths = widthsFor(stroke, range, live);\n  const xs: number[] = [];\n  const ys: number[] = [];\n  const ws: number[] = [];\n\n  if (n === 1) {\n    xs.push(pts[0][0]);\n    ys.push(pts[0][1]);\n    ws.push(widths[0]);\n  }\n  for (let i = 0; i < n - 1; i++) {\n    const p0 = pts[Math.max(0, i - 1)];\n    const p1 = pts[i];\n    const p2 = pts[i + 1];\n    const p3 = pts[Math.min(n - 1, i + 2)];\n    const count = i === n - 2 ? 9 : 8; // the final segment also emits u = 1\n    for (let j = 0; j < count; j++) {\n      const u = j / 8;\n      xs.push(cr(p0[0], p1[0], p2[0], p3[0], u));\n      ys.push(cr(p0[1], p1[1], p2[1], p3[1], u));\n      ws.push(widths[i] + (widths[i + 1] - widths[i]) * u);\n    }\n  }\n\n  const px = [xs[0]];\n  const py = [ys[0]];\n  const pw = [ws[0]];\n  let carry = 0;\n  let length = 0;\n  for (let k = 1; k < xs.length; k++) {\n    const ax = xs[k - 1];\n    const ay = ys[k - 1];\n    const aw = ws[k - 1];\n    const bx = xs[k];\n    const by = ys[k];\n    const bw = ws[k];\n    const seg = Math.hypot(bx - ax, by - ay);\n    if (seg === 0) continue;\n    length += seg;\n    let pos = SAMPLE_STEP - carry;\n    while (pos <= seg) {\n      const u = pos / seg;\n      px.push(ax + (bx - ax) * u);\n      py.push(ay + (by - ay) * u);\n      pw.push(aw + (bw - aw) * u);\n      pos += SAMPLE_STEP;\n    }\n    carry = seg - (pos - SAMPLE_STEP);\n  }\n  const lx = xs[xs.length - 1];\n  const ly = ys[ys.length - 1];\n  if (Math.hypot(lx - px[px.length - 1], ly - py[py.length - 1]) > 0.01) {\n    px.push(lx);\n    py.push(ly);\n    pw.push(ws[ws.length - 1]);\n  }\n\n  return {\n    x: px.map((v) => v * xf.s + xf.ox),\n    y: py.map((v) => v * xf.s + xf.oy),\n    w: pw.map((v) => v * xf.s),\n    length,\n  };\n}\n\nfunction tangentAt(d: Dense, k: number): [number, number] {\n  const n = d.x.length;\n  const a = Math.max(0, k - 1);\n  const b = Math.min(n - 1, k + 1);\n  const tx = d.x[b] - d.x[a];\n  const ty = d.y[b] - d.y[a];\n  const len = Math.hypot(tx, ty) || 1;\n  return [tx / len, ty / len];\n}\n\n// Half circle around (cx, cy), from the left normal through `dir` to the right normal.\nfunction arc(out: number[], cx: number, cy: number, r: number, dir: number, from: number, to: number) {\n  for (let j = from; j <= to; j++) {\n    const a = dir + Math.PI / 2 - (Math.PI * j) / CAP_SEGMENTS;\n    out.push(cx + Math.cos(a) * r, cy + Math.sin(a) * r);\n  }\n}\n\nfunction pathD(pts: number[]): string {\n  if (pts.length < 4) return \"\";\n  let s = `M${pts[0].toFixed(2)} ${pts[1].toFixed(2)}`;\n  for (let i = 2; i < pts.length; i += 2) s += `L${pts[i].toFixed(2)} ${pts[i + 1].toFixed(2)}`;\n  return `${s}Z`;\n}\n\n// One filled polygon per run. Rounded caps are optional, so the live run can stay flat at the tip.\nfunction ribbon(d: Dense, i0: number, i1: number, capStart: boolean, capEnd: boolean): string {\n  const count = i1 - i0 + 1;\n  const left: number[] = [];\n  const right: number[] = [];\n  for (let k = i0; k <= i1; k++) {\n    const [tx, ty] = tangentAt(d, k);\n    const hw = d.w[k] / 2;\n    left.push(d.x[k] - ty * hw, d.y[k] + tx * hw);\n    right.push(d.x[k] + ty * hw, d.y[k] - tx * hw);\n  }\n  const out: number[] = [];\n  for (let j = 0; j < count; j++) out.push(left[2 * j], left[2 * j + 1]);\n  if (capEnd) {\n    const [tx, ty] = tangentAt(d, i1);\n    arc(out, d.x[i1], d.y[i1], d.w[i1] / 2, Math.atan2(ty, tx), 1, CAP_SEGMENTS);\n  }\n  for (let j = count - 1; j >= 0; j--) out.push(right[2 * j], right[2 * j + 1]);\n  if (capStart) {\n    const [tx, ty] = tangentAt(d, i0);\n    arc(out, d.x[i0], d.y[i0], d.w[i0] / 2, Math.atan2(-ty, -tx), 1, CAP_SEGMENTS);\n  }\n  return pathD(out);\n}\n\nfunction dotD(x: number, y: number, r: number): string {\n  const out: number[] = [];\n  for (let j = 0; j < 24; j++) {\n    const a = (Math.PI * 2 * j) / 24;\n    out.push(x + Math.cos(a) * r, y + Math.sin(a) * r);\n  }\n  return pathD(out);\n}\n\n// Full outline of one stroke as SVG path data. Strokes with fewer than two distinct points become a dot.\nfunction outlineD(stroke: InkStroke, width: Range | undefined, xf: Xf): string {\n  if (stroke.points.length === 0) return \"\";\n  const range = rangeFor(stroke.pen, width);\n  const d = centreline(stroke, range, false, xf);\n  if (d.length < 0.5 || d.x.length < 2) return dotD(d.x[0], d.y[0], d.w[0] / 2);\n  return ribbon(d, 0, d.x.length - 1, true, true);\n}\n\n// Live run from dense index `from` to the tip. Returns the new dense count so the caller can track the tip.\nfunction liveRun(stroke: InkStroke, width: Range | undefined, from: number): { d: string; count: number } {\n  const d = centreline(stroke, rangeFor(stroke.pen, width), true, IDENTITY);\n  const count = d.x.length;\n  if (count < 2 || d.length < 0.5 || from >= count - 1) return { d: \"\", count };\n  return { d: ribbon(d, from, count - 1, from === 0, false), count };\n}\n\n// Shift snap: the end point moves onto the nearest multiple of 360 / steps degrees from the start.\nfunction snapEnd(start: InkPoint, end: [number, number], steps: number): [number, number] {\n  const dx = end[0] - start[0];\n  const dy = end[1] - start[1];\n  const len = Math.hypot(dx, dy);\n  const step = (Math.PI * 2) / steps;\n  const a = Math.round(Math.atan2(dy, dx) / step) * step;\n  return [start[0] + Math.cos(a) * len, start[1] + Math.sin(a) * len];\n}\n\nfunction paintStrokes(\n  ctx: CanvasRenderingContext2D,\n  strokes: InkStroke[],\n  width: Range | undefined,\n  xf: Xf,\n  color?: string,\n) {\n  for (const stroke of strokes) {\n    ctx.fillStyle = color ?? stroke.color;\n    ctx.fill(new Path2D(outlineD(stroke, width, xf)));\n  }\n}\n\nfunction paintCanvas(\n  canvas: HTMLCanvasElement,\n  w: number,\n  h: number,\n  dpr: number,\n  strokes: InkStroke[],\n  width: Range | undefined,\n  xf: Xf,\n  color?: string,\n) {\n  const ctx = canvas.getContext(\"2d\");\n  if (!ctx) return;\n  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n  ctx.clearRect(0, 0, w, h);\n  paintStrokes(ctx, strokes, width, xf, color);\n}\n\nfunction escAttr(value: string) {\n  return value.replace(/&/g, \"&amp;\").replace(/\"/g, \"&quot;\").replace(/</g, \"&lt;\");\n}\n\nfunction escXml(value: string) {\n  return value.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\");\n}\n\nfunction exportSvg(strokes: InkStroke[], w: number, h: number, width?: Range): string {\n  const paths = strokes\n    .map((s) => `<path d=\"${outlineD(s, width, IDENTITY)}\" fill=\"${escAttr(s.color)}\"/>`)\n    .join(\"\");\n  return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${r2(w)} ${r2(h)}\">${paths}</svg>`;\n}\n\nfunction textSvg(text: string, w: number, h: number, ink: string): string {\n  return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${r2(w)} ${r2(h)}\"><text x=\"${(w * 0.08).toFixed(2)}\" y=\"${(h * 0.72).toFixed(2)}\" font-family=\"'Bjork Grotesk Display', sans-serif\" font-style=\"italic\" font-size=\"40\" fill=\"${escAttr(ink)}\">${escXml(text)}</text></svg>`;\n}\n\n/** Serialises strokes as an SVG string: one path per stroke, coordinates to two decimals. */\nexport function strokesToSvg(strokes: InkStroke[], size: { width: number; height: number }): string {\n  return exportSvg(strokes, size.width, size.height);\n}\n\n// Built-in signature, authored as loose \"Bjork\" in a 560 x 240 box with real timestamps (about 1.66s).\nconst SIGNATURE_POINTS: InkPoint[][] = [\n  [\n    [150, 152, 0, 0],\n    [150, 146, 8, 0],\n    [150, 140, 17, 0],\n    [149.9, 134, 25, 0],\n    [149.8, 128, 33, 0],\n    [149.8, 122, 42, 0],\n    [149.8, 116, 50, 0],\n    [149.8, 110, 58, 0],\n    [149.8, 104, 67, 0],\n    [149.9, 98, 75, 0],\n    [150.1, 92, 83, 0],\n    [150.3, 86, 92, 0],\n    [150.8, 80, 100, 0],\n    [151.6, 74.1, 108, 0],\n    [153.2, 68.3, 117, 0],\n    [156.9, 63.7, 125, 0],\n    [162.7, 62.7, 133, 0],\n    [168.6, 63.7, 141, 0],\n    [174.6, 64, 150, 0],\n    [180.5, 64.7, 158, 0],\n    [186.3, 66.2, 166, 0],\n    [191.8, 68.6, 175, 0],\n    [196.7, 72.2, 183, 0],\n    [200.7, 76.6, 191, 0],\n    [204, 81.6, 200, 0],\n    [205.9, 87.3, 208, 0],\n    [205.4, 93.2, 216, 0],\n    [202.7, 98.5, 224, 0],\n    [198.4, 102.6, 233, 0],\n    [192.9, 105.1, 241, 0],\n    [187, 106.3, 249, 0],\n    [181.1, 107.1, 258, 0],\n    [175.1, 107.7, 266, 0],\n    [169.2, 108.4, 274, 0],\n    [163.2, 109.3, 283, 0],\n    [166.3, 111.1, 288, 0],\n    [172.2, 111.6, 296, 0],\n    [178.2, 112.1, 304, 0],\n    [184.2, 112.7, 313, 0],\n    [190.1, 113.6, 321, 0],\n    [195.9, 115.1, 329, 0],\n    [201.1, 118.1, 338, 0],\n    [205.4, 122.2, 346, 0],\n    [208.8, 127.1, 354, 0],\n    [211.2, 132.6, 362, 0],\n    [212, 138.5, 371, 0],\n    [210.5, 144.3, 379, 0],\n    [207.5, 149.5, 387, 0],\n    [203.4, 153.8, 396, 0],\n    [198.3, 157, 404, 0],\n    [192.6, 158.9, 412, 0],\n    [186.7, 159.7, 421, 0],\n    [180.7, 160.1, 429, 0],\n    [174.7, 160.2, 437, 0],\n    [168.7, 160.2, 446, 0],\n    [162.7, 160.1, 454, 0],\n    [156.7, 160, 462, 0],\n    [150.7, 160, 471, 0],\n    [150, 160, 472, 0],\n  ],\n  [\n    [252, 96, 612, 0],\n    [251.8, 102, 620, 0],\n    [251.6, 108, 628, 0],\n    [251.3, 114, 637, 0],\n    [251.1, 120, 645, 0],\n    [250.9, 126, 653, 0],\n    [250.6, 132, 662, 0],\n    [250.2, 138, 670, 0],\n    [249.6, 143.9, 678, 0],\n    [249.1, 149.9, 687, 0],\n    [248.2, 155.8, 695, 0],\n    [246.3, 161.5, 703, 0],\n    [242.6, 166.3, 712, 0],\n    [237.6, 169.4, 720, 0],\n    [231.7, 169.5, 728, 0],\n    [226.3, 167, 736, 0],\n    [222.9, 162.4, 744, 0],\n    [226.7, 158, 752, 0],\n    [232, 155.4, 761, 0],\n    [237.5, 153, 769, 0],\n    [243.1, 150.7, 777, 0],\n    [248.6, 148.3, 786, 0],\n    [253.9, 145.6, 794, 0],\n    [259, 142.5, 802, 0],\n    [263.4, 138.4, 811, 0],\n    [266.5, 133.2, 819, 0],\n    [268.6, 127.6, 827, 0],\n    [270.2, 121.8, 836, 0],\n    [271.8, 116.1, 844, 0],\n    [274.1, 110.5, 852, 0],\n    [278.2, 106.3, 860, 0],\n    [283.6, 103.6, 869, 0],\n    [289.4, 102.3, 877, 0],\n    [295.4, 102.3, 885, 0],\n    [300.7, 104.7, 894, 0],\n    [303.4, 110, 902, 0],\n    [304.5, 115.9, 910, 0],\n    [304.7, 121.9, 918, 0],\n    [304.3, 127.9, 927, 0],\n    [303.1, 133.8, 935, 0],\n    [301.1, 139.4, 943, 0],\n    [298.6, 144.9, 952, 0],\n    [295.5, 150, 960, 0],\n    [291.6, 154.6, 968, 0],\n    [286.7, 157.9, 977, 0],\n    [280.9, 159.6, 985, 0],\n    [274.9, 160.1, 993, 0],\n    [269, 159.3, 1002, 0],\n    [264.3, 155.9, 1010, 0],\n    [262.8, 150.1, 1018, 0],\n    [262.3, 144.2, 1026, 0],\n    [262.2, 138.2, 1035, 0],\n    [262, 136, 1038, 0],\n  ],\n  [\n    [326, 160, 1178, 0],\n    [325.9, 154, 1186, 0],\n    [325.7, 148, 1194, 0],\n    [325.5, 142, 1203, 0],\n    [325.4, 136, 1211, 0],\n    [325.4, 130, 1219, 0],\n    [325.7, 124, 1228, 0],\n    [327.1, 118.2, 1236, 0],\n    [331.7, 114.8, 1244, 0],\n    [337.3, 112.7, 1252, 0],\n    [343.2, 111.6, 1261, 0],\n    [349, 112.6, 1269, 0],\n    [352.4, 117.5, 1277, 0],\n    [355.6, 122.6, 1285, 0],\n    [360.1, 121.7, 1292, 0],\n    [362.2, 116.1, 1300, 0],\n    [363.8, 110.4, 1308, 0],\n    [365.3, 104.5, 1317, 0],\n    [366.6, 98.7, 1325, 0],\n    [367.9, 92.8, 1333, 0],\n    [369.2, 87, 1342, 0],\n    [370.5, 81.1, 1350, 0],\n    [371.8, 75.2, 1358, 0],\n    [373.3, 69.4, 1367, 0],\n    [374.3, 72.3, 1371, 0],\n    [373.8, 78.3, 1379, 0],\n    [373.3, 84.2, 1388, 0],\n    [372.7, 90.2, 1396, 0],\n    [372.1, 96.2, 1404, 0],\n    [371.5, 102.2, 1413, 0],\n    [370.9, 108.1, 1421, 0],\n    [370.4, 114.1, 1429, 0],\n    [370, 120.1, 1438, 0],\n    [369.8, 126.1, 1446, 0],\n    [369.7, 132.1, 1454, 0],\n    [369.7, 138.1, 1463, 0],\n    [369.7, 144.1, 1471, 0],\n    [369.8, 150.1, 1479, 0],\n    [369.9, 156.1, 1488, 0],\n    [369.6, 158, 1490, 0],\n    [369, 152.1, 1499, 0],\n    [368.5, 146.1, 1507, 0],\n    [368.4, 140.1, 1515, 0],\n    [368.7, 134.1, 1524, 0],\n    [369.9, 128.2, 1532, 0],\n    [373.1, 123.2, 1540, 0],\n    [377.2, 118.8, 1549, 0],\n    [381.7, 114.9, 1557, 0],\n    [386.5, 111.3, 1565, 0],\n    [391.6, 108.1, 1574, 0],\n    [388.1, 111.8, 1580, 0],\n    [384, 116.1, 1589, 0],\n    [380.9, 121.2, 1597, 0],\n    [380.2, 127, 1605, 0],\n    [382.1, 132.7, 1614, 0],\n    [384.8, 138.1, 1622, 0],\n    [387.8, 143.3, 1630, 0],\n    [390.9, 148.4, 1639, 0],\n    [394.1, 153.5, 1647, 0],\n    [397.2, 158.6, 1655, 0],\n    [398, 160, 1658, 0],\n  ],\n];\n\nexport const DEMO_SIGNATURE: InkStroke[] = SIGNATURE_POINTS.map((points) => ({\n  pen: \"pen\",\n  color: \"#ededed\",\n  points,\n}));\n\nconst DEMO_END_MS = Math.max(...DEMO_SIGNATURE.flatMap((s) => s.points.map((p) => p[2])));\nconst DEMO_CYCLE_MS = DEMO_END_MS + 240 + ATTRACT_HOLD_MS + ATTRACT_FADE_MS;\n\n// Fits the 560 x 240 signature into the pad, scaling down on narrow pads and centring on wide ones.\nfunction demoTransform(w: number, h: number): Xf {\n  const s = Math.max(0.05, Math.min(1, (w - 24) / SIG_W));\n  return { s, ox: (w - SIG_W * s) / 2, oy: (h - SIG_H * s) / 2 };\n}\n\nfunction demoUntil(t: number): InkStroke[] {\n  const out: InkStroke[] = [];\n  for (const stroke of DEMO_SIGNATURE) {\n    const points = stroke.points.filter((p) => p[2] <= t);\n    if (points.length) out.push({ ...stroke, points });\n  }\n  return out;\n}\n\nconst easeFade = cubicBezier(0.23, 1, 0.32, 1);\n\nfunction PenGlyph({ kind }: { kind: InkPen }) {\n  if (kind === \"pen\") {\n    return (\n      <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinejoin=\"round\" focusable=\"false\">\n        <path d=\"M3 13l1.2-3.6L10.4 2.2l2.4 2.4-6.2 6.2z\" />\n        <path d=\"M9.2 3.4l2.4 2.4\" />\n      </svg>\n    );\n  }\n  if (kind === \"brush\") {\n    return (\n      <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" focusable=\"false\">\n        <path d=\"M2.5 11c2.2-5.4 4.6-5.4 6.2-1.8s3.2 3.6 4.8-.6\" />\n      </svg>\n    );\n  }\n  return (\n    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1\" strokeLinecap=\"round\" focusable=\"false\">\n      <path d=\"M2.5 11c2.2-5.4 4.6-5.4 6.2-1.8s3.2 3.6 4.8-.6\" />\n    </svg>\n  );\n}\n\nexport function VelocityInk({\n  value,\n  defaultValue,\n  onChange,\n  onClear,\n  pen: penProp,\n  defaultPen = \"pen\",\n  onPenChange,\n  colors,\n  width,\n  snapAngles = 8,\n  guide = \"signature\",\n  toolbar = true,\n  fallbackInput = true,\n  readOnly = false,\n  height = 240,\n  ariaLabel = \"Signature pad\",\n  tone,\n  attract = false,\n  className,\n}: VelocityInkProps) {\n  const resolvedTone = useBjorkTone(tone);\n  const p = BJORK_PALETTE[resolvedTone];\n  const reduced = !!useReducedMotion();\n  const idBase = useId();\n  const inputId = `${idBase}-typed`;\n  const padRef = useRef<HTMLDivElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const size = useElementSize(padRef);\n  const sizeRef = useRef({ w: 0, h: 0 });\n  const dprRef = useRef(1);\n\n  const isControlled = value !== undefined;\n  const [internal, setInternal] = useState<InkStroke[]>(defaultValue ?? []);\n  const strokes = value ?? internal;\n  const strokesRef = useRef(strokes);\n  useLayoutEffect(() => {\n    strokesRef.current = strokes;\n  });\n\n  const [rev, setRev] = useState(0);\n  const [penState, setPenState] = useState<InkPen>(defaultPen);\n  const pen = penProp ?? penState;\n  const [inkChoice, setInkChoice] = useState<\"ink\" | \"accent\">(\"ink\");\n  const [typed, setTyped] = useState(false);\n  const [typedText, setTypedText] = useState(\"\");\n  const [announce, setAnnounce] = useState(\"\");\n\n  const inkColor = colors?.ink ?? p.text;\n  const accentColor = colors?.accent ?? p.accentInk;\n  const activeColor = inkChoice === \"ink\" ? inkColor : accentColor;\n\n  const isEmpty = strokes.length === 0;\n  const attractOn = attract && !reduced && isEmpty && !typed;\n  const staticDemo = attract && reduced && isEmpty && !typed;\n\n  // Paint the committed state. Attract and typed mode paint their own frames, so this effect steps aside for them.\n  useLayoutEffect(() => {\n    const canvas = canvasRef.current;\n    if (!canvas || size.width === 0 || size.height === 0) return;\n    const dpr = sizeCanvas(canvas, size.width, size.height);\n    dprRef.current = dpr;\n    sizeRef.current = { w: size.width, h: size.height };\n    canvas.style.opacity = \"1\";\n    canvas.style.transition = \"none\";\n    if (typed || attractOn) return;\n    const drawn = staticDemo ? DEMO_SIGNATURE : strokes;\n    const isDemo = drawn === DEMO_SIGNATURE;\n    paintCanvas(\n      canvas,\n      size.width,\n      size.height,\n      dpr,\n      drawn,\n      width,\n      isDemo ? demoTransform(size.width, size.height) : IDENTITY,\n      isDemo ? p.text : undefined,\n    );\n  }, [size.width, size.height, strokes, rev, typed, attractOn, staticDemo, width, p.text]);\n\n  // Attract: replays the built-in signature after 4s without input, then holds, fades and restarts.\n  const inputRef = useRef(false);\n  const idleRef = useRef(ATTRACT_IDLE_S);\n  const playingRef = useRef(false);\n  const timeRef = useRef(0);\n  useVisibleLoop(\n    padRef,\n    (dt) => {\n      if (inputRef.current) {\n        inputRef.current = false;\n        idleRef.current = 0;\n      } else {\n        idleRef.current += dt;\n      }\n      const canvas = canvasRef.current;\n      if (!canvas) return true;\n      if (idleRef.current < ATTRACT_IDLE_S) {\n        playingRef.current = false;\n        return true;\n      }\n      if (!playingRef.current) {\n        playingRef.current = true;\n        timeRef.current = 0;\n      }\n      let t = timeRef.current + dt * 1000;\n      if (t >= DEMO_CYCLE_MS) t -= DEMO_CYCLE_MS;\n      timeRef.current = t;\n\n      const { w, h } = sizeRef.current;\n      if (w === 0 || h === 0) return true;\n      const drawEnd = DEMO_END_MS + 240;\n      let frame = DEMO_SIGNATURE;\n      let opacity = 1;\n      if (t < drawEnd) frame = demoUntil(t);\n      else if (t > drawEnd + ATTRACT_HOLD_MS) {\n        const f = clamp((t - drawEnd - ATTRACT_HOLD_MS) / ATTRACT_FADE_MS, 0, 1);\n        opacity = 1 - easeFade(f);\n      }\n      canvas.style.opacity = String(opacity);\n      paintCanvas(canvas, w, h, dprRef.current, frame, undefined, demoTransform(w, h), p.text);\n      return true;\n    },\n    { enabled: attractOn },\n  );\n\n  const liveRef = useRef<Live | null>(null);\n  const clearingRef = useRef(false);\n  const clearTimer = useRef<number | null>(null);\n  useEffect(\n    () => () => {\n      if (clearTimer.current !== null) window.clearTimeout(clearTimer.current);\n    },\n    [],\n  );\n\n  const commit = (next: InkStroke[]) => {\n    if (!isControlled) setInternal(next);\n    strokesRef.current = next;\n    setRev((r) => r + 1);\n    const w = size.width || 460;\n    const h = size.height || height;\n    onChange?.(next, exportSvg(next, w, h, width));\n  };\n\n  const undo = () => {\n    const current = strokesRef.current;\n    if (current.length === 0) return;\n    commit(current.slice(0, -1));\n    setAnnounce(\"Undone\");\n  };\n\n  const clear = () => {\n    const current = strokesRef.current;\n    if (current.length === 0 || clearingRef.current) return;\n    onClear?.();\n    const finish = () => {\n      clearingRef.current = false;\n      commit([]);\n      setAnnounce(\"Cleared\");\n    };\n    if (reduced) {\n      finish();\n      return;\n    }\n    const canvas = canvasRef.current;\n    clearingRef.current = true;\n    if (canvas) {\n      canvas.style.transition = `opacity ${CLEAR_MS}ms ${easeCss.out}`;\n      canvas.style.opacity = \"0\";\n    }\n    clearTimer.current = window.setTimeout(() => {\n      clearTimer.current = null;\n      if (canvas) {\n        canvas.style.transition = \"none\";\n        canvas.style.opacity = \"1\";\n      }\n      finish();\n    }, CLEAR_MS);\n  };\n\n  const choosePen = (next: InkPen) => {\n    if (penProp === undefined) setPenState(next);\n    onPenChange?.(next);\n  };\n\n  const onPointerDown = (e: PointerEvent<HTMLCanvasElement>) => {\n    if (e.button !== 0 || liveRef.current !== null || clearingRef.current || typed) return;\n    const canvas = e.currentTarget;\n    canvas.setPointerCapture(e.pointerId);\n    padRef.current?.focus({ preventScroll: true });\n    inputRef.current = true;\n    if (strokesRef.current.length === 0) {\n      const { w, h } = sizeRef.current;\n      if (w > 0) paintCanvas(canvas, w, h, dprRef.current, [], undefined, IDENTITY);\n    }\n    const rect = canvas.getBoundingClientRect();\n    liveRef.current = {\n      id: e.pointerId,\n      pen,\n      color: activeColor,\n      pts: [[e.clientX - rect.left, e.clientY - rect.top, e.timeStamp, e.pointerType === \"pen\" ? e.pressure : 0]],\n      drawn: 0,\n      snapping: false,\n      left: rect.left,\n      top: rect.top,\n      lastT: e.timeStamp,\n    };\n  };\n\n  const onPointerMove = (e: PointerEvent<HTMLCanvasElement>) => {\n    const L = liveRef.current;\n    if (!L || e.pointerId !== L.id) return;\n    inputRef.current = true;\n\n    // Capped at 120Hz and deduplicated under 0.75px. Coalesced events carry the real sample times.\n    const native = e.nativeEvent;\n    const coalesced = typeof native.getCoalescedEvents === \"function\" ? native.getCoalescedEvents() : [];\n    const list = coalesced.length > 0 ? coalesced : [native];\n    let added = false;\n    for (const ev of list) {\n      const t = ev.timeStamp;\n      if (t - L.lastT < MIN_FRAME_MS - 0.5) continue;\n      const x = ev.clientX - L.left;\n      const y = ev.clientY - L.top;\n      const last = L.pts[L.pts.length - 1];\n      if (Math.hypot(x - last[0], y - last[1]) < MIN_MOVE) continue;\n      L.pts.push([x, y, t, ev.pointerType === \"pen\" ? ev.pressure : 0]);\n      L.lastT = t;\n      added = true;\n    }\n\n    const canvas = e.currentTarget;\n    const ctx = canvas.getContext(\"2d\");\n    const { w, h } = sizeRef.current;\n    const dpr = dprRef.current;\n    if (!ctx || w === 0) return;\n\n    if (e.shiftKey && snapAngles > 0) {\n      // Shift: straight preview at constant mid width. Repaints the committed layer, which is cheap for a 2-point stroke.\n      const end = snapEnd(L.pts[0], [e.clientX - L.left, e.clientY - L.top], snapAngles);\n      L.snapping = true;\n      const preview: InkStroke = {\n        pen: L.pen,\n        color: L.color,\n        snapped: true,\n        points: [\n          [L.pts[0][0], L.pts[0][1], L.pts[0][2], 0],\n          [end[0], end[1], e.timeStamp, 0],\n        ],\n      };\n      paintCanvas(canvas, w, h, dpr, [...strokesRef.current, preview], width, IDENTITY);\n      return;\n    }\n    if (L.snapping) {\n      L.snapping = false;\n      L.drawn = 0;\n      paintCanvas(canvas, w, h, dpr, strokesRef.current, width, IDENTITY);\n    }\n    if (!added) return;\n\n    // Incremental: paint only the new run, from a short overlap behind the tip.\n    const from = Math.max(0, L.drawn - LIVE_OVERLAP);\n    const { d, count } = liveRun({ pen: L.pen, color: L.color, points: L.pts }, width, from);\n    if (d) {\n      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n      ctx.fillStyle = L.color;\n      ctx.fill(new Path2D(d));\n    }\n    L.drawn = Math.max(L.drawn, count - 1);\n  };\n\n  const finishStroke = (e: PointerEvent<HTMLCanvasElement>, cancelled: boolean) => {\n    const L = liveRef.current;\n    if (!L || e.pointerId !== L.id) return;\n    liveRef.current = null;\n    if (e.currentTarget.hasPointerCapture(e.pointerId)) {\n      e.currentTarget.releasePointerCapture(e.pointerId);\n    }\n    const x = e.clientX - L.left;\n    const y = e.clientY - L.top;\n    const straight = snapAngles > 0 && (cancelled ? L.snapping : e.shiftKey);\n\n    let stroke: InkStroke;\n    if (straight) {\n      const end = snapEnd(L.pts[0], [x, y], snapAngles);\n      stroke = {\n        pen: L.pen,\n        color: L.color,\n        snapped: true,\n        points: [\n          [r2(L.pts[0][0]), r2(L.pts[0][1]), Math.round(L.pts[0][2]), 0],\n          [r2(end[0]), r2(end[1]), Math.round(e.timeStamp), 0],\n        ],\n      };\n    } else {\n      const pts = [...L.pts];\n      if (!cancelled) {\n        const last = pts[pts.length - 1];\n        if (Math.hypot(x - last[0], y - last[1]) >= MIN_MOVE) {\n          pts.push([x, y, e.timeStamp, e.pointerType === \"pen\" ? e.pressure : 0]);\n        }\n      }\n      stroke = {\n        pen: L.pen,\n        color: L.color,\n        points: pts.map(([px, py, t, pr]) => [r2(px), r2(py), Math.round(t), r2(pr)] as InkPoint),\n      };\n    }\n    commit([...strokesRef.current, stroke]);\n  };\n\n  const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n    inputRef.current = true;\n    if (readOnly || typed) return;\n    if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.key.toLowerCase() === \"z\") {\n      e.preventDefault();\n      undo();\n    }\n  };\n\n  const onTypeChange = (text: string) => {\n    setTypedText(text);\n    const w = size.width || 460;\n    const h = size.height || height;\n    onChange?.([], textSvg(text, w, h, inkColor));\n  };\n\n  const leaveType = () => {\n    setTyped(false);\n    const w = size.width || 460;\n    const h = size.height || height;\n    onChange?.(strokesRef.current, exportSvg(strokesRef.current, w, h, width));\n  };\n\n  const tokens = {\n    text: tok(\"text\", p.text),\n    textMedium: tok(\"text-medium\", p.textMedium),\n    textMuted: tok(\"text-muted\", p.textMuted),\n    textSoft: tok(\"text-soft\", p.textSoft),\n    textFaint: tok(\"text-faint\", p.textFaint),\n    border: tok(\"border\", p.border),\n    borderStrong: tok(\"border-strong\", p.borderStrong),\n    hair: tok(\"hair\", p.hair),\n    surface: tok(\"surface\", p.surface),\n    surfaceActive: tok(\"surface-active\", p.active),\n    menu: tok(\"menu\", p.surface),\n    accentInk: tok(\"accent-ink\", p.accentInk),\n    accentSoft: tok(\"accent-soft\", p.accentSoft),\n  };\n\n  const pens: { id: InkPen; label: string }[] = [\n    { id: \"pen\", label: \"Pen\" },\n    { id: \"brush\", label: \"Brush\" },\n    { id: \"fineliner\", label: \"Fineliner\" },\n  ];\n  const swatches: { id: \"ink\" | \"accent\"; label: string; color: string }[] = [\n    { id: \"ink\", label: \"Ink\", color: inkColor },\n    { id: \"accent\", label: \"Accent\", color: accentColor },\n  ];\n  const showToolbar = toolbar && !readOnly && !typed;\n  const showFallback = fallbackInput && !readOnly;\n  const indicatorId = `${idBase}-pen`;\n  const gridBackground = `radial-gradient(circle, ${p.hair} 1px, transparent 1.25px)`;\n\n  return (\n    <div\n      ref={padRef}\n      data-velocity-ink=\"\"\n      tabIndex={-1}\n      onKeyDown={onKeyDown}\n      className={cn(\"@container relative w-full min-w-0 select-none overflow-hidden rounded-[18px] border outline-none\", className)}\n      style={{\n        height,\n        background: tokens.surface,\n        borderColor: tokens.border,\n        boxShadow: BJORK_SURFACE[resolvedTone].shadowSurface,\n        color: tokens.text,\n      } as CSSProperties}\n    >\n      <canvas\n        ref={canvasRef}\n        role=\"img\"\n        aria-label={`${ariaLabel} (${strokes.length} strokes)`}\n        onPointerDown={readOnly ? undefined : onPointerDown}\n        onPointerMove={readOnly ? undefined : onPointerMove}\n        onPointerUp={readOnly ? undefined : (e) => finishStroke(e, false)}\n        onPointerCancel={readOnly ? undefined : (e) => finishStroke(e, true)}\n        className=\"absolute inset-0 block touch-none\"\n        style={{\n          cursor: readOnly ? \"default\" : \"crosshair\",\n          visibility: typed ? \"hidden\" : \"visible\",\n        }}\n      />\n\n      {guide === \"grid\" && (\n        <span\n          aria-hidden=\"true\"\n          className=\"pointer-events-none absolute inset-0\"\n          style={{ backgroundImage: gridBackground, backgroundSize: \"24px 24px\", backgroundPosition: \"12px 12px\" }}\n        />\n      )}\n      {guide === \"signature\" && (\n        <>\n          <span\n            aria-hidden=\"true\"\n            className=\"pointer-events-none absolute h-px\"\n            style={{ left: \"8%\", width: \"84%\", top: \"72%\", background: tokens.hair }}\n          />\n          <span\n            aria-hidden=\"true\"\n            className=\"pointer-events-none absolute font-mono text-[14px] leading-none\"\n            style={{\n              left: \"max(8px, calc(8% - 20px))\",\n              top: \"72%\",\n              // Optical: the cross reads low against the line, so it sits 0.5px higher (blur test: -1px left the ink 0.5px above the line).\n              transform: \"translateY(calc(-50% - 0.5px))\",\n              color: tokens.textSoft,\n            }}\n          >\n            ×\n          </span>\n          <span\n            aria-hidden=\"true\"\n            className=\"pointer-events-none absolute hidden font-mono text-[11px] uppercase tracking-[0.06em] @[400px]:block\"\n            style={{ right: \"8%\", top: \"calc(72% + 8px)\", color: tokens.textFaint }}\n          >\n            Sign above\n          </span>\n        </>\n      )}\n\n      {typed && (\n        <span\n          aria-hidden=\"true\"\n          className=\"pointer-events-none absolute whitespace-pre font-bjork-display text-[40px] italic leading-none\"\n          style={{ left: \"8%\", top: \"72%\", transform: \"translateY(-80%)\", color: inkColor }}\n        >\n          {typedText}\n        </span>\n      )}\n\n      {showToolbar && (\n        <div\n          role=\"toolbar\"\n          aria-label=\"Drawing tools\"\n          className=\"absolute bottom-2 left-2 flex items-center gap-0.5 rounded-[16px] border p-1\"\n          style={{ background: tokens.menu, borderColor: tokens.border, boxShadow: tok(\"shadow-menu\", \"none\") }}\n        >\n          {pens.map((item) => {\n            const active = pen === item.id;\n            return (\n              <button\n                key={item.id}\n                type=\"button\"\n                aria-label={item.label}\n                aria-pressed={active}\n                onClick={() => choosePen(item.id)}\n                className={cn(\"relative grid size-8 place-items-center rounded-[11px]\", pressable)}\n                style={{ color: active ? tokens.accentInk : tokens.textMedium }}\n              >\n                {active && (\n                  <motion.span\n                    layoutId={indicatorId}\n                    aria-hidden=\"true\"\n                    className=\"absolute inset-0 rounded-[11px]\"\n                    style={{ background: tokens.surfaceActive }}\n                    transition={reduced ? { duration: 0 } : springs.standard}\n                  />\n                )}\n                <span className=\"relative grid place-items-center\">\n                  <PenGlyph kind={item.id} />\n                </span>\n              </button>\n            );\n          })}\n          <span aria-hidden=\"true\" className=\"mx-0.5 h-4 w-px\" style={{ background: tokens.border }} />\n          {swatches.map((sw) => {\n            const active = inkChoice === sw.id;\n            return (\n              <button\n                key={sw.id}\n                type=\"button\"\n                aria-label={sw.label}\n                aria-pressed={active}\n                onClick={() => setInkChoice(sw.id)}\n                className={cn(\"grid size-6 place-items-center rounded-full\", pressable)}\n              >\n                <span\n                  aria-hidden=\"true\"\n                  className=\"block size-4 rounded-full\"\n                  style={{\n                    background: sw.color,\n                    boxShadow: active ? `0 0 0 2px ${tokens.menu}, 0 0 0 3px ${sw.color}` : undefined,\n                  }}\n                />\n              </button>\n            );\n          })}\n          <span aria-hidden=\"true\" className=\"mx-0.5 h-4 w-px\" style={{ background: tokens.border }} />\n          <button\n            type=\"button\"\n            onClick={undo}\n            disabled={isEmpty}\n            className={cn(\"h-7 rounded-[10px] px-2 font-mono text-[11px]\", pressable)}\n            style={{ color: tokens.textMedium }}\n          >\n            Undo\n          </button>\n          <button\n            type=\"button\"\n            onClick={clear}\n            disabled={isEmpty}\n            className={cn(\"h-7 rounded-[10px] px-2 font-mono text-[11px]\", pressable)}\n            style={{ color: tokens.textMedium }}\n          >\n            Clear\n          </button>\n        </div>\n      )}\n\n      {typed && !readOnly && (\n        <div className=\"absolute bottom-2 left-2 flex items-center gap-2\">\n          <label htmlFor={inputId} className=\"font-mono text-[11px] uppercase tracking-[0.04em]\" style={{ color: tokens.textMuted }}>\n            Name\n          </label>\n          <input\n            id={inputId}\n            autoFocus\n            value={typedText}\n            onChange={(e) => onTypeChange(e.target.value)}\n            autoComplete=\"off\"\n            className=\"h-7 w-40 min-w-0 rounded-[6px] border-b bg-transparent px-1 font-mono text-[13px] outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--bjork-accent,#ec5c13)]\"\n            style={{ borderColor: tokens.borderStrong, color: tokens.text }}\n          />\n        </div>\n      )}\n\n      {showFallback && (\n        <button\n          type=\"button\"\n          onClick={() => (typed ? leaveType() : setTyped(true))}\n          className={cn(\"absolute right-2 top-2 h-7 rounded-[10px] px-2 font-mono text-[11px] @[460px]:bottom-2 @[460px]:top-auto\", pressable)}\n          style={{ color: tokens.accentInk, background: typed ? \"transparent\" : tokens.accentSoft }}\n        >\n          {typed ? \"Draw instead\" : \"Type instead\"}\n        </button>\n      )}\n\n      <LiveRegion message={announce} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/controls/velocity-ink.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n",
      "type": "registry:lib",
      "target": "@lib/utils.ts"
    },
    {
      "path": "components/bjork-ui/_core/palette.ts",
      "content": "export type BjorkTone = \"dark\" | \"light\";\n\n// Canvas, WebGL and SVG attribute colours. DOM code uses the CSS tokens with these as fallbacks.\nexport const BJORK_PALETTE = {\n  dark: {\n    bg: \"#050505\", stage: \"#111111\", surface: \"#121212\", raised: \"#161616\", active: \"#202020\",\n    border: \"#232323\", borderStrong: \"#343434\",\n    text: \"#ededed\", textMedium: \"rgba(237,237,237,0.72)\", textMuted: \"rgba(237,237,237,0.6)\",\n    textSoft: \"rgba(237,237,237,0.5)\", textFaint: \"rgba(237,237,237,0.22)\", hair: \"rgba(237,237,237,0.12)\",\n    accent: \"#ec5c13\", accentInk: \"#ec5c13\", accentFill: \"#b84a12\", accentSoft: \"rgba(236,92,19,0.12)\", accentMuted: \"rgba(236,92,19,0.24)\",\n    accentFg: \"#fff2ea\", success: \"#4cc38a\", warning: \"#f2b544\", error: \"#ff5c4d\",\n  },\n  light: {\n    bg: \"#f7f5ef\", stage: \"#f7f5ef\", surface: \"#fffcf6\", raised: \"#f5efe3\", active: \"#efe7d8\",\n    border: \"#eee6db\", borderStrong: \"#e1d7c8\",\n    text: \"#171717\", textMedium: \"rgba(23,23,23,0.78)\", textMuted: \"rgba(23,23,23,0.68)\",\n    textSoft: \"rgba(23,23,23,0.62)\", textFaint: \"rgba(23,23,23,0.22)\", hair: \"rgba(23,23,23,0.10)\",\n    accent: \"#ec7d43\", accentInk: \"#b4531f\", accentFill: \"#ec7d43\", accentSoft: \"rgba(236,125,67,0.10)\", accentMuted: \"rgba(236,125,67,0.20)\",\n    accentFg: \"#3f2112\", success: \"#1f8a55\", warning: \"#a86b00\", error: \"#c8361f\",\n  },\n} as const;\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/palette.ts"
    },
    {
      "path": "components/bjork-ui/_core/motion.ts",
      "content": "// Shared springs, easings and durations. Components import these instead of inventing values.\n\nexport const springs = {\n  press: { type: \"spring\", stiffness: 500, damping: 30, mass: 0.6 },\n  snappy: { type: \"spring\", stiffness: 400, damping: 25, mass: 1 },\n  standard: { type: \"spring\", stiffness: 300, damping: 30, mass: 0.8 },\n  soft: { type: \"spring\", stiffness: 200, damping: 25, mass: 1.2 },\n  settle: { type: \"spring\", stiffness: 380, damping: 30, mass: 0.8 },\n  blurIn: { type: \"spring\", stiffness: 400, damping: 28, mass: 0.6 },\n} as const;\n\nexport const ease = {\n  out: [0.23, 1, 0.32, 1],\n  inOut: [0.77, 0, 0.175, 1],\n  drawer: [0.32, 0.72, 0, 1],\n} as const;\n\nexport const easeCss = {\n  out: \"cubic-bezier(0.23,1,0.32,1)\",\n  inOut: \"cubic-bezier(0.77,0,0.175,1)\",\n  drawer: \"cubic-bezier(0.32,0.72,0,1)\",\n} as const;\n\nexport const durations = { press: 140, tooltip: 160, menu: 200, panel: 280 } as const; // ms\n\n// Cubic bezier easing for canvas and rAF code. Returns progress y for input x in [0, 1].\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number {\n  const cx = 3 * x1;\n  const bx = 3 * (x2 - x1) - cx;\n  const ax = 1 - cx - bx;\n  const cy = 3 * y1;\n  const by = 3 * (y2 - y1) - cy;\n  const ay = 1 - cy - by;\n  const sampleX = (s: number) => ((ax * s + bx) * s + cx) * s;\n  const sampleY = (s: number) => ((ay * s + by) * s + cy) * s;\n  const sampleDX = (s: number) => (3 * ax * s + 2 * bx) * s + cx;\n\n  const solveX = (x: number) => {\n    let s = x;\n    for (let i = 0; i < 8; i++) {\n      const err = sampleX(s) - x;\n      if (Math.abs(err) < 1e-6) return s;\n      const d = sampleDX(s);\n      if (Math.abs(d) < 1e-6) break;\n      s -= err / d;\n    }\n    let lo = 0;\n    let hi = 1;\n    s = x;\n    while (lo < hi) {\n      const v = sampleX(s);\n      if (Math.abs(v - x) < 1e-6) return s;\n      if (x > v) lo = s;\n      else hi = s;\n      s = (lo + hi) / 2;\n      if (hi - lo < 1e-7) break;\n    }\n    return s;\n  };\n\n  return (t: number) => {\n    if (t <= 0) return 0;\n    if (t >= 1) return 1;\n    return sampleY(solveX(t));\n  };\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/motion.ts"
    },
    {
      "path": "components/bjork-ui/_core/tone.ts",
      "content": "\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\nimport { useTheme } from \"next-themes\";\nimport type { BjorkTone } from \"./palette\";\n\nconst subscribeNoop = () => () => {};\nconst getMounted = () => true;\nconst getServerMounted = () => false;\n\n/**\n * Resolves the tone for a component. An explicit `tone` always wins.\n * Otherwise it follows next-themes' resolved theme, but only after mount,\n * so the server render and first client render agree on dark.\n */\nexport function useBjorkTone(tone?: BjorkTone): BjorkTone {\n  const { resolvedTheme } = useTheme();\n  const mounted = useSyncExternalStore(subscribeNoop, getMounted, getServerMounted);\n  if (tone) return tone;\n  if (!mounted) return \"dark\";\n  return resolvedTheme === \"light\" ? \"light\" : \"dark\";\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/tone.ts"
    },
    {
      "path": "components/bjork-ui/_core/surface.ts",
      "content": "import type { CSSProperties } from \"react\";\nimport type { BjorkTone } from \"./palette\";\n\n// The library surface (CANON.md §1). Values mirror app/globals.css :root and .dark. Change both together.\nexport const BJORK_SURFACE = {\n  light: {\n    surface: \"#fffcf6\", surfaceMuted: \"rgba(250, 246, 237, 0.94)\", surfaceHover: \"#f5efe3\", surfaceActive: \"#efe7d8\",\n    panel: \"#f8f2e7\", menu: \"rgba(255, 252, 246, 0.98)\", field: \"rgba(255, 252, 246, 0.96)\",\n    fieldMuted: \"rgba(248, 242, 231, 0.82)\", fieldInset: \"rgba(239, 231, 216, 0.72)\",\n    border: \"#eee6db\", borderMuted: \"#f5ede2\", borderStrong: \"#e1d7c8\",\n    shadowSurface: \"inset 0 7px 14px rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.92), inset 1px 0 0 rgba(88, 72, 49, 0.026), inset -1px 0 0 rgba(255, 255, 255, 0.68), 0 14px 22px -9px rgba(66, 52, 33, 0.11)\",\n    shadowSoft: \"inset 0 1px 0 rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.86)\",\n    shadowPanel: \"inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.64), 0 18px 38px -30px rgba(66, 52, 33, 0.2)\",\n    shadowMenu: \"inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 0 12px 24px rgba(88, 72, 49, 0.022), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.62), 0 22px 44px -26px rgba(66, 52, 33, 0.22)\",\n    shadowInset: \"inset 0 1px 10px rgba(88, 72, 49, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.72)\",\n  },\n  dark: {\n    surface: \"#121212\", surfaceMuted: \"rgba(22, 22, 22, 0.92)\", surfaceHover: \"#161616\", surfaceActive: \"#202020\",\n    panel: \"#0d0d0d\", menu: \"rgba(18, 18, 18, 0.98)\", field: \"rgba(18, 18, 18, 0.95)\",\n    fieldMuted: \"rgba(18, 18, 18, 0.55)\", fieldInset: \"rgba(9, 9, 9, 0.75)\",\n    border: \"#232323\", borderMuted: \"#1c1c1c\", borderStrong: \"#343434\",\n    shadowSurface: \"inset 0 7px 14px rgba(255, 255, 255, 0.03), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.06), 0 14px 20px -6px rgba(0, 0, 0, 0.45)\",\n    shadowSoft: \"inset 0 1px 0 rgba(255, 255, 255, 0.045)\",\n    shadowPanel: \"inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 36px -28px rgba(0, 0, 0, 0.9)\",\n    shadowMenu: \"inset 0 1px 0 rgba(255, 255, 255, 0.055), inset 0 12px 24px rgba(255, 255, 255, 0.018), inset 0 -18px 26px rgba(0, 0, 0, 0.24), 0 22px 42px -22px rgba(0, 0, 0, 0.9)\",\n    shadowInset: \"inset 0 1px 10px rgba(0, 0, 0, 0.45)\",\n  },\n} as const;\n\n/** Writes the surface tokens for a pinned tone as --bjork-* custom properties. Spread first; kit-specific keys may override. */\nexport function surfaceVars(tone: BjorkTone): CSSProperties {\n  const s = BJORK_SURFACE[tone];\n  return {\n    \"--bjork-surface\": s.surface, \"--bjork-surface-muted\": s.surfaceMuted, \"--bjork-surface-hover\": s.surfaceHover,\n    \"--bjork-surface-active\": s.surfaceActive, \"--bjork-panel\": s.panel, \"--bjork-menu\": s.menu, \"--bjork-field\": s.field,\n    \"--bjork-field-muted\": s.fieldMuted, \"--bjork-field-inset\": s.fieldInset, \"--bjork-border\": s.border,\n    \"--bjork-border-muted\": s.borderMuted, \"--bjork-border-strong\": s.borderStrong,\n    \"--bjork-shadow-surface\": s.shadowSurface, \"--bjork-shadow-soft\": s.shadowSoft, \"--bjork-shadow-panel\": s.shadowPanel,\n    \"--bjork-shadow-menu\": s.shadowMenu, \"--bjork-shadow-inset\": s.shadowInset,\n  } as CSSProperties;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/surface.ts"
    },
    {
      "path": "components/bjork-ui/_core/a11y.tsx",
      "content": "import type { ReactNode } from \"react\";\n\n// Text for assistive tech only.\nexport function VisuallyHidden({ children }: { children: ReactNode }) {\n  return <span className=\"sr-only\">{children}</span>;\n}\n\n// Announces `message` when it changes. Same text re-rendered does not re-announce.\nexport function LiveRegion({\n  message,\n  politeness = \"polite\",\n}: {\n  message: string;\n  politeness?: \"polite\" | \"assertive\";\n}) {\n  return (\n    <span role=\"status\" aria-live={politeness} aria-atomic=\"true\" className=\"sr-only\">\n      {message}\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/a11y.tsx"
    },
    {
      "path": "components/bjork-ui/_core/canvas.ts",
      "content": "\"use client\";\n\nimport { useEffect, useState, type RefObject } from \"react\";\nimport { isCoarsePointer } from \"./loop\";\n\n// Caps DPR at 1.5 on coarse pointers and 2 otherwise.\nexport function defaultMaxDpr(): number {\n  return isCoarsePointer() ? 1.5 : 2;\n}\n\n// Sets the backing size for a CSS box and returns the DPR used.\nexport function sizeCanvas(\n  canvas: HTMLCanvasElement,\n  cssW: number,\n  cssH: number,\n  maxDpr: number = defaultMaxDpr(),\n): number {\n  const dpr = Math.min(typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1, maxDpr);\n  canvas.width = Math.max(1, Math.round(cssW * dpr));\n  canvas.height = Math.max(1, Math.round(cssH * dpr));\n  canvas.style.width = `${cssW}px`;\n  canvas.style.height = `${cssH}px`;\n  return dpr;\n}\n\n// Rounded size of an element, kept current with a ResizeObserver.\nexport function useElementSize(ref: RefObject<HTMLElement | null>): { width: number; height: number } {\n  const [size, setSize] = useState({ width: 0, height: 0 });\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || typeof ResizeObserver === \"undefined\") return;\n    const observer = new ResizeObserver((entries) => {\n      const box = entries[0]?.contentRect;\n      if (!box) return;\n      const width = Math.round(box.width);\n      const height = Math.round(box.height);\n      setSize((prev) => (prev.width === width && prev.height === height ? prev : { width, height }));\n    });\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, [ref]);\n\n  return size;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/canvas.ts"
    },
    {
      "path": "components/bjork-ui/_core/loop.ts",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useMemo, useRef, type RefObject } from \"react\";\n\nexport interface VisibleLoopOptions {\n  enabled?: boolean;\n  fpsCap?: number;\n  rootMargin?: string;\n}\n\n/**\n * Runs `frame(dt, t)` on requestAnimationFrame while the element is near the viewport,\n * the tab is visible and `enabled` is not false. Return `false` from `frame` to go idle\n * until `wake()` is called. Writes `data-loop` on the element: running, idle or paused.\n */\nexport function useVisibleLoop(\n  ref: RefObject<HTMLElement | null>,\n  frame: (dt: number, t: number) => boolean | void,\n  opts?: VisibleLoopOptions,\n): { wake: () => void } {\n  const enabled = opts?.enabled !== false;\n  const fpsCap = opts?.fpsCap ?? 0;\n  const rootMargin = opts?.rootMargin ?? \"96px\";\n\n  const frameRef = useRef(frame);\n  useEffect(() => {\n    frameRef.current = frame;\n  }, [frame]);\n\n  const wakeRef = useRef<() => void>(() => {});\n  const wake = useCallback(() => wakeRef.current(), []);\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || typeof window === \"undefined\") return;\n\n    let wants = true; // false once the frame callback returns false\n    let inView = false;\n    let raf = 0;\n    let last = 0;\n    let t = 0;\n    const minFrame = fpsCap > 0 ? 1000 / fpsCap : 0;\n\n    const canRun = () => enabled && inView && document.visibilityState === \"visible\";\n    const stop = () => {\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0;\n    };\n\n    const update = () => {\n      if (!enabled) {\n        stop();\n        el.dataset.loop = \"paused\";\n        return;\n      }\n      if (!wants) {\n        stop();\n        el.dataset.loop = \"idle\";\n        return;\n      }\n      if (!canRun()) {\n        stop();\n        el.dataset.loop = \"paused\";\n        return;\n      }\n      el.dataset.loop = \"running\";\n      if (!raf) {\n        last = performance.now();\n        raf = requestAnimationFrame(tick);\n      }\n    };\n\n    const tick = (now: number) => {\n      raf = 0;\n      if (!canRun() || !wants) {\n        update();\n        return;\n      }\n      const elapsed = now - last;\n      if (minFrame && elapsed < minFrame - 0.5) {\n        raf = requestAnimationFrame(tick);\n        return;\n      }\n      last = now;\n      const dt = Math.min(0.05, Math.max(0, elapsed / 1000));\n      t += dt;\n      const keep = frameRef.current(dt, t);\n      if (keep === false) {\n        wants = false;\n        update();\n        return;\n      }\n      raf = requestAnimationFrame(tick);\n    };\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        inView = entry.isIntersecting;\n        update();\n      },\n      { rootMargin },\n    );\n    observer.observe(el);\n\n    const onVisibility = () => update();\n    document.addEventListener(\"visibilitychange\", onVisibility);\n\n    wakeRef.current = () => {\n      wants = true;\n      update();\n    };\n\n    update();\n\n    return () => {\n      stop();\n      observer.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVisibility);\n      wakeRef.current = () => {};\n    };\n  }, [ref, enabled, fpsCap, rootMargin]);\n\n  return useMemo(() => ({ wake }), [wake]);\n}\n\n// matchMedia based check. False on the server.\nexport function isCoarsePointer(): boolean {\n  if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return false;\n  return window.matchMedia(\"(pointer: coarse)\").matches;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/loop.ts"
    }
  ],
  "cssVars": {
    "light": {
      "bjork-bg": "#f7f3ea",
      "bjork-surface": "#fffcf6",
      "bjork-surface-muted": "rgba(250, 246, 237, 0.94)",
      "bjork-surface-hover": "#f5efe3",
      "bjork-surface-active": "#efe7d8",
      "bjork-panel": "#f8f2e7",
      "bjork-menu": "rgba(255, 252, 246, 0.98)",
      "bjork-field": "rgba(255, 252, 246, 0.96)",
      "bjork-field-muted": "rgba(248, 242, 231, 0.82)",
      "bjork-field-inset": "rgba(239, 231, 216, 0.72)",
      "bjork-error-bg": "#fff0e8",
      "bjork-text": "#171717",
      "bjork-text-strong": "rgba(23, 23, 23, 0.9)",
      "bjork-text-medium": "rgba(23, 23, 23, 0.78)",
      "bjork-text-muted": "rgba(23, 23, 23, 0.68)",
      "bjork-text-soft": "rgba(23, 23, 23, 0.62)",
      "bjork-text-faint": "rgba(23, 23, 23, 0.22)",
      "bjork-inverted-text": "#fff8f0",
      "bjork-border": "#eee6db",
      "bjork-border-muted": "#f5ede2",
      "bjork-border-strong": "#e1d7c8",
      "bjork-thumb": "#a49b8e",
      "bjork-track": "#ded6ca",
      "bjork-accent": "#ec7d43",
      "bjork-accent-hover": "#f0935f",
      "bjork-accent-soft": "rgba(236, 125, 67, 0.1)",
      "bjork-accent-muted": "rgba(236, 125, 67, 0.2)",
      "bjork-accent-badge": "rgba(236, 125, 67, 0.16)",
      "bjork-accent-badge-foreground": "#8d421d",
      "bjork-accent-foreground": "#3f2112",
      "bjork-accent-fill": "#ec7d43",
      "bjork-accent-fill-hover": "#f0935f",
      "bjork-shadow-surface": "inset 0 7px 14px rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.92), inset 1px 0 0 rgba(88, 72, 49, 0.026), inset -1px 0 0 rgba(255, 255, 255, 0.68), 0 14px 22px -9px rgba(66, 52, 33, 0.11)",
      "bjork-shadow-soft": "inset 0 1px 0 rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.86)",
      "bjork-shadow-panel": "inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.64), 0 18px 38px -30px rgba(66, 52, 33, 0.2)",
      "bjork-shadow-menu": "inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 0 12px 24px rgba(88, 72, 49, 0.022), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.62), 0 22px 44px -26px rgba(66, 52, 33, 0.22)",
      "bjork-shadow-inset": "inset 0 1px 10px rgba(88, 72, 49, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.72)",
      "bjork-ring-offset": "#f7f3ea"
    },
    "dark": {
      "bjork-bg": "#111111",
      "bjork-surface": "#121212",
      "bjork-surface-muted": "rgba(22, 22, 22, 0.92)",
      "bjork-surface-hover": "#161616",
      "bjork-surface-active": "#202020",
      "bjork-panel": "#0d0d0d",
      "bjork-menu": "rgba(18, 18, 18, 0.98)",
      "bjork-field": "rgba(18, 18, 18, 0.95)",
      "bjork-field-muted": "rgba(18, 18, 18, 0.55)",
      "bjork-field-inset": "rgba(9, 9, 9, 0.75)",
      "bjork-error-bg": "#130d0a",
      "bjork-text": "#ededed",
      "bjork-text-strong": "rgba(237, 237, 237, 0.9)",
      "bjork-text-medium": "rgba(237, 237, 237, 0.72)",
      "bjork-text-muted": "rgba(237, 237, 237, 0.6)",
      "bjork-text-soft": "rgba(237, 237, 237, 0.5)",
      "bjork-text-faint": "rgba(237, 237, 237, 0.22)",
      "bjork-inverted-text": "#080808",
      "bjork-border": "#232323",
      "bjork-border-muted": "#1c1c1c",
      "bjork-border-strong": "#343434",
      "bjork-thumb": "#626262",
      "bjork-track": "#090909",
      "bjork-accent": "#ec5c13",
      "bjork-accent-hover": "#f07832",
      "bjork-accent-soft": "rgba(236, 92, 19, 0.12)",
      "bjork-accent-muted": "rgba(236, 92, 19, 0.24)",
      "bjork-accent-badge": "#b84a12",
      "bjork-accent-badge-foreground": "#fff2ea",
      "bjork-accent-foreground": "#fff2ea",
      "bjork-accent-fill": "#b84a12",
      "bjork-accent-fill-hover": "#a84a14",
      "bjork-shadow-surface": "inset 0 7px 14px rgba(255, 255, 255, 0.03), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.06), 0 14px 20px -6px rgba(0, 0, 0, 0.45)",
      "bjork-shadow-soft": "inset 0 1px 0 rgba(255, 255, 255, 0.045)",
      "bjork-shadow-panel": "inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 36px -28px rgba(0, 0, 0, 0.9)",
      "bjork-shadow-menu": "inset 0 1px 0 rgba(255, 255, 255, 0.055), inset 0 12px 24px rgba(255, 255, 255, 0.018), inset 0 -18px 26px rgba(0, 0, 0, 0.24), 0 22px 42px -22px rgba(0, 0, 0, 0.9)",
      "bjork-shadow-inset": "inset 0 1px 10px rgba(0, 0, 0, 0.45)",
      "bjork-ring-offset": "#080808"
    }
  },
  "css": {
    ".bjork-range": {
      "box-shadow": "inset 0 1px 1px rgba(255, 255, 255, 0.04), 0 0 14px rgba(189, 69, 20, 0.06)"
    },
    ".bjork-range::-webkit-slider-thumb": {
      "appearance": "none",
      "width": "16px",
      "height": "8px",
      "border": "0",
      "border-radius": "999px",
      "background": "var(--bjork-thumb)",
      "box-shadow": "inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.42)"
    },
    ".bjork-range::-moz-range-thumb": {
      "width": "16px",
      "height": "8px",
      "border": "0",
      "border-radius": "999px",
      "background": "var(--bjork-thumb)",
      "box-shadow": "inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.42)"
    },
    ".bjork-layered-button-accent, .bjork-layered-button-raised": {
      "position": "relative",
      "isolation": "isolate",
      "appearance": "none",
      "overflow": "hidden",
      "border": "0",
      "border-radius": "13px",
      "box-shadow": "inset 0 1px 0 #ffffff38, 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
      "transition": "filter 150ms ease-out, box-shadow 150ms ease-out"
    },
    ".bjork-layered-button-accent::after, .bjork-layered-button-raised::after": {
      "position": "absolute",
      "inset": "0",
      "pointer-events": "none",
      "content": "\"\"",
      "border": "1.5px solid transparent",
      "border-radius": "inherit",
      "background": "linear-gradient(#ffffffb8, #0000003d 41% 75%, #ffffff47) border-box",
      "mix-blend-mode": "overlay",
      "-webkit-mask-image": "linear-gradient(#000, #000), linear-gradient(#000, #000)",
      "mask-image": "linear-gradient(#000, #000), linear-gradient(#000, #000)",
      "-webkit-mask-clip": "padding-box, border-box",
      "mask-clip": "padding-box, border-box",
      "-webkit-mask-origin": "padding-box, border-box",
      "mask-origin": "padding-box, border-box",
      "-webkit-mask-composite": "xor",
      "mask-composite": "exclude"
    },
    ".bjork-layered-button-accent": {
      "color": "oklch(100% 0 0)",
      "text-shadow": "0 -1px #00000040",
      "background": "radial-gradient(ellipse at -20px top, rgba(255, 255, 255, 0.14), transparent), linear-gradient(180deg, #ec5c13 0%, #ec5c13 62%, color-mix(in oklab, #ec5c13 84%, black 16%) 100%)"
    },
    ".bjork-layered-button-raised": {
      "color": "oklch(100% 0 0)",
      "text-shadow": "0 -1px #00000026",
      "background": "radial-gradient(ellipse at -20px top, #ffffff38, #fff0), linear-gradient(180deg, oklch(0.1881 0.006 265), oklch(0.5493 0.0081 265))"
    },
    ".dark .bjork-layered-button-raised": {
      "color": "oklch(0.2574 0.0056 265)",
      "text-shadow": "0 -1px #00000026",
      "background": "radial-gradient(ellipse at -20px top, #ffffff38, #fff0), linear-gradient(180deg, color-mix(in oklab, oklch(0.9674 0.0013 265) 80%, oklch(0.2574 0.0056 265) 20%), color-mix(in oklab, oklch(0.669 0.0107 265) 80%, oklch(0.2574 0.0056 265) 20%))"
    },
    "@media (hover: hover)": {
      ".bjork-layered-button-accent:hover": {
        "filter": "brightness(1.08) saturate(1.04)"
      },
      ".bjork-layered-button-raised:hover": {
        "filter": "brightness(1.08) contrast(0.9)"
      }
    }
  },
  "meta": {
    "collection": "Controls",
    "registryUrl": "https://ui.isaiahbjork.com/velocity-ink.json",
    "installCommand": "npx shadcn@latest add https://ui.isaiahbjork.com/velocity-ink.json"
  },
  "type": "registry:component"
}