{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scene-states",
  "title": "Scene states",
  "description": "Scene states is a production-ready interactive component from BJORK UI, packaged for shadcn registries.",
  "dependencies": [
    "clsx",
    "next-themes",
    "tailwind-merge",
    "three"
  ],
  "files": [
    {
      "path": "components/bjork-ui/interactive/scene-states-demo.tsx",
      "content": "\"use client\";\n\n// Scene States demo: six DOM sections drive one lit object. Each section declares a camera\n// pose and a few lighting params with `data-scene-state`; scroll blends between them.\n\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport * as THREE from \"three\";\nimport { cn } from \"@/lib/utils\";\nimport { useBjorkTone } from \"../_core/tone\";\nimport { useVisibleLoop } from \"../_core/loop\";\nimport {\n  createSceneRig,\n  poseToPosition,\n  useSceneStates,\n  type SceneStates,\n  type StateDef,\n  type Vec3,\n} from \"../_core/scene-states\";\n\ntype Params = {\n  /** Key light azimuth, radians. */\n  keyAngle: number;\n  /** Key light elevation, radians. */\n  keyHeight: number;\n  /** 0 cool daylight, 1 sodium dusk. */\n  warmth: number;\n  exposure: number;\n  /** Ring tilt around X, radians. */\n  tilt: number;\n  /** Rim light; blends with easeOutQuad (a fade key). */\n  glow: number;\n};\n\nexport const SCENE_STATE_DEFS: Record<string, StateDef<Params>> = {\n  overview: {\n    pose: { target: [0, 0.75, 0], radius: 10.5, phi: 1.12, theta: 0.65 },\n    params: { keyAngle: 0.9, keyHeight: 0.9, warmth: 0.15, exposure: 1, tilt: 0.42, glow: 0.2 },\n    mobile: { pose: { radius: 14 } },\n  },\n  profile: {\n    pose: { target: [0, 0.8, 0], radius: 6.4, phi: 1.5, theta: 1.57 },\n    params: { keyAngle: 2.6, keyHeight: 0.45, warmth: 0.1, exposure: 1.05, tilt: 0.1, glow: 0.9 },\n    mobile: { pose: { radius: 9 } },\n  },\n  detail: {\n    pose: { target: [0.35, 1.05, 0], radius: 3.4, phi: 1.22, theta: 2.5 },\n    params: { keyAngle: 3.4, keyHeight: 0.7, warmth: 0.3, exposure: 1.1, tilt: 0.8, glow: 0.4 },\n    mobile: { pose: { radius: 5 } },\n  },\n  above: {\n    pose: { target: [0, 0.4, 0], radius: 9, phi: 0.18, theta: null },\n    params: { keyAngle: 4.4, keyHeight: 1.2, warmth: 0.05, exposure: 0.95, tilt: 1.3, glow: 0.1 },\n    mobile: { pose: { radius: 12.5 } },\n  },\n  dusk: {\n    pose: { target: [0, 0.7, 0], radius: 7.5, phi: 1.38, theta: -0.75 },\n    params: { keyAngle: 5.6, keyHeight: 0.14, warmth: 1, exposure: 0.72, tilt: 0.3, glow: 1 },\n    mobile: { pose: { radius: 10.5 } },\n  },\n  rest: {\n    pose: { target: [0, 0.75, 0], radius: 12, phi: 1.05, theta: 0.65 },\n    params: { keyAngle: 0.9, keyHeight: 0.9, warmth: 0.15, exposure: 1, tilt: 0.42, glow: 0.2 },\n    damp: 0.06,\n    mobile: { pose: { radius: 15.5 } },\n  },\n};\n\nconst SECTIONS: { key: keyof typeof SCENE_STATE_DEFS; title: string; body: string; attrs: string }[] = [\n  {\n    key: \"overview\",\n    title: \"Overview\",\n    body: \"A section declares a pose. Nothing else: no timeline, no scroll trigger, no pinning.\",\n    attrs: 'data-scene-state=\"overview\"',\n  },\n  {\n    key: \"profile\",\n    title: \"Profile\",\n    body: \"Pose and params blend with smoothstep as the probe crosses from one anchor to the next.\",\n    attrs: 'data-scene-state=\"profile\"',\n  },\n  {\n    key: \"detail\",\n    title: \"Detail\",\n    body: \"Theta takes the shortest arc, so the camera never swings the long way round.\",\n    attrs: 'data-scene-state=\"detail\"',\n  },\n  {\n    key: \"above\",\n    title: \"Above\",\n    body: \"A null theta keeps whatever the previous state had: rise straight up from where you were.\",\n    attrs: 'data-scene-state=\"above\"',\n  },\n  {\n    key: \"dusk\",\n    title: \"Dusk\",\n    body: \"Fade keys ease out, so the rim light arrives before the camera does.\",\n    attrs: 'data-scene-state=\"dusk\"',\n  },\n  {\n    key: \"rest\",\n    title: \"Rest\",\n    body: \"A lead starts the blend early. Damping is per state and frame-rate independent.\",\n    attrs: 'data-scene-state=\"rest\" data-scene-lead=\"0.4\"',\n  },\n];\n\nconst PALETTES = {\n  dark: { bg: \"#0d0d0d\", ground: \"#1a1917\", body: \"#d9d4cc\", ring: \"#ec5c13\", ink: \"#f2eee7\", soft: \"rgba(242,238,231,0.56)\", line: \"rgba(242,238,231,0.14)\" },\n  light: { bg: \"#f2ede3\", ground: \"#e6dfd2\", body: \"#f8f5ef\", ring: \"#d9531a\", ink: \"#1a1815\", soft: \"rgba(26,24,21,0.58)\", line: \"rgba(26,24,21,0.14)\" },\n} as const;\n\nclass LitObject {\n  readonly renderer: THREE.WebGLRenderer;\n  readonly camera = new THREE.PerspectiveCamera(32, 1, 0.1, 100);\n  private scene = new THREE.Scene();\n  private key = new THREE.DirectionalLight(0xffffff, 2.4);\n  private rim = new THREE.DirectionalLight(0xffffff, 0);\n  private hemi: THREE.HemisphereLight;\n  private ringGroup = new THREE.Group();\n  private pos: Vec3 = [0, 0, 0];\n  private cool = new THREE.Color(\"#dfe8ff\");\n  private warm = new THREE.Color(\"#ffb070\");\n\n  constructor(canvas: HTMLCanvasElement, tone: \"light\" | \"dark\") {\n    const pal = PALETTES[tone];\n    this.renderer = new THREE.WebGLRenderer({ canvas, antialias: true });\n    this.renderer.shadowMap.enabled = true;\n    this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;\n    this.renderer.toneMapping = THREE.ACESFilmicToneMapping;\n    this.scene.background = new THREE.Color(pal.bg);\n    this.scene.fog = new THREE.Fog(pal.bg, 14, 30);\n\n    this.hemi = new THREE.HemisphereLight(tone === \"dark\" ? 0x6b7280 : 0xffffff, pal.ground, tone === \"dark\" ? 0.35 : 0.9);\n    this.scene.add(this.hemi);\n    this.key.castShadow = true;\n    this.key.shadow.mapSize.set(1024, 1024);\n    this.key.shadow.camera.left = -4;\n    this.key.shadow.camera.right = 4;\n    this.key.shadow.camera.top = 4;\n    this.key.shadow.camera.bottom = -4;\n    this.key.shadow.radius = 6;\n    this.key.shadow.bias = -0.0008;\n    this.scene.add(this.key, this.key.target, this.rim);\n\n    const ground = new THREE.Mesh(\n      new THREE.CircleGeometry(30, 64),\n      new THREE.MeshStandardMaterial({ color: pal.ground, roughness: 0.95 }),\n    );\n    ground.rotation.x = -Math.PI / 2;\n    ground.receiveShadow = true;\n    this.scene.add(ground);\n\n    const plinth = new THREE.Mesh(\n      new THREE.CylinderGeometry(1.3, 1.36, 0.16, 96),\n      new THREE.MeshStandardMaterial({ color: pal.body, roughness: 0.6 }),\n    );\n    plinth.position.y = 0.08;\n    plinth.castShadow = plinth.receiveShadow = true;\n    this.scene.add(plinth);\n\n    const sphere = new THREE.Mesh(\n      new THREE.SphereGeometry(0.72, 96, 64),\n      new THREE.MeshStandardMaterial({ color: pal.body, roughness: 0.32, metalness: 0.05 }),\n    );\n    sphere.position.y = 0.16 + 0.72;\n    sphere.castShadow = sphere.receiveShadow = true;\n    this.scene.add(sphere);\n\n    const ring = new THREE.Mesh(\n      new THREE.TorusGeometry(1.15, 0.022, 16, 160),\n      new THREE.MeshStandardMaterial({ color: pal.ring, roughness: 0.3, metalness: 0.4, emissive: pal.ring, emissiveIntensity: 0.25 }),\n    );\n    ring.castShadow = true;\n    ring.rotation.x = Math.PI / 2;\n    this.ringGroup.position.copy(sphere.position);\n    this.ringGroup.add(ring);\n    this.scene.add(this.ringGroup);\n  }\n\n  resize(w: number, h: number) {\n    this.renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));\n    this.renderer.setSize(w, h, false);\n    this.camera.aspect = w / Math.max(1, h);\n    this.camera.updateProjectionMatrix();\n  }\n\n  render(pose: Parameters<typeof poseToPosition>[0] & { theta: number }, p: Params, t: number) {\n    poseToPosition(pose, this.pos, pose.theta);\n    this.camera.position.set(...this.pos);\n    this.camera.lookAt(...pose.target);\n    const r = 6;\n    this.key.position.set(\n      Math.cos(p.keyAngle) * Math.cos(p.keyHeight) * r,\n      Math.sin(p.keyHeight) * r + 0.5,\n      Math.sin(p.keyAngle) * Math.cos(p.keyHeight) * r,\n    );\n    this.key.color.copy(this.cool).lerp(this.warm, p.warmth);\n    this.key.intensity = 2.6 * p.exposure;\n    // Rim sits opposite the key.\n    this.rim.position.set(-this.key.position.x, 2.2, -this.key.position.z);\n    this.rim.color.copy(this.warm);\n    this.rim.intensity = 2.2 * p.glow;\n    this.renderer.toneMappingExposure = p.exposure;\n    this.ringGroup.rotation.set(p.tilt, t * 0.15, 0);\n    this.renderer.render(this.scene, this.camera);\n  }\n\n  dispose() {\n    this.scene.traverse((o) => {\n      if (o instanceof THREE.Mesh) {\n        o.geometry.dispose();\n        (o.material as THREE.Material).dispose();\n      }\n    });\n    this.renderer.dispose();\n  }\n}\n\nexport interface SceneStatesDemoProps {\n  tone?: \"light\" | \"dark\";\n  /** Renders one still frame of the first state, without sections. */\n  preview?: boolean;\n  className?: string;\n}\n\nexport function SceneStatesDemo({ tone: toneProp, preview = false, className }: SceneStatesDemoProps) {\n  const tone = useBjorkTone(toneProp);\n  const pal = PALETTES[tone];\n  const rootRef = useRef<HTMLDivElement>(null);\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n  const objectRef = useRef<LitObject | null>(null);\n  const [root, setRoot] = useState<HTMLElement | null>(null);\n  const [debug, setDebug] = useState(false);\n  const [active, setActive] = useState(\"overview\");\n  const activeRef = useRef(\"overview\");\n  const rig = useMemo(() => createSceneRig(SCENE_STATE_DEFS.overview), []);\n  const timeRef = useRef(0);\n\n  const statesRef = useSceneStates(SCENE_STATE_DEFS, {\n    root,\n    mobileQuery: \"(max-width: 767px)\",\n    fadeKeys: [\"glow\"],\n    initialKey: \"overview\",\n    debug,\n  });\n\n  const frame = useCallback(\n    (dt: number) => {\n      const obj = objectRef.current;\n      const states: SceneStates<Params> | null = statesRef.current;\n      if (!obj) return false;\n      timeRef.current += dt;\n      if (preview || !states) {\n        const d = SCENE_STATE_DEFS.overview;\n        obj.render({ ...d.pose, theta: d.pose.theta ?? 0 }, d.params, 0);\n        return false;\n      }\n      const s = states.sample();\n      const { pose, params } = rig.update(s, dt);\n      obj.render(pose, params as Params, timeRef.current);\n      if (s.activeKey && s.activeKey !== activeRef.current) {\n        activeRef.current = s.activeKey;\n        setActive(s.activeKey);\n      }\n      return true; // the ring keeps turning while the demo is on screen\n    },\n    [preview, rig, statesRef],\n  );\n\n  const { wake } = useVisibleLoop(rootRef, frame, { enabled: !preview });\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n    if (!canvas) return;\n    let obj: LitObject;\n    try {\n      obj = new LitObject(canvas, tone);\n    } catch {\n      return;\n    }\n    objectRef.current = obj;\n    const resize = () => {\n      const rect = canvas.getBoundingClientRect();\n      obj.resize(rect.width, rect.height);\n      if (preview) frame(0);\n      else wake();\n    };\n    const ro = new ResizeObserver(resize);\n    ro.observe(canvas);\n    resize();\n    return () => {\n      ro.disconnect();\n      obj.dispose();\n      objectRef.current = null;\n    };\n  }, [tone, preview, frame, wake]);\n\n  useEffect(() => {\n    if (preview) return;\n    const onScroll = () => wake();\n    window.addEventListener(\"scroll\", onScroll, { passive: true });\n    return () => window.removeEventListener(\"scroll\", onScroll);\n  }, [preview, wake]);\n\n  const setRootEl = useCallback((el: HTMLDivElement | null) => {\n    rootRef.current = el;\n    setRoot(el);\n  }, []);\n\n  if (preview) {\n    return (\n      <div className={cn(\"relative h-full w-full overflow-hidden\", className)} style={{ background: pal.bg }}>\n        <canvas ref={canvasRef} aria-hidden=\"true\" className=\"absolute inset-0 h-full w-full\" />\n        <div ref={setRootEl} className=\"pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-between p-8\">\n          <div>\n            <div className=\"font-mono text-[11px] uppercase tracking-[0.16em]\" style={{ color: pal.soft }}>\n              01 / 06\n            </div>\n            <div className=\"mt-2 text-[40px] font-medium leading-none tracking-[-0.03em]\" style={{ color: pal.ink }}>\n              Overview\n            </div>\n          </div>\n          <code className=\"rounded-md border px-2 py-1 font-mono text-[11px]\" style={{ color: pal.soft, borderColor: pal.line }}>\n            data-scene-state=&quot;overview&quot;\n          </code>\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div ref={setRootEl} className={cn(\"relative\", className)} style={{ background: pal.bg, color: pal.ink }}>\n      <div className=\"sticky top-0 h-[100svh] w-full overflow-hidden\">\n        <canvas ref={canvasRef} aria-hidden=\"true\" className=\"absolute inset-0 h-full w-full\" />\n        <div className=\"pointer-events-none absolute inset-x-0 top-0 flex items-start justify-between px-5 pt-5 font-mono text-[11px] uppercase tracking-[0.16em] sm:px-8 sm:pt-7\" style={{ color: pal.soft }}>\n          <span>Scene states</span>\n          <span className=\"tabular-nums\">\n            {String(SECTIONS.findIndex((s) => s.key === active) + 1).padStart(2, \"0\")} / {String(SECTIONS.length).padStart(2, \"0\")}\n          </span>\n        </div>\n        <button\n          type=\"button\"\n          onClick={() => setDebug((d) => !d)}\n          aria-pressed={debug}\n          className=\"absolute bottom-5 right-5 cursor-pointer rounded-full border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.14em] transition-colors sm:bottom-7 sm:right-8\"\n          style={{ color: debug ? pal.ink : pal.soft, borderColor: pal.line, background: debug ? pal.line : \"transparent\" }}\n        >\n          {debug ? \"Hide anchors\" : \"Show anchors\"}\n        </button>\n      </div>\n      <div className=\"relative -mt-[100svh]\">\n        {SECTIONS.map((s, i) => (\n          <section\n            key={s.key}\n            data-scene-state={s.key}\n            data-scene-lead={s.key === \"rest\" ? \"0.4\" : undefined}\n            aria-labelledby={`scene-state-${s.key}`}\n            className={cn(\"flex min-h-[100svh] items-end px-5 pb-24 sm:items-center sm:px-8 sm:pb-0\", i % 2 ? \"sm:justify-end\" : \"sm:justify-start\")}\n          >\n            <div className=\"max-w-[340px]\">\n              <div className=\"font-mono text-[11px] uppercase tracking-[0.16em] tabular-nums\" style={{ color: pal.soft }}>\n                {String(i + 1).padStart(2, \"0\")}\n              </div>\n              <h2 id={`scene-state-${s.key}`} className=\"mt-3 text-[40px] font-medium leading-none tracking-[-0.03em]\">\n                {s.title}\n              </h2>\n              <p className=\"mt-4 text-[15px] leading-relaxed\" style={{ color: pal.soft }}>\n                {s.body}\n              </p>\n              <code className=\"mt-5 inline-block rounded-md border px-2 py-1 font-mono text-[11px]\" style={{ color: pal.soft, borderColor: pal.line }}>\n                {s.attrs}\n              </code>\n            </div>\n          </section>\n        ))}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/interactive/scene-states-demo.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/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/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/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"
    },
    {
      "path": "components/bjork-ui/_core/scene-states.ts",
      "content": "\"use client\";\n\n// Scene States: DOM sections declare camera poses, scroll blends between them.\n//\n//   <section data-scene-state=\"overview\" />\n//   <section data-scene-state=\"detail\" data-scene-lead=\"0.4\" />\n//   <div data-scene-state=\"pinned\" data-scene-hold />   // holds through a sticky span\n//\n// The engine knows nothing about three.js. It returns a blended pose and params,\n// and a small rig damps toward them frame-rate independently. Add `?scene-debug`\n// to the URL to draw every anchor and the probe.\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nexport type Vec3 = [number, number, number];\n\nexport interface Pose {\n  target: Vec3;\n  radius: number;\n  /** Polar angle from +Y. 0 looks straight down. */\n  phi: number;\n  /** Azimuth around +Y. `null` keeps whatever the previous state had. */\n  theta: number | null;\n}\n\nexport type SceneParams = Record<string, number>;\n\nexport interface StateDef<P extends SceneParams = SceneParams> {\n  pose: Pose;\n  params: P;\n  /** Per-frame damping at 60 fps, 0..1. Defaults to 0.1. */\n  damp?: number;\n  mobile?: { pose?: Partial<Pose>; params?: Partial<P>; damp?: number };\n}\n\nexport interface SceneSample<P extends SceneParams = SceneParams> {\n  pose: Pose & { theta: number };\n  params: P;\n  activeKey: string | null;\n  fromKey: string | null;\n  toKey: string | null;\n  /** Raw blend 0..1 between `fromKey` and `toKey`. */\n  t: number;\n  damp: number;\n  /** True when the active section asked to snap (data-scene-immediate). */\n  immediate: boolean;\n  /** Document-space probe line, useful for debugging. */\n  probe: number;\n}\n\nexport interface SceneStatesOptions<P extends SceneParams = SceneParams> {\n  /** Element to scan for `[data-scene-state]`. Defaults to document.body. */\n  root?: HTMLElement | null;\n  /** Element that scrolls. Defaults to the window. */\n  scrollRoot?: HTMLElement | null;\n  /** Mobile overrides apply while this matches. */\n  mobileQuery?: string;\n  /** Params that blend with easeOutQuad so lights die before the camera arrives. */\n  fadeKeys?: (keyof P & string)[];\n  /** Fallback when no section is registered. */\n  initialKey?: string;\n  /** Force the debug overlay regardless of the URL. */\n  debug?: boolean;\n}\n\nexport interface SceneStates<P extends SceneParams = SceneParams> {\n  sample(scrollY?: number, vh?: number, maxScroll?: number): SceneSample<P>;\n  rescan(): void;\n  destroy(): void;\n  readonly keys: string[];\n}\n\ninterface Entry {\n  el: HTMLElement;\n  key: string;\n  anchorY: number;\n  lead: number | null;\n  immediate: boolean;\n}\n\nconst DEFAULT_DAMP = 0.1;\nconst TAU = Math.PI * 2;\n\nexport const clamp01 = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\nexport const smoothstep = (t: number) => t * t * (3 - 2 * t);\nexport const easeOutQuad = (t: number) => t * (2 - t);\nexport const lerp = (a: number, b: number, t: number) => a + (b - a) * t;\n\n/** Shortest signed difference b - a on the circle. */\nexport function angleDelta(a: number, b: number) {\n  let d = (b - a) % TAU;\n  if (d > Math.PI) d -= TAU;\n  if (d < -Math.PI) d += TAU;\n  return d;\n}\n\n/**\n * Converts a per-frame damping factor (tuned at 60 fps) into the factor for `dt` seconds,\n * so the rig settles the same on a 120 Hz display as on a 60 Hz one.\n */\nexport function dampFactor(damp: number, dt: number) {\n  if (damp >= 1) return 1;\n  return 1 - Math.pow(1 - damp, dt * 60);\n}\n\n/** Exponential approach with rate `lambda` per second. `1 - e^(-9dt)` is the house default. */\nexport function expDamp(current: number, target: number, lambda: number, dt: number) {\n  return lerp(current, target, 1 - Math.exp(-lambda * dt));\n}\n\n/** World-space camera position for a pose: target + r·(sinφ sinθ, cosφ, sinφ cosθ). */\nexport function poseToPosition(pose: Pose, out: Vec3 = [0, 0, 0], theta = pose.theta ?? 0): Vec3 {\n  const s = Math.sin(pose.phi);\n  out[0] = pose.target[0] + pose.radius * s * Math.sin(theta);\n  out[1] = pose.target[1] + pose.radius * Math.cos(pose.phi);\n  out[2] = pose.target[2] + pose.radius * s * Math.cos(theta);\n  return out;\n}\n\n/** Blends two poses. Theta takes the shortest arc; a null theta keeps `fallbackTheta`. */\nexport function blendPose(a: Pose, b: Pose, t: number, fallbackTheta: number, out?: Pose & { theta: number }) {\n  const res = out ?? { target: [0, 0, 0] as Vec3, radius: 0, phi: 0, theta: 0 };\n  res.target[0] = lerp(a.target[0], b.target[0], t);\n  res.target[1] = lerp(a.target[1], b.target[1], t);\n  res.target[2] = lerp(a.target[2], b.target[2], t);\n  res.radius = lerp(a.radius, b.radius, t);\n  res.phi = lerp(a.phi, b.phi, t);\n  const ta = a.theta ?? fallbackTheta;\n  const tb = b.theta ?? fallbackTheta;\n  res.theta = ta + angleDelta(ta, tb) * t;\n  return res;\n}\n\nfunction resolveDef<P extends SceneParams>(def: StateDef<P>, mobile: boolean): StateDef<P> {\n  if (!mobile || !def.mobile) return def;\n  return {\n    pose: { ...def.pose, ...def.mobile.pose },\n    params: { ...def.params, ...def.mobile.params } as P,\n    damp: def.mobile.damp ?? def.damp,\n  };\n}\n\nfunction readScroll(scrollRoot: HTMLElement | null | undefined) {\n  if (scrollRoot) {\n    return {\n      y: scrollRoot.scrollTop,\n      vh: scrollRoot.clientHeight,\n      max: Math.max(0, scrollRoot.scrollHeight - scrollRoot.clientHeight),\n    };\n  }\n  const vh = window.innerHeight;\n  const doc = document.scrollingElement ?? document.documentElement;\n  return { y: window.scrollY, vh, max: Math.max(0, doc.scrollHeight - vh) };\n}\n\n/**\n * Builds the engine. `defs` maps a state key to its pose and params. Every def should\n * carry the same param keys; missing ones fall back to the first def's value.\n */\nexport function createSceneStates<P extends SceneParams>(\n  defs: Record<string, StateDef<P>>,\n  opts: SceneStatesOptions<P> = {},\n): SceneStates<P> {\n  const keys = Object.keys(defs);\n  const fadeKeys = new Set<string>(opts.fadeKeys ?? []);\n  const paramKeys = Array.from(new Set(keys.flatMap((k) => Object.keys(defs[k].params))));\n  const fallbackKey = opts.initialKey && defs[opts.initialKey] ? opts.initialKey : keys[0];\n  const mq =\n    typeof window !== \"undefined\" && opts.mobileQuery ? window.matchMedia(opts.mobileQuery) : null;\n\n  let entries: Entry[] = [];\n  let lastTheta = defs[fallbackKey]?.pose.theta ?? 0;\n  const out: SceneSample<P> = {\n    pose: { target: [0, 0, 0], radius: 0, phi: 0, theta: 0 },\n    params: {} as P,\n    activeKey: null,\n    fromKey: null,\n    toKey: null,\n    t: 0,\n    damp: DEFAULT_DAMP,\n    immediate: false,\n    probe: 0,\n  };\n\n  const def = (key: string) => {\n    const d = defs[key] ?? defs[fallbackKey];\n    return resolveDef(d, Boolean(mq?.matches));\n  };\n\n  const measure = () => {\n    if (typeof window === \"undefined\") return;\n    const root = opts.root ?? document.body;\n    const { y, vh } = readScroll(opts.scrollRoot);\n    const rootTop = opts.scrollRoot ? opts.scrollRoot.getBoundingClientRect().top : 0;\n    const portrait = vh > (opts.scrollRoot?.clientWidth ?? window.innerWidth);\n    const next: Entry[] = [];\n    root.querySelectorAll<HTMLElement>(\"[data-scene-state]\").forEach((el) => {\n      const key = el.dataset.sceneState;\n      if (!key || !defs[key]) return;\n      const rect = el.getBoundingClientRect();\n      const top = rect.top - rootTop + y;\n      const lead = el.dataset.sceneLead != null ? parseFloat(el.dataset.sceneLead) : NaN;\n      const base = {\n        el,\n        key,\n        lead: Number.isFinite(lead) && lead > 0 ? lead : null,\n        immediate: el.hasAttribute(\"data-scene-immediate\"),\n      };\n      if (el.hasAttribute(\"data-scene-hold\") && rect.height > vh) {\n        // Two anchors with the same key: the blend stays flat across the sticky span.\n        next.push({ ...base, anchorY: top + vh / 2 });\n        next.push({ ...base, lead: null, anchorY: top + rect.height - vh / 2 });\n        return;\n      }\n      next.push({ ...base, anchorY: portrait ? top : top + rect.height / 2 });\n    });\n    next.sort((a, b) => a.anchorY - b.anchorY);\n    entries = next;\n    debug?.draw(entries);\n  };\n\n  // Rescans are coalesced to one per frame.\n  let raf = 0;\n  const schedule = () => {\n    if (typeof window === \"undefined\") return;\n    cancelAnimationFrame(raf);\n    raf = requestAnimationFrame(measure);\n  };\n\n  let mo: MutationObserver | null = null;\n  let ro: ResizeObserver | null = null;\n  const debug =\n    typeof window !== \"undefined\" &&\n    (opts.debug || new URLSearchParams(window.location.search).has(\"scene-debug\"))\n      ? createDebugOverlay(opts.scrollRoot ?? null)\n      : null;\n\n  if (typeof window !== \"undefined\") {\n    const root = opts.root ?? document.body;\n    mo = new MutationObserver(schedule);\n    mo.observe(root, { childList: true, subtree: true, attributes: true, attributeFilter: [\"data-scene-state\", \"data-scene-lead\", \"data-scene-hold\"] });\n    ro = new ResizeObserver(schedule);\n    ro.observe(root);\n    mq?.addEventListener?.(\"change\", schedule);\n    window.addEventListener(\"resize\", schedule);\n    measure();\n  }\n\n  const blendParams = (a: P, b: P, t: number, tf: number) => {\n    const base = defs[fallbackKey].params;\n    const res = out.params as SceneParams;\n    for (const k of paramKeys) {\n      const va = a[k] ?? base[k] ?? 0;\n      const vb = b[k] ?? base[k] ?? 0;\n      res[k] = lerp(va, vb, fadeKeys.has(k) ? tf : t);\n    }\n  };\n\n  const sample = (scrollY?: number, vh?: number, maxScroll?: number): SceneSample<P> => {\n    const live = typeof window !== \"undefined\" ? readScroll(opts.scrollRoot) : { y: 0, vh: 1, max: 0 };\n    const y = scrollY ?? live.y;\n    const h = vh ?? live.vh;\n    const max = maxScroll ?? live.max;\n\n    if (entries.length === 0) {\n      const d = def(fallbackKey);\n      blendPose(d.pose, d.pose, 0, lastTheta, out.pose);\n      blendParams(d.params, d.params, 0, 0);\n      out.activeKey = out.fromKey = out.toKey = fallbackKey;\n      out.t = 0;\n      out.damp = d.damp ?? DEFAULT_DAMP;\n      out.immediate = false;\n      out.probe = y + h / 2;\n      return out;\n    }\n\n    // Edge-corrected probe: the first and last sections stay reachable.\n    const half = h / 2;\n    const i = 1 - smoothstep(clamp01(y / half));\n    const s = 1 - smoothstep(clamp01((max - y) / half));\n    const c = y + half * (1 - i + s);\n\n    let idx = 0;\n    while (idx < entries.length - 1 && entries[idx + 1].anchorY <= c) idx++;\n    const from = entries[idx];\n    const to = entries[Math.min(idx + 1, entries.length - 1)];\n    const start = to.lead != null ? Math.max(from.anchorY, to.anchorY - to.lead * h) : from.anchorY;\n    const span = to.anchorY - start;\n    const t = span > 0 ? clamp01((c - start) / span) : 0;\n\n    const a = def(from.key);\n    const b = def(to.key);\n    blendPose(a.pose, b.pose, smoothstep(t), lastTheta, out.pose);\n    lastTheta = out.pose.theta;\n    blendParams(a.params, b.params, smoothstep(t), easeOutQuad(t));\n\n    const active = t < 0.5 ? from : to;\n    out.activeKey = active.key;\n    out.fromKey = from.key;\n    out.toKey = to.key;\n    out.t = t;\n    out.damp = def(active.key).damp ?? DEFAULT_DAMP;\n    out.immediate = active.immediate;\n    out.probe = c;\n    debug?.probe(c, y);\n    return out;\n  };\n\n  return {\n    sample,\n    rescan: measure,\n    destroy() {\n      cancelAnimationFrame(raf);\n      mo?.disconnect();\n      ro?.disconnect();\n      mq?.removeEventListener?.(\"change\", schedule);\n      if (typeof window !== \"undefined\") window.removeEventListener(\"resize\", schedule);\n      debug?.destroy();\n      entries = [];\n    },\n    get keys() {\n      return keys;\n    },\n  };\n}\n\n/**\n * A damped follower for poses and params. `update` moves toward the sample using\n * frame-rate independent damping and returns the smoothed values.\n */\nexport function createSceneRig<P extends SceneParams>(initial: { pose: Pose; params: P }) {\n  const pose: Pose & { theta: number } = {\n    target: [...initial.pose.target] as Vec3,\n    radius: initial.pose.radius,\n    phi: initial.pose.phi,\n    theta: initial.pose.theta ?? 0,\n  };\n  const params = { ...initial.params } as P;\n  return {\n    pose,\n    params,\n    update(sample: { pose: Pose; params: P; damp?: number; immediate?: boolean }, dt: number) {\n      const k = sample.immediate ? 1 : dampFactor(sample.damp ?? DEFAULT_DAMP, dt);\n      for (let i = 0; i < 3; i++) pose.target[i] += (sample.pose.target[i] - pose.target[i]) * k;\n      pose.radius += (sample.pose.radius - pose.radius) * k;\n      pose.phi += (sample.pose.phi - pose.phi) * k;\n      if (sample.pose.theta != null) pose.theta += angleDelta(pose.theta, sample.pose.theta) * k;\n      const p = params as SceneParams;\n      for (const key in sample.params) p[key] = (p[key] ?? 0) + (sample.params[key] - (p[key] ?? 0)) * k;\n      return { pose, params };\n    },\n    /** True once every value is within `eps` of the sample. */\n    settled(sample: { pose: Pose; params: P }, eps = 1e-4) {\n      if (Math.abs(sample.pose.radius - pose.radius) > eps) return false;\n      if (Math.abs(sample.pose.phi - pose.phi) > eps) return false;\n      if (sample.pose.theta != null && Math.abs(angleDelta(pose.theta, sample.pose.theta)) > eps) return false;\n      for (let i = 0; i < 3; i++) if (Math.abs(sample.pose.target[i] - pose.target[i]) > eps) return false;\n      for (const key in sample.params) if (Math.abs(sample.params[key] - (params as SceneParams)[key]) > eps) return false;\n      return true;\n    },\n  };\n}\n\n/**\n * React binding. The engine is created once per mount; pass stable `defs`.\n * Returns a ref whose `current` is the engine (null before mount).\n */\nexport function useSceneStates<P extends SceneParams>(\n  defs: Record<string, StateDef<P>>,\n  opts?: SceneStatesOptions<P>,\n) {\n  const ref = useRef<SceneStates<P> | null>(null);\n  const root = opts?.root ?? null;\n  const scrollRoot = opts?.scrollRoot ?? null;\n  const mobileQuery = opts?.mobileQuery;\n  const fadeKey = (opts?.fadeKeys ?? []).join(\",\");\n  const initialKey = opts?.initialKey;\n  const debug = opts?.debug;\n  const stableOpts = useMemo(\n    () => ({\n      root,\n      scrollRoot,\n      mobileQuery,\n      fadeKeys: fadeKey ? (fadeKey.split(\",\") as (keyof P & string)[]) : [],\n      initialKey,\n      debug,\n    }),\n    [root, scrollRoot, mobileQuery, fadeKey, initialKey, debug],\n  );\n\n  useEffect(() => {\n    const engine = createSceneStates(defs, stableOpts);\n    ref.current = engine;\n    return () => {\n      engine.destroy();\n      ref.current = null;\n    };\n  }, [defs, stableOpts]);\n\n  return ref;\n}\n\n// ─── ?scene-debug overlay ─────────────────────────────────────────────────────\n\nfunction createDebugOverlay(scrollRoot: HTMLElement | null) {\n  const layer = document.createElement(\"div\");\n  layer.setAttribute(\"aria-hidden\", \"true\");\n  layer.style.cssText =\n    \"position:fixed;inset:0;pointer-events:none;z-index:2147483000;font:11px/1.2 ui-monospace,monospace;\";\n  const probeLine = document.createElement(\"div\");\n  probeLine.style.cssText =\n    \"position:absolute;left:0;right:0;height:0;border-top:1px dashed #ec5c13;\";\n  const probeLabel = document.createElement(\"span\");\n  probeLabel.style.cssText =\n    \"position:absolute;right:8px;top:-16px;color:#ec5c13;background:rgba(0,0,0,.6);padding:1px 4px;border-radius:3px;\";\n  probeLabel.textContent = \"probe\";\n  probeLine.appendChild(probeLabel);\n  layer.appendChild(probeLine);\n  document.body.appendChild(layer);\n\n  let marks: { el: HTMLDivElement; y: number }[] = [];\n  let lastY = 0;\n  const place = (scrollY: number) => {\n    const offset = scrollRoot ? scrollRoot.getBoundingClientRect().top : 0;\n    for (const m of marks) m.el.style.transform = `translateY(${m.y - scrollY + offset}px)`;\n  };\n\n  return {\n    draw(entries: Entry[]) {\n      marks.forEach((m) => m.el.remove());\n      marks = entries.map((e) => {\n        const el = document.createElement(\"div\");\n        el.style.cssText =\n          \"position:absolute;left:0;right:0;top:0;height:0;border-top:1px solid rgba(80,180,255,.8);\";\n        const label = document.createElement(\"span\");\n        label.style.cssText =\n          \"position:absolute;left:8px;top:-16px;color:#7cc4ff;background:rgba(0,0,0,.6);padding:1px 4px;border-radius:3px;\";\n        label.textContent = `${e.key}${e.lead ? ` lead ${e.lead}` : \"\"}${e.immediate ? \" immediate\" : \"\"}`;\n        el.appendChild(label);\n        layer.appendChild(el);\n        return { el, y: e.anchorY };\n      });\n      place(lastY);\n    },\n    probe(c: number, scrollY: number) {\n      lastY = scrollY;\n      const offset = scrollRoot ? scrollRoot.getBoundingClientRect().top : 0;\n      probeLine.style.transform = `translateY(${c - scrollY + offset}px)`;\n      place(scrollY);\n    },\n    destroy() {\n      layer.remove();\n    },\n  };\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/scene-states.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": "Interactive",
    "registryUrl": "https://ui.isaiahbjork.com/scene-states.json",
    "installCommand": "npx shadcn@latest add https://ui.isaiahbjork.com/scene-states.json"
  },
  "type": "registry:component"
}