{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"mobile-paywall","type":"registry:component","title":"Mobile Paywall","description":"A phone paywall selects a plan and shows a Welcome to Pro confirmation.","dependencies":["remotion","@remotion/google-fonts"],"docs":"Needs a Remotion project. If a frame renders black, the component is drawing on a transparent layer: put a background behind it, e.g. <AbsoluteFill style={{ background: \"#faf9f6\" }}><Component /></AbsoluteFill>.","registryDependencies":["https://kuchi.kalarislabs.com/r/gradient-ground.json"],"files":[{"path":"components/kuchi/mobile-paywall.tsx","type":"registry:component","target":"components/kuchi/mobile-paywall.tsx","content":"/*! Portions Copyright (c) 2026 Remocn. MIT License. See THIRD_PARTY_LICENSES. */\n\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Figtree\";\nimport type React from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  spring,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/kuchi/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/kuchi/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/kuchi/gsh/presets\";\n\nconst figtree = loadFont(\"normal\", {\n  weights: [\"300\", \"400\"],\n  subsets: [\"latin\"],\n});\n\nexport type PaywallIcon = \"grid\" | \"film\" | \"palette\" | \"bolt\";\n\nexport interface PaywallFeature {\n  title: string;\n  description: string;\n  icon?: PaywallIcon;\n}\n\nexport interface PaywallPlan {\n  label: string;\n  price: string;\n  detail: string;\n  /** Shown after \"7 days free, then …\" when the plan is selected. */\n  renews: string;\n  badge?: string;\n}\n\nexport interface MobilePaywallProps {\n  appName?: string;\n  title?: string;\n  features?: PaywallFeature[];\n  /** Two plans: the first is the one that gets tapped, the second starts selected. */\n  plans?: [PaywallPlan, PaywallPlan];\n  cta?: string;\n  account?: string;\n  /** Trial dates on the confirmation: start, reminder, first charge. */\n  dates?: [string, string, string];\n  /** Three lines beside the phone: paywall, confirm, welcome. */\n  lines?: [string, string, string];\n  /** Heading on the welcome screen after the purchase. */\n  welcomeTitle?: string;\n  /** Line under the welcome heading. */\n  welcomeSub?: string;\n  /** Button on the welcome screen. */\n  welcomeCta?: string;\n  accent?: string;\n  /** Color of the lines beside the phone; overrides the theme. */\n  ink?: string;\n  /** Solid fill in place of the gradient ground; \"transparent\" drops it. */\n  background?: string;\n  /** Typeface for the copy. Load it yourself; Figtree by default. */\n  fontFamily?: string;\n  /** Replaces the acme mark on the app icon. */\n  logo?: React.ReactNode;\n  /** Size of the phone and lines, around the frame's center. */\n  scale?: number;\n  /** Frames to hold the first frame before anything moves. */\n  delay?: number;\n  speed?: number;\n  theme?: \"light\" | \"dark\";\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_FEATURES: PaywallFeature[] = [\n  {\n    title: \"Every component, unlocked\",\n    description: \"200+ animations, transitions and scenes\",\n    icon: \"grid\",\n  },\n  {\n    title: \"4K, 60fps export\",\n    description: \"Crisp launch videos for every channel\",\n    icon: \"film\",\n  },\n  {\n    title: \"Brand kits\",\n    description: \"Your fonts, colors and logo, everywhere\",\n    icon: \"palette\",\n  },\n  {\n    title: \"Priority renders\",\n    description: \"Skip the queue on every export\",\n    icon: \"bolt\",\n  },\n];\n\nconst DEFAULT_PLANS: [PaywallPlan, PaywallPlan] = [\n  {\n    label: \"Yearly\",\n    price: \"$59.99/yr\",\n    detail: \"$5.00/mo, billed yearly\",\n    renews: \"$59.99/year\",\n    badge: \"Save 37%\",\n  },\n  {\n    label: \"Monthly\",\n    price: \"$7.99/mo\",\n    detail: \"Billed monthly\",\n    renews: \"$7.99/month\",\n  },\n];\n\nconst ICONS: Record<PaywallIcon, string> = {\n  grid: \"M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z\",\n  film: \"M3 5h18v14H3zM7 5v14M17 5v14M3 9.5h4M3 14.5h4M17 9.5h4M17 14.5h4\",\n  palette:\n    \"M12 3a9 9 0 100 18c1 0 1.5-.7 1.5-1.5 0-.9-.7-1.2-.7-2 0-.8.7-1.5 1.5-1.5H17a4 4 0 004-4c0-5-4-9-9-9zM7.5 11.5h.01M10.5 7.5h.01M15 7.5h.01\",\n  bolt: \"M13 2L4 14h7l-1 8 9-12h-7z\",\n};\n\n\nconst SW = 393;\nconst SH = 852;\nconst BEZEL = 11;\nconst BW = SW + BEZEL * 2;\nconst BH = SH + BEZEL * 2;\nconst SHEET_TOP = 58;\nconst PAD = 22;\nconst CW = SW - PAD * 2;\nconst CARD_W = (CW - 10) / 2;\nconst PLANS_Y = 562;\nconst CTA_Y = 694;\n\nconst SHEET_AT = 4;\nconst TAP_IN = 50;\nconst TAP1 = 66;\nconst TAP2 = 100;\nconst PAY_AT = 108;\nconst DC1 = 138;\nconst DC2 = 146;\nconst CHECK_AT = 156;\nconst DISMISS = 180;\nconst WELCOME = 186;\n\nconst clamp = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst LIGHT = Easing.bezier(0.22, 1, 0.36, 1);\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\nconst CAMERA = Easing.bezier(0.87, 0, 0.13, 1);\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\nconst MORPH = { damping: 200 };\n\nconst LIGHT_PAL = {\n  sheet: \"#ffffff\",\n  behind: \"#c8c8ce\",\n  text: \"#121215\",\n  muted: \"#6c6c74\",\n  ring: \"rgba(18,18,21,0.1)\",\n  hair: \"rgba(18,18,21,0.08)\",\n  chip: \"#f2f2f4\",\n  ctaBg: \"#121215\",\n  ctaText: \"#ffffff\",\n  pay: \"#ffffff\",\n  copy: \"#121215\",\n  frame:\n    \"linear-gradient(155deg,#f1f1f3 0%,#c4c4ca 30%,#e2e2e6 62%,#b3b3ba 100%)\",\n  shadow:\n    \"0 50px 90px -24px rgba(30,32,44,0.32), 0 14px 30px -10px rgba(30,32,44,0.18)\",\n  dark: false,\n};\nconst DARK_PAL: typeof LIGHT_PAL = {\n  sheet: \"#0d0d10\",\n  behind: \"#2a2a2f\",\n  text: \"#f4f4f6\",\n  muted: \"#8d8d96\",\n  ring: \"rgba(255,255,255,0.12)\",\n  hair: \"rgba(255,255,255,0.08)\",\n  chip: \"#1c1c20\",\n  ctaBg: \"#f4f4f6\",\n  ctaText: \"#111113\",\n  pay: \"#1a1a1d\",\n  copy: \"#f4f4f6\",\n  frame:\n    \"linear-gradient(155deg,#55565c 0%,#2a2b2f 30%,#3d3e43 62%,#1f2023 100%)\",\n  shadow:\n    \"0 50px 100px -20px rgba(0,0,0,0.7), 0 18px 36px -12px rgba(0,0,0,0.5)\",\n  dark: true,\n};\ntype Palette = typeof LIGHT_PAL;\n\nfunction withAlpha(hex: string, alpha: number) {\n  const h = hex.replace(\"#\", \"\");\n  const full = h.length === 3 ? h.replace(/./g, (x) => x + x) : h.slice(0, 6);\n  const n = Number.parseInt(full, 16);\n  return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;\n}\n\nfunction Glyph({\n  d,\n  size = 18,\n  color,\n  sw = 1.5,\n}: {\n  d: string;\n  size?: number;\n  color: string;\n  sw?: number;\n}) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n      <path\n        d={d}\n        stroke={color}\n        strokeWidth={sw}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nfunction AppTile({\n  size,\n  accent,\n  logo,\n}: {\n  size: number;\n  accent: string;\n  logo?: React.ReactNode;\n}) {\n  return (\n    <div\n      style={{\n        width: size,\n        height: size,\n        borderRadius: size * 0.24,\n        background: accent,\n        boxShadow: `inset 0 0 0 0.5px rgba(255,255,255,0.22), inset 0 1px 0 rgba(255,255,255,0.2), 0 ${size * 0.12}px ${size * 0.3}px -${size * 0.08}px rgba(0,0,0,0.3)`,\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n        flexShrink: 0,\n      }}\n    >\n      {logo ?? (\n        <svg viewBox=\"0 0 124.06 134.26\" height={size * 0.42} aria-hidden>\n          <circle cx=\"62.03\" cy=\"67.13\" r=\"56\" fill=\"#fff\"  />\n        </svg>\n      )}\n    </div>\n  );\n}\n\nfunction StatusBar({ color }: { color: string }) {\n  return (\n    <div\n      style={{\n        position: \"absolute\",\n        top: 0,\n        left: 0,\n        right: 0,\n        height: 54,\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"space-between\",\n        padding: \"6px 30px 0 34px\",\n        zIndex: 8,\n      }}\n    >\n      <span\n        style={{\n          fontSize: 17,\n          color,\n          width: 54,\n          textAlign: \"center\",\n        }}\n      >\n        9:41\n      </span>\n      <div style={{ display: \"flex\", gap: 7, alignItems: \"center\" }}>\n        <svg width=\"18\" height=\"12\" viewBox=\"0 0 18 12\">\n          {[0, 1, 2, 3].map((i) => (\n            <rect\n              key={i}\n              x={i * 4.6}\n              y={9 - i * 3}\n              width={3.2}\n              height={3 + i * 3}\n              rx={0.8}\n              fill={color}\n            />\n          ))}\n        </svg>\n        <svg width=\"16\" height=\"12\" viewBox=\"0 0 16 12\">\n          <path\n            d=\"M8 11.2l2.3-2.6a3.3 3.3 0 00-4.6 0zM3.6 6.4a6.3 6.3 0 018.8 0l1.4-1.6a8.4 8.4 0 00-11.6 0zM.6 3.1a10.6 10.6 0 0114.8 0L16.8 1.5a12.7 12.7 0 00-17.6 0z\"\n            fill={color}\n          />\n        </svg>\n        <div\n          style={{\n            width: 25,\n            height: 12,\n            borderRadius: 3.5,\n            border: `1px solid ${color}`,\n            padding: 1.5,\n            boxSizing: \"border-box\",\n          }}\n        >\n          <div\n            style={{\n              width: \"78%\",\n              height: \"100%\",\n              borderRadius: 2,\n              background: color,\n            }}\n          />\n        </div>\n      </div>\n    </div>\n  );\n}\n\nfunction Phone({\n  children,\n  sidePress,\n  c,\n}: {\n  children: React.ReactNode;\n  sidePress: number;\n  c: Palette;\n}) {\n  const btn = (side: \"left\" | \"right\", top: number, h: number, dx = 0) => (\n    <div\n      style={{\n        position: \"absolute\",\n        [side]: -3 + dx,\n        top,\n        width: 4,\n        height: h,\n        borderRadius: 2,\n        background: c.frame,\n      }}\n    />\n  );\n  return (\n    <div style={{ position: \"relative\", width: BW, height: BH }}>\n      {btn(\"left\", 150, 32)}\n      {btn(\"left\", 210, 62)}\n      {btn(\"left\", 284, 62)}\n      {btn(\"right\", 236, 98, sidePress * 1.6)}\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          borderRadius: 68,\n          background: c.frame,\n          boxShadow: `${c.shadow}, inset 0 0 0 1px rgba(255,255,255,0.22)`,\n        }}\n      />\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 3.5,\n          borderRadius: 64.5,\n          background: \"#050506\",\n        }}\n      />\n      <div\n        style={{\n          position: \"absolute\",\n          left: BEZEL,\n          top: BEZEL,\n          width: SW,\n          height: SH,\n          borderRadius: 56,\n          overflow: \"hidden\",\n          background: \"#000\",\n        }}\n      >\n        {children}\n        <div\n          style={{\n            position: \"absolute\",\n            top: 11,\n            left: (SW - 126) / 2,\n            width: 126,\n            height: 37,\n            borderRadius: 19,\n            background: \"#000\",\n            zIndex: 20,\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n\nfunction Radio({ on, accent, c }: { on: number; accent: string; c: Palette }) {\n  return (\n    <div\n      style={{\n        width: 22,\n        height: 22,\n        borderRadius: 11,\n        boxShadow: `inset 0 0 0 1.5px ${c.ring}`,\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n      }}\n    >\n      <div\n        style={{\n          width: 22,\n          height: 22,\n          borderRadius: 11,\n          background: accent,\n          transform: `scale(${on})`,\n          display: \"flex\",\n          alignItems: \"center\",\n          justifyContent: \"center\",\n        }}\n      >\n        <Glyph d=\"M6 12.5l4 4 8-9\" size={14} color=\"#fff\" sw={2} />\n      </div>\n    </div>\n  );\n}\n\n/** The foreground at `scale`, around the frame's center; nothing extra at 1. */\nfunction ScaleLayer({\n  scale,\n  children,\n}: {\n  scale: number;\n  children: React.ReactNode;\n}) {\n  if (scale === 1) return children;\n  return (\n    <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n      {children}\n    </AbsoluteFill>\n  );\n}\n\nexport function MobilePaywall({\n  appName = \"acme Pro\",\n  title = \"Ship launch videos in minutes\",\n  features = DEFAULT_FEATURES,\n  plans = DEFAULT_PLANS,\n  cta = \"Start free for 7 days\",\n  account = \"maya@kitebase.dev\",\n  dates = [\"Nov 2\", \"Nov 7\", \"Nov 9\"],\n  lines = [\n    \"Pro, one tap away.\",\n    \"Double-click to confirm.\",\n    \"Seven days, on us.\",\n  ],\n  welcomeTitle = \"Welcome to Pro\",\n  welcomeSub = \"Your free week starts now. Here’s how it works.\",\n  welcomeCta = \"Start creating\",\n  accent = \"#3B5BFD\",\n  ink,\n  background,\n  fontFamily = figtree.fontFamily,\n  logo,\n  scale = 1,\n  delay = 0,\n  speed = 1,\n  theme = \"light\",\n  ground,\n  groundParams,\n}: MobilePaywallProps) {\n  const frame = Math.max(0, useCurrentFrame() - delay);\n  const { fps, width, height } = useVideoConfig();\n  const f = frame * speed;\n  const c = theme === \"dark\" ? DARK_PAL : LIGHT_PAL;\n  const fg = ink ?? c.copy;\n  const tall = height > width;\n  const W = tall ? 720 : 1280;\n  const H = tall ? 1280 : 720;\n  const u = Math.min(width / W, height / H);\n  const k = tall ? (H * 0.74) / BH : (H * 0.94) / BH;\n  const phoneCx = tall ? W / 2 : W * 0.665;\n  const phoneCy = tall ? H - 36 - (BH * k) / 2 : H / 2;\n\n  const sp = (at: number, config: typeof CARD | typeof MORPH = CARD) =>\n    spring({ frame: f - at, fps, config });\n  const pressAt = (at: number) =>\n    spring({ frame: f - at, fps, config: CHIP }) -\n    spring({ frame: f - at - 4, fps, config: CHIP });\n\n  const rise = spring({ frame: f, fps, config: HEAVY });\n  const sheetIn = sp(SHEET_AT, HEAVY);\n  const hero = sp(10, CHIP);\n  const titleIn = interpolate(f, [12, 26], [0, 1], { ...clamp, easing: ENTER });\n  const featIn = features.map((_, i) => sp(16 + i * 3));\n  const plansIn = [sp(26), sp(29)];\n  const ctaIn = sp(32);\n\n  const sel = sp(TAP1 + 1, MORPH);\n  const ctaPress = pressAt(TAP2);\n\n  const keys = [\n    { t: TAP_IN, x: 300, y: 800 },\n    { t: TAP1 - 1, x: PAD + CARD_W / 2, y: PLANS_Y + 50 },\n    { t: TAP1 + 10, x: PAD + CARD_W / 2 + 6, y: PLANS_Y + 56 },\n    { t: TAP2 - 1, x: SW / 2, y: CTA_Y + 28 },\n  ];\n  let tap = { x: keys[0].x, y: keys[0].y };\n  for (let i = 0; i < keys.length - 1; i++) {\n    const a = keys[i];\n    const b = keys[i + 1];\n    if (f >= a.t) {\n      const e = MOVE(Math.min(1, Math.max(0, (f - a.t) / (b.t - a.t))));\n      const dist = Math.hypot(b.x - a.x, b.y - a.y);\n      const lift = Math.sin(Math.PI * e) * Math.min(36, dist * 0.2);\n      const nx = dist ? -(b.y - a.y) / dist : 0;\n      const ny = dist ? (b.x - a.x) / dist : 0;\n      tap = {\n        x: a.x + (b.x - a.x) * e + nx * lift,\n        y: a.y + (b.y - a.y) * e + ny * lift,\n      };\n    }\n  }\n  const tapOpacity = interpolate(\n    f,\n    [TAP_IN, TAP_IN + 6, TAP2 + 6, TAP2 + 11],\n    [0, 1, 1, 0],\n    clamp,\n  );\n  const tapScale = 1 - 0.14 * Math.max(pressAt(TAP1), pressAt(TAP2));\n\n  const pay = sp(PAY_AT, HEAVY);\n  const away = spring({\n    frame: f - DISMISS,\n    fps,\n    config: MORPH,\n    durationInFrames: 14,\n  });\n  const sidePress = Math.max(pressAt(DC1), pressAt(DC2));\n  const hintOn = f >= PAY_AT + 8 && f < DC2 + 5;\n  const hintPulse = hintOn ? 0.55 + 0.45 * Math.sin((f - PAY_AT) / 3.2) : 0;\n  const hintIn = spring({ frame: f - PAY_AT - 8, fps, config: CARD });\n  const processing = f >= DC2 + 2 && f < CHECK_AT;\n  const check = interpolate(f, [CHECK_AT, CHECK_AT + 14], [0, 1], {\n    ...clamp,\n    easing: LIGHT,\n  });\n  const done = f >= CHECK_AT;\n\n  const out = interpolate(f, [DISMISS, DISMISS + 8], [1, 0], {\n    ...clamp,\n    easing: EXIT,\n  });\n  const wIcon = sp(WELCOME);\n  const wBadge = sp(WELCOME + 8, CHIP);\n  const wTitle = interpolate(f, [WELCOME + 4, WELCOME + 18], [0, 1], {\n    ...clamp,\n    easing: ENTER,\n  });\n  const wSub = interpolate(f, [WELCOME + 7, WELCOME + 21], [0, 1], {\n    ...clamp,\n    easing: ENTER,\n  });\n  const wRows = [0, 1, 2].map((i) => sp(WELCOME + 10 + i * 4));\n  const wRail = interpolate(f, [WELCOME + 12, WELCOME + 30], [0, 1], {\n    ...clamp,\n    easing: MOVE,\n  });\n  const wCta = sp(WELCOME + 16);\n  const camera = interpolate(f, [0, 250], [1, 1.035], {\n    ...clamp,\n    easing: CAMERA,\n  });\n\n  const enter = (v: number, dy = 10): React.CSSProperties => ({\n    opacity: Math.min(1, v * 1.4),\n    transform: `translateY(${(1 - v) * dy}px)`,\n  });\n  const abs = (top: number): React.CSSProperties => ({\n    position: \"absolute\",\n    left: PAD,\n    width: CW,\n    top: top - SHEET_TOP,\n  });\n\n  const beats = [0, PAY_AT, WELCOME];\n  const copyLine = (i: number) => {\n    const inAt = beats[i] + (i === 0 ? 8 : 0);\n    const outAt = beats[i + 1];\n    const pin = interpolate(f, [inAt, inAt + 14], [0, 1], {\n      ...clamp,\n      easing: ENTER,\n    });\n    const pout =\n      outAt === undefined\n        ? 0\n        : interpolate(f, [outAt - 2, outAt + 6], [0, 1], {\n            ...clamp,\n            easing: EXIT,\n          });\n    if (pin <= 0 || pout >= 1) return null;\n    return (\n      <div\n        key={i}\n        style={{\n          position: \"absolute\",\n          left: 0,\n          right: 0,\n          top: 0,\n          transform: `translateY(${(1 - pin) * 70 - pout * 50}%)`,\n          opacity: pin * (1 - pout),\n        }}\n      >\n        {lines[i]}\n      </div>\n    );\n  };\n\n  const timeline: [string, string, string][] = [\n    [dates[0], \"Today\", \"Every Pro feature is unlocked\"],\n    [dates[1], \"Reminder\", \"We’ll nudge you two days before\"],\n    [dates[2], \"Trial ends\", `Billed ${plans[0].renews}, cancel anytime`],\n  ];\n\n  return (\n    <AbsoluteFill style={{ fontFamily, overflow: \"hidden\" }}>\n      {background === undefined ? (\n        <>\n          <GshGround\n            preset={ground ?? (c.dark ? \"flood\" : \"glasswork\")}\n            params={\n              groundParams ??\n              (c.dark || ground\n                ? undefined\n                : { colors: [\"#a9bbff\", \"#3552ff\", \"#1a2a9e\", \"#7f9bff\"] })\n            }\n            timeOffset={c.dark ? 3 : 8}\n            timeScale={0.35}\n          />\n          <AbsoluteFill\n            style={{\n              background: c.dark ? \"rgba(2,3,8,0.25)\" : \"rgba(240,241,245,0.3)\",\n            }}\n          />\n        </>\n      ) : (\n        <AbsoluteFill\n          style={{\n            background: background === \"transparent\" ? undefined : background,\n          }}\n        />\n      )}\n      <ScaleLayer scale={scale}>\n        <div\n          style={{\n            position: \"absolute\",\n            left: (width - W * u) / 2,\n            top: (height - H * u) / 2,\n            width: W,\n            height: H,\n            transformOrigin: \"0 0\",\n            transform: `scale(${u})`,\n          }}\n        >\n          <div\n            style={{\n              position: \"absolute\",\n              left: tall ? 56 : 92,\n              top: tall ? 88 : H / 2 - 80,\n              width: tall ? W - 112 : 500,\n              height: 160,\n              fontSize: tall ? 60 : 72,\n              fontWeight: 300,\n              lineHeight: 1.04,\n              letterSpacing: \"-0.035em\",\n              color: fg,\n              overflow: \"hidden\",\n              textWrap: \"balance\",\n            }}\n          >\n            {[0, 1, 2].map((i) => copyLine(i))}\n          </div>\n          <div\n            style={{\n              position: \"absolute\",\n              left: phoneCx - BW / 2,\n              top: phoneCy - BH / 2,\n              width: BW,\n              height: BH,\n              transform: `translateY(${(1 - rise) * H * 0.9}px) scale(${k * camera})`,\n            }}\n          >\n            <Phone sidePress={sidePress} c={c}>\n              <StatusBar color=\"#fff\" />\n              <div\n                style={{\n                  position: \"absolute\",\n                  top: 47,\n                  left: 14,\n                  right: 14,\n                  height: 60,\n                  borderRadius: 12,\n                  background: c.behind,\n                  opacity: sheetIn,\n                }}\n              />\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: 0,\n                  right: 0,\n                  top: SHEET_TOP,\n                  bottom: 0,\n                  borderRadius: \"14px 14px 0 0\",\n                  background: c.sheet,\n                  color: c.text,\n                  overflow: \"hidden\",\n                  transform: `translateY(${(1 - sheetIn) * SH}px)`,\n                }}\n              >\n                <div\n                  style={{\n                    position: \"absolute\",\n                    inset: 0,\n                    opacity: out,\n                    transform: `scale(${0.96 + out * 0.04})`,\n                  }}\n                >\n                  <div\n                    style={{\n                      ...abs(74),\n                      display: \"flex\",\n                      justifyContent: \"space-between\",\n                      alignItems: \"center\",\n                    }}\n                  >\n                    <div\n                      style={{\n                        width: 32,\n                        height: 32,\n                        borderRadius: 16,\n                        background: c.chip,\n                        display: \"flex\",\n                        alignItems: \"center\",\n                        justifyContent: \"center\",\n                      }}\n                    >\n                      <Glyph\n                        d=\"M7 7l10 10M17 7L7 17\"\n                        size={15}\n                        color={c.muted}\n                        sw={2}\n                      />\n                    </div>\n                    <span style={{ fontSize: 15, color: c.muted }}>\n                      Restore\n                    </span>\n                  </div>\n                  <div\n                    style={{\n                      ...abs(112),\n                      display: \"flex\",\n                      opacity: Math.min(1, hero * 1.5),\n                      transform: `scale(${0.8 + hero * 0.2})`,\n                      transformOrigin: \"0 50%\",\n                    }}\n                  >\n                    <AppTile size={64} accent={accent} logo={logo} />\n                  </div>\n                  <div\n                    style={{\n                      ...abs(196),\n                      fontSize: 34,\n                      fontWeight: 300,\n                      letterSpacing: \"-0.035em\",\n                      lineHeight: 1.08,\n                      textWrap: \"balance\",\n                      paddingRight: 30,\n                      boxSizing: \"border-box\",\n                      ...enter(titleIn, 16),\n                    }}\n                  >\n                    {title}\n                  </div>\n                  <div\n                    style={{\n                      ...abs(298),\n                      height: 1,\n                      background: c.hair,\n                      opacity: featIn[0],\n                    }}\n                  />\n                  {features.slice(0, 4).map((ft, i) => (\n                    <div\n                      key={ft.title}\n                      style={{\n                        ...abs(316 + i * 52),\n                        display: \"flex\",\n                        alignItems: \"center\",\n                        gap: 14,\n                        fontSize: 17,\n                        ...enter(featIn[i], 12),\n                      }}\n                    >\n                      <Glyph\n                        d={ICONS[ft.icon ?? \"grid\"]}\n                        size={22}\n                        color={c.text}\n                      />\n                      {ft.title}\n                    </div>\n                  ))}\n                  {plans.map((pl, i) => {\n                    const on = i === 0 ? sel : 1 - sel;\n                    const press = i === 0 ? pressAt(TAP1) : 0;\n                    return (\n                      <div\n                        key={pl.label}\n                        style={{\n                          position: \"absolute\",\n                          left: PAD + i * (CARD_W + 10),\n                          top: PLANS_Y - SHEET_TOP,\n                          width: CARD_W,\n                          height: 96,\n                          borderRadius: 16,\n                          background: withAlpha(\n                            accent,\n                            (c.dark ? 0.12 : 0.05) * on,\n                          ),\n                          boxShadow: `inset 0 0 0 ${1 + on * 0.5}px ${on > 0.5 ? accent : c.ring}`,\n                          padding: \"16px 14px\",\n                          boxSizing: \"border-box\",\n                          fontVariantNumeric: \"tabular-nums\",\n                          opacity: Math.min(1, plansIn[i] * 1.4),\n                          transform: `translateY(${(1 - plansIn[i]) * 16}px) scale(${1 - press * 0.04})`,\n                        }}\n                      >\n                        {pl.badge ? (\n                          <div\n                            style={{\n                              position: \"absolute\",\n                              top: -10,\n                              right: 12,\n                              height: 20,\n                              padding: \"0 7px\",\n                              borderRadius: 6,\n                              background: on > 0.5 ? accent : c.text,\n                              color: on > 0.5 ? \"#fff\" : c.sheet,\n                              fontSize: 13,\n                              lineHeight: \"20px\",\n                            }}\n                          >\n                            {pl.badge}\n                          </div>\n                        ) : null}\n                        <div\n                          style={{ position: \"absolute\", right: 12, top: 16 }}\n                        >\n                          <Radio on={on} accent={accent} c={c} />\n                        </div>\n                        <div style={{ fontSize: 15, color: c.muted }}>\n                          {pl.label}\n                        </div>\n                        <div\n                          style={{\n                            fontSize: 22,\n                            fontWeight: 300,\n                            letterSpacing: \"-0.02em\",\n                            marginTop: 4,\n                          }}\n                        >\n                          {pl.price}\n                        </div>\n                        <div\n                          style={{ fontSize: 13, color: c.muted, marginTop: 2 }}\n                        >\n                          {pl.detail}\n                        </div>\n                      </div>\n                    );\n                  })}\n                  <div\n                    style={{\n                      ...abs(668),\n                      height: 18,\n                      fontSize: 14,\n                      color: c.muted,\n                      textAlign: \"center\",\n                      opacity: Math.min(1, ctaIn * 1.4),\n                    }}\n                  >\n                    {plans.map((pl, i) => {\n                      const o = i === 0 ? sel : 1 - sel;\n                      return (\n                        <div\n                          key={pl.label}\n                          style={{\n                            position: \"absolute\",\n                            inset: 0,\n                            opacity: o,\n                            transform: `translateY(${(1 - o) * (i === 0 ? 8 : -8)}px)`,\n                          }}\n                        >\n                          7 days free, then{\" \"}\n                          <span style={{ color: c.text }}>{pl.renews}</span>\n                        </div>\n                      );\n                    })}\n                  </div>\n                  <div\n                    style={{\n                      ...abs(CTA_Y),\n                      height: 56,\n                      borderRadius: 28,\n                      background: c.ctaBg,\n                      color: c.ctaText,\n                      fontSize: 17,\n                      display: \"flex\",\n                      alignItems: \"center\",\n                      justifyContent: \"center\",\n                      opacity: Math.min(1, ctaIn * 1.4),\n                      transform: `translateY(${(1 - ctaIn) * 16}px) scale(${1 - ctaPress * 0.04})`,\n                    }}\n                  >\n                    {cta}\n                  </div>\n                  <div\n                    style={{\n                      ...abs(764),\n                      textAlign: \"center\",\n                      fontSize: 14,\n                      color: c.muted,\n                      opacity: ctaIn,\n                    }}\n                  >\n                    Cancel anytime · Terms · Privacy\n                  </div>\n                </div>\n\n                {f >= WELCOME - 2 ? (\n                  <div style={{ position: \"absolute\", inset: 0 }}>\n                    <div\n                      style={{\n                        ...abs(164),\n                        opacity: Math.min(1, wIcon * 1.5),\n                        transform: `scale(${0.85 + wIcon * 0.15})`,\n                        transformOrigin: \"0 50%\",\n                      }}\n                    >\n                      <div style={{ position: \"relative\", width: 72 }}>\n                        <AppTile size={72} accent={accent} logo={logo} />\n                        <div\n                          style={{\n                            position: \"absolute\",\n                            right: -8,\n                            bottom: -8,\n                            width: 30,\n                            height: 30,\n                            borderRadius: 15,\n                            background: \"#1f9d55\",\n                            boxShadow: `0 0 0 3px ${c.sheet}`,\n                            display: \"flex\",\n                            alignItems: \"center\",\n                            justifyContent: \"center\",\n                            transform: `scale(${wBadge})`,\n                          }}\n                        >\n                          <Glyph\n                            d=\"M6 12.5l4 4 8-9\"\n                            size={16}\n                            color=\"#fff\"\n                            sw={2}\n                          />\n                        </div>\n                      </div>\n                    </div>\n                    <div\n                      style={{\n                        ...abs(266),\n                        fontSize: 34,\n                        fontWeight: 300,\n                        letterSpacing: \"-0.035em\",\n                        ...enter(wTitle, 16),\n                      }}\n                    >\n                      {welcomeTitle}\n                    </div>\n                    <div\n                      style={{\n                        ...abs(312),\n                        fontSize: 16,\n                        lineHeight: 1.4,\n                        color: c.muted,\n                        textWrap: \"pretty\",\n                        ...enter(wSub, 12),\n                      }}\n                    >\n                      {welcomeSub}\n                    </div>\n                    <div\n                      style={{\n                        position: \"absolute\",\n                        left: PAD + 10.25,\n                        top: 412 - SHEET_TOP,\n                        width: 1.5,\n                        height: 148 * wRail,\n                        background: `linear-gradient(${accent}, ${c.hair})`,\n                      }}\n                    />\n                    {timeline.map(([date, head, body], i) => (\n                      <div\n                        key={head}\n                        style={{\n                          ...abs(400 + i * 74),\n                          display: \"flex\",\n                          gap: 16,\n                          ...enter(wRows[i], 14),\n                        }}\n                      >\n                        <div\n                          style={{\n                            width: 22,\n                            height: 22,\n                            borderRadius: 11,\n                            flexShrink: 0,\n                            background: i === 0 ? accent : c.sheet,\n                            boxShadow:\n                              i === 0 ? \"none\" : `inset 0 0 0 1.5px ${c.ring}`,\n                            display: \"flex\",\n                            alignItems: \"center\",\n                            justifyContent: \"center\",\n                            marginTop: 1,\n                          }}\n                        >\n                          {i === 0 ? (\n                            <Glyph\n                              d=\"M6 12.5l4 4 8-9\"\n                              size={13}\n                              color=\"#fff\"\n                              sw={2}\n                            />\n                          ) : null}\n                        </div>\n                        <div style={{ flex: 1 }}>\n                          <div\n                            style={{\n                              display: \"flex\",\n                              justifyContent: \"space-between\",\n                              fontSize: 17,\n                            }}\n                          >\n                            {head}\n                            <span\n                              style={{\n                                fontSize: 15,\n                                color: c.muted,\n                                fontVariantNumeric: \"tabular-nums\",\n                              }}\n                            >\n                              {date}\n                            </span>\n                          </div>\n                          <div\n                            style={{\n                              fontSize: 15,\n                              color: c.muted,\n                              marginTop: 3,\n                            }}\n                          >\n                            {body}\n                          </div>\n                        </div>\n                      </div>\n                    ))}\n                    <div\n                      style={{\n                        ...abs(CTA_Y),\n                        height: 56,\n                        borderRadius: 28,\n                        background: accent,\n                        color: \"#fff\",\n                        fontSize: 17,\n                        display: \"flex\",\n                        alignItems: \"center\",\n                        justifyContent: \"center\",\n                        ...enter(wCta, 24),\n                      }}\n                    >\n                      {welcomeCta}\n                    </div>\n                  </div>\n                ) : null}\n              </div>\n\n              <div\n                style={{\n                  position: \"absolute\",\n                  inset: 0,\n                  background: \"#000\",\n                  opacity: 0.5 * Math.max(0, pay - away),\n                  zIndex: 10,\n                }}\n              />\n              {hintOn ? (\n                <div\n                  style={{\n                    position: \"absolute\",\n                    right: 0,\n                    top: 225,\n                    height: 98,\n                    zIndex: 12,\n                    display: \"flex\",\n                    alignItems: \"center\",\n                    gap: 14,\n                    padding: \"0 10px 0 18px\",\n                    borderRadius: \"22px 0 0 22px\",\n                    background: \"rgba(28,28,30,0.94)\",\n                    boxShadow:\n                      \"inset 0 0 0 0.5px rgba(255,255,255,0.12), 0 8px 24px rgba(0,0,0,0.35)\",\n                    opacity:\n                      Math.min(1, hintIn * 1.5) *\n                      interpolate(f, [DC2, DC2 + 5], [1, 0], {\n                        ...clamp,\n                        easing: EXIT,\n                      }),\n                    transform: `translateX(${(1 - hintIn) * 40}px)`,\n                  }}\n                >\n                  <div\n                    style={{\n                      textAlign: \"right\",\n                      color: \"#fff\",\n                      fontSize: 15,\n                      lineHeight: 1.3,\n                    }}\n                  >\n                    Double Click\n                    <br />\n                    to Subscribe\n                  </div>\n                  <div\n                    style={{\n                      width: 4,\n                      height: 74,\n                      borderRadius: 2,\n                      background: \"#fff\",\n                      opacity: 0.35 + hintPulse * 0.65,\n                      transform: `translateX(${sidePress * 2}px)`,\n                    }}\n                  />\n                </div>\n              ) : null}\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: 8,\n                  right: 8,\n                  bottom: 8,\n                  height: 404,\n                  borderRadius: 48,\n                  background: c.pay,\n                  fontVariantNumeric: \"tabular-nums\",\n                  color: c.text,\n                  zIndex: 11,\n                  padding: \"22px 24px\",\n                  boxSizing: \"border-box\",\n                  transform: `translateY(${(1 - pay) * 430 + away * 440}px)`,\n                  boxShadow: c.dark\n                    ? \"inset 0 1px 0 rgba(255,255,255,0.06)\"\n                    : \"0 -4px 30px rgba(0,0,0,0.16)\",\n                  opacity: f >= PAY_AT ? 1 : 0,\n                }}\n              >\n                <div style={{ display: \"flex\", alignItems: \"center\", gap: 12 }}>\n                  <AppTile size={44} accent={accent} logo={logo} />\n                  <div style={{ flex: 1 }}>\n                    <div style={{ fontSize: 17 }}>{appName}</div>\n                    <div style={{ fontSize: 14, color: c.muted, marginTop: 1 }}>\n                      {plans[0].label} subscription\n                    </div>\n                  </div>\n                  <div\n                    style={{\n                      width: 30,\n                      height: 30,\n                      borderRadius: 15,\n                      background: c.chip,\n                      display: \"flex\",\n                      alignItems: \"center\",\n                      justifyContent: \"center\",\n                    }}\n                  >\n                    <Glyph\n                      d=\"M7 7l10 10M17 7L7 17\"\n                      size={13}\n                      color={c.muted}\n                      sw={2}\n                    />\n                  </div>\n                </div>\n                <div style={{ marginTop: 16 }}>\n                  {[\n                    [\"Free trial\", \"7 days\"],\n                    [\"Then\", plans[0].renews],\n                    [\"First charge\", `${dates[2]}, 2026`],\n                    [\"Account\", account],\n                  ].map(([kk, v]) => (\n                    <div\n                      key={kk}\n                      style={{\n                        display: \"flex\",\n                        justifyContent: \"space-between\",\n                        alignItems: \"center\",\n                        height: 42,\n                        boxShadow: `inset 0 1px 0 ${c.hair}`,\n                        fontSize: 15,\n                      }}\n                    >\n                      <span style={{ color: c.muted }}>{kk}</span>\n                      <span>{v}</span>\n                    </div>\n                  ))}\n                </div>\n                <div\n                  style={{\n                    position: \"absolute\",\n                    left: 0,\n                    right: 0,\n                    bottom: 30,\n                    display: \"flex\",\n                    flexDirection: \"column\",\n                    alignItems: \"center\",\n                    gap: 10,\n                  }}\n                >\n                  <div style={{ position: \"relative\", width: 50, height: 50 }}>\n                    {done ? (\n                      <svg width={50} height={50} viewBox=\"0 0 50 50\">\n                        <circle\n                          cx={25}\n                          cy={25}\n                          r={22}\n                          fill=\"none\"\n                          stroke={accent}\n                          strokeWidth={2}\n                          pathLength={1}\n                          strokeDasharray={1}\n                          strokeDashoffset={1 - check}\n                          transform=\"rotate(-90 25 25)\"\n                        />\n                        <path\n                          d=\"M15 25.5l7 7 13-14\"\n                          fill=\"none\"\n                          stroke={accent}\n                          strokeWidth={2.4}\n                          strokeLinecap=\"round\"\n                          strokeLinejoin=\"round\"\n                          pathLength={1}\n                          strokeDasharray={1}\n                          strokeDashoffset={\n                            1 - interpolate(check, [0.4, 1], [0, 1], clamp)\n                          }\n                        />\n                      </svg>\n                    ) : processing ? (\n                      <svg\n                        width={50}\n                        height={50}\n                        viewBox=\"0 0 50 50\"\n                        style={{ transform: `rotate(${f * 14}deg)` }}\n                      >\n                        <circle\n                          cx={25}\n                          cy={25}\n                          r={20}\n                          fill=\"none\"\n                          stroke={c.hair}\n                          strokeWidth={2.5}\n                        />\n                        <circle\n                          cx={25}\n                          cy={25}\n                          r={20}\n                          fill=\"none\"\n                          stroke={accent}\n                          strokeWidth={2.5}\n                          strokeLinecap=\"round\"\n                          strokeDasharray=\"34 200\"\n                        />\n                      </svg>\n                    ) : (\n                      <svg width={50} height={50} viewBox=\"0 0 50 50\">\n                        <rect\n                          x={14}\n                          y={6}\n                          width={20}\n                          height={38}\n                          rx={6}\n                          fill=\"none\"\n                          stroke={c.text}\n                          strokeWidth={1.5}\n                        />\n                        <rect\n                          x={35 + sidePress * -1.5}\n                          y={14}\n                          width={3.5}\n                          height={11}\n                          rx={1.5}\n                          fill={accent}\n                          opacity={0.5 + hintPulse * 0.5}\n                        />\n                      </svg>\n                    )}\n                  </div>\n                  <div style={{ fontSize: 15 }}>\n                    {done\n                      ? \"Done\"\n                      : processing\n                        ? \"Processing…\"\n                        : \"Confirm with side button\"}\n                  </div>\n                </div>\n              </div>\n              <div\n                style={{\n                  position: \"absolute\",\n                  left: tap.x - 22,\n                  top: tap.y - 22,\n                  width: 44,\n                  height: 44,\n                  borderRadius: 22,\n                  background: \"rgba(40,40,48,0.24)\",\n                  boxShadow:\n                    \"inset 0 0 0 1.5px rgba(255,255,255,0.85), 0 4px 14px rgba(0,0,0,0.22)\",\n                  opacity: tapOpacity,\n                  transform: `scale(${tapScale})`,\n                  zIndex: 15,\n                }}\n              />\n              <div\n                style={{\n                  position: \"absolute\",\n                  bottom: 8,\n                  left: (SW - 136) / 2,\n                  width: 136,\n                  height: 5,\n                  borderRadius: 3,\n                  background: c.dark ? \"#fff\" : \"#111\",\n                  zIndex: 16,\n                }}\n              />\n            </Phone>\n          </div>\n        </div>\n      </ScaleLayer>\n    </AbsoluteFill>\n  );\n}\n"}]}