{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "isometric-ranking-stack",
  "title": "Isometric Ranking Stack",
  "author": "ncdai <dai@chanhdai.com>",
  "description": "Interactive isometric leaderboard stack featuring hover lift, layered perspective depth, rank badges, and KPI evaluation metrics.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "src/registry/components/isometric-ranking-stack/isometric-ranking-stack.tsx",
      "content": "\"use client\"\n\nimport React, {\n  useId,\n  useState,\n  type HTMLAttributes,\n  type KeyboardEvent,\n} from \"react\"\nimport {\n  AnimatePresence,\n  motion,\n  MotionConfig,\n  useReducedMotion,\n} from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface StackStep {\n  id: string\n  label: string\n  description: string\n}\n\nexport interface IsometricRankingStackProps extends Omit<\n  HTMLAttributes<HTMLElement>,\n  \"title\"\n> {\n  /** Color theme: \"auto\" follows Tailwind's .dark class, or force \"dark\" / \"light\" */\n  theme?: \"auto\" | \"dark\" | \"light\"\n  /** Hero headline text */\n  headline?: string\n  /** Supporting paragraph below the headline */\n  subtitle?: string\n  /** Primary CTA button label */\n  primaryCtaText?: string\n  /** Secondary CTA button label */\n  secondaryCtaText?: string\n  /** User prompt shown in the top-right floating card */\n  promptText?: string\n  /** Prompt author name */\n  promptAuthor?: string\n  /** Recommended brand name in the AI answer card */\n  answerBrand?: string\n  /** AI answer body text */\n  answerText?: string\n  /** Initial active tier index (0 = bottom \"Indexed\", 3 = top \"Named first\", -1 = wireframe idle) */\n  initialStep?: number\n  /** Callback fired when the primary CTA button is clicked */\n  onPrimaryClick?: () => void\n  /** Callback fired when the secondary CTA button is clicked */\n  onSecondaryClick?: () => void\n}\n\nconst DEFAULT_STEPS: StackStep[] = [\n  {\n    id: \"indexed\",\n    label: \"Indexed\",\n    description: \"Search engines can find and read your pages.\",\n  },\n  {\n    id: \"mentioned\",\n    label: \"Mentioned\",\n    description: \"AI answers say your name when buyers ask.\",\n  },\n  {\n    id: \"cited\",\n    label: \"Cited\",\n    description: \"Answers link your pages as their source.\",\n  },\n  {\n    id: \"named-first\",\n    label: \"Named first\",\n    description: \"AI recommends you before anyone else.\",\n  },\n]\n\nconst EASE_OUT_QUINT: [number, number, number, number] = [0.16, 1, 0.3, 1]\n\nconst CONNECTOR_SPRING = {\n  type: \"spring\" as const,\n  stiffness: 340,\n  damping: 34,\n  mass: 0.75,\n}\n\n// Isometric cube geometry in SVG coordinate space (580 x 430)\nconst SVG_W = 580\nconst SVG_H = 430\nconst CX = 352\nconst TOP_Y = 84\nconst DX = 114\nconst DY = 66\nconst LAYER_H = 36\nconst NUM_LAYERS = 4\n\nfunction getPlanePoints(planeIndex: number) {\n  const y0 = TOP_Y + planeIndex * LAYER_H\n  return {\n    top: { x: CX, y: y0 },\n    right: { x: CX + DX, y: y0 + DY },\n    bottom: { x: CX, y: y0 + DY * 2 },\n    left: { x: CX - DX, y: y0 + DY },\n  }\n}\n\nfunction OpenAiMiniIcon() {\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      className=\"size-3.5 shrink-0 text-current\"\n      aria-hidden=\"true\"\n    >\n      <path\n        fill=\"currentColor\"\n        d=\"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5Z\"\n      />\n    </svg>\n  )\n}\n\nexport const IsometricRankingStack = React.forwardRef<\n  HTMLElement,\n  IsometricRankingStackProps\n>(\n  (\n    {\n      theme = \"auto\",\n      headline = \"Go from indexed to recommended\",\n      subtitle = \"Search engines find your pages. AI decides if it trusts them enough to say your name. Cited shows the step you are on for every prompt, and what moves you up.\",\n      primaryCtaText = \"Start for free\",\n      secondaryCtaText = \"See how scoring works\",\n      promptText = \"best invoicing app for a two-person studio?\",\n      promptAuthor = \"Maya\",\n      answerBrand = \"Ledgerly.\",\n      answerText = \"It shares clients between seats and chases late invoices for you.\",\n      initialStep = -1,\n      onPrimaryClick,\n      onSecondaryClick,\n      className,\n      style,\n      ...rest\n    },\n    ref\n  ) => {\n    const uid = useId()\n    const shouldReduceMotion = Boolean(useReducedMotion())\n\n    const normalizedInitial =\n      Number.isInteger(initialStep) &&\n      initialStep >= 0 &&\n      initialStep < NUM_LAYERS\n        ? initialStep\n        : null\n\n    const [hoveredStep, setHoveredStep] = useState<number | null>(\n      normalizedInitial\n    )\n    const [lockedStep, setLockedStep] = useState<number | null>(\n      normalizedInitial\n    )\n\n    const activeStep = hoveredStep ?? lockedStep\n    const activeData = activeStep !== null ? DEFAULT_STEPS[activeStep] : null\n\n    const isForcedDark = theme === \"dark\"\n    const isForcedLight = theme === \"light\"\n\n    const surfaceClasses = isForcedDark\n      ? \"bg-[#0A0A0A] text-[#F5F5F7]\"\n      : isForcedLight\n        ? \"bg-[#FAFAFA] text-[#09090B]\"\n        : \"bg-transparent text-[#09090B] dark:text-[#F5F5F7]\"\n\n    const subtitleClasses = isForcedDark\n      ? \"text-[#8E8E93]\"\n      : isForcedLight\n        ? \"text-[#52525B]\"\n        : \"text-[#52525B] dark:text-[#8E8E93]\"\n\n    const cardClasses = isForcedDark\n      ? \"bg-[#151517]/95 border-white/[0.08] text-[#A1A1AA] shadow-[inset_0_1px_0_rgba(255,255,255,0.06),0_16px_40px_rgba(0,0,0,0.5)]\"\n      : isForcedLight\n        ? \"bg-white/95 border-black/[0.08] text-[#52525B] shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_12px_30px_rgba(0,0,0,0.07)]\"\n        : \"bg-white/95 border-black/[0.08] text-[#52525B] shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_12px_30px_rgba(0,0,0,0.07)] dark:bg-[#151517]/95 dark:border-white/[0.08] dark:text-[#A1A1AA] dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.06),0_16px_40px_rgba(0,0,0,0.5)]\"\n\n    const cardStrongText = isForcedDark\n      ? \"text-[#F5F5F7]\"\n      : isForcedLight\n        ? \"text-[#09090B]\"\n        : \"text-[#09090B] dark:text-[#F5F5F7]\"\n\n    const secondaryBtnClasses = isForcedDark\n      ? \"bg-[#151517] text-[#E5E5EA] border border-white/10 hover:bg-[#1C1C20] hover:border-white/[0.16] focus-visible:ring-offset-[#0A0A0A]\"\n      : isForcedLight\n        ? \"bg-white text-[#18181B] border border-black/[0.12] shadow-[0_1px_2px_rgba(0,0,0,0.04)] hover:bg-[#F4F4F5] focus-visible:ring-offset-[#FAFAFA]\"\n        : \"bg-white text-[#18181B] border border-black/[0.12] shadow-[0_1px_2px_rgba(0,0,0,0.04)] hover:bg-[#F4F4F5] focus-visible:ring-offset-[#FAFAFA] dark:bg-[#151517] dark:text-[#E5E5EA] dark:border-white/10 dark:shadow-none dark:hover:bg-[#1C1C20] dark:hover:border-white/[0.16] dark:focus-visible:ring-offset-[#0A0A0A]\"\n\n    const activePlaneIndex =\n      activeStep !== null ? NUM_LAYERS - 1 - activeStep : null\n    const activeConnectorY =\n      activePlaneIndex !== null\n        ? TOP_Y + activePlaneIndex * LAYER_H + DY\n        : TOP_Y + DY\n\n    // Cube-locked isometric floor grid centered at bottom diamond center\n    const bottomCenterX = CX\n    const bottomCenterY = TOP_Y + NUM_LAYERS * LAYER_H + DY\n    const stepX = DX / 4\n    const stepY = DY / 4\n    const gridExtent = 8\n    const gridLines: Array<{ x1: number; y1: number; x2: number; y2: number }> =\n      []\n\n    for (let i = -gridExtent; i <= gridExtent; i++) {\n      // Lines along +u = (+stepX, +stepY)\n      const ox1 = bottomCenterX + i * stepX\n      const oy1 = bottomCenterY - i * stepY\n      gridLines.push({\n        x1: ox1 - gridExtent * stepX,\n        y1: oy1 - gridExtent * stepY,\n        x2: ox1 + gridExtent * stepX,\n        y2: oy1 + gridExtent * stepY,\n      })\n\n      // Lines along +v = (-stepX, +stepY)\n      const ox2 = bottomCenterX + i * stepX\n      const oy2 = bottomCenterY + i * stepY\n      gridLines.push({\n        x1: ox2 + gridExtent * stepX,\n        y1: oy2 - gridExtent * stepY,\n        x2: ox2 - gridExtent * stepX,\n        y2: oy2 + gridExtent * stepY,\n      })\n    }\n\n    const topPlane = getPlanePoints(0)\n    const bottomPlane = getPlanePoints(NUM_LAYERS)\n\n    return (\n      <MotionConfig reducedMotion=\"user\">\n        <section\n          ref={ref}\n          aria-labelledby={`${uid}-heading`}\n          className={cn(\n            \"relative w-full overflow-hidden px-4 py-12 sm:px-8 sm:py-16 lg:px-12\",\n            \"antialiased transition-colors duration-200\",\n            surfaceClasses,\n            className\n          )}\n          style={{\n            fontFamily:\n              '\"Inter\", \"Plus Jakarta Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n            ...style,\n          }}\n          {...rest}\n        >\n          <div className=\"mx-auto grid w-full max-w-[1180px] grid-cols-1 items-center gap-10 lg:grid-cols-12 lg:gap-6\">\n            {/* Left Copy & CTAs */}\n            <div className=\"flex flex-col items-start text-left lg:col-span-5\">\n              <h2\n                id={`${uid}-heading`}\n                className=\"max-w-[440px] text-[2.2rem] leading-[1.09] font-medium tracking-[-0.032em] sm:text-[2.75rem] lg:text-[3.1rem]\"\n              >\n                {headline}\n              </h2>\n\n              <p\n                className={cn(\n                  \"mt-5 max-w-[400px] text-[0.95rem] leading-[1.58] tracking-[-0.005em] sm:text-[1rem]\",\n                  subtitleClasses\n                )}\n              >\n                {subtitle}\n              </p>\n\n              <div className=\"mt-7 flex flex-wrap items-center gap-3\">\n                <button\n                  type=\"button\"\n                  onClick={onPrimaryClick}\n                  className={cn(\n                    \"relative inline-flex h-11 items-center justify-center rounded-full px-6\",\n                    \"text-[0.875rem] font-medium tracking-[-0.01em] text-white\",\n                    \"transition-all duration-150 hover:brightness-110 active:scale-[0.98]\",\n                    \"focus-visible:ring-2 focus-visible:ring-[#4A7AFF] focus-visible:ring-offset-2 focus-visible:outline-none\",\n                    isForcedDark\n                      ? \"focus-visible:ring-offset-[#0A0A0A]\"\n                      : isForcedLight\n                        ? \"focus-visible:ring-offset-[#FAFAFA]\"\n                        : \"focus-visible:ring-offset-[#FAFAFA] dark:focus-visible:ring-offset-[#0A0A0A]\"\n                  )}\n                  style={{\n                    background:\n                      \"radial-gradient(120% 100% at 50% 0%, #3E6EFF 0%, #1C3A8A 48%, #101218 100%)\",\n                    boxShadow:\n                      \"inset 0 1px 0 rgba(255,255,255,0.32), 0 0 0 1px rgba(255,255,255,0.12), 0 4px 12px rgba(16,18,24,0.18)\",\n                  }}\n                >\n                  <span className=\"relative z-10\">{primaryCtaText}</span>\n                </button>\n\n                <button\n                  type=\"button\"\n                  onClick={onSecondaryClick}\n                  className={cn(\n                    \"inline-flex h-11 items-center justify-center rounded-full px-6\",\n                    \"text-[0.875rem] font-medium tracking-[-0.01em]\",\n                    \"transition-all duration-150 active:scale-[0.98]\",\n                    \"focus-visible:ring-2 focus-visible:ring-[#4A7AFF] focus-visible:ring-offset-2 focus-visible:outline-none\",\n                    secondaryBtnClasses\n                  )}\n                >\n                  {secondaryCtaText}\n                </button>\n              </div>\n            </div>\n\n            {/* Right Interactive Isometric Stack */}\n            <div className=\"relative flex w-full items-center justify-center lg:col-span-7\">\n              <div\n                className=\"relative w-full max-w-[650px] select-none\"\n                onMouseLeave={() => setHoveredStep(null)}\n              >\n                {/* Top-Right Prompt Card */}\n                <div\n                  className={cn(\n                    \"relative z-10 mb-2 ml-auto w-fit max-w-[250px] rounded-xl border px-3.5 py-2.5 text-left text-[0.76rem] leading-[1.45] backdrop-blur-md sm:absolute sm:top-0 sm:right-2 sm:mb-0\",\n                    cardClasses\n                  )}\n                >\n                  <div className=\"flex items-start gap-2.5\">\n                    <span\n                      aria-hidden=\"true\"\n                      className=\"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-linear-to-br from-[#D97757] to-[#7C3AED] text-[10px] font-semibold text-white ring-1 ring-white/15\"\n                    >\n                      {promptAuthor.slice(0, 1).toUpperCase()}\n                    </span>\n                    <p>\n                      <span className={cn(\"font-semibold\", cardStrongText)}>\n                        {promptAuthor}\n                      </span>{\" \"}\n                      {promptText}\n                    </p>\n                  </div>\n                </div>\n\n                {/* Top-Left AI Answer Card */}\n                <div\n                  className={cn(\n                    \"relative z-10 mb-3 w-fit max-w-[265px] rounded-xl border px-3.5 py-2.5 text-left text-[0.76rem] leading-[1.45] backdrop-blur-md sm:absolute sm:top-[12%] sm:left-[12%] sm:mb-0\",\n                    cardClasses\n                  )}\n                >\n                  <div className=\"flex items-start gap-2.5\">\n                    <span\n                      aria-hidden=\"true\"\n                      className={cn(\n                        \"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-md border\",\n                        isForcedDark\n                          ? \"border-white/15 bg-[#1F1F23] text-white\"\n                          : isForcedLight\n                            ? \"border-black/10 bg-[#F4F4F5] text-[#18181B]\"\n                            : \"border-black/10 bg-[#F4F4F5] text-[#18181B] dark:border-white/15 dark:bg-[#1F1F23] dark:text-white\"\n                      )}\n                    >\n                      <OpenAiMiniIcon />\n                    </span>\n                    <p>\n                      <span className={cn(\"font-semibold\", cardStrongText)}>\n                        {answerBrand}\n                      </span>{\" \"}\n                      {answerText}\n                    </p>\n                  </div>\n                </div>\n\n                {/* Isometric SVG Stack */}\n                <svg\n                  viewBox={`0 0 ${SVG_W} ${SVG_H}`}\n                  className=\"h-auto w-full overflow-visible\"\n                  role=\"group\"\n                  aria-label=\"Interactive AI visibility ranking layers\"\n                >\n                  <defs>\n                    {/* Floor Grid Radial Fade */}\n                    <radialGradient\n                      id={`${uid}-grid-mask-grad`}\n                      cx=\"50%\"\n                      cy=\"50%\"\n                      r=\"50%\"\n                    >\n                      <stop offset=\"25%\" stopColor=\"white\" stopOpacity=\"1\" />\n                      <stop offset=\"100%\" stopColor=\"white\" stopOpacity=\"0\" />\n                    </radialGradient>\n                    <mask id={`${uid}-grid-mask`}>\n                      <ellipse\n                        cx={bottomCenterX}\n                        cy={bottomCenterY}\n                        rx=\"225\"\n                        ry=\"130\"\n                        fill={`url(#${uid}-grid-mask-grad)`}\n                      />\n                    </mask>\n\n                    {/* Active Top Face Directional Specular Gradient */}\n                    <linearGradient\n                      id={`${uid}-top-face-dark`}\n                      x1=\"15%\"\n                      y1=\"85%\"\n                      x2=\"85%\"\n                      y2=\"15%\"\n                    >\n                      <stop offset=\"0%\" stopColor=\"#1A1A1D\" />\n                      <stop offset=\"52%\" stopColor=\"#35353B\" />\n                      <stop offset=\"100%\" stopColor=\"#232328\" />\n                    </linearGradient>\n                    <linearGradient\n                      id={`${uid}-top-face-light`}\n                      x1=\"15%\"\n                      y1=\"85%\"\n                      x2=\"85%\"\n                      y2=\"15%\"\n                    >\n                      <stop offset=\"0%\" stopColor=\"#DCDCE0\" />\n                      <stop offset=\"52%\" stopColor=\"#F4F4F6\" />\n                      <stop offset=\"100%\" stopColor=\"#E4E4E8\" />\n                    </linearGradient>\n                  </defs>\n\n                  {/* Cube-Locked Isometric Floor Grid */}\n                  <g\n                    mask={`url(#${uid}-grid-mask)`}\n                    className={cn(\n                      isForcedDark\n                        ? \"stroke-white/8\"\n                        : isForcedLight\n                          ? \"stroke-black/[0.07]\"\n                          : \"stroke-black/[0.07] dark:stroke-white/8\"\n                    )}\n                    strokeWidth=\"1\"\n                  >\n                    {gridLines.map((line, i) => (\n                      <line\n                        key={i}\n                        x1={line.x1}\n                        y1={line.y1}\n                        x2={line.x2}\n                        y2={line.y2}\n                      />\n                    ))}\n                  </g>\n\n                  {/* Hidden Back Vertical & Bottom Edges (Dashed) */}\n                  <g\n                    className={cn(\n                      isForcedDark\n                        ? \"stroke-white/25\"\n                        : isForcedLight\n                          ? \"stroke-black/20\"\n                          : \"stroke-black/20 dark:stroke-white/25\"\n                    )}\n                    strokeWidth=\"1\"\n                    strokeDasharray=\"3 3\"\n                  >\n                    <line\n                      x1={topPlane.top.x}\n                      y1={topPlane.top.y}\n                      x2={bottomPlane.top.x}\n                      y2={bottomPlane.top.y}\n                    />\n                    <line\n                      x1={bottomPlane.left.x}\n                      y1={bottomPlane.left.y}\n                      x2={bottomPlane.top.x}\n                      y2={bottomPlane.top.y}\n                    />\n                    <line\n                      x1={bottomPlane.right.x}\n                      y1={bottomPlane.right.y}\n                      x2={bottomPlane.top.x}\n                      y2={bottomPlane.top.y}\n                    />\n                  </g>\n\n                  {/* Top Plane Internal 2x2 Grid Lines */}\n                  <g\n                    className={cn(\n                      isForcedDark\n                        ? \"stroke-white/20\"\n                        : isForcedLight\n                          ? \"stroke-black/15\"\n                          : \"stroke-black/15 dark:stroke-white/20\"\n                    )}\n                    strokeWidth=\"1\"\n                  >\n                    <line\n                      x1={(topPlane.top.x + topPlane.left.x) / 2}\n                      y1={(topPlane.top.y + topPlane.left.y) / 2}\n                      x2={(topPlane.right.x + topPlane.bottom.x) / 2}\n                      y2={(topPlane.right.y + topPlane.bottom.y) / 2}\n                    />\n                    <line\n                      x1={(topPlane.top.x + topPlane.right.x) / 2}\n                      y1={(topPlane.top.y + topPlane.right.y) / 2}\n                      x2={(topPlane.left.x + topPlane.bottom.x) / 2}\n                      y2={(topPlane.left.y + topPlane.bottom.y) / 2}\n                    />\n                  </g>\n\n                  {/* 4 Cumulative Tiers (Rendered bottom-to-top: 0 -> 3) */}\n                  {DEFAULT_STEPS.map((step, stepIndex) => {\n                    const topIdx = NUM_LAYERS - 1 - stepIndex\n                    const pTop = getPlanePoints(topIdx)\n                    const pBot = getPlanePoints(topIdx + 1)\n                    const isFilled =\n                      activeStep !== null && stepIndex <= activeStep\n                    const isTopActive = activeStep === stepIndex\n\n                    const leftFacePoints = `${pTop.left.x},${pTop.left.y} ${pTop.bottom.x},${pTop.bottom.y} ${pBot.bottom.x},${pBot.bottom.y} ${pBot.left.x},${pBot.left.y}`\n                    const rightFacePoints = `${pTop.bottom.x},${pTop.bottom.y} ${pTop.right.x},${pTop.right.y} ${pBot.right.x},${pBot.right.y} ${pBot.bottom.x},${pBot.bottom.y}`\n                    const topFacePoints = `${pTop.top.x},${pTop.top.y} ${pTop.right.x},${pTop.right.y} ${pTop.bottom.x},${pTop.bottom.y} ${pTop.left.x},${pTop.left.y}`\n\n                    return (\n                      <g\n                        key={step.id}\n                        role=\"button\"\n                        tabIndex={0}\n                        aria-label={`${step.label}: ${step.description}`}\n                        aria-pressed={lockedStep === stepIndex}\n                        className=\"cursor-pointer outline-none\"\n                        onMouseEnter={() => setHoveredStep(stepIndex)}\n                        onFocus={() => setHoveredStep(stepIndex)}\n                        onBlur={() => setHoveredStep(null)}\n                        onClick={() =>\n                          setLockedStep((prev) =>\n                            prev === stepIndex ? null : stepIndex\n                          )\n                        }\n                        onKeyDown={(e: KeyboardEvent<SVGGElement>) => {\n                          if (e.key === \"Enter\" || e.key === \" \") {\n                            e.preventDefault()\n                            setLockedStep((prev) =>\n                              prev === stepIndex ? null : stepIndex\n                            )\n                          }\n                        }}\n                      >\n                        {/* Top face (only filled on the highest active tier) */}\n                        <motion.polygon\n                          points={topFacePoints}\n                          initial={false}\n                          animate={{ opacity: isTopActive ? 1 : 0 }}\n                          transition={{\n                            duration: shouldReduceMotion ? 0 : 0.22,\n                            ease: EASE_OUT_QUINT,\n                          }}\n                          fill={\n                            isForcedLight\n                              ? `url(#${uid}-top-face-light)`\n                              : `url(#${uid}-top-face-dark)`\n                          }\n                          className={cn(\n                            !isForcedDark &&\n                              !isForcedLight &&\n                              \"fill-[#E4E4E8] dark:fill-[#2A2A2F]\"\n                          )}\n                        />\n\n                        {/* Left side face */}\n                        <motion.polygon\n                          points={leftFacePoints}\n                          initial={false}\n                          animate={{ opacity: isFilled ? 1 : 0 }}\n                          transition={{\n                            duration: shouldReduceMotion ? 0 : 0.22,\n                            ease: EASE_OUT_QUINT,\n                          }}\n                          className={cn(\n                            isForcedDark\n                              ? \"fill-[#222226]\"\n                              : isForcedLight\n                                ? \"fill-[#D4D4D8]\"\n                                : \"fill-[#D4D4D8] dark:fill-[#222226]\"\n                          )}\n                        />\n\n                        {/* Right side face */}\n                        <motion.polygon\n                          points={rightFacePoints}\n                          initial={false}\n                          animate={{ opacity: isFilled ? 1 : 0 }}\n                          transition={{\n                            duration: shouldReduceMotion ? 0 : 0.22,\n                            ease: EASE_OUT_QUINT,\n                          }}\n                          className={cn(\n                            isForcedDark\n                              ? \"fill-[#151518]\"\n                              : isForcedLight\n                                ? \"fill-[#E4E4E7]\"\n                                : \"fill-[#E4E4E7] dark:fill-[#151518]\"\n                          )}\n                        />\n\n                        {/* Wireframe perimeter for this tier */}\n                        <g\n                          className={cn(\n                            \"transition-colors duration-200\",\n                            isTopActive\n                              ? isForcedDark\n                                ? \"stroke-white/95\"\n                                : isForcedLight\n                                  ? \"stroke-black/85\"\n                                  : \"stroke-black/85 dark:stroke-white/95\"\n                              : isForcedDark\n                                ? \"stroke-white/45\"\n                                : isForcedLight\n                                  ? \"stroke-black/30\"\n                                  : \"stroke-black/30 dark:stroke-white/45\"\n                          )}\n                          strokeWidth={isTopActive ? \"1.25\" : \"1\"}\n                          fill=\"none\"\n                        >\n                          <polyline\n                            points={`${pTop.left.x},${pTop.left.y} ${pTop.bottom.x},${pTop.bottom.y} ${pTop.right.x},${pTop.right.y}`}\n                          />\n                          <polyline\n                            points={`${pTop.left.x},${pTop.left.y} ${pTop.top.x},${pTop.top.y} ${pTop.right.x},${pTop.right.y}`}\n                            opacity={isFilled && !isTopActive ? 0.2 : 0.85}\n                          />\n                          <polyline\n                            points={`${pBot.left.x},${pBot.left.y} ${pBot.bottom.x},${pBot.bottom.y} ${pBot.right.x},${pBot.right.y}`}\n                          />\n                          <line\n                            x1={pTop.left.x}\n                            y1={pTop.left.y}\n                            x2={pBot.left.x}\n                            y2={pBot.left.y}\n                          />\n                          <line\n                            x1={pTop.bottom.x}\n                            y1={pTop.bottom.y}\n                            x2={pBot.bottom.x}\n                            y2={pBot.bottom.y}\n                          />\n                          <line\n                            x1={pTop.right.x}\n                            y1={pTop.right.y}\n                            x2={pBot.right.x}\n                            y2={pBot.right.y}\n                          />\n                        </g>\n\n                        {/* Crisp vertex anchor dots */}\n                        <g\n                          className={cn(\n                            isForcedDark\n                              ? \"fill-[#0A0A0A] stroke-white/80\"\n                              : isForcedLight\n                                ? \"fill-[#FAFAFA] stroke-black/70\"\n                                : \"fill-[#FAFAFA] stroke-black/70 dark:fill-[#0A0A0A] dark:stroke-white/80\"\n                          )}\n                          strokeWidth=\"1.1\"\n                        >\n                          <circle cx={pTop.left.x} cy={pTop.left.y} r=\"1.9\" />\n                          <circle\n                            cx={pTop.bottom.x}\n                            cy={pTop.bottom.y}\n                            r=\"1.9\"\n                          />\n                          <circle cx={pTop.right.x} cy={pTop.right.y} r=\"1.9\" />\n                          <circle cx={pTop.top.x} cy={pTop.top.y} r=\"1.9\" />\n                        </g>\n                      </g>\n                    )\n                  })}\n\n                  {/* Centered Isometric Cited Brand Ring on Top Plane */}\n                  <g\n                    transform={`translate(${CX}, ${TOP_Y + DY}) scale(1, 0.577) rotate(-45)`}\n                    className=\"pointer-events-none\"\n                  >\n                    <path\n                      d=\"M 18 0 A 18 18 0 1 1 5.5 -17.1\"\n                      fill=\"none\"\n                      stroke={isForcedLight ? \"#18181B\" : \"#F5F5F7\"}\n                      className={cn(\n                        !isForcedDark &&\n                          !isForcedLight &&\n                          \"stroke-[#18181B] dark:stroke-[#F5F5F7]\"\n                      )}\n                      strokeWidth=\"5.5\"\n                      strokeLinecap=\"round\"\n                    />\n                    <circle\n                      cx=\"14\"\n                      cy=\"-11\"\n                      r=\"3.2\"\n                      fill={isForcedLight ? \"#18181B\" : \"#F5F5F7\"}\n                      className={cn(\n                        !isForcedDark &&\n                          !isForcedLight &&\n                          \"fill-[#18181B] dark:fill-[#F5F5F7]\"\n                      )}\n                    />\n                  </g>\n\n                  {/* Active Tier Connector Line + Dot */}\n                  <AnimatePresence>\n                    {activeData && (\n                      <motion.g\n                        initial={{ opacity: 0 }}\n                        animate={{ opacity: 1, y: activeConnectorY }}\n                        exit={{ opacity: 0 }}\n                        transition={\n                          shouldReduceMotion\n                            ? { duration: 0 }\n                            : {\n                                opacity: { duration: 0.16 },\n                                y: CONNECTOR_SPRING,\n                              }\n                        }\n                        className=\"pointer-events-none\"\n                      >\n                        <line\n                          x1={154}\n                          y1={0}\n                          x2={CX - DX - 10}\n                          y2={0}\n                          className={cn(\n                            isForcedDark\n                              ? \"stroke-white/35\"\n                              : isForcedLight\n                                ? \"stroke-black/30\"\n                                : \"stroke-black/30 dark:stroke-white/35\"\n                          )}\n                          strokeWidth=\"1\"\n                        />\n                        <circle\n                          cx={CX - DX - 10}\n                          cy={0}\n                          r=\"2.6\"\n                          className={cn(\n                            isForcedDark\n                              ? \"fill-white\"\n                              : isForcedLight\n                                ? \"fill-[#09090B]\"\n                                : \"fill-[#09090B] dark:fill-white\"\n                          )}\n                        />\n                      </motion.g>\n                    )}\n                  </AnimatePresence>\n                </svg>\n\n                {/* Active Tier Callout Label */}\n                <AnimatePresence mode=\"wait\">\n                  {activeData && activePlaneIndex !== null && (\n                    <motion.div\n                      key={activeData.id}\n                      initial={\n                        shouldReduceMotion\n                          ? { opacity: 1 }\n                          : { opacity: 0, x: -6 }\n                      }\n                      animate={{ opacity: 1, x: 0 }}\n                      exit={\n                        shouldReduceMotion\n                          ? { opacity: 0 }\n                          : { opacity: 0, x: -4 }\n                      }\n                      transition={{\n                        duration: shouldReduceMotion ? 0 : 0.18,\n                        ease: EASE_OUT_QUINT,\n                      }}\n                      style={{\n                        top: `${(activeConnectorY / SVG_H) * 100}%`,\n                      }}\n                      className=\"pointer-events-none absolute left-0 hidden w-[24.5%] -translate-y-1/2 pr-2 text-right sm:block\"\n                    >\n                      <p\n                        className={cn(\n                          \"text-[0.82rem] leading-tight font-semibold\",\n                          cardStrongText\n                        )}\n                      >\n                        {activeData.label}\n                      </p>\n                      <p\n                        className={cn(\n                          \"mt-1 text-[0.72rem] leading-[1.38]\",\n                          subtitleClasses\n                        )}\n                      >\n                        {activeData.description}\n                      </p>\n                    </motion.div>\n                  )}\n                </AnimatePresence>\n\n                {/* Mobile Interactive Step Pills */}\n                <div className=\"mt-2 flex flex-wrap items-center justify-center gap-2 sm:hidden\">\n                  {DEFAULT_STEPS.map((step, idx) => {\n                    const selected = activeStep === idx\n                    return (\n                      <button\n                        key={step.id}\n                        type=\"button\"\n                        onClick={() =>\n                          setLockedStep((prev) => (prev === idx ? null : idx))\n                        }\n                        className={cn(\n                          \"rounded-full border px-3 py-1 text-xs font-medium transition-colors\",\n                          selected\n                            ? isForcedLight\n                              ? \"border-black/25 bg-black/5 text-[#09090B]\"\n                              : \"border-white/30 bg-white/10 text-white\"\n                            : isForcedLight\n                              ? \"border-black/10 text-[#52525B]\"\n                              : \"border-white/10 text-[#8E8E93]\"\n                        )}\n                      >\n                        {step.label}\n                      </button>\n                    )\n                  })}\n                </div>\n              </div>\n            </div>\n          </div>\n        </section>\n      </MotionConfig>\n    )\n  }\n)\n\nIsometricRankingStack.displayName = \"IsometricRankingStack\"\n\nexport default IsometricRankingStack\n",
      "type": "registry:component",
      "target": "@components/isometric-ranking-stack.tsx"
    }
  ],
  "docs": "https://syed.flinkeo.online/components/isometric-ranking-stack",
  "categories": [
    "cards"
  ],
  "type": "registry:component"
}