{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button",
  "title": "Button",
  "author": "AlgorizeTech",
  "description": "A button with variants, sizes, loading state, and a click ripple effect. Reach for it as the default action element anywhere in an interface.",
  "dependencies": [],
  "registryDependencies": [
    "https://avaraui.com/r/icons.json",
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/Button.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport React, { useEffect, useState } from \"react\";\nimport { getButtonThemeStyle } from \"./button-theme\";\n\nconst Loader2: React.FC<{ className?: string }> = ({ className }) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"24\"\n    height=\"24\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    stroke=\"currentColor\"\n    strokeWidth=\"2\"\n    strokeLinecap=\"round\"\n    strokeLinejoin=\"round\"\n    className={cn(\"animate-spin\", className)}\n  >\n    <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n  </svg>\n);\n\nconst ArrowRightIcon: React.FC<{ className?: string }> = ({ className }) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"16\"\n    height=\"16\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    stroke=\"currentColor\"\n    strokeWidth=\"2\"\n    strokeLinecap=\"round\"\n    strokeLinejoin=\"round\"\n    className={className}\n    aria-hidden=\"true\"\n  >\n    <path d=\"M5 12h14\" />\n    <path d=\"m12 5 7 7-7 7\" />\n  </svg>\n);\n\nexport type ButtonVariant =\n  | \"outline\"\n  | \"spin-border\"\n  | \"pulse-glow\"\n  | \"shimmer-beam\"\n  | \"neon-aura\"\n  | \"ripple-wave\"\n  | \"gradient-flow\"\n  | \"border-beam\"\n  | \"radar-ping\"\n  | \"breathe-glow\"\n  | \"spotlight\"\n  | \"cosmic-orbit\"\n  | \"cyber-scan\"\n  | \"expand-icon\"\n  | \"slide-icon\"\n  | \"slide-icon-loop\"\n  | \"slide-bg\"\n  | \"slide-bg-top\"\n  | \"slide-bg-bottom\"\n  | \"slide-bg-right\"\n  | \"slide-text\"\n  | \"slide-text-down\"\n  | \"slide-text-bounce\"\n  | \"scale-up\"\n  | \"shine-sweep\"\n  | \"glow-pulse\"\n  | \"skew-slide\"\n  | \"border-expand\"\n  | \"icon-rotate\"\n  | \"icon-bounce\"\n  | \"icon-spin\"\n  | \"curtain-reveal\"\n  | \"corner-expand\"\n  | \"glassmorphism\"\n  | \"floating-shadow\"\n  | \"magnetic-pull\"\n  | \"glitch-cyber\"\n  | \"3d\"\n  | \"3d-press\"\n  | \"liquid-fill\"\n  | \"border-chase\"\n  | \"3d-flip\"\n  | \"holographic\"\n  | \"laser-border\"\n  | \"wave-ripple\"\n  | \"electric-pulse\"\n  | \"neon-sign\"\n  | \"morphing-blob\"\n  | \"split-door-reveal\"\n  | \"expanding-circle-center\"\n  | \"diamond-glare-wipe\"\n  | \"border-draw-outline\"\n  | \"vertical-curtain-rise\"\n  | \"magnetic-pulse-ring\"\n  | \"aura-glow-stream\"\n  | \"neon-portal-ring\"\n  | \"cyber-matrix-pulse\"\n  | \"liquid-gradient-flow\"\n  | \"magnetic-laser-ring\"\n  | \"quantum-flux-beam\"\n  | \"border-corner-pulse\"\n  | \"beacon-radar-pulse\"\n  | \"dual-ring-pulse\"\n  | \"square-frame-pulse\"\n  | \"corner-dash-pulse\"\n  | \"horizontal-shutter-split\"\n  | \"diagonal-slash-fill\"\n  | \"corner-cross-bracket\"\n  | \"inset-box-shadow-fill\"\n  | \"glowing-line-trace\"\n  | \"prism-reflection-shimmer\"\n  | \"dual-spin-border\"\n  | \"shards-control\"\n  // The plain shadcn-style surfaces. Everything above is an animated\n  // treatment; these five are the ordinary buttons most pages actually need,\n  // and the docs have always advertised them.\n  | \"default\"\n  | \"destructive\"\n  | \"secondary\"\n  | \"ghost\"\n  | \"link\"\n  | \"pricing-primary\"\n  | \"pricing-outline\"\n  | \"pricing-glow\"\n  | \"pricing-muted\"\n  | \"pricing-pill\"\n  | \"pricing-dark\"\n  | \"pricing-typographic\"\n  | \"pricing-typographic-muted\";\ntype ButtonSize = \"default\" | \"sm\" | \"lg\";\n\n/**\n * Decoration a \"shards-control\" tile plays when it lands on something: a\n * slider reaching full, a toggle switching on, or a new select / colour pick.\n */\nexport type ShardsEffect = \"none\" | \"sparkle\" | \"orbit\" | \"beacon\" | \"shimmer\";\n/** `once` plays per landing; `continuous` loops for as long as the tile stays active. */\nexport type ShardsEffectMode = \"once\" | \"continuous\";\n\n/**\n * The plain variants, styled from theme tokens so they follow whatever palette\n * the consumer has in globals.css.\n *\n * `outline` is deliberately absent: it is the default value and already has its\n * own treatment further down, so listing it here would silently restyle every\n * button that never passed a variant.\n */\nconst PLAIN_VARIANTS: Record<string, string> = {\n  default:\n    \"bg-primary text-primary-foreground border-transparent hover:bg-primary/90\",\n  destructive:\n    \"bg-destructive text-white border-transparent hover:bg-destructive/90\",\n  secondary:\n    \"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80\",\n  ghost:\n    \"bg-transparent text-foreground border-transparent shadow-none hover:bg-accent hover:text-accent-foreground\",\n  link: \"bg-transparent text-primary border-transparent shadow-none underline-offset-4 hover:underline\",\n  \"pricing-primary\":\n    \"rounded-lg font-sans text-[13.5px] font-semibold px-7 py-3.5 bg-primary text-primary-foreground border-transparent shadow-xs hover:bg-primary/90 hover:shadow-md hover:shadow-primary/20 hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all duration-200\",\n  \"pricing-outline\":\n    \"rounded-lg font-sans text-[13.5px] font-semibold px-6 py-3 border border-border bg-muted/50 dark:bg-card text-foreground hover:bg-muted/80 dark:hover:bg-muted/40 hover:border-foreground/15 dark:hover:border-foreground/25 hover:shadow-xs hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all duration-200\",\n  \"pricing-glow\":\n    \"rounded-lg font-sans text-sm font-semibold px-7 py-3.5 bg-primary text-primary-foreground border border-primary/30 shadow-[0_0_20px_-3px_color-mix(in_oklab,var(--primary)_45%,transparent)] hover:shadow-[0_0_32px_-1px_color-mix(in_oklab,var(--primary)_70%,transparent)] hover:brightness-105 hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all duration-200\",\n  \"pricing-muted\":\n    \"rounded-lg font-sans text-[13.5px] font-semibold px-7 py-3.5 bg-muted text-foreground border-transparent shadow-2xs hover:bg-muted/70 hover:shadow-xs hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all duration-200\",\n  \"pricing-pill\":\n    \"rounded-lg font-sans text-xs sm:text-[13px] font-bold uppercase tracking-wider px-8 py-3.5 bg-primary text-primary-foreground border-transparent shadow-md hover:bg-primary/90 hover:shadow-lg hover:shadow-primary/25 hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all duration-200\",\n  \"pricing-dark\":\n    \"rounded-lg font-sans text-xs sm:text-[13.5px] font-semibold px-7 py-3.5 bg-gradient-to-b from-foreground/85 to-foreground text-background border-transparent shadow-md hover:from-foreground/95 hover:to-foreground hover:shadow-lg hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.98] transition-all duration-200\",\n  \"pricing-typographic\":\n    \"rounded-lg font-sans text-xs sm:text-sm font-semibold uppercase tracking-widest px-8 py-4 bg-primary text-primary-foreground border-transparent shadow-md active:scale-[0.99] transition-all duration-300\",\n  \"pricing-typographic-muted\":\n    \"rounded-lg font-sans text-xs sm:text-sm font-semibold uppercase tracking-widest px-8 py-4 bg-muted text-foreground border-transparent shadow-none active:scale-[0.99] transition-all duration-300\",\n};\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  variant?: ButtonVariant;\n  size?: ButtonSize;\n  loading?: boolean;\n  color?: string;\n  iconLeft?: React.ReactNode;\n  iconRight?: React.ReactNode;\n  /** Whether to show a default trailing arrow icon (e.g. for pricing CTAs like \"Continue →\"). */\n  showArrow?: boolean;\n\n  /* Props for \"shards-control\" glass dark parameter tile variant */\n  controlType?: \"color\" | \"select\" | \"slider\" | \"toggle\";\n  label?: string;\n  value?: string | number;\n  options?: string[];\n  checked?: boolean;\n  onCheckedChange?: (checked: boolean) => void;\n  colorHex?: string;\n  onColorChange?: (color: string) => void;\n  min?: number;\n  max?: number;\n  step?: number;\n  onValueChange?: (value: number | string) => void;\n  /**\n   * Effect played by a \"shards-control\" tile. Left unset, the tile keeps its\n   * built-in feedback (slider beacon at full, colour burst on a pick).\n   */\n  effect?: ShardsEffect;\n  effectMode?: ShardsEffectMode;\n  /**\n   * Whether a `continuous` effect is running. Defaults to: slider at full,\n   * toggle on, select / colour once something has been picked.\n   */\n  effectActive?: boolean;\n}\n\ninterface Ripple {\n  x: number;\n  y: number;\n  size: number;\n  id: number;\n}\n\n/* Helper HSV/HSL conversion for full interactive Color Canvas and Hue Slider */\nfunction hsvToHex(h: number, s: number, v: number): string {\n  const f = (n: number, k = (n + h / 60) % 6) =>\n    v - v * s * Math.max(0, Math.min(k, 4 - k, 1));\n  const r = Math.round(f(5) * 255);\n  const g = Math.round(f(3) * 255);\n  const b = Math.round(f(1) * 255);\n  return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n}\n\nfunction hexToHsv(hex: string): { h: number; s: number; v: number } {\n  let c = hex.replace(\"#\", \"\");\n  if (c.length === 3) {\n    c = c.split(\"\").map((x) => x + x).join(\"\");\n  }\n  const num = parseInt(c, 16);\n  if (isNaN(num)) return { h: 270, s: 0.7, v: 0.7 };\n  const r = ((num >> 16) & 255) / 255;\n  const g = ((num >> 8) & 255) / 255;\n  const b = (num & 255) / 255;\n\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const d = max - min;\n  let h = 0;\n  const s = max === 0 ? 0 : d / max;\n  const v = max;\n\n  if (max !== min) {\n    switch (max) {\n      case r:\n        h = (g - b) / d + (g < b ? 6 : 0);\n        break;\n      case g:\n        h = (b - r) / d + 2;\n        break;\n      case b:\n        h = (r - g) / d + 4;\n        break;\n    }\n    h /= 6;\n  }\n  return { h: Math.round(h * 360), s, v };\n}\n\nfunction colorWithAlpha(color: string, alpha: number): string {\n  if (color.startsWith(\"#\")) {\n    let hex = color.slice(1);\n    if (hex.length === 3) {\n      hex = hex.split(\"\").map((x) => x + x).join(\"\");\n    }\n    if (hex.length === 6) {\n      const r = parseInt(hex.slice(0, 2), 16);\n      const g = parseInt(hex.slice(2, 4), 16);\n      const b = parseInt(hex.slice(4, 6), 16);\n      return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n    }\n  }\n  return color;\n}\n\nconst ColorPickerPopover: React.FC<{\n  color: string;\n  onChange: (hex: string) => void;\n  onClose: () => void;\n}> = ({ color, onChange, onClose }) => {\n  const initialHsv = React.useMemo(() => hexToHsv(color), []);\n  const [hue, setHue] = useState(initialHsv.h);\n  const [sat, setSat] = useState(initialHsv.s);\n  const [val, setVal] = useState(initialHsv.v);\n\n  const canvasRef = React.useRef<HTMLDivElement>(null);\n  const hueRef = React.useRef<HTMLDivElement>(null);\n\n  const [isDraggingCanvas, setIsDraggingCanvas] = useState(false);\n  const [isDraggingHue, setIsDraggingHue] = useState(false);\n\n  // Sync internal state when external color changes (e.g. swatch click), and\n  // again when a drag ends. Done while rendering, against the last values seen.\n  const [synced, setSynced] = useState({ color, isDraggingCanvas, isDraggingHue });\n  if (\n    synced.color !== color ||\n    synced.isDraggingCanvas !== isDraggingCanvas ||\n    synced.isDraggingHue !== isDraggingHue\n  ) {\n    setSynced({ color, isDraggingCanvas, isDraggingHue });\n    if (!isDraggingCanvas && !isDraggingHue) {\n      const hsv = hexToHsv(color);\n      setSat(hsv.s);\n      setVal(hsv.v);\n      if (hsv.s > 0.05) {\n        setHue(hsv.h);\n      }\n    }\n  }\n\n  const handleCanvasMove = React.useCallback(\n    (clientX: number, clientY: number) => {\n      if (!canvasRef.current) return;\n      const rect = canvasRef.current.getBoundingClientRect();\n      const x = Math.max(0, Math.min(rect.width, clientX - rect.left));\n      const y = Math.max(0, Math.min(rect.height, clientY - rect.top));\n\n      const newSat = x / rect.width;\n      const newVal = 1 - y / rect.height;\n\n      setSat(newSat);\n      setVal(newVal);\n      onChange(hsvToHex(hue, newSat, newVal));\n    },\n    [hue, onChange]\n  );\n\n  const handleHueMove = React.useCallback(\n    (clientX: number) => {\n      if (!hueRef.current) return;\n      const rect = hueRef.current.getBoundingClientRect();\n      const x = Math.max(0, Math.min(rect.width, clientX - rect.left));\n      const newHue = (x / rect.width) * 360;\n\n      setHue(newHue);\n      onChange(hsvToHex(newHue, sat, val));\n    },\n    [sat, val, onChange]\n  );\n\n  useEffect(() => {\n    if (!isDraggingCanvas) return;\n    const onMove = (e: MouseEvent) => handleCanvasMove(e.clientX, e.clientY);\n    const onUp = () => setIsDraggingCanvas(false);\n    window.addEventListener(\"mousemove\", onMove);\n    window.addEventListener(\"mouseup\", onUp);\n    return () => {\n      window.removeEventListener(\"mousemove\", onMove);\n      window.removeEventListener(\"mouseup\", onUp);\n    };\n  }, [isDraggingCanvas, handleCanvasMove]);\n\n  useEffect(() => {\n    if (!isDraggingHue) return;\n    const onMove = (e: MouseEvent) => handleHueMove(e.clientX);\n    const onUp = () => setIsDraggingHue(false);\n    window.addEventListener(\"mousemove\", onMove);\n    window.addEventListener(\"mouseup\", onUp);\n    return () => {\n      window.removeEventListener(\"mousemove\", onMove);\n      window.removeEventListener(\"mouseup\", onUp);\n    };\n  }, [isDraggingHue, handleHueMove]);\n\n  const hueColor = hsvToHex(hue, 1, 1);\n\n  return (\n    <>\n      <div\n        className=\"fixed inset-0 z-40\"\n        onClick={(e) => {\n          e.stopPropagation();\n          onClose();\n        }}\n      />\n      <div className=\"absolute left-0 right-0 top-full mt-1.5 z-50 p-3 rounded-2xl border border-border/80 bg-popover text-popover-foreground shadow-lg flex flex-col gap-3 animate-in fade-in-0 zoom-in-95 duration-150 custom-control-interactive\">\n        {/* 1. Interactive 2D Color Spectrum Field Box */}\n        <div\n          ref={canvasRef}\n          onMouseDown={(e) => {\n            e.stopPropagation();\n            setIsDraggingCanvas(true);\n            handleCanvasMove(e.clientX, e.clientY);\n          }}\n          className=\"relative w-full h-32 rounded-xl overflow-hidden cursor-crosshair select-none\"\n          style={{\n            backgroundColor: hueColor,\n            backgroundImage:\n              \"linear-gradient(to top, #000 0%, transparent 80%), linear-gradient(to right, #fff 0%, transparent 65%)\",\n          }}\n        >\n          {/* Selector Pointer Circle */}\n          <div\n            className=\"absolute w-4 h-4 -ml-2 -mt-2 rounded-full border-2 border-white shadow-md pointer-events-none transition-transform active:scale-125\"\n            style={{\n              left: `${sat * 100}%`,\n              top: `${(1 - val) * 100}%`,\n              backgroundColor: color,\n            }}\n          />\n        </div>\n\n        {/* 2. Rainbow Hue Spectrum Drag Bar */}\n        <div\n          ref={hueRef}\n          onMouseDown={(e) => {\n            e.stopPropagation();\n            setIsDraggingHue(true);\n            handleHueMove(e.clientX);\n          }}\n          className=\"relative w-full h-3.5 rounded-full cursor-pointer select-none\"\n        >\n          <div\n            className=\"w-full h-full rounded-full\"\n            style={{\n              background:\n                \"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)\",\n            }}\n          />\n          {/* Slider Ring Handle */}\n          <div\n            className=\"absolute top-1/2 -translate-y-1/2 w-4 h-4 -ml-2 rounded-full border-2 border-white shadow-md pointer-events-none\"\n            style={{\n              left: `${(hue / 360) * 100}%`,\n              backgroundColor: hueColor,\n            }}\n          />\n        </div>\n\n        {/* 3. Palette Color Swatches Grid */}\n        <div className=\"flex flex-wrap gap-2.5 pt-1\">\n          {[\n            \"#a855f7\",\n            \"#8b5cf6\",\n            \"#6366f1\",\n            \"#3b82f6\",\n            \"#06b6d4\",\n            \"#10b981\",\n            \"#84cc16\",\n            \"#eab308\",\n            \"#f97316\",\n            \"#ef4444\",\n            \"#ec4899\",\n            \"#f43f5e\",\n            \"#ffffff\",\n            \"#94a3b8\",\n            \"#000000\",\n          ].map((hex) => (\n            <button\n              key={hex}\n              type=\"button\"\n              onClick={(e) => {\n                e.stopPropagation();\n                onChange(hex);\n              }}\n              className=\"w-5 h-5 rounded-md transition-transform hover:scale-110 active:scale-95 border border-foreground/15 shadow-xs cursor-pointer\"\n              style={{ backgroundColor: hex }}\n            />\n          ))}\n        </div>\n      </div>\n    </>\n  );\n};\n\ntype PlayableShardsEffect = Exclude<ShardsEffect, \"none\">;\n\n/** Length of one `once` play, per effect, in seconds. */\nconst FX_ONCE_S: Record<PlayableShardsEffect, number> = {\n  sparkle: 2.2,\n  orbit: 1.6,\n  beacon: 2,\n  shimmer: 1.2,\n};\nconst FX_SPECKS = 16;\n\n/** Deterministic 0–1 noise so server and client scatter the specks alike. */\nconst fxNoise = (i: number, salt: number) => {\n  const x = Math.sin(i * 12.9898 + salt * 78.233) * 43758.5453;\n  return x - Math.floor(x);\n};\n\n/** Shows only a 2px ring at the padding edge — the track the orbit beams run in. */\nconst FX_RING_MASK: React.CSSProperties = {\n  WebkitMask: \"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",\n  WebkitMaskComposite: \"xor\",\n  mask: \"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",\n  maskComposite: \"exclude\",\n};\n\nconst SHARDS_FX_CSS = `\n@keyframes shards-fx-life { 0% { opacity: 0; } 8%, 75% { opacity: 1; } 100% { opacity: 0; } }\n@keyframes shards-fx-in { from { opacity: 0; } to { opacity: 1; } }\n@keyframes shards-fx-out { from { opacity: 1; } to { opacity: 0; } }\n@keyframes shards-fx-breathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.75; } }\n@keyframes shards-fx-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }\n@keyframes shards-fx-speck {\n  0% { opacity: 0; transform: translateY(0) scale(0.4); }\n  50% { opacity: 0.9; transform: translateY(-6px) scale(1.3); }\n  100% { opacity: 0; transform: translateY(-12px) scale(0.4); }\n}\n@keyframes shards-fx-orbit {\n  from { transform: translate(-50%, -50%) rotate(0deg); }\n  to { transform: translate(-50%, -50%) rotate(360deg); }\n}\n@keyframes shards-fx-sheen {\n  from { transform: translateX(-120%) skewX(-20deg); }\n  to { transform: translateX(420%) skewX(-20deg); }\n}\n@keyframes shards-fx-sheen-loop {\n  0% { transform: translateX(-120%) skewX(-20deg); }\n  40%, 100% { transform: translateX(420%) skewX(-20deg); }\n}\n@keyframes shards-fx-bloom {\n  0% { opacity: 0; transform: scale(0.98); }\n  35% { opacity: 0.6; }\n  100% { opacity: 0; transform: scale(1.04); }\n}\n@keyframes shards-fx-ping {\n  0% { transform: scale(1); opacity: 0.85; }\n  70%, 100% { transform: scale(1.18, 1.55); opacity: 0; }\n}\n@keyframes shards-fx-aura { 0% { opacity: 0.95; } 45% { opacity: 0.6; } 100% { opacity: 0; } }\n`;\n\n/**\n * One effect layer over a control tile, tinted by `color` (the theme primary\n * when omitted). `once` runs its single play and calls `onDone`; `continuous`\n * fades in, loops, and fades out when `leaving` turns on, then calls `onDone`.\n */\nfunction ShardsEffectLayer({\n  effect,\n  mode,\n  leaving = false,\n  color,\n  onDone,\n}: {\n  effect: PlayableShardsEffect;\n  mode: ShardsEffectMode;\n  leaving?: boolean;\n  color?: string;\n  onDone: () => void;\n}) {\n  const loop = mode === \"continuous\";\n  // The same layers serve both modes: once they play a single time, looped\n  // they repeat forever while the wrapper holds them on screen.\n  const run = (name: string, seconds: number, ease: string, delay = 0): React.CSSProperties => ({\n    animation: `${name} ${seconds}s ${ease} ${delay}s ${loop ? \"infinite\" : 1} both`,\n  });\n  const life = loop\n    ? `${leaving ? \"shards-fx-out\" : \"shards-fx-in\"} 0.4s ease-out both`\n    : `shards-fx-life ${FX_ONCE_S[effect]}s linear both`;\n\n  return (\n    <span\n      aria-hidden\n      onAnimationEnd={(e) => {\n        if (e.target === e.currentTarget && (!loop || leaving)) onDone();\n      }}\n      className=\"pointer-events-none absolute inset-0 z-0 rounded-xl text-primary\"\n      style={{ animation: life, color }}\n    >\n      <style dangerouslySetInnerHTML={{ __html: SHARDS_FX_CSS }} />\n\n      {/* Max-effort sky: a glow rising from the floor and twinkling specks. */}\n      {effect === \"sparkle\" && (\n        <span className=\"absolute inset-0 overflow-hidden rounded-xl\">\n          <span className=\"absolute inset-0 bg-[radial-gradient(ellipse_at_bottom,currentColor,transparent_70%)] opacity-20\" />\n          <span className=\"absolute inset-0 opacity-40\">\n            <span\n              className=\"absolute inset-x-4 bottom-0 h-full bg-[radial-gradient(ellipse_at_bottom,currentColor,transparent_60%)] blur-md\"\n              style={run(\"shards-fx-breathe\", loop ? 3.2 : 1.1, \"ease-in-out\")}\n            />\n          </span>\n          {Array.from({ length: FX_SPECKS }).map((_, i) => {\n            const size = 1.5 + fxNoise(i, 3) * 2;\n            return (\n              <span\n                key={i}\n                className=\"absolute rounded-full bg-current\"\n                style={{\n                  left: `${fxNoise(i, 1) * 100}%`,\n                  top: `${100 - Math.pow(fxNoise(i, 2), 2) * 85}%`,\n                  width: size,\n                  height: size,\n                  boxShadow: \"0 0 6px 1px currentColor\",\n                  // A single play squeezes the twinkles into its window.\n                  ...run(\n                    \"shards-fx-speck\",\n                    loop ? 1.8 + fxNoise(i, 4) * 2.4 : 1 + fxNoise(i, 4) * 0.8,\n                    \"ease-in-out\",\n                    fxNoise(i, 5) * (loop ? 3 : 0.9),\n                  ),\n                }}\n              />\n            );\n          })}\n        </span>\n      )}\n\n      {/* Premium lap: two beams run the edge, a sheen crosses, a halo blooms. */}\n      {effect === \"orbit\" && (\n        <>\n          <span className=\"absolute inset-0 opacity-70\">\n            <span\n              className=\"absolute inset-0 rounded-xl\"\n              style={{\n                boxShadow: \"0 0 18px 4px currentColor\",\n                ...(loop\n                  ? run(\"shards-fx-breathe\", 2.8, \"ease-in-out\")\n                  : run(\"shards-fx-bloom\", 1.1, \"cubic-bezier(0, 0, 0.58, 1)\", 0.1)),\n              }}\n            />\n          </span>\n          <span className=\"absolute inset-0 overflow-hidden rounded-xl\">\n            <span\n              className=\"absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r from-transparent via-current to-transparent opacity-25\"\n              style={\n                loop\n                  ? run(\"shards-fx-sheen-loop\", 2.8, \"cubic-bezier(0.42, 0, 0.58, 1)\")\n                  : run(\"shards-fx-sheen\", 1, \"cubic-bezier(0.42, 0, 0.58, 1)\", 0.15)\n              }\n            />\n          </span>\n          <span className=\"absolute inset-0 overflow-hidden rounded-xl p-[2px]\" style={FX_RING_MASK}>\n            <span\n              className=\"absolute left-1/2 top-1/2 aspect-square w-[150%]\"\n              style={{\n                background:\n                  \"conic-gradient(from 0deg, transparent 0deg, currentColor 50deg, transparent 90deg, transparent 180deg, currentColor 230deg, transparent 270deg)\",\n                ...(loop\n                  ? run(\"shards-fx-orbit\", 2.8, \"linear\")\n                  : run(\"shards-fx-orbit\", FX_ONCE_S.orbit, \"cubic-bezier(0.45, 0, 0.2, 1)\")),\n              }}\n            />\n          </span>\n        </>\n      )}\n\n      {/* Beacon: a filled ping, a trailing border ping and a soft aura. */}\n      {effect === \"beacon\" && (\n        <>\n          <span\n            className=\"absolute inset-0 rounded-xl bg-current/25\"\n            style={run(\"shards-fx-ping\", loop ? 2.2 : 1.8, \"cubic-bezier(0, 0, 0.2, 1)\")}\n          />\n          <span\n            className=\"absolute inset-0 rounded-xl border-2 border-current/50\"\n            style={run(\"shards-fx-ping\", loop ? 2.2 : 1.8, \"cubic-bezier(0, 0, 0.2, 1)\", 0.15)}\n          />\n          <span\n            className=\"absolute -inset-1.5 rounded-xl bg-current/25 blur-md\"\n            style={run(\"shards-fx-aura\", loop ? 2.2 : 1.8, \"ease-out\")}\n          />\n        </>\n      )}\n\n      {/* Shimmer: a bright band wipes across while the tile and its edge flash. */}\n      {effect === \"shimmer\" && (\n        <>\n          <span\n            className=\"absolute inset-0 rounded-xl bg-current/15\"\n            style={loop ? run(\"shards-fx-breathe\", 2.4, \"ease-in-out\") : run(\"shards-fx-flash\", 1.1, \"ease-out\")}\n          />\n          <span className=\"absolute inset-0 overflow-hidden rounded-xl\">\n            <span\n              className=\"absolute inset-y-0 left-0 w-1/2 bg-gradient-to-r from-transparent via-current to-transparent opacity-40\"\n              style={\n                loop\n                  ? run(\"shards-fx-sheen-loop\", 2.4, \"cubic-bezier(0.42, 0, 0.58, 1)\")\n                  : run(\"shards-fx-sheen\", 1, \"cubic-bezier(0.16, 1, 0.3, 1)\")\n              }\n            />\n          </span>\n          <span className=\"absolute inset-0 opacity-70\">\n            <span\n              className=\"absolute inset-0 rounded-xl\"\n              style={{\n                boxShadow: \"0 0 0 1.5px currentColor, 0 0 16px 2px currentColor\",\n                ...(loop ? run(\"shards-fx-breathe\", 2.4, \"ease-in-out\") : run(\"shards-fx-flash\", 1.1, \"ease-out\")),\n              }}\n            />\n          </span>\n        </>\n      )}\n    </span>\n  );\n}\n\nfunction usePrefersReducedMotion() {\n  const [reduce, setReduce] = useState(false);\n  useEffect(() => {\n    const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n    const sync = () => setReduce(query.matches);\n    sync();\n    query.addEventListener(\"change\", sync);\n    return () => query.removeEventListener(\"change\", sync);\n  }, []);\n  return reduce;\n}\n\n/**\n * Keeps something mounted while `active`, and on through its exit: `leaving`\n * is on between `active` turning off and the caller reporting `done`.\n */\nfunction useLinger(active: boolean) {\n  const [mounted, setMounted] = useState(active);\n  if (active && !mounted) setMounted(true);\n  return {\n    mounted,\n    leaving: mounted && !active,\n    done: React.useCallback(() => setMounted(false), []),\n  };\n}\n\n/**\n * The \"shards-control\" variant is a whole control tile — select, toggle,\n * colour and slider — with state of its own. It lives in its own component so\n * its hooks run unconditionally; `Button` hands off to it for that variant.\n */\ntype ShardsControlTileProps = Pick<\n  ButtonProps,\n  | \"controlType\"\n  | \"label\"\n  | \"value\"\n  | \"options\"\n  | \"checked\"\n  | \"onCheckedChange\"\n  | \"colorHex\"\n  | \"onColorChange\"\n  | \"min\"\n  | \"max\"\n  | \"step\"\n  | \"onValueChange\"\n  | \"effect\"\n  | \"effectMode\"\n  | \"effectActive\"\n  | \"className\"\n  | \"children\"\n> & {\n  style?: React.CSSProperties;\n  forwardedRef: React.ForwardedRef<HTMLButtonElement>;\n};\n\nconst ShardsControlTile = ({\n  controlType = \"select\",\n  label,\n  value,\n  options = [],\n  checked = false,\n  onCheckedChange,\n  colorHex,\n  onColorChange,\n  min = 0,\n  max = 10,\n  step = 0.1,\n  onValueChange,\n  effect,\n  effectMode = \"once\",\n  effectActive,\n  className,\n  children,\n  style,\n  forwardedRef,\n}: ShardsControlTileProps) => {\n    // `??`, not `||`: a defined `colorHex` (even \"\") is what the tile shows, as the old mount-time sync made it.\n    const [internalColor, setInternalColor] = useState(colorHex ?? \"#896abd\");\n    const [internalVal, setInternalVal] = useState(value !== undefined ? String(value) : (options[0] || \"1\"));\n    const [internalChecked, setInternalChecked] = useState(Boolean(checked));\n    const [colorKey, setColorKey] = useState(0);\n\n    const [isSelectOpen, setIsSelectOpen] = useState(false);\n    const [isColorOpen, setIsColorOpen] = useState(false);\n    const [isDraggingSlider, setIsDraggingSlider] = useState(false);\n\n    const containerRef = React.useRef<HTMLDivElement>(null);\n    const sliderRef = React.useRef<HTMLDivElement>(null);\n    // The tile's root element (the slider track, or the tile itself) is what\n    // the Button's ref receives. No deps: re-attached on every commit, as the\n    // inline ref callbacks this replaces were.\n    React.useImperativeHandle(\n      forwardedRef,\n      () => (controlType === \"slider\" ? sliderRef.current : containerRef.current) as unknown as HTMLButtonElement,\n    );\n\n    // Outside click listener to dismiss open popovers\n    useEffect(() => {\n      if (!isSelectOpen && !isColorOpen) return;\n      const handleOutsideClick = (e: MouseEvent) => {\n        if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n          setIsSelectOpen(false);\n          setIsColorOpen(false);\n        }\n      };\n      document.addEventListener(\"mousedown\", handleOutsideClick);\n      return () => document.removeEventListener(\"mousedown\", handleOutsideClick);\n    }, [isSelectOpen, isColorOpen]);\n\n    // Keep internal state updated if props change dynamically: compared with\n    // the props last seen and adjusted while rendering.\n    const [seenProps, setSeenProps] = useState({ colorHex, value, checked });\n    if (!Object.is(seenProps.colorHex, colorHex) || !Object.is(seenProps.value, value) || !Object.is(seenProps.checked, checked)) {\n      setSeenProps({ colorHex, value, checked });\n      if (!Object.is(seenProps.colorHex, colorHex) && colorHex !== undefined) setInternalColor(colorHex);\n      if (!Object.is(seenProps.value, value) && value !== undefined) setInternalVal(String(value));\n      if (!Object.is(seenProps.checked, checked) && checked !== undefined) setInternalChecked(Boolean(checked));\n    }\n\n    const displayLabel = label || children || \"Shards\";\n    const displayColor = internalColor;\n    const displayValue = internalVal;\n    const displayChecked = internalChecked;\n\n    const handleColorChange = (newHex: string) => {\n      setInternalColor(newHex);\n      setColorKey((prev) => prev + 1);\n      onColorChange?.(newHex);\n    };\n\n    // Calculate numeric percentage for slider fill (0% to 100%)\n    const numVal = !isNaN(Number(displayValue)) ? Number(displayValue) : min;\n    const percentage = Math.max(0, Math.min(100, ((numVal - min) / (max - min)) * 100));\n\n    // Ref to track if slider was already at 100% so pulse triggers exactly ONCE per 100% arrival\n    const wasAt100Ref = React.useRef(percentage >= 99.5 || numVal >= max);\n    const [sliderPulseKey, setSliderPulseKey] = useState(0);\n\n    // Watch percentage to trigger pulse on 100% arrival\n    useEffect(() => {\n      if (controlType !== \"slider\") return;\n      const isAt100 = percentage >= 99.5 || numVal >= max;\n      if (isAt100) {\n        if (!wasAt100Ref.current) {\n          setSliderPulseKey((k) => k + 1);\n          wasAt100Ref.current = true;\n        }\n      } else {\n        wasAt100Ref.current = false;\n      }\n    }, [percentage, numVal, max, controlType]);\n\n    // ── Effects ──────────────────────────────────────────────\n    // What an effect reacts to: a slider at full, a toggle that is on, or\n    // the current pick of a select / colour tile.\n    const isAtMax = percentage >= 99.5 || numVal >= max;\n    const fxSignal =\n      controlType === \"slider\"\n        ? isAtMax\n        : controlType === \"toggle\"\n          ? displayChecked\n          : controlType === \"color\"\n            ? displayColor\n            : displayValue;\n    const playable = effect && effect !== \"none\" ? effect : null;\n    const reduceMotion = usePrefersReducedMotion();\n    // The running `once` play (0 = idle). A landing while one is still\n    // playing is folded into it, so dragging a colour doesn't restart it.\n    const [fxPlay, setFxPlay] = useState(0);\n    // Every play gets a fresh key, so a new landing restarts the layer.\n    const [fxSeq, setFxSeq] = useState(0);\n    const [hasPicked, setHasPicked] = useState(false);\n    // A landing is a change of signal, noticed while rendering.\n    const [lastSignal, setLastSignal] = useState(fxSignal);\n    if (lastSignal !== fxSignal) {\n      setLastSignal(fxSignal);\n      // Booleans land on the way up only: filling the slider, switching on.\n      if (fxSignal !== false) {\n        if (typeof fxSignal !== \"boolean\") setHasPicked(true);\n        if (playable && effectMode === \"once\" && !reduceMotion && fxPlay === 0) {\n          setFxSeq(fxSeq + 1);\n          setFxPlay(fxSeq + 1);\n        }\n      }\n    }\n\n    const loopOn =\n      Boolean(playable) &&\n      effectMode === \"continuous\" &&\n      !reduceMotion &&\n      (effectActive ?? (typeof fxSignal === \"boolean\" ? fxSignal : hasPicked));\n    const loopLayer = useLinger(loopOn);\n    const fxTint = controlType === \"color\" ? displayColor : undefined;\n    const effectLayers = playable && (\n      <>\n        {loopLayer.mounted && (\n          <ShardsEffectLayer\n            effect={playable}\n            mode=\"continuous\"\n            leaving={loopLayer.leaving}\n            color={fxTint}\n            onDone={loopLayer.done}\n          />\n        )}\n        {fxPlay > 0 && (\n          <ShardsEffectLayer\n            key={fxPlay}\n            effect={playable}\n            mode=\"once\"\n            color={fxTint}\n            onDone={() => setFxPlay(0)}\n          />\n        )}\n      </>\n    );\n\n    // Dragging logic for full-tile slider\n    const handleSliderMove = React.useCallback(\n      (clientX: number) => {\n        if (!sliderRef.current) return;\n        const rect = sliderRef.current.getBoundingClientRect();\n        const offsetX = Math.max(0, Math.min(rect.width, clientX - rect.left));\n        const ratio = offsetX / rect.width;\n        let rawVal = min + ratio * (max - min);\n\n        // Round to step precision\n        if (step) {\n          const precision = (step.toString().split(\".\")[1] || \"\").length;\n          rawVal = Number(Math.round(Number(rawVal + \"e\" + precision)) + \"e-\" + precision);\n        }\n        const clampedVal = Math.max(min, Math.min(max, rawVal));\n        const valStr = step < 1 ? clampedVal.toFixed(1) : String(Math.round(clampedVal));\n\n        setInternalVal(valStr);\n        onValueChange?.(Number(valStr));\n      },\n      [min, max, step, onValueChange]\n    );\n\n    const handleMouseDown = (e: React.MouseEvent<HTMLDivElement>) => {\n      if (controlType !== \"slider\") return;\n      setIsDraggingSlider(true);\n      handleSliderMove(e.clientX);\n    };\n\n    const handleTouchStart = (e: React.TouchEvent<HTMLDivElement>) => {\n      if (controlType !== \"slider\") return;\n      if (e.touches[0]) {\n        setIsDraggingSlider(true);\n        handleSliderMove(e.touches[0].clientX);\n      }\n    };\n\n    useEffect(() => {\n      if (!isDraggingSlider) return;\n\n      const onMouseMove = (e: MouseEvent) => handleSliderMove(e.clientX);\n      const onMouseUp = () => setIsDraggingSlider(false);\n      const onTouchMove = (e: TouchEvent) => {\n        if (e.touches[0]) handleSliderMove(e.touches[0].clientX);\n      };\n      const onTouchEnd = () => setIsDraggingSlider(false);\n\n      window.addEventListener(\"mousemove\", onMouseMove);\n      window.addEventListener(\"mouseup\", onMouseUp);\n      window.addEventListener(\"touchmove\", onTouchMove, { passive: true });\n      window.addEventListener(\"touchend\", onTouchEnd);\n\n      return () => {\n        window.removeEventListener(\"mousemove\", onMouseMove);\n        window.removeEventListener(\"mouseup\", onMouseUp);\n        window.removeEventListener(\"touchmove\", onTouchMove);\n        window.removeEventListener(\"touchend\", onTouchEnd);\n      };\n    }, [isDraggingSlider, handleSliderMove]);\n\n    // Handle tile click for non-slider controls\n    const handleTileClick = (e: React.MouseEvent<HTMLDivElement>) => {\n      if (controlType === \"slider\") return;\n      // Prevent tile click when clicking directly inside interactive child controls\n      if ((e.target as HTMLElement).closest(\".custom-control-interactive\")) return;\n\n      if (controlType === \"toggle\") {\n        const next = !displayChecked;\n        setInternalChecked(next);\n        onCheckedChange?.(next);\n      } else if (controlType === \"select\") {\n        setIsSelectOpen((prev) => !prev);\n      } else if (controlType === \"color\") {\n        setIsColorOpen((prev) => !prev);\n      }\n    };\n\n    /* SPECIAL RENDER FOR FULL TILE RANGE SLIDER BUTTON */\n    if (controlType === \"slider\") {\n      return (\n        <div className=\"relative w-full rounded-xl isolation-auto\" style={style}>\n          {/* Keyframes for Beacon Radar Pulse when reaching 100% */}\n          <style\n            dangerouslySetInnerHTML={{\n              __html: `\n                @keyframes beacon-ping-once {\n                  0% {\n                    transform: scale(1);\n                    opacity: 0.85;\n                  }\n                  70%, 100% {\n                    transform: scale(1.18, 1.55);\n                    opacity: 0;\n                  }\n                }\n                @keyframes beacon-aura-once {\n                  0% {\n                    opacity: 0.95;\n                  }\n                  45% {\n                    opacity: 0.6;\n                  }\n                  100% {\n                    opacity: 0;\n                  }\n                }\n              `,\n            }}\n          />\n\n          {/* Smooth Soft Aura Beacon Ring & Ping Wave on reaching 100% (Identical to Beacon Pulse button variant) */}\n          {effect === undefined && sliderPulseKey > 0 && (\n            <div key={`beacon-pulse-${sliderPulseKey}`} className=\"absolute inset-0 z-0 pointer-events-none\">\n              {/* Primary Ping Expanding Radar Ring */}\n              <span\n                className=\"absolute inset-0 rounded-xl bg-primary/40 pointer-events-none\"\n                style={{\n                  animation: \"beacon-ping-once 1.8s cubic-bezier(0, 0, 0.2, 1) forwards\",\n                }}\n              />\n              {/* Secondary Offset Border Ping Ring */}\n              <span\n                className=\"absolute inset-0 rounded-xl border-2 border-primary/50 pointer-events-none\"\n                style={{\n                  animation: \"beacon-ping-once 1.8s cubic-bezier(0, 0, 0.2, 1) 0.15s forwards\",\n                }}\n              />\n              {/* Soft Aura Glow */}\n              <span\n                className=\"absolute -inset-1.5 rounded-xl bg-primary/25 blur-md pointer-events-none\"\n                style={{\n                  animation: \"beacon-aura-once 1.8s ease-out forwards\",\n                }}\n              />\n            </div>\n          )}\n\n          <div\n            ref={sliderRef}\n            onMouseDown={handleMouseDown}\n            onTouchStart={handleTouchStart}\n            className={cn(\n              \"relative z-10 flex items-center justify-between w-full h-12 px-4 rounded-xl border select-none group cursor-pointer transition-all duration-200\",\n              \"bg-background/90 dark:bg-card/90\",\n              isAtMax\n                ? \"border-primary/50 shadow-[0_0_12px_color-mix(in_oklab,var(--primary)_20%,transparent)]\"\n                : \"border-border/80\",\n              className\n            )}\n          >\n            {/* Filled Active Drag Pill Surface with vertical border line & handle cursor */}\n            <div\n              className=\"absolute left-0 top-0 bottom-0 bg-primary/15 rounded-xl transition-all duration-75 pointer-events-none border-r-2 border-primary/30\"\n              style={{ width: `${percentage}%` }}\n            >\n              {/* Invisible Edge Drag Indicator with cursor-ew-resize */}\n              <span className=\"absolute right-0 top-0 bottom-0 w-3 -mr-1.5 cursor-ew-resize pointer-events-auto\" />\n            </div>\n\n            {effectLayers}\n\n            {/* Label on Left */}\n            <span className=\"relative z-10 text-foreground font-semibold text-xs tracking-wide pointer-events-none\">\n              {displayLabel}\n            </span>\n\n            {/* Value Display on Right */}\n            <span className=\"relative z-10 font-mono text-xs font-semibold text-foreground pointer-events-none\">\n              {displayValue}\n            </span>\n          </div>\n        </div>\n      );\n    }\n\n    return (\n      <div\n        ref={containerRef}\n        onClick={handleTileClick}\n        className={cn(\n          \"relative flex items-center justify-between w-full h-12 px-4 py-2.5 rounded-xl border backdrop-blur-md text-xs font-semibold select-none group cursor-pointer transition-colors duration-200\",\n          (isSelectOpen || isColorOpen) ? \"z-30\" : \"z-10\",\n          \"bg-background/90 text-foreground border-border/80 dark:bg-card/90\",\n          className\n        )}\n        style={style}\n      >\n        {/* Shards Color Animation Keyframes */}\n        <style\n          dangerouslySetInnerHTML={{\n            __html: `\n              @keyframes shards-sweep-anim {\n                0% {\n                  transform: translateX(-120%) skewX(-20deg);\n                  opacity: 0;\n                }\n                20% {\n                  opacity: 0.95;\n                }\n                75% {\n                  opacity: 0.95;\n                }\n                100% {\n                  transform: translateX(220%) skewX(-20deg);\n                  opacity: 0;\n                }\n              }\n              @keyframes shards-bg-pulse {\n                0% {\n                  opacity: 0;\n                }\n                25% {\n                  opacity: 0.45;\n                }\n                70% {\n                  opacity: 0.2;\n                }\n                100% {\n                  opacity: 0;\n                }\n              }\n              @keyframes shards-border-glow {\n                0% {\n                  opacity: 0;\n                }\n                25% {\n                  opacity: 1;\n                }\n                100% {\n                  opacity: 0;\n                }\n              }\n              @keyframes shards-radial-burst {\n                0% {\n                  transform: scale(0.1);\n                  opacity: 0.95;\n                }\n                50% {\n                  opacity: 0.6;\n                }\n                100% {\n                  transform: scale(4);\n                  opacity: 0;\n                }\n              }\n            `,\n          }}\n        />\n\n        {/* Dynamic Animated Background Effect on Color Change */}\n        {effect === undefined && controlType === \"color\" && colorKey > 0 && (\n          <div\n            key={`shards-color-anim-${colorKey}`}\n            className=\"absolute inset-0 rounded-xl overflow-hidden pointer-events-none z-0\"\n            style={{ borderRadius: \"inherit\" }}\n          >\n            {/* Ambient Background Glow Flash */}\n            <div\n              className=\"absolute inset-0 rounded-xl pointer-events-none\"\n              style={{\n                borderRadius: \"inherit\",\n                backgroundColor: displayColor,\n                animation: \"shards-bg-pulse 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards\",\n              }}\n            />\n\n            {/* Radial Color Shockwave Burst from the right (color indicator) */}\n            <div\n              className=\"absolute right-6 top-1/2 -translate-y-1/2 w-28 h-28 -mr-14 -mt-14 rounded-full pointer-events-none\"\n              style={{\n                background: `radial-gradient(circle, ${colorWithAlpha(displayColor, 0.85)} 0%, ${colorWithAlpha(displayColor, 0.4)} 45%, transparent 70%)`,\n                animation: \"shards-radial-burst 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards\",\n              }}\n            />\n\n            {/* Luminous Wave Sweep */}\n            <div\n              className=\"absolute inset-0 w-full h-full pointer-events-none\"\n              style={{\n                borderRadius: \"inherit\",\n                background: `linear-gradient(90deg, transparent 0%, ${colorWithAlpha(displayColor, 0.25)} 15%, ${colorWithAlpha(displayColor, 0.95)} 50%, ${colorWithAlpha(displayColor, 0.25)} 85%, transparent 100%)`,\n                animation: \"shards-sweep-anim 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards\",\n              }}\n            />\n\n            {/* Glowing Border Pulse Ring */}\n            <div\n              className=\"absolute inset-0 rounded-xl pointer-events-none\"\n              style={{\n                borderRadius: \"inherit\",\n                boxShadow: `0 0 0 2px ${displayColor}, 0 0 20px 4px ${colorWithAlpha(displayColor, 0.6)}`,\n                animation: \"shards-border-glow 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards\",\n              }}\n            />\n          </div>\n        )}\n\n        {effectLayers}\n\n        {/* Label on Left */}\n        <span className=\"relative z-10 text-foreground/90 font-semibold tracking-wide truncate max-w-[60%] transition-colors duration-200 pointer-events-none\">\n          {displayLabel}\n        </span>\n\n        {/* Right Control UI depending on controlType */}\n        <div className=\"flex items-center gap-2.5 shrink-0 relative z-20\">\n          {/* 1. Custom Color Picker Trigger */}\n          {controlType === \"color\" && (\n            <div className=\"custom-control-interactive\">\n              <button\n                type=\"button\"\n                onClick={(e) => {\n                  e.stopPropagation();\n                  setIsColorOpen(!isColorOpen);\n                }}\n                className=\"flex items-center gap-2 transition-transform active:scale-95 cursor-pointer\"\n              >\n                <span\n                  className=\"w-5 h-5 rounded-md shadow-xs border-0 transition-transform duration-200 hover:scale-105\"\n                  style={{ backgroundColor: displayColor }}\n                />\n                <span className=\"font-mono text-xs text-foreground font-medium px-2.5 py-1.5 rounded-lg bg-muted border-0\">\n                  {displayColor}\n                </span>\n              </button>\n            </div>\n          )}\n\n          {/* 2. Custom Animated Dropdown Select Trigger */}\n          {controlType === \"select\" && (\n            <div className=\"custom-control-interactive\">\n              <button\n                type=\"button\"\n                onClick={(e) => {\n                  e.stopPropagation();\n                  setIsSelectOpen(!isSelectOpen);\n                }}\n                className=\"flex items-center gap-1.5 text-foreground/90 text-xs font-semibold px-2 py-1 rounded-md transition-all duration-200 hover:text-primary active:scale-95 cursor-pointer\"\n              >\n                <span className=\"truncate\">{displayValue || \"Select\"}</span>\n                <span className={cn(\"text-foreground/70 text-[10px] transition-transform duration-200\", isSelectOpen && \"rotate-180\")}>\n                  ▲\n                </span>\n              </button>\n            </div>\n          )}\n\n          {/* 3. Toggle Switch Control */}\n          {controlType === \"toggle\" && (\n            <button\n              type=\"button\"\n              role=\"switch\"\n              aria-checked={displayChecked}\n              onClick={(e) => {\n                e.stopPropagation();\n                const next = !displayChecked;\n                setInternalChecked(next);\n                onCheckedChange?.(next);\n              }}\n              className={cn(\n                \"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary/40 custom-control-interactive\",\n                displayChecked ? \"bg-primary\" : \"bg-muted\"\n              )}\n            >\n              <span\n                className={cn(\n                  \"pointer-events-none inline-block h-4 w-4 transform rounded-full shadow-md ring-0 transition duration-300 ease-in-out\",\n                  displayChecked\n                    ? \"translate-x-4 bg-primary-foreground\"\n                    : \"translate-x-0 bg-background dark:bg-foreground\"\n                )}\n              />\n            </button>\n          )}\n        </div>\n\n        {/* Full-Width Floating Color Picker Modal (Matching user uploaded design) */}\n        {controlType === \"color\" && isColorOpen && (\n          <ColorPickerPopover\n            color={displayColor}\n            onChange={(newHex) => {\n              handleColorChange(newHex);\n            }}\n            onClose={() => setIsColorOpen(false)}\n          />\n        )}\n\n        {/* Full-Width Floating Dropdown Menu (Exact parent tile button width with tight mt-1 gap) */}\n        {controlType === \"select\" && isSelectOpen && (\n          <>\n            <div\n              className=\"fixed inset-0 z-40\"\n              onClick={(e) => {\n                e.stopPropagation();\n                setIsSelectOpen(false);\n              }}\n            />\n            <div className=\"absolute left-0 right-0 top-full mt-1 z-50 py-2 px-1 rounded-2xl border border-border/80 bg-popover text-popover-foreground shadow-lg flex flex-col gap-1 overflow-hidden animate-in fade-in-0 zoom-in-95 duration-150 custom-control-interactive\">\n              {(options.length > 0 ? options : [\"Right\", \"Left\", \"Center\", \"Full\"]).map((opt) => (\n                <button\n                  key={opt}\n                  type=\"button\"\n                  onClick={(e) => {\n                    e.stopPropagation();\n                    setInternalVal(opt);\n                    onValueChange?.(opt);\n                    setIsSelectOpen(false);\n                  }}\n                  className={cn(\n                    \"w-full text-left px-4 py-2 text-xs font-medium transition-colors duration-150 rounded-xl hover:bg-muted/80 cursor-pointer\",\n                    displayValue === opt\n                      ? \"text-foreground font-semibold\"\n                      : \"text-muted-foreground\"\n                  )}\n                >\n                  {opt}\n                </button>\n              ))}\n            </div>\n          </>\n        )}\n      </div>\n    );\n};\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n  (\n    {\n      className,\n      variant = \"outline\",\n      size = \"default\",\n      children,\n      loading,\n      color,\n      onClick,\n      iconLeft,\n      iconRight,\n      showArrow,\n      style,\n      controlType = \"select\",\n      label,\n      value,\n      options = [],\n      checked = false,\n      onCheckedChange,\n      colorHex,\n      onColorChange,\n      min = 0,\n      max = 10,\n      step = 0.1,\n      onValueChange,\n      effect,\n      effectMode,\n      effectActive,\n      ...props\n    },\n    ref,\n  ) => {\n    const [ripples, setRipples] = useState<Ripple[]>([]);\n\n    const iconOnly = !children && Boolean(iconLeft || iconRight);\n    const combinedStyle = { ...getButtonThemeStyle(color), ...style };\n\n    useEffect(() => {\n      const styleId = \"ripple-animation-style\";\n      if (document.getElementById(styleId)) return;\n\n      const style = document.createElement(\"style\");\n      style.id = styleId;\n      style.innerHTML = `\n            @keyframes ripple-effect {\n                from {\n                    transform: scale(0);\n                    opacity: 1;\n                }\n                to {\n                    transform: scale(2);\n                    opacity: 0;\n                }\n            }\n            .animate-ripple {\n                animation: ripple-effect 0.7s ease-out forwards;\n            }\n        `;\n      document.head.appendChild(style);\n    }, []);\n\n    const createRipple = (event: React.MouseEvent<HTMLButtonElement>) => {\n      if (loading) return;\n\n      const button = event.currentTarget;\n      const rect = button.getBoundingClientRect();\n      const rippleSize = Math.max(rect.width, rect.height);\n      const x = event.clientX - rect.left - rippleSize / 2;\n      const y = event.clientY - rect.top - rippleSize / 2;\n\n      const newRipple: Ripple = { x, y, size: rippleSize, id: Date.now() };\n\n      setRipples((currentRipples) => [...currentRipples, newRipple]);\n\n      setTimeout(() => {\n        setRipples((currentRipples) => currentRipples.slice(1));\n      }, 700);\n\n      onClick?.(event);\n    };\n\n    const baseClasses =\n      variant === \"slide-icon\" ||\n      variant === \"slide-icon-loop\" ||\n      variant === \"slide-text\" ||\n      variant === \"slide-text-down\" ||\n      variant === \"slide-text-bounce\"\n        ? \"relative inline-flex items-center justify-center rounded-xl text-sm font-semibold transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:pointer-events-none active:scale-[0.97] cursor-pointer group bg-background text-foreground border border-border hover:bg-primary hover:text-primary-foreground shadow-xs overflow-hidden\"\n        : variant === \"expand-icon\" || variant === \"slide-bg\"\n        ? \"relative inline-flex items-center justify-center rounded-xl text-sm font-semibold transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:pointer-events-none active:scale-[0.97] cursor-pointer group bg-background text-foreground border border-border shadow-xs overflow-hidden\"\n        : \"relative inline-flex items-center justify-center rounded-xl text-sm font-semibold transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:pointer-events-none active:scale-[0.97] cursor-pointer group bg-background text-foreground border border-border hover:bg-primary hover:text-primary-foreground shadow-xs\";\n\n    const sizeClasses = {\n      default: iconOnly ? \"h-12 w-12 p-0\" : \"h-12 py-2.5 px-6\",\n      sm: iconOnly ? \"h-10 w-10 p-0\" : \"h-10 px-4 rounded-lg text-xs\",\n      lg: iconOnly ? \"h-14 w-14 p-0\" : \"h-14 px-8 rounded-xl text-base\",\n    };\n\n    const rippleColor = \"bg-primary/10 dark:bg-white/10\";\n\n    const activeIcon = iconRight || iconLeft;\n\n    // The plain surfaces short-circuit ahead of every animated variant: they\n    // share one render and differ only by the token classes above.\n    if (PLAIN_VARIANTS[variant]) {\n      const isPricingVariant = typeof variant === \"string\" && variant.startsWith(\"pricing-\");\n      const isTypographic = variant === \"pricing-typographic\" || variant === \"pricing-typographic-muted\";\n      const isTypographicMuted = variant === \"pricing-typographic-muted\";\n      return (\n        <button\n          className={cn(\n            \"group relative inline-flex items-center justify-center border text-sm font-semibold transition-all duration-300 overflow-hidden cursor-pointer\",\n            \"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n            \"disabled:opacity-50 disabled:pointer-events-none\",\n            isPricingVariant\n              ? \"gap-2.5 font-sans rounded-lg\"\n              : \"rounded-xl shadow-xs active:scale-[0.97]\",\n            !isPricingVariant && sizeClasses[size],\n            PLAIN_VARIANTS[variant],\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          style={combinedStyle}\n          {...props}\n        >\n          {/* Typographic sliding curtain effect */}\n          {isTypographic && (\n            <div\n              className={cn(\n                \"absolute inset-0 translate-y-[100%] rounded-[inherit] group-hover:translate-y-0 transition-transform duration-500 ease-[cubic-bezier(0.19,1,0.22,1)] pointer-events-none\",\n                isTypographicMuted ? \"bg-primary\" : \"bg-black/20\",\n              )}\n            />\n          )}\n\n          <span\n            className={cn(\n              \"relative z-10 inline-flex items-center justify-center gap-3 transition-colors duration-500\",\n              isTypographicMuted && \"group-hover:text-primary-foreground\",\n            )}\n          >\n            {loading && <Loader2 className=\"h-4 w-4 animate-spin\" />}\n            {!loading && iconLeft && (\n              <span className=\"inline-flex items-center\">{iconLeft}</span>\n            )}\n            {children}\n            {!loading && (iconRight || (showArrow && !iconRight)) && (\n              isTypographic && !iconRight ? (\n                <div className=\"relative z-10 w-4 h-4 overflow-hidden flex items-center\">\n                  <ArrowRightIcon className=\"absolute w-4 h-4 -translate-x-full group-hover:translate-x-0 transition-transform duration-500 ease-[cubic-bezier(0.19,1,0.22,1)]\" />\n                  <ArrowRightIcon className=\"absolute w-4 h-4 translate-x-0 group-hover:translate-x-full transition-transform duration-500 ease-[cubic-bezier(0.19,1,0.22,1)]\" />\n                </div>\n              ) : (\n                <span className=\"inline-flex items-center transition-transform duration-200 group-hover:translate-x-1\">\n                  {iconRight ?? <ArrowRightIcon className=\"w-4 h-4 stroke-[2] transition-transform duration-200 group-hover:translate-x-1\" />}\n                </span>\n              )\n            )}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Variant: Animated Customizable Control Tile with Custom Popover Dropdown & Custom Color Picker Modal\n    if (variant === \"shards-control\") {\n      return (\n        <ShardsControlTile\n          controlType={controlType}\n          label={label}\n          value={value}\n          options={options}\n          checked={checked}\n          onCheckedChange={onCheckedChange}\n          colorHex={colorHex}\n          onColorChange={onColorChange}\n          min={min}\n          max={max}\n          step={step}\n          onValueChange={onValueChange}\n          effect={effect}\n          effectMode={effectMode}\n          effectActive={effectActive}\n          className={className}\n          style={combinedStyle}\n          forwardedRef={ref}\n        >\n          {children}\n        </ShardsControlTile>\n      );\n    }\n\n    // Style 1: Upwards Text Roll (Initial text goes UP, duplicate comes from BOTTOM)\n    if (variant === \"slide-text\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Invisible copy holds the width; both visible labels are absolute\n              and travel the button's full height, so the outgoing one clears\n              the top edge completely and both land on the same centre. */}\n          <span aria-hidden className=\"invisible inline-flex items-center gap-2\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n          <span className=\"absolute inset-0 inline-flex items-center justify-center gap-2 transition-transform duration-300 ease-out group-hover:-translate-y-full\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n          <span aria-hidden className=\"absolute inset-0 inline-flex items-center justify-center gap-2 translate-y-full transition-transform duration-300 ease-out group-hover:translate-y-0\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Style 2: Downwards Text Roll (Initial text goes DOWN, duplicate comes from TOP)\n    if (variant === \"slide-text-down\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Same construction as slide-text, mirrored - see the note there. */}\n          <span aria-hidden className=\"invisible inline-flex items-center gap-2\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n          <span className=\"absolute inset-0 inline-flex items-center justify-center gap-2 transition-transform duration-300 ease-out group-hover:translate-y-full\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n          <span aria-hidden className=\"absolute inset-0 inline-flex items-center justify-center gap-2 -translate-y-full transition-transform duration-300 ease-out group-hover:translate-y-0\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Style 3: Homepage Hero Staggered Character Spring Bounce (Exact Homepage Hero Animation)\n    if (variant === \"slide-text-bounce\") {\n      const text = typeof children === \"string\" ? children : \"Spring Bounce\";\n      const letters = text.split(\"\");\n\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Main Initial Character Row (Spring Bounce Out Upwards on Hover) */}\n          <span className=\"inline-flex items-center justify-center\">\n            {loading && <Loader2 className=\"h-4 w-4 mr-2\" />}\n            {letters.map((char, index) => (\n              <span\n                key={index}\n                className=\"inline-block transition-all duration-300 group-hover:-translate-y-6 group-hover:opacity-0 group-hover:scale-50\"\n                style={{\n                  transitionDelay: `${index * 25}ms`,\n                  transitionTimingFunction: \"cubic-bezier(0.34, 1.56, 0.64, 1)\",\n                }}\n              >\n                {char === \" \" ? \"\\u00A0\" : char}\n              </span>\n            ))}\n          </span>\n\n          {/* Duplicate Character Row (Spring Bounce In from Bottom on Hover) */}\n          <span className=\"absolute inset-0 inline-flex items-center justify-center\">\n            {loading && <Loader2 className=\"h-4 w-4 mr-2\" />}\n            {letters.map((char, index) => (\n              <span\n                key={index}\n                className=\"inline-block translate-y-6 opacity-0 scale-50 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 group-hover:scale-100\"\n                style={{\n                  transitionDelay: `${index * 25}ms`,\n                  transitionTimingFunction: \"cubic-bezier(0.34, 1.56, 0.64, 1)\",\n                }}\n              >\n                {char === \" \" ? \"\\u00A0\" : char}\n              </span>\n            ))}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Variant: Expand Icon Color Fill (Ultra-slow 1.6s radial background expansion)\n    if (variant === \"expand-icon\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden transition-all duration-700\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Content Wrapper (Highest Z-index z-50 to guarantee text stays strictly on top of all bg layers) */}\n          <span className=\"relative z-50 flex items-center justify-center gap-3\">\n            {iconLeft && (\n              <span className=\"relative flex items-center justify-center h-7 w-7 rounded-full text-primary-foreground z-30 shrink-0 shadow-sm\">\n                {/* Layer 1: Initial Icon BG (Fades out on hover) */}\n                <span className=\"absolute inset-0 rounded-full bg-primary/20 transition-opacity duration-700 ease-in-out group-hover:opacity-0 pointer-events-none z-0\" />\n\n                {/* Layer 2: Hover Icon Circle BG (Fades in to theme primary-foreground on hover) */}\n                <span className=\"absolute inset-0 rounded-full bg-primary-foreground opacity-0 transition-opacity duration-700 ease-in-out group-hover:opacity-100 pointer-events-none z-10\" />\n\n                {/* Layer 3: Ultra-Slow 1.6s Radial Primary Layer (Scales out slowly from icon center to fill entire button) */}\n                <span className=\"absolute inset-0 rounded-full bg-primary transition-transform duration-[1600ms] [transition-timing-function:cubic-bezier(0.25,1,0.5,1)] group-hover:scale-[30] pointer-events-none -z-10\" />\n\n                {/* Icon Symbol: text-primary-foreground initially, text-primary on hover */}\n                <span className=\"relative z-20 flex items-center justify-center text-primary-foreground group-hover:text-primary transition-colors duration-700\">\n                  {loading ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : iconLeft}\n                </span>\n              </span>\n            )}\n\n            {/* Main Label Text (Elevated Z-Index z-50; transitions to primary-foreground on hover) */}\n            <span className=\"relative z-50 transition-colors duration-700 text-foreground group-hover:!text-primary-foreground font-semibold\">\n              {children}\n            </span>\n\n            {iconRight && !iconLeft && (\n              <span className=\"relative flex items-center justify-center h-7 w-7 rounded-full text-primary-foreground z-30 shrink-0 shadow-sm\">\n                {/* Layer 1: Initial Icon BG (Fades out on hover) */}\n                <span className=\"absolute inset-0 rounded-full bg-primary/20 transition-opacity duration-700 ease-in-out group-hover:opacity-0 pointer-events-none z-0\" />\n\n                {/* Layer 2: Hover Icon Circle BG (Fades in to theme primary-foreground on hover) */}\n                <span className=\"absolute inset-0 rounded-full bg-primary-foreground opacity-0 transition-opacity duration-700 ease-in-out group-hover:opacity-100 pointer-events-none z-10\" />\n\n                {/* Layer 3: Ultra-Slow 1.6s Radial Primary Layer (Scales out slowly from icon center to fill entire button) */}\n                <span className=\"absolute inset-0 rounded-full bg-primary transition-transform duration-[1600ms] [transition-timing-function:cubic-bezier(0.25,1,0.5,1)] group-hover:scale-[30] pointer-events-none -z-10\" />\n\n                {/* Icon Symbol: text-primary-foreground initially, text-primary on hover */}\n                <span className=\"relative z-20 flex items-center justify-center text-primary-foreground group-hover:text-primary transition-colors duration-700\">\n                  {loading ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : iconRight}\n                </span>\n              </span>\n            )}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Variant: Horizontal Slide Background Wipe (Background slides in from left to right on hover)\n    if (variant === \"slide-bg\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary -translate-x-full transition-transform duration-500 ease-out group-hover:translate-x-0 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Variant: Slide BG Top (Top to bottom fill)\n    if (variant === \"slide-bg-top\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary -translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Slide BG Bottom (Bottom to top fill)\n    if (variant === \"slide-bg-bottom\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Slide BG Right (Right to left fill)\n    if (variant === \"slide-bg-right\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary translate-x-full transition-transform duration-500 ease-out group-hover:translate-x-0 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Scale Up (Center pop scale background)\n    if (variant === \"scale-up\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary scale-0 transition-transform duration-500 ease-out group-hover:scale-100 rounded-xl pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Shine Sweep (Solid block color with border, 100% working auto-sweeping glare pass)\n    if (variant === \"shine-sweep\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 bg-primary text-primary-foreground border-2 border-primary/30 shadow-md\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Continuous Auto-Sweeping White Glare Beam */}\n          <span className=\"absolute inset-0 w-1/2 h-full bg-gradient-to-r from-transparent via-white/70 to-transparent -skew-x-12 animate-[shine-sweep-keyframe_2.5s_infinite] pointer-events-none z-10\" />\n\n          {/* Plain <style> rather than styled-jsx, which only compiles under\n              Next.js — everywhere else React rejects its unknown attribute and\n              TypeScript fails the build. */}\n          <style\n            dangerouslySetInnerHTML={{\n              __html: `@keyframes shine-sweep-keyframe {\n  0% { transform: translateX(-150%) skewX(-12deg); }\n  100% { transform: translateX(350%) skewX(-12deg); }\n}`,\n            }}\n          />\n\n          <span className=\"relative z-20 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && (\n              <span className=\"flex items-center justify-center\">{iconLeft}</span>\n            )}\n            {children}\n            {!loading && iconRight && (\n              <span className=\"flex items-center justify-center\">\n                {iconRight}\n              </span>\n            )}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Glow Pulse (Shadow pulse animation)\n    if (variant === \"glow-pulse\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground transition-all duration-300 hover:shadow-[0_0_25px_rgba(59,130,246,0.6)] hover:scale-[1.03]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Skew Slide (Diagonal skewed background slide)\n    if (variant === \"skew-slide\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary -skew-x-12 -translate-x-full transition-transform duration-500 ease-out group-hover:translate-x-0 group-hover:scale-125 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Border Expand (Outset border outline expansion)\n    if (variant === \"border-expand\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 transition-all duration-300 hover:ring-2 hover:ring-primary/30 hover:ring-offset-2 hover:ring-offset-background\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Icon Rotate (Icon 360 spin on hover)\n    if (variant === \"icon-rotate\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && (\n              <span className=\"transition-transform duration-500 group-hover:rotate-180\">\n                {iconLeft}\n              </span>\n            )}\n            {children}\n            {!loading && iconRight && (\n              <span className=\"transition-transform duration-500 group-hover:rotate-180\">\n                {iconRight}\n              </span>\n            )}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Icon Bounce (Icon spring bounce on hover)\n    if (variant === \"icon-bounce\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && (\n              <span className=\"transition-transform duration-300 group-hover:-translate-y-1\">\n                {iconLeft}\n              </span>\n            )}\n            {children}\n            {!loading && iconRight && (\n              <span className=\"transition-transform duration-300 group-hover:translate-x-1.5\">\n                {iconRight}\n              </span>\n            )}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Icon Spin (Infinite smooth spin on hover)\n    if (variant === \"icon-spin\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && (\n              <span className=\"group-hover:animate-spin\">\n                {iconLeft}\n              </span>\n            )}\n            {children}\n            {!loading && iconRight && (\n              <span className=\"group-hover:animate-spin\">\n                {iconRight}\n              </span>\n            )}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Curtain Reveal (Vertical split curtain wipe)\n    if (variant === \"curtain-reveal\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-x-0 top-0 h-1/2 bg-primary -translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n          <span className=\"absolute inset-x-0 bottom-0 h-1/2 bg-primary translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Pulse Glow (Ambient continuous glow pulse)\n    if (variant === \"pulse-glow\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground shadow-[0_0_20px_rgba(59,130,246,0.6)] animate-pulse\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Shimmer Beam (Continuous diagonal glossy beam sweep)\n    if (variant === \"shimmer-beam\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5 bg-primary text-primary-foreground\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 w-1/2 h-full bg-gradient-to-r from-transparent via-white/40 to-transparent -skew-x-12 animate-[shimmer_2.5s_infinite] pointer-events-none z-10\" />\n          <span className=\"relative z-20 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Neon Aura (Continuous glowing neon shadow ring)\n    if (variant === \"neon-aura\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground border-2 border-primary/30 shadow-[0_0_15px_var(--primary,#3b82f6)] animate-bounce\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Border Beam (Continuous traveling border light beam)\n    if (variant === \"border-beam\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto\">\n          <div className=\"absolute inset-0 bg-[conic-gradient(from_0deg,transparent_70%,var(--primary,#3b82f6)_100%)] animate-[spin_3s_linear_infinite]\" />\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto bg-background\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && <span>{iconLeft}</span>}\n              {children}\n              {!loading && iconRight && <span>{iconRight}</span>}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Radar Ping (Continuous radar pulse ping)\n    if (variant === \"radar-ping\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 rounded-xl bg-primary animate-ping opacity-30 pointer-events-none\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Gradient Flow (Continuous animated gradient shift)\n    if (variant === \"gradient-flow\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-[linear-gradient(90deg,var(--primary,#3b82f6),#ec4899,#8b5cf6,var(--primary,#3b82f6))] bg-[length:200%_auto] animate-[gradient_4s_linear_infinite] text-white\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Keyframes travel with the variant so the animation survives a copy\n              into a project whose globals.css never defined `gradient`. */}\n          <style\n            dangerouslySetInnerHTML={{\n              __html: `@keyframes gradient {\n  0% { background-position: 0% 50%; }\n  50% { background-position: 100% 50%; }\n  100% { background-position: 0% 50%; }\n}`,\n            }}\n          />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Breathe Glow (Slow breathing glow opacity scale)\n    if (variant === \"breathe-glow\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground animate-[ping_3s_cubic-bezier(0,0,0.2,1)_infinite] shadow-[0_0_30px_rgba(59,130,246,0.8)]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Spotlight Beam (Moving spotlight radial glow)\n    if (variant === \"spotlight\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5 bg-primary text-primary-foreground\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-[radial-gradient(circle_at_center,var(--primary,#3b82f6)_0%,transparent_70%)] animate-[pulse_2s_infinite] opacity-60 pointer-events-none\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Cosmic Orbit (Spinning outer ring dot)\n    if (variant === \"cosmic-orbit\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto\">\n          <div className=\"absolute inset-0 bg-[conic-gradient(from_0deg,transparent_75%,var(--primary,#3b82f6)_100%)] animate-[spin_2.5s_linear_infinite]\" />\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto bg-background\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && <span>{iconLeft}</span>}\n              {children}\n              {!loading && iconRight && <span>{iconRight}</span>}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Cyber Scan (Moving horizontal scan line)\n    if (variant === \"cyber-scan\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5 bg-zinc-950 text-cyan-400 border border-cyan-500/50 shadow-[0_0_15px_rgba(6,182,212,0.4)]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-x-0 h-[2px] bg-cyan-400 animate-[bounce_1.5s_infinite] pointer-events-none z-10 opacity-70\" />\n          <span className=\"relative z-20 flex items-center justify-center gap-2 font-semibold tracking-wider\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Glassmorphism (Frosted glass blur effect)\n    if (variant === \"glassmorphism\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-white/10 dark:bg-white/5 backdrop-blur-md border border-white/20 dark:border-white/10 shadow-lg text-foreground hover:bg-white/20 transition-all duration-300\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Floating Shadow (Elevation float animation)\n    if (variant === \"floating-shadow\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground shadow-md hover:-translate-y-1 hover:shadow-xl transition-all duration-300\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Magnetic Pull (Inner scale pulse)\n    if (variant === \"magnetic-pull\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground transition-transform duration-300 hover:scale-[1.05] active:scale-[0.95]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Glitch Cyber (Cyberpunk RGB glitch effect)\n    if (variant === \"glitch-cyber\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-black text-lime-400 border border-lime-400 hover:shadow-[3px_3px_0px_#f43f5e] transition-all duration-150 font-mono uppercase tracking-widest\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: 3D Press (Neumorphic 3D depth press)\n    // Variant: 3D (a raised face over a darker edge and a ground shadow; the\n    // face sinks toward the edge on hover and all the way down on press)\n    if (variant === \"3d\") {\n      return (\n        <button\n          className={cn(\n            \"relative inline-flex w-max cursor-pointer rounded-xl border-0 bg-transparent p-0 text-sm font-semibold text-primary-foreground group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:opacity-50 disabled:pointer-events-none\",\n            size === \"sm\" ? \"h-10 rounded-lg text-xs\" : size === \"lg\" ? \"h-14 text-base\" : \"h-12\",\n            className,\n          )}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Ground shadow - spreads as the face lifts, tightens as it presses */}\n          <span\n            aria-hidden\n            className=\"absolute inset-0 translate-y-1.5 rounded-[inherit] bg-black/30 blur-[2px] transition-transform duration-200 ease-out group-hover:translate-y-1 group-active:translate-y-0.5\"\n          />\n          {/* Edge - the same primary, darkened, sitting where the face rests */}\n          <span\n            aria-hidden\n            className=\"absolute inset-0 rounded-[inherit] bg-primary brightness-[.55]\"\n          />\n          {/* Face */}\n          <span\n            className={cn(\n              \"relative flex h-full items-center justify-center gap-2 rounded-[inherit] bg-primary shadow-[inset_0_1px_0_rgba(255,255,255,0.25)] transition-transform duration-200 ease-out -translate-y-1.5 group-hover:-translate-y-1 group-active:-translate-y-px\",\n              size === \"sm\" ? \"px-4\" : size === \"lg\" ? \"px-8\" : \"px-6\",\n            )}\n          >\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    if (variant === \"3d-press\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground border-b-4 border-[color:color-mix(in_oklab,var(--primary)_70%,black)] active:border-b-0 active:translate-y-1 transition-all duration-100\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Liquid Fill (Liquid wave rise fill)\n    if (variant === \"liquid-fill\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-700 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: 3D Flip (CodePen 3D Perspective Card Flip)\n    if (variant === \"3d-flip\") {\n      return (\n        <div className=\"perspective-1000 group inline-block\">\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max px-5 py-2.5 bg-primary text-primary-foreground transition-transform duration-500 [transform-style:preserve-3d] group-hover:[transform:rotateX(180deg)]\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            <span className=\"flex items-center justify-center gap-2 font-semibold [backface-visibility:hidden]\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && <span>{iconLeft}</span>}\n              {children}\n              {!loading && iconRight && <span>{iconRight}</span>}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Holographic (Iridescent prismatic metallic sheen)\n    if (variant === \"holographic\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-5 py-2.5 bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 text-white shadow-lg hover:brightness-125 transition-all duration-300\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"absolute inset-0 bg-[linear-gradient(115deg,transparent_20%,rgba(255,255,255,0.4)_40%,transparent_60%)] animate-[shimmer_3s_infinite] pointer-events-none\" />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Laser Border (Continuous high-voltage glowing laser outline)\n    if (variant === \"laser-border\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto\">\n          <div className=\"absolute inset-0 bg-[conic-gradient(from_0deg,#ef4444,#f59e0b,#10b981,#3b82f6,#ef4444)] animate-[spin_1.5s_linear_infinite]\" />\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto bg-black text-white dark:bg-black\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && <span>{iconLeft}</span>}\n              {children}\n              {!loading && iconRight && <span>{iconRight}</span>}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Electric Pulse (High frequency electric jitter shadow)\n    if (variant === \"electric-pulse\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-yellow-400 text-black font-semibold shadow-[0_0_20px_#facc15] animate-[pulse_1s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Neon Sign (Retro 80s flicker neon tube text)\n    if (variant === \"neon-sign\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-5 py-2.5 bg-zinc-950 text-fuchsia-400 border border-fuchsia-500 shadow-[0_0_15px_#d946ef] animate-[pulse_2s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold tracking-wider\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Sliding Icon Physics (Horizontal rounded icon slide)\n    if (variant === \"slide-icon\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max pl-4 pr-3.5 gap-3\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Sliding Left Icon on Hover */}\n          <span className=\"absolute left-3.5 top-1/2 -translate-y-1/2 flex items-center justify-center h-7 w-7 rounded-full bg-primary-foreground text-primary shadow-xs -translate-x-10 opacity-0 group-hover:translate-x-0 group-hover:opacity-100 transition-all duration-300 ease-out z-20\">\n            {activeIcon}\n          </span>\n\n          {/* Main Button Label Text */}\n          <span className=\"relative z-10 font-semibold transition-transform duration-300 ease-out group-hover:translate-x-[36px]\">\n            {children}\n          </span>\n\n          {/* Initial Right Icon (slides out to right on hover) */}\n          <span className=\"relative z-10 flex items-center justify-center h-7 w-7 rounded-full bg-muted text-foreground group-hover:translate-x-10 group-hover:opacity-0 transition-all duration-300 ease-out\">\n            {loading ? <Loader2 className=\"h-4 w-4\" /> : activeIcon}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Variant: Slide Icon Loop (same rounded icon as slide-icon, but the arrow\n    // never rests: it travels out of the circle to the right and re-enters\n    // from the left, on a loop. The circle clips it, so only the pass shows.)\n    if (variant === \"slide-icon-loop\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max pl-4 pr-3.5 gap-3\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Plain <style> rather than styled-jsx — see shine-sweep. */}\n          <style\n            dangerouslySetInnerHTML={{\n              __html: `@keyframes slide-icon-loop {\n  0%   { transform: translateX(-100%); animation-timing-function: ease-out; }\n  50%  { transform: translateX(0);     animation-timing-function: ease-in; }\n  100% { transform: translateX(100%); }\n}`,\n            }}\n          />\n\n          <span className=\"relative z-10 font-semibold\">{children}</span>\n\n          {/* Looping Right Icon (circle clips the arrow as it wraps around) */}\n          <span className=\"relative z-10 flex items-center justify-center h-7 w-7 rounded-full bg-muted text-foreground overflow-hidden transition-colors duration-300 group-hover:bg-primary-foreground group-hover:text-primary\">\n            {loading ? (\n              <Loader2 className=\"h-4 w-4\" />\n            ) : (\n              <span className=\"flex items-center justify-center animate-[slide-icon-loop_1.4s_linear_infinite] motion-reduce:animate-none\">\n                {activeIcon}\n              </span>\n            )}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      );\n    }\n\n    // Variant: Split Door Reveal (Continuous horizontal split door pulse using ::before & ::after)\n    if (variant === \"split-door-reveal\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 before:absolute before:inset-y-0 before:left-0 before:w-1/2 before:bg-primary/30 before:animate-[pulse_2s_infinite] after:absolute after:inset-y-0 after:right-0 after:w-1/2 after:bg-primary/30 after:animate-[pulse_2s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Expanding Circle Center (Continuous expanding center ring ping using ::before)\n    if (variant === \"expanding-circle-center\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-8 before:h-8 before:rounded-full before:bg-primary/50 before:animate-ping\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Diamond Glare Wipe (Continuous diagonal glare sweep pass using ::after)\n    if (variant === \"diamond-glare-wipe\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 bg-primary text-primary-foreground after:absolute after:top-0 after:-left-[100%] after:w-full after:h-full after:bg-[linear-gradient(90deg,transparent,rgba(255,255,255,0.4),transparent)] after:-skew-x-12 after:animate-[shimmer_2s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Border Draw Outline (Continuous pulse border trace using ::before and ::after)\n    if (variant === \"border-draw-outline\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 border-2 border-primary/30 animate-[pulse_2s_infinite] shadow-[0_0_15px_var(--primary,#3b82f6)]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Vertical Curtain Rise (Continuous curtain bounce using ::before)\n    if (variant === \"vertical-curtain-rise\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 before:absolute before:inset-x-0 before:bottom-0 before:h-1 before:bg-primary before:animate-pulse\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Horizontal Shutter Split (Continuous shutter pulse using ::before and ::after)\n    if (variant === \"horizontal-shutter-split\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 before:absolute before:inset-x-0 before:top-0 before:h-1/2 before:bg-primary/20 before:animate-[pulse_1.5s_infinite] after:absolute after:inset-x-0 after:bottom-0 after:h-1/2 after:bg-primary/20 after:animate-[pulse_1.5s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Diagonal Slash Fill (Continuous 45 degree blade shimmer using ::before)\n    if (variant === \"diagonal-slash-fill\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 before:absolute before:top-0 before:bottom-0 before:-left-[50%] before:w-[150%] before:bg-gradient-to-r before:from-transparent before:via-primary/40 before:to-transparent before:-skew-x-[35deg] before:animate-[shimmer_2.5s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Corner Cross Bracket (Continuous glowing corner brackets using ::before and ::after)\n    if (variant === \"corner-cross-bracket\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 border border-primary/40 before:absolute before:top-0 before:left-0 before:w-3 before:h-3 before:border-t-2 before:border-l-2 before:border-primary/30 before:animate-pulse after:absolute after:bottom-0 after:right-0 after:w-3 after:h-3 after:border-b-2 after:border-r-2 after:border-primary/30 after:animate-pulse\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Inset Box Shadow Fill (Continuous inset glow pulse)\n    if (variant === \"inset-box-shadow-fill\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 shadow-[inset_0_0_15px_var(--primary,#3b82f6)] animate-pulse\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Glowing Line Trace (Continuous bottom tracking glow line using ::after)\n    if (variant === \"glowing-line-trace\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 after:absolute after:bottom-0 after:left-0 after:right-0 after:h-[3px] after:bg-primary after:shadow-[0_0_10px_var(--primary,#3b82f6)] after:animate-pulse\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Aura Glow Stream (Continuous pulsing ambient glowing background aura stream)\n    if (variant === \"aura-glow-stream\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 bg-primary text-primary-foreground shadow-[0_0_25px_var(--primary,#3b82f6)] animate-[pulse_2s_infinite] before:absolute before:-inset-1 before:rounded-xl before:bg-primary/40 before:blur-md before:animate-pulse before:-z-10\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Neon Portal Ring (Continuous traveling 360 neon portal gradient ring)\n    if (variant === \"neon-portal-ring\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto\">\n          <div className=\"absolute inset-0 bg-[conic-gradient(from_0deg,transparent_50%,var(--primary,#3b82f6)_100%)] animate-[spin_2.5s_linear_infinite]\" />\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto bg-background text-foreground border border-border shadow-sm\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && <span>{iconLeft}</span>}\n              {children}\n              {!loading && iconRight && <span>{iconRight}</span>}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Cyber Matrix Pulse (High frequency scanning cyber pulse line)\n    if (variant === \"cyber-matrix-pulse\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 border border-primary/50 text-primary shadow-[0_0_15px_rgba(59,130,246,0.3)] before:absolute before:inset-x-0 before:h-[2px] before:bg-primary before:shadow-[0_0_10px_var(--primary,#3b82f6)] before:animate-[bounce_1.5s_infinite] before:opacity-80\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Liquid Gradient Flow (Continuous animated 200% fluid gradient shift)\n    if (variant === \"liquid-gradient-flow\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 bg-[linear-gradient(90deg,var(--primary,#3b82f6),#60a5fa,#2563eb,var(--primary,#3b82f6))] bg-[length:200%_auto] animate-[gradient_3s_linear_infinite] text-white shadow-md\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Keyframes travel with the variant so the animation survives a copy\n              into a project whose globals.css never defined `gradient`. */}\n          <style\n            dangerouslySetInnerHTML={{\n              __html: `@keyframes gradient {\n  0% { background-position: 0% 50%; }\n  50% { background-position: 100% 50%; }\n  100% { background-position: 0% 50%; }\n}`,\n            }}\n          />\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Magnetic Laser Ring (Continuous laser border with soft outer glow ring)\n    if (variant === \"magnetic-laser-ring\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto shadow-[0_0_20px_var(--primary,#3b82f6)]\">\n          <div className=\"absolute inset-0 bg-[conic-gradient(from_0deg,transparent_75%,var(--primary,#3b82f6)_100%)] animate-[spin_2s_linear_infinite]\" />\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto bg-background text-foreground border border-border\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && <span>{iconLeft}</span>}\n              {children}\n              {!loading && iconRight && <span>{iconRight}</span>}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Quantum Flux Beam (Continuous shimmer glossy glare pass)\n    if (variant === \"quantum-flux-beam\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max overflow-hidden px-6 py-2.5 bg-primary text-primary-foreground shadow-lg after:absolute after:inset-0 after:w-1/2 after:h-full after:bg-[linear-gradient(90deg,transparent,rgba(255,255,255,0.4),transparent)] after:-skew-x-12 after:animate-[shimmer_2s_infinite]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Prism Reflection Shimmer (Prismatic tracking border sheen)\n    if (variant === \"prism-reflection-shimmer\") {\n      return (\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max px-6 py-2.5 border-2 border-primary/30 animate-pulse shadow-[0_0_15px_var(--primary,#3b82f6)]\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          <span className=\"relative z-10 flex items-center justify-center gap-2 font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && <span>{iconLeft}</span>}\n            {children}\n            {!loading && iconRight && <span>{iconRight}</span>}\n          </span>\n        </button>\n      );\n    }\n\n    // Variant: Dual Spin Border (Two perfectly synchronized counter-rotating conic border beams)\n    if (variant === \"dual-spin-border\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto\">\n          {/* Beam 1: Clockwise spinning thin 15% conic beam */}\n          <div className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[350%] aspect-square bg-[conic-gradient(from_0deg,transparent_85%,var(--primary,#3b82f6)_100%)] animate-[spin_3s_linear_infinite] pointer-events-none\" />\n          {/* Beam 2: Counter-clockwise spinning opposite 180-deg offset thin 15% conic beam */}\n          <div className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[350%] aspect-square bg-[conic-gradient(from_180deg,transparent_85%,var(--primary,#3b82f6)_100%)] animate-[spin_3s_linear_infinite_reverse] pointer-events-none\" />\n\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto overflow-hidden bg-background text-foreground border-0\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            {/* Liquid Fill Wave Layer on Hover */}\n            <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n\n            <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && (\n                <span className=\"flex items-center justify-center\">{iconLeft}</span>\n              )}\n              {children}\n              {!loading && iconRight && (\n                <span className=\"flex items-center justify-center\">\n                  {iconRight}\n                </span>\n              )}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Border Corner Pulse (Sequential sharp border line waves expanding outward and fading away)\n    if (variant === \"border-corner-pulse\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group rounded-xl isolation-auto\">\n          {/* Wave Line 1: Expands outwards and fades away */}\n          <span className=\"absolute inset-0 rounded-xl border border-primary/80 animate-[ping_2.5s_cubic-bezier(0,0,0.2,1)_infinite] pointer-events-none -z-10\" />\n          {/* Wave Line 2: Follows 0.8s later, expands outward and fades away */}\n          <span className=\"absolute inset-0 rounded-xl border border-primary/80 animate-[ping_2.5s_cubic-bezier(0,0,0.2,1)_infinite] [animation-delay:0.8s] pointer-events-none -z-10\" />\n          {/* Wave Line 3: Follows 1.6s later, expands outward and fades away */}\n          <span className=\"absolute inset-0 rounded-xl border border-primary/80 animate-[ping_2.5s_cubic-bezier(0,0,0.2,1)_infinite] [animation-delay:1.6s] pointer-events-none -z-10\" />\n\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto overflow-hidden bg-background text-foreground border border-primary/60\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            {/* Liquid Fill Wave Layer on Hover */}\n            <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n\n            <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && (\n                <span className=\"flex items-center justify-center\">{iconLeft}</span>\n              )}\n              {children}\n              {!loading && iconRight && (\n                <span className=\"flex items-center justify-center\">\n                  {iconRight}\n                </span>\n              )}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Beacon Radar Pulse (Circular beacon ping wave expanding from icon/center)\n    if (variant === \"beacon-radar-pulse\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group rounded-xl isolation-auto\">\n          {/* Smooth Soft Aura Beacon Ring */}\n          <span className=\"absolute inset-0 rounded-xl bg-primary/40 animate-[ping_2.2s_cubic-bezier(0,0,0.2,1)_infinite] pointer-events-none -z-10\" />\n          <span className=\"absolute -inset-1 rounded-xl bg-primary/20 blur-md animate-pulse pointer-events-none -z-20\" />\n\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto overflow-hidden bg-background text-foreground border border-primary/50\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            {/* Liquid Fill Wave Layer on Hover */}\n            <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n\n            <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && (\n                <span className=\"flex items-center justify-center\">{iconLeft}</span>\n              )}\n              {children}\n              {!loading && iconRight && (\n                <span className=\"flex items-center justify-center\">\n                  {iconRight}\n                </span>\n              )}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Dual Ring Pulse (2 layered offset border line rings pulsing outward)\n    if (variant === \"dual-ring-pulse\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group rounded-xl isolation-auto\">\n          {/* Ring 1: Fast Sharp Border Line */}\n          <span className=\"absolute inset-0 rounded-xl border border-primary/30 animate-[ping_1.8s_cubic-bezier(0,0,0.2,1)_infinite] pointer-events-none -z-10\" />\n          {/* Ring 2: Slow Offset Outer Border Line */}\n          <span className=\"absolute inset-0 rounded-xl border border-primary/60 animate-[ping_1.8s_cubic-bezier(0,0,0.2,1)_infinite] [animation-delay:0.9s] pointer-events-none -z-10\" />\n\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto overflow-hidden bg-background text-foreground border border-primary/60\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            {/* Liquid Fill Wave Layer on Hover */}\n            <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n\n            <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && (\n                <span className=\"flex items-center justify-center\">{iconLeft}</span>\n              )}\n              {children}\n              {!loading && iconRight && (\n                <span className=\"flex items-center justify-center\">\n                  {iconRight}\n                </span>\n              )}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    // Variant: Corner Dash Pulse (4 corner L-bracket lines pulsing outward)\n    if (variant === \"corner-dash-pulse\") {\n      return (\n        <div className=\"relative inline-flex items-center justify-center group p-1 rounded-xl isolation-auto\">\n          <span className=\"absolute -top-1.5 -left-1.5 w-3.5 h-3.5 border-t-2 border-l-2 border-primary/30 rounded-tl-md animate-[ping_2s_infinite] pointer-events-none\" />\n          <span className=\"absolute -top-1.5 -right-1.5 w-3.5 h-3.5 border-t-2 border-r-2 border-primary/30 rounded-tr-md animate-[ping_2s_infinite] pointer-events-none\" />\n          <span className=\"absolute -bottom-1.5 -left-1.5 w-3.5 h-3.5 border-b-2 border-l-2 border-primary/30 rounded-bl-md animate-[ping_2s_infinite] pointer-events-none\" />\n          <span className=\"absolute -bottom-1.5 -right-1.5 w-3.5 h-3.5 border-b-2 border-r-2 border-primary/30 rounded-br-md animate-[ping_2s_infinite] pointer-events-none\" />\n\n          <button\n            className={cn(\n              baseClasses,\n              sizeClasses[size],\n              \"relative z-10 w-max h-auto overflow-hidden bg-background text-foreground border border-primary/50\",\n              className,\n            )}\n            onClick={createRipple}\n            disabled={loading}\n            ref={ref}\n            {...props}\n          >\n            {/* Liquid Fill Wave Layer on Hover */}\n            <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n\n            <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n              {loading && <Loader2 className=\"h-4 w-4\" />}\n              {!loading && iconLeft && (\n                <span className=\"flex items-center justify-center\">{iconLeft}</span>\n              )}\n              {children}\n              {!loading && iconRight && (\n                <span className=\"flex items-center justify-center\">\n                  {iconRight}\n                </span>\n              )}\n            </span>\n          </button>\n        </div>\n      );\n    }\n\n    return (\n      <div className=\"relative inline-flex items-center justify-center group p-[2px] rounded-xl overflow-hidden isolation-auto bg-muted\">\n        {/* Conic Spinning Beam layer that spins exactly over the border frame */}\n        <div className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[350%] aspect-square bg-[conic-gradient(from_0deg,transparent_70%,var(--primary,#3b82f6)_100%)] group-hover:opacity-0 animate-[spin_3s_linear_infinite] opacity-100 transition-opacity duration-300 pointer-events-none\" />\n\n        <button\n          className={cn(\n            baseClasses,\n            sizeClasses[size],\n            \"relative z-10 w-max h-auto overflow-hidden bg-background text-foreground border-0\",\n            className,\n          )}\n          onClick={createRipple}\n          disabled={loading}\n          ref={ref}\n          {...props}\n        >\n          {/* Liquid Fill Wave Layer (Rises smoothly from bottom to top on hover) */}\n          <span className=\"absolute inset-0 bg-primary rounded-t-full translate-y-full transition-transform duration-500 ease-out group-hover:translate-y-0 pointer-events-none z-0\" />\n\n          <span className=\"relative z-10 flex items-center justify-center gap-2 transition-colors duration-300 group-hover:text-primary-foreground font-semibold\">\n            {loading && <Loader2 className=\"h-4 w-4\" />}\n            {!loading && iconLeft && (\n              <span className=\"flex items-center justify-center\">{iconLeft}</span>\n            )}\n            {children}\n            {!loading && iconRight && (\n              <span className=\"flex items-center justify-center\">\n                {iconRight}\n              </span>\n            )}\n          </span>\n\n          {!loading && (\n            <div className=\"absolute inset-0 z-0 pointer-events-none overflow-hidden rounded-xl\">\n              {ripples.map((ripple) => (\n                <span\n                  key={ripple.id}\n                  className={cn(\n                    \"absolute rounded-full animate-ripple\",\n                    rippleColor,\n                  )}\n                  style={{\n                    left: ripple.x,\n                    top: ripple.y,\n                    width: ripple.size,\n                    height: ripple.size,\n                  }}\n                />\n              ))}\n            </div>\n          )}\n        </button>\n      </div>\n    );\n  },\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n",
      "type": "registry:component",
      "target": "components/custom/blocks/Button.tsx"
    },
    {
      "path": "src/components/custom/blocks/button-theme.ts",
      "content": "// The colour-preset helper for Button. Kept out of the component file so it\n// stays a components-only module (React Fast Refresh).\n\nimport type { CSSProperties } from \"react\";\n\nexport function getButtonThemeStyle(color?: string): CSSProperties {\n  if (!color || color === \"default\" || color === \"primary\") {\n    return {};\n  }\n\n  let primary = color;\n  let primaryForeground = \"#ffffff\";\n\n  if (color === \"indigo\") {\n    primary = \"#6366f1\";\n  } else if (color === \"rose\") {\n    primary = \"#f43f5e\";\n  } else if (color === \"emerald\") {\n    primary = \"#10b981\";\n  } else if (color === \"zinc\") {\n    primary = \"#27272a\";\n    primaryForeground = \"#fafafa\";\n  }\n\n  return {\n    \"--primary\": primary,\n    \"--primary-foreground\": primaryForeground,\n    \"--ring\": primary,\n  } as CSSProperties;\n}\n",
      "type": "registry:component",
      "target": "components/custom/blocks/button-theme.ts"
    }
  ],
  "docs": "Default export. Supports variant (default | destructive | outline | secondary | ghost | link), size (sm | lg), and a `loading` prop. Ripple keyframes are injected into document.head on mount, so no Tailwind config or global CSS changes are needed.",
  "categories": [
    "actions",
    "forms"
  ],
  "type": "registry:component"
}
