{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "light-burn-to-line",
  "title": "Light Burn to Line",
  "description": "Light burns the scene down to a line that opens onto \"Now ship your first film.\".",
  "dependencies": [
    "remotion",
    "@remotion/google-fonts",
    "@remotion/transitions"
  ],
  "registryDependencies": ["@remocn/gsh"],
  "files": [
    {
      "path": "registry/remocn/light-burn-to-line/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont as loadGeist } from \"@remotion/google-fonts/Geist\";\nimport { loadFont as loadSerif } from \"@remotion/google-fonts/InstrumentSerif\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport {\n  linearTiming,\n  type TransitionPresentation,\n  type TransitionPresentationComponentProps,\n  TransitionSeries,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  Img,\n  interpolate,\n  random,\n  spring,\n  staticFile,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/remocn/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/remocn/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/remocn/gsh/presets\";\n\nconst geist = loadGeist(\"normal\", {\n  weights: [\"300\", \"400\"],\n  subsets: [\"latin\"],\n});\nconst serif = loadSerif(\"italic\", { weights: [\"400\"], subsets: [\"latin\"] });\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"600\"],\n  subsets: [\"latin\"],\n});\n\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\nfunction RemocnLogo({ fontSize, color }: { fontSize: number; color: string }) {\n  return (\n    <div\n      style={{\n        display: \"flex\",\n        alignItems: \"baseline\",\n        color,\n        fontFamily: manrope.fontFamily,\n        fontWeight: 600,\n        fontSize,\n        letterSpacing: \"-0.025em\",\n        lineHeight: 1,\n      }}\n    >\n      <svg\n        viewBox=\"0 0 124.06 134.26\"\n        style={{ height: \"0.76em\", width: \"auto\" }}\n        aria-hidden\n      >\n        <path fill=\"currentColor\" d={REMOCN_R_PATH} />\n      </svg>\n      <span style={{ marginLeft: \"0.04em\" }}>emocn</span>\n    </div>\n  );\n}\n\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\nexport type LightBurnToLineProps = {\n  origin?: \"right\" | \"left\";\n  subject?: [number, number, number, number];\n  to?: [number, number];\n  lineWidth?: number;\n  lineHeight?: number;\n  light?: string;\n  bloom?: string;\n  sink?: string;\n  count?: number;\n  seed?: number;\n};\n\nexport const lightBurnToLineDefaults: Required<LightBurnToLineProps> = {\n  origin: \"right\",\n  subject: [0.16, 0.15, 0.68, 0.7],\n  to: [0.5, 0.5],\n  lineWidth: 0.6,\n  lineHeight: 0.1,\n  light: \"#ffffff\",\n  bloom: \"#8fb4ff\",\n  sink: \"#01030c\",\n  count: 24,\n  seed: 3,\n};\n\ntype Blob = { x: number; y: number; r: number };\ntype Knot = readonly [number, number, number];\n\nconst mix = (a: number, b: number, t: number) => a + (b - a) * t;\n\nconst smooth = (a: number, b: number, x: number) => {\n  const t = Math.min(1, Math.max(0, (x - a) / (b - a)));\n  return t * t * (3 - 2 * t);\n};\n\nfunction hermite(x: number, knots: readonly Knot[]) {\n  if (x <= knots[0][0]) {\n    return knots[0][1];\n  }\n  for (let i = 1; i < knots.length; i++) {\n    const [x0, y0, m0] = knots[i - 1];\n    const [x1, y1, m1] = knots[i];\n    if (x <= x1) {\n      const h = x1 - x0;\n      const t = (x - x0) / h;\n      const t2 = t * t;\n      const t3 = t2 * t;\n      return (\n        (2 * t3 - 3 * t2 + 1) * y0 +\n        (t3 - 2 * t2 + t) * h * m0 +\n        (3 * t2 - 2 * t3) * y1 +\n        (t3 - t2) * h * m1\n      );\n    }\n  }\n  return knots[knots.length - 1][1];\n}\n\nconst BURN = {\n  sweepEnd: 0.34,\n  travelIn: 0.18,\n  gather: 0.5,\n  travelOut: 0.9,\n  revealIn: 0.58,\n  darkEnd: 0.56,\n} as const;\n\nconst SWEEP: readonly Knot[] = [\n  [0, 0, 1.2],\n  [BURN.sweepEnd, 1, 0],\n];\n\nconst TRAVEL: readonly Knot[] = [\n  [BURN.travelIn, 0, 0],\n  [BURN.gather, 0.5, 1.6],\n  [BURN.travelOut, 1, 0],\n];\n\nfunction burnState(\n  p: number,\n  W: number,\n  H: number,\n  o: Required<LightBurnToLineProps>,\n) {\n  const eat = hermite(p, SWEEP);\n  const travel = hermite(p, TRAVEL);\n  const reveal = smooth(0.42, 0.96, travel);\n  const fade = smooth(BURN.revealIn, 1, p);\n  const dark = smooth(0, BURN.darkEnd, p);\n  const [sx, sy, sw, sh] = o.subject;\n  const wx = sx * W;\n  const wy = sy * H;\n  const ww = sw * W;\n  const wh = sh * H;\n  const dir = o.origin === \"left\" ? -1 : 1;\n  const edge = dir > 0 ? wx + ww : wx;\n  const cx = o.to[0] * W;\n  const cy = o.to[1] * H;\n  const lw = o.lineWidth * W;\n  const lh = o.lineHeight * H;\n  const n = Math.max(4, o.count);\n  const keys = Array.from({ length: n }, (_, j) =>\n    random(`burn-u-${o.seed}-${j}`),\n  );\n  const blobs: Blob[] = [];\n  for (let i = 0; i < n; i++) {\n    const rank = keys.filter((q) => q < keys[i]).length;\n    const u = (rank + 0.5 + (random(`burn-j-${o.seed}-${i}`) - 0.5) * 0.6) / n;\n    const v = random(`burn-v-${o.seed}-${i}`);\n    const s = random(`burn-s-${o.seed}-${i}`);\n    const depth = u ** 1.25 * 0.8;\n    const grow = smooth(depth * 0.7, depth * 0.7 + 0.4, eat);\n    const k = hermite(p + 0.03 - s * 0.06, TRAVEL);\n    const x0 = edge - dir * ww * depth + dir * ww * 0.04;\n    const y0 = wy + wh * (0.16 + 0.68 * v);\n    const xc = cx + (v - 0.5) * lh * 1.4;\n    const yc = cy + (u - 0.5) * lh * 0.8;\n    const t = n === 1 ? 0.5 : i / (n - 1);\n    const xl = cx + (t - 0.5) * lw * 0.94;\n    const yl = cy + (s - 0.5) * lh * 0.16;\n    const a = (1 - k) ** 3;\n    const bc = 3 * k * (1 - k);\n    const d = k ** 3;\n    const r0 = (0.13 + 0.11 * s) * wh;\n    const rc = lh * (0.7 + 0.5 * s);\n    const rl = lh * (0.42 + 0.22 * s);\n    const rMid = 2 * rc - 0.5 * (r0 + rl);\n    const r = (1 - k) ** 2 * r0 + 2 * k * (1 - k) * rMid + k * k * rl;\n    blobs.push({\n      x: a * x0 + bc * xc + d * xl,\n      y: a * y0 + bc * yc + d * yl,\n      r: r * grow * (1 + fade * 0.35),\n    });\n  }\n  return { eat, travel, reveal, fade, dark, blobs, dir };\n}\n\nfunction blobMask(blobs: Blob[], spread: number, alpha: number, full: number) {\n  const layers = blobs.map(\n    (b) =>\n      `radial-gradient(circle at ${b.x.toFixed(1)}px ${b.y.toFixed(1)}px, rgba(0,0,0,${alpha.toFixed(3)}) ${(b.r * 0.55).toFixed(1)}px, rgba(0,0,0,0) ${(b.r * spread).toFixed(1)}px)`,\n  );\n  layers.push(\n    `linear-gradient(rgba(0,0,0,${full.toFixed(3)}), rgba(0,0,0,${full.toFixed(3)}))`,\n  );\n  return layers.join(\", \");\n}\n\nfunction SoftDiscs({\n  blobs,\n  color,\n  core,\n  scale,\n  alpha,\n  W,\n  H,\n}: {\n  blobs: Blob[];\n  color: string;\n  core: number;\n  scale: number;\n  alpha: number;\n  W: number;\n  H: number;\n}) {\n  const id = `burn-soft-${useId().replace(/:/g, \"\")}`;\n  return (\n    <svg\n      width={W}\n      height={H}\n      style={{\n        position: \"absolute\",\n        inset: 0,\n        opacity: alpha,\n        mixBlendMode: \"screen\",\n        pointerEvents: \"none\",\n      }}\n    >\n      <defs>\n        <radialGradient id={id}>\n          <stop offset={0} stopColor={color} stopOpacity={1} />\n          <stop offset={core} stopColor={color} stopOpacity={0.92} />\n          <stop\n            offset={mix(core, 1, 0.45)}\n            stopColor={color}\n            stopOpacity={0.38}\n          />\n          <stop offset={1} stopColor={color} stopOpacity={0} />\n        </radialGradient>\n      </defs>\n      {blobs.map((b, i) =>\n        b.r > 0.5 ? (\n          <circle\n            key={`soft-${i.toString()}`}\n            cx={b.x}\n            cy={b.y}\n            r={b.r * scale}\n            fill={`url(#${id})`}\n          />\n        ) : null,\n      )}\n    </svg>\n  );\n}\n\nconst GOO_RES = 0.5;\n\nfunction LightMass({\n  blobs,\n  alpha,\n  light,\n  bloom,\n  W,\n  H,\n  blur,\n  seed,\n  gather,\n}: {\n  gather: number;\n  seed: number;\n  blobs: Blob[];\n  alpha: number;\n  light: string;\n  bloom: string;\n  W: number;\n  H: number;\n  blur: number;\n}) {\n  const raw = useId().replace(/:/g, \"\");\n  const gooId = `burn-goo-${raw}`;\n  const soft = Math.max(4, H * 0.03);\n  if (alpha <= 0.002) {\n    return null;\n  }\n  return (\n    <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n      <SoftDiscs\n        blobs={blobs}\n        color={bloom}\n        core={0.2}\n        scale={2.3}\n        alpha={alpha * 0.75}\n        W={W}\n        H={H}\n      />\n      <svg\n        width={W * GOO_RES}\n        height={H * GOO_RES}\n        viewBox={`0 0 ${W} ${H}`}\n        style={{\n          position: \"absolute\",\n          left: 0,\n          top: 0,\n          transform: `scale(${1 / GOO_RES})`,\n          transformOrigin: \"0 0\",\n          opacity: alpha * mix(0.9, 1, gather),\n        }}\n      >\n        <defs>\n          <filter\n            id={gooId}\n            x=\"-30%\"\n            y=\"-30%\"\n            width=\"160%\"\n            height=\"160%\"\n            colorInterpolationFilters=\"sRGB\"\n          >\n            <feGaussianBlur in=\"SourceGraphic\" stdDeviation={soft} result=\"b\" />\n            <feColorMatrix\n              in=\"b\"\n              type=\"matrix\"\n              values=\"1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 5 -1.6\"\n              result=\"g\"\n            />\n            <feTurbulence\n              type=\"fractalNoise\"\n              baseFrequency={(2.4 / H).toFixed(5)}\n              numOctaves={2}\n              seed={seed}\n              result=\"n\"\n            />\n            <feDisplacementMap\n              in=\"g\"\n              in2=\"n\"\n              scale={H * 0.07}\n              xChannelSelector=\"R\"\n              yChannelSelector=\"G\"\n              result=\"d\"\n            />\n            <feGaussianBlur\n              in=\"d\"\n              stdDeviation={(soft * 0.22 + blur).toFixed(2)}\n            />\n          </filter>\n        </defs>\n        <g filter={`url(#${gooId})`}>\n          {blobs.map((b, i) =>\n            b.r > 0.5 ? (\n              <circle\n                key={`core-${i.toString()}`}\n                cx={b.x}\n                cy={b.y}\n                r={b.r * mix(0.72, 1, gather)}\n                fill={light}\n              />\n            ) : null,\n          )}\n        </g>\n      </svg>\n    </AbsoluteFill>\n  );\n}\n\nconst LightBurnToLinePresentation: React.FC<\n  TransitionPresentationComponentProps<LightBurnToLineProps>\n> = ({\n  children,\n  presentationProgress,\n  presentationDirection,\n  passedProps,\n}) => {\n  const { width: W, height: H } = useVideoConfig();\n  const o = { ...lightBurnToLineDefaults, ...passedProps };\n  const s = burnState(presentationProgress, W, H, o);\n\n  if (presentationDirection === \"exiting\") {\n    const dim = 1 - 0.55 * s.dark - 0.45 * smooth(0, 0.6, s.travel);\n    const zoom = 1 - 0.03 * s.dark - 0.035 * s.travel;\n    const halo = smooth(0, 0.3, s.eat) * (1 - smooth(0.15, 0.7, s.travel));\n    return (\n      <AbsoluteFill style={{ backgroundColor: o.sink }}>\n        <AbsoluteFill\n          style={{\n            transform: `scale(${zoom})`,\n            transformOrigin: `${o.to[0] * 100}% ${o.to[1] * 100}%`,\n            opacity: dim,\n          }}\n        >\n          {children}\n        </AbsoluteFill>\n        <AbsoluteFill\n          style={{\n            background: `linear-gradient(${s.dir > 0 ? 90 : 270}deg, ${o.sink} 0%, ${o.sink} 12%, transparent 68%)`,\n            opacity: 0.85 * s.dark,\n          }}\n        />\n        {halo > 0.002 ? (\n          <SoftDiscs\n            blobs={s.blobs}\n            color={o.light}\n            core={0.29}\n            scale={2.4}\n            alpha={halo * 0.85}\n            W={W}\n            H={H}\n          />\n        ) : null}\n      </AbsoluteFill>\n    );\n  }\n\n  const heat = 1 - s.fade;\n  const alpha = (1 - s.fade) * (1 - 0.5 * s.reveal);\n  const mask =\n    s.fade < 0.999 ? blobMask(s.blobs, 1.3, s.reveal, s.fade) : undefined;\n  const prev = burnState(\n    Math.max(0, presentationProgress - 1 / 30),\n    W,\n    H,\n    o,\n  ).blobs;\n  const speed =\n    s.blobs.reduce(\n      (acc, b, i) => acc + Math.hypot(b.x - prev[i].x, b.y - prev[i].y),\n      0,\n    ) / s.blobs.length;\n\n  return (\n    <AbsoluteFill>\n      <AbsoluteFill style={{ maskImage: mask, WebkitMaskImage: mask }}>\n        <AbsoluteFill\n          style={{\n            filter:\n              heat > 0.002\n                ? `brightness(${(1 + 1.4 * heat).toFixed(3)})`\n                : undefined,\n          }}\n        >\n          {children}\n        </AbsoluteFill>\n      </AbsoluteFill>\n      <LightMass\n        blobs={s.blobs}\n        alpha={alpha}\n        light={o.light}\n        bloom={o.bloom}\n        W={W}\n        H={H}\n        blur={Math.min(4, speed / 8)}\n        seed={o.seed}\n        gather={smooth(0.1, 0.5, s.travel)}\n      />\n    </AbsoluteFill>\n  );\n};\n\nexport function lightBurnToLine(\n  props: LightBurnToLineProps = {},\n): TransitionPresentation<LightBurnToLineProps> {\n  return { component: LightBurnToLinePresentation, props };\n}\n\ntype Palette = {\n  ink: string;\n  muted: string;\n  accent: string;\n  windowBg: string;\n  sidebar: string;\n  sideInk: string;\n  sideMuted: string;\n  page: string;\n  pageInk: string;\n  pageMuted: string;\n  hairline: string;\n  shadow: string;\n  chip: string;\n  pill: string;\n  light: string;\n  bloom: string;\n  sink: string;\n  groundA: Partial<GradientParams>;\n  groundB: Partial<GradientParams>;\n};\n\nconst THEMES: Record<\"dark\" | \"light\", Palette> = {\n  dark: {\n    ink: \"#f2f5ff\",\n    muted: \"rgba(220,228,255,0.6)\",\n    accent: \"#3b5bfd\",\n    windowBg: \"#0d1018\",\n    sidebar: \"#0f131d\",\n    sideInk: \"#e6ebf7\",\n    sideMuted: \"rgba(214,222,240,0.52)\",\n    page: \"#f4efe4\",\n    pageInk: \"#1d1a16\",\n    pageMuted: \"rgba(29,26,22,0.56)\",\n    hairline: \"rgba(255,255,255,0.09)\",\n    shadow: \"0,4,20\",\n    chip: \"rgba(255,255,255,0.07)\",\n    pill: \"rgba(14,18,30,0.6)\",\n    light: \"#ffffff\",\n    bloom: \"#8fb4ff\",\n    sink: \"#01030c\",\n    groundA: {\n      kind: \"mist\",\n      colors: [\"#9cc0ff\", \"#2f6bff\", \"#1238b8\", \"#030a2a\"],\n      background: \"#010414\",\n      speed: 0.7,\n      loopSeconds: 16,\n      scale: 0.85,\n      warp: 0.4,\n      blur: 0.75,\n      grain: 0.12,\n      seed: 7,\n    },\n    groundB: {\n      kind: \"mist\",\n      colors: [\"#3a6cff\", \"#1438b0\", \"#071650\", \"#01030c\"],\n      background: \"#010208\",\n      speed: 0.6,\n      loopSeconds: 16,\n      scale: 0.7,\n      warp: 0.35,\n      blur: 0.8,\n      grain: 0.12,\n      seed: 21,\n    },\n  },\n  light: {\n    ink: \"#12141a\",\n    muted: \"rgba(18,20,26,0.56)\",\n    accent: \"#2f4ff0\",\n    windowBg: \"#ffffff\",\n    sidebar: \"#f6f6f4\",\n    sideInk: \"#1a1c22\",\n    sideMuted: \"rgba(26,28,34,0.5)\",\n    page: \"#fbf8f1\",\n    pageInk: \"#1d1a16\",\n    pageMuted: \"rgba(29,26,22,0.56)\",\n    hairline: \"rgba(20,24,40,0.1)\",\n    shadow: \"30,40,90\",\n    chip: \"rgba(20,24,40,0.05)\",\n    pill: \"rgba(255,255,255,0.72)\",\n    light: \"#ffffff\",\n    bloom: \"#c4d2ff\",\n    sink: \"#7f90d2\",\n    groundA: {\n      kind: \"mist\",\n      colors: [\"#3d5cf5\", \"#7f98ff\", \"#c9d4ff\", \"#1f2f9e\"],\n      background: \"#aebcf2\",\n      speed: 0.7,\n      loopSeconds: 16,\n      scale: 0.85,\n      warp: 0.4,\n      blur: 0.7,\n      grain: 0.18,\n      seed: 7,\n    },\n    groundB: {\n      kind: \"mist\",\n      colors: [\"#8ea4ff\", \"#c6d1ff\", \"#e9ecfa\", \"#5a72e6\"],\n      background: \"#f1f0ec\",\n      speed: 0.6,\n      loopSeconds: 16,\n      scale: 0.8,\n      warp: 0.35,\n      blur: 0.75,\n      grain: 0.24,\n      seed: 11,\n    },\n  },\n};\n\nconst A_LEN = 78;\nconst B_LEN = 84;\nconst T_LEN = 36;\nexport const LIGHT_BURN_TO_LINE_DURATION = A_LEN + B_LEN - T_LEN;\n\nconst A_BEATS = { window: 0, chat: 6, check: 18, photos: 24 } as const;\nconst B_BEATS = { line: 12, settle: 34, pill: 42 } as const;\n\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\n\nfunction layout(W: number, H: number) {\n  const tall = H > W * 1.1;\n  if (tall) {\n    return {\n      tall,\n      subject: [0.06, 0.2, 0.88, 0.56] as [number, number, number, number],\n      to: [0.5, 0.47] as [number, number],\n      lineWidth: 0.78,\n      lineHeight: 0.13,\n    };\n  }\n  return {\n    tall,\n    subject: [0.14, 0.13, 0.72, 0.74] as [number, number, number, number],\n    to: [0.5, 0.47] as [number, number],\n    lineWidth: 0.66,\n    lineHeight: 0.12,\n  };\n}\n\nfunction Icon({ d, size, color }: { d: string; size: number; color: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" width={size} height={size} aria-hidden>\n      <path\n        d={d}\n        fill=\"none\"\n        stroke={color}\n        strokeWidth=\"1.5\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n\nconst ICONS = {\n  back: \"M15 6l-6 6 6 6\",\n  fwd: \"M9 6l6 6-6 6\",\n  lock: \"M7 11V8a5 5 0 0110 0v3M6 11h12v9H6z\",\n  check: \"M5 12.5l4.5 4.5L19 7.5\",\n  send: \"M12 19V5M6 11l6-6 6 6\",\n  plus: \"M12 5v14M5 12h14\",\n};\n\nfunction SceneA({\n  palette,\n  ground,\n  groundParams,\n}: {\n  palette: Palette;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}) {\n  const frame = useCurrentFrame();\n  const { width: W, height: H, fps } = useVideoConfig();\n  const L = layout(W, H);\n  const [sx, sy, sw, sh] = L.subject;\n  const u = Math.min(W, H) / 720;\n  const lift = spring({ frame: frame - A_BEATS.window, fps, config: HEAVY });\n  const push = interpolate(frame, [0, A_LEN], [1, 1.035], CLAMP);\n  const chat = interpolate(frame, [A_BEATS.chat, A_BEATS.chat + 12], [0, 1], {\n    ...CLAMP,\n    easing: ENTER,\n  });\n  const check = spring({ frame: frame - A_BEATS.check, fps, config: CHIP });\n  const photos = [0, 1, 2].map((i) =>\n    spring({ frame: frame - A_BEATS.photos - i * 3, fps, config: CARD }),\n  );\n  const sideW = L.tall ? 0 : sw * W * 0.3;\n  const fs = 15.5 * u;\n  const pagePad = (L.tall ? 26 : 24) * u;\n\n  return (\n    <AbsoluteFill>\n      <GshGround\n        preset={ground}\n        params={ground ? groundParams : { ...palette.groundA, ...groundParams }}\n        timeOffset={5}\n        timeScale={0.7}\n      />\n      <AbsoluteFill style={{ transform: `scale(${push})` }}>\n        <div\n          style={{\n            position: \"absolute\",\n            left: sx * W,\n            top: sy * H,\n            width: sw * W,\n            height: sh * H,\n            borderRadius: 14 * u,\n            overflow: \"hidden\",\n            backgroundColor: palette.windowBg,\n            fontFamily: geist.fontFamily,\n            transform: `translateY(${(1 - lift) * 40 * u}px) scale(${0.96 + 0.04 * lift})`,\n            opacity: interpolate(lift, [0, 0.3], [0, 1], CLAMP),\n            boxShadow: `0 1px 2px rgba(${palette.shadow},0.3), 0 18px 40px rgba(${palette.shadow},0.35), 0 50px 110px rgba(${palette.shadow},0.45), inset 0 0 0 1px ${palette.hairline}`,\n            display: \"flex\",\n            flexDirection: \"column\",\n          }}\n        >\n          <div\n            style={{\n              height: 44 * u,\n              flexShrink: 0,\n              display: \"flex\",\n              alignItems: \"center\",\n              gap: 10 * u,\n              padding: `0 ${14 * u}px`,\n              borderBottom: `1px solid ${palette.hairline}`,\n              backgroundColor: palette.sidebar,\n            }}\n          >\n            {[\"#ff6159\", \"#ffbd2e\", \"#28c941\"].map((c) => (\n              <div\n                key={c}\n                style={{\n                  width: 10 * u,\n                  height: 10 * u,\n                  borderRadius: 99,\n                  backgroundColor: c,\n                  opacity: 0.85,\n                }}\n              />\n            ))}\n            <div style={{ display: \"flex\", gap: 4 * u, marginLeft: 8 * u }}>\n              <Icon d={ICONS.back} size={16 * u} color={palette.sideMuted} />\n              <Icon d={ICONS.fwd} size={16 * u} color={palette.sideMuted} />\n            </div>\n            <div\n              style={{\n                flex: 1,\n                display: \"flex\",\n                justifyContent: \"center\",\n              }}\n            >\n              <div\n                style={{\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  gap: 6 * u,\n                  padding: `${5 * u}px ${14 * u}px`,\n                  borderRadius: 8 * u,\n                  backgroundColor: palette.chip,\n                  color: palette.sideMuted,\n                  fontSize: fs,\n                }}\n              >\n                <Icon d={ICONS.lock} size={12 * u} color={palette.sideMuted} />\n                lumen.app/launch\n              </div>\n            </div>\n            <div\n              style={{\n                padding: `${6 * u}px ${12 * u}px`,\n                borderRadius: 8 * u,\n                backgroundColor: palette.accent,\n                color: \"#fff\",\n                fontSize: fs,\n                fontWeight: 400,\n              }}\n            >\n              Publish\n            </div>\n          </div>\n          <div style={{ flex: 1, display: \"flex\", minHeight: 0 }}>\n            {L.tall ? null : (\n              <div\n                style={{\n                  width: sideW,\n                  flexShrink: 0,\n                  backgroundColor: palette.sidebar,\n                  borderRight: `1px solid ${palette.hairline}`,\n                  padding: 14 * u,\n                  display: \"flex\",\n                  flexDirection: \"column\",\n                  gap: 10 * u,\n                  color: palette.sideInk,\n                  fontSize: fs,\n                }}\n              >\n                <div\n                  style={{\n                    alignSelf: \"flex-end\",\n                    maxWidth: \"88%\",\n                    padding: `${8 * u}px ${11 * u}px`,\n                    borderRadius: 10 * u,\n                    backgroundColor: palette.chip,\n                    boxShadow: `inset 0 0 0 1px ${palette.hairline}`,\n                    lineHeight: 1.35,\n                    opacity: chat,\n                    transform: `translateY(${(1 - chat) * 10 * u}px)`,\n                  }}\n                >\n                  Make the hero calmer and add the product shots.\n                </div>\n                <div\n                  style={{\n                    display: \"flex\",\n                    flexDirection: \"column\",\n                    gap: 7 * u,\n                    color: palette.sideMuted,\n                    opacity: chat,\n                  }}\n                >\n                  {[\n                    \"Softened the headline\",\n                    \"Added 3 product shots\",\n                    \"Tuned the type scale\",\n                  ].map((t, i) => (\n                    <div\n                      key={t}\n                      style={{\n                        display: \"flex\",\n                        alignItems: \"center\",\n                        gap: 7 * u,\n                        opacity: interpolate(\n                          check,\n                          [i * 0.2, i * 0.2 + 0.4],\n                          [0, 1],\n                          CLAMP,\n                        ),\n                      }}\n                    >\n                      <div\n                        style={{\n                          width: 16 * u,\n                          height: 16 * u,\n                          borderRadius: 99,\n                          backgroundColor: \"rgba(59,91,253,0.18)\",\n                          display: \"flex\",\n                          alignItems: \"center\",\n                          justifyContent: \"center\",\n                          transform: `scale(${0.6 + 0.4 * check})`,\n                        }}\n                      >\n                        <Icon d={ICONS.check} size={11 * u} color=\"#7d97ff\" />\n                      </div>\n                      {t}\n                    </div>\n                  ))}\n                </div>\n                <div style={{ flex: 1 }} />\n                <div\n                  style={{\n                    borderRadius: 10 * u,\n                    boxShadow: `inset 0 0 0 1px ${palette.hairline}`,\n                    padding: 10 * u,\n                    display: \"flex\",\n                    flexDirection: \"column\",\n                    gap: 10 * u,\n                    color: palette.sideMuted,\n                  }}\n                >\n                  Ask for a change…\n                  <div\n                    style={{\n                      display: \"flex\",\n                      justifyContent: \"space-between\",\n                      alignItems: \"center\",\n                    }}\n                  >\n                    <Icon\n                      d={ICONS.plus}\n                      size={15 * u}\n                      color={palette.sideMuted}\n                    />\n                    <div\n                      style={{\n                        width: 22 * u,\n                        height: 22 * u,\n                        borderRadius: 99,\n                        backgroundColor: palette.accent,\n                        display: \"flex\",\n                        alignItems: \"center\",\n                        justifyContent: \"center\",\n                      }}\n                    >\n                      <Icon d={ICONS.send} size={13 * u} color=\"#fff\" />\n                    </div>\n                  </div>\n                </div>\n              </div>\n            )}\n            <div\n              style={{\n                flex: 1,\n                backgroundColor: palette.page,\n                padding: pagePad,\n                display: \"flex\",\n                flexDirection: \"column\",\n                gap: 14 * u,\n                color: palette.pageInk,\n                minWidth: 0,\n              }}\n            >\n              <div\n                style={{\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  justifyContent: \"space-between\",\n                  fontSize: fs,\n                  color: palette.pageMuted,\n                }}\n              >\n                <div\n                  style={{\n                    fontFamily: serif.fontFamily,\n                    fontStyle: \"italic\",\n                    fontSize: 20 * u,\n                    color: palette.pageInk,\n                  }}\n                >\n                  Lumen\n                </div>\n                <div\n                  style={{ display: \"flex\", gap: 14 * u, alignItems: \"center\" }}\n                >\n                  {L.tall ? null : (\n                    <>\n                      <span>Product</span>\n                      <span>Stories</span>\n                      <span>Pricing</span>\n                    </>\n                  )}\n                  <span\n                    style={{\n                      padding: `${5 * u}px ${11 * u}px`,\n                      borderRadius: 99,\n                      backgroundColor: \"#c2412d\",\n                      color: \"#fff\",\n                    }}\n                  >\n                    Get early access\n                  </span>\n                </div>\n              </div>\n              <div\n                style={{\n                  fontFamily: serif.fontFamily,\n                  fontStyle: \"italic\",\n                  fontSize: (L.tall ? 50 : 42) * u,\n                  lineHeight: 1,\n                  letterSpacing: \"-0.02em\",\n                  marginTop: 8 * u,\n                }}\n              >\n                Your next launch,\n                <br />\n                already in motion.\n              </div>\n              <div\n                style={{\n                  display: \"flex\",\n                  gap: 8 * u,\n                  fontSize: 14.5 * u,\n                  color: palette.pageMuted,\n                }}\n              >\n                {[\"Teaser\", \"Walkthrough\", \"Changelog\", \"Cutdowns\"].map(\n                  (t, i) => (\n                    <span\n                      key={t}\n                      style={{\n                        padding: `${4 * u}px ${10 * u}px`,\n                        borderRadius: 99,\n                        backgroundColor:\n                          i === 0 ? palette.pageInk : \"rgba(29,26,22,0.06)\",\n                        color: i === 0 ? palette.page : palette.pageMuted,\n                      }}\n                    >\n                      {t}\n                    </span>\n                  ),\n                )}\n              </div>\n              <div\n                style={{\n                  flex: 1,\n                  display: \"flex\",\n                  gap: 10 * u,\n                  minHeight: 0,\n                }}\n              >\n                {[\n                  \"templates/product-showcase/sculpture.jpg\",\n                  \"templates/launch-anything/horizon.jpg\",\n                  \"templates/brand-guidelines/ceramics.jpg\",\n                ].map((src, i) => (\n                  <div\n                    key={src}\n                    style={{\n                      flex: i === 1 ? 1.25 : 1,\n                      borderRadius: 10 * u,\n                      overflow: \"hidden\",\n                      position: \"relative\",\n                      opacity: interpolate(photos[i], [0, 0.35], [0, 1], CLAMP),\n                      transform: `translateY(${(1 - photos[i]) * 24 * u}px)`,\n                      boxShadow:\n                        \"0 1px 2px rgba(0,0,0,0.12), 0 10px 24px rgba(0,0,0,0.12)\",\n                    }}\n                  >\n                    <Img\n                      src={staticFile(src)}\n                      style={{\n                        position: \"absolute\",\n                        inset: 0,\n                        width: \"100%\",\n                        height: \"100%\",\n                        objectFit: \"cover\",\n                        transform: `scale(${1.1 - 0.1 * photos[i]})`,\n                      }}\n                    />\n                  </div>\n                ))}\n              </div>\n            </div>\n          </div>\n        </div>\n      </AbsoluteFill>\n    </AbsoluteFill>\n  );\n}\n\nfunction SceneB({\n  line,\n  cta,\n  url,\n  palette,\n  ground,\n  groundParams,\n}: {\n  line: string;\n  cta: string;\n  url: string;\n  palette: Palette;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}) {\n  const frame = useCurrentFrame();\n  const { width: W, height: H, fps } = useVideoConfig();\n  const L = layout(W, H);\n  const u = Math.min(W, H) / 720;\n  const fs = L.tall ? W * 0.105 : W * 0.06;\n  const pu = L.tall ? W / 480 : u;\n  const settle = interpolate(frame, [B_BEATS.line, B_BEATS.settle], [0, 1], {\n    ...CLAMP,\n    easing: Easing.bezier(0.45, 0, 0.25, 1),\n  });\n  const pill = spring({ frame: frame - B_BEATS.pill, fps, config: CHIP });\n  const push = interpolate(frame, [0, B_LEN], [1.02, 1.05], CLAMP);\n  const words = line.split(\" \");\n  const mid = Math.ceil(words.length / 2);\n\n  return (\n    <AbsoluteFill>\n      <GshGround\n        preset={ground}\n        params={ground ? groundParams : { ...palette.groundB, ...groundParams }}\n        timeOffset={9}\n        timeScale={0.6}\n      />\n      <AbsoluteFill\n        style={{\n          transform: `scale(${push})`,\n          transformOrigin: `${L.to[0] * 100}% ${L.to[1] * 100}%`,\n        }}\n      >\n        <div\n          style={{\n            position: \"absolute\",\n            left: 0,\n            right: 0,\n            top: L.to[1] * H,\n            transform: \"translateY(-50%)\",\n            display: \"flex\",\n            justifyContent: \"center\",\n          }}\n        >\n          <div\n            style={{\n              fontFamily: geist.fontFamily,\n              fontWeight: 300,\n              fontSize: fs,\n              lineHeight: 1.04,\n              color: palette.ink,\n              textAlign: \"center\",\n              letterSpacing: `${(0.16 * (1 - settle) - 0.035).toFixed(4)}em`,\n              filter:\n                settle < 0.99\n                  ? `blur(${((1 - settle) * 8 * u).toFixed(2)}px)`\n                  : undefined,\n              whiteSpace: \"nowrap\",\n            }}\n          >\n            {L.tall ? (\n              <>\n                {words.slice(0, mid).join(\" \")}\n                <br />\n                {words.slice(mid).join(\" \")}\n              </>\n            ) : (\n              line\n            )}\n          </div>\n        </div>\n        <div\n          style={{\n            position: \"absolute\",\n            left: 0,\n            right: 0,\n            top: L.to[1] * H + fs * (L.tall ? 1.45 : 0.95),\n            display: \"flex\",\n            justifyContent: \"center\",\n          }}\n        >\n          <div\n            style={{\n              display: \"flex\",\n              alignItems: \"center\",\n              gap: 12 * pu,\n              padding: `${7 * pu}px ${7 * pu}px ${7 * pu}px ${16 * pu}px`,\n              borderRadius: 99,\n              backgroundColor: palette.pill,\n              boxShadow: `inset 0 0 0 1px ${palette.hairline}, inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 30px rgba(${palette.shadow},0.3)`,\n              fontFamily: geist.fontFamily,\n              fontSize: 20 * pu,\n              color: palette.muted,\n              opacity: interpolate(pill, [0, 0.3], [0, 1], CLAMP),\n              transform: `translateY(${(1 - pill) * 16 * pu}px) scale(${0.9 + 0.1 * pill})`,\n            }}\n          >\n            <RemocnLogo fontSize={20 * pu} color={palette.ink} />\n            <span>{url}</span>\n            <span\n              style={{\n                padding: `${7 * pu}px ${14 * pu}px`,\n                borderRadius: 99,\n                backgroundColor: palette.accent,\n                color: \"#fff\",\n              }}\n            >\n              {cta}\n            </span>\n          </div>\n        </div>\n      </AbsoluteFill>\n    </AbsoluteFill>\n  );\n}\n\nexport interface LightBurnToLineDemoProps {\n  theme?: \"dark\" | \"light\";\n  accent?: string;\n  line?: string;\n  cta?: string;\n  url?: string;\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n  groundB?: GshPresetId;\n  groundParamsB?: Partial<GradientParams>;\n  transition?: LightBurnToLineProps;\n}\n\nexport function LightBurnToLineDemo({\n  theme = \"dark\",\n  accent,\n  line = \"Now ship your first film.\",\n  cta = \"Start free\",\n  url = \"remocn.dev/new\",\n  ground,\n  groundParams,\n  groundB,\n  groundParamsB,\n  transition,\n}: LightBurnToLineDemoProps) {\n  const { width: W, height: H } = useVideoConfig();\n  const base = THEMES[theme];\n  const palette = accent ? { ...base, accent } : base;\n  const L = layout(W, H);\n  return (\n    <AbsoluteFill style={{ backgroundColor: palette.sink }}>\n      <TransitionSeries>\n        <TransitionSeries.Sequence durationInFrames={A_LEN}>\n          <SceneA\n            palette={palette}\n            ground={ground}\n            groundParams={groundParams}\n          />\n        </TransitionSeries.Sequence>\n        <TransitionSeries.Transition\n          presentation={lightBurnToLine({\n            subject: L.subject,\n            to: L.to,\n            lineWidth: L.lineWidth,\n            lineHeight: L.lineHeight,\n            light: palette.light,\n            bloom: palette.bloom,\n            sink: palette.sink,\n            ...transition,\n          })}\n          timing={linearTiming({ durationInFrames: T_LEN })}\n        />\n        <TransitionSeries.Sequence durationInFrames={B_LEN}>\n          <SceneB\n            line={line}\n            cta={cta}\n            url={url}\n            palette={palette}\n            ground={groundB}\n            groundParams={groundParamsB}\n          />\n        </TransitionSeries.Sequence>\n      </TransitionSeries>\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/light-burn-to-line.tsx"
    }
  ],
  "type": "registry:component"
}
