{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cinema-split-reveal",
  "type": "registry:component",
  "title": "Cinema Split Reveal",
  "description": "A split-screen poster for two leads, a rain-soaked night harbor against a desert at dusk, divided by a glowing diagonal seam. Hovering or focusing a side pushes the seam across, opens that character's line and recolors the shared title.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "cinematic",
    "cinematic",
    "split screen",
    "diagonal",
    "characters",
    "series",
    "hero"
  ],
  "docs": "https://hyperblur.dev/effects/cinema-split-reveal",
  "files": [
    {
      "path": "registry/hyperblur/cinema-split-reveal.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/cinema-split-reveal.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface CinemaSplitSide {\n  name: string;\n  role: string;\n  quote: string;\n  accent: string;\n}\n\nexport type CinemaSplitActive = \"left\" | \"right\" | null;\n\nexport interface CinemaSplitRevealProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  tagline?: string;\n  left?: CinemaSplitSide;\n  right?: CinemaSplitSide;\n  autoPlay?: boolean;\n  interval?: number;\n  slant?: number;\n  onSideChange?: (side: CinemaSplitActive) => void;\n  headingAs?: \"h1\" | \"h2\";\n}\n\nconst css = `\n.hb-vc8 {\n  position: relative;\n  box-sizing: border-box;\n  display: block;\n  width: 100%;\n  height: 580px;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #000;\n  color: #fff;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vc8 *, .hb-vc8 *::before, .hb-vc8 *::after { box-sizing: border-box; }\n.hb-vc8-half {\n  position: absolute;\n  inset: 0;\n  transition: clip-path 1.1s cubic-bezier(.76, 0, .24, 1);\n}\n.hb-vc8-half[data-side=\"left\"] { background: linear-gradient(180deg, #050b18 0%, #0c1c36 55%, #13294a 75%, #060a12 100%); }\n.hb-vc8-half[data-side=\"right\"] { background: linear-gradient(180deg, #1c0c06 0%, #6b2a10 45%, #e0773a 68%, #3a1608 100%); }\n.hb-vc8-art { position: absolute; inset: 0; transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }\n.hb-vc8-art svg { display: block; width: 100%; height: 100%; }\n.hb-vc8-half[data-state=\"grow\"] .hb-vc8-art { transform: scale(1.06); }\n.hb-vc8-rain {\n  position: absolute;\n  inset: -20% 0 0;\n  background: repeating-linear-gradient(100deg, transparent 0 18px, rgba(170, 200, 255, .12) 18px 19px, transparent 19px 41px);\n  animation: hb-vc8-rain .6s linear infinite;\n}\n@keyframes hb-vc8-rain {\n  from { transform: translate3d(0, 0, 0); }\n  to { transform: translate3d(-12px, 20%, 0); }\n}\n.hb-vc8-heat {\n  position: absolute;\n  inset: 0;\n  background: radial-gradient(50% 30% at 70% 66%, rgba(255, 220, 160, .35), transparent 70%);\n  animation: hb-vc8-heat 4s ease-in-out infinite alternate;\n}\n@keyframes hb-vc8-heat {\n  from { opacity: .6; transform: translate3d(0, 0, 0); }\n  to { opacity: 1; transform: translate3d(0, -6px, 0); }\n}\n.hb-vc8-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent 45%); }\n.hb-vc8-card {\n  position: absolute;\n  bottom: clamp(26px, 6cqi, 56px);\n  z-index: 2;\n  display: flex;\n  flex-direction: column;\n  max-width: min(320px, 38cqi);\n  padding: 0;\n  border: 0;\n  background: none;\n  color: inherit;\n  font: inherit;\n  text-align: inherit;\n  cursor: pointer;\n  transition: opacity .6s ease, transform .9s cubic-bezier(.2, .7, .2, 1);\n}\n.hb-vc8-card:focus-visible { outline: 2px solid var(--hb-vc8-c); outline-offset: 8px; border-radius: 6px; }\n.hb-vc8-half[data-side=\"left\"] .hb-vc8-card { left: clamp(20px, 5cqi, 56px); text-align: left; align-items: flex-start; }\n.hb-vc8-half[data-side=\"right\"] .hb-vc8-card { right: clamp(20px, 5cqi, 56px); text-align: right; align-items: flex-end; }\n.hb-vc8-half[data-state=\"shrink\"] .hb-vc8-card { opacity: .18; }\n.hb-vc8-half[data-state=\"grow\"] .hb-vc8-card { transform: translate3d(0, -6px, 0); }\n.hb-vc8-role {\n  color: var(--hb-vc8-c);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 10.5px;\n  letter-spacing: .24em;\n  text-transform: uppercase;\n}\n.hb-vc8-name {\n  margin-top: 8px;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(26px, 4.4cqi, 48px);\n  font-weight: 700;\n  line-height: 1;\n  letter-spacing: -.02em;\n  text-transform: uppercase;\n}\n.hb-vc8-quote {\n  max-height: 0;\n  margin-top: 0;\n  overflow: hidden;\n  color: rgba(255, 255, 255, .78);\n  font-size: 14px;\n  line-height: 1.5;\n  opacity: 0;\n  transition: max-height .8s cubic-bezier(.2, .7, .2, 1), opacity .5s ease, margin-top .6s ease;\n}\n.hb-vc8-half[data-state=\"grow\"] .hb-vc8-quote { max-height: 80px; margin-top: 10px; opacity: 1; }\n.hb-vc8-hint {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  margin-top: 12px;\n  color: rgba(255, 255, 255, .6);\n  font-size: 12px;\n}\n.hb-vc8-hint::before { content: \"\"; width: 18px; height: 1px; background: var(--hb-vc8-c); }\n.hb-vc8-title {\n  position: absolute;\n  left: 0;\n  right: 0;\n  top: 40%;\n  z-index: 1;\n  margin: 0;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(48px, 12.5cqi, 168px);\n  font-weight: 700;\n  line-height: .9;\n  letter-spacing: -.05em;\n  text-align: center;\n  text-transform: uppercase;\n  transform: translateY(-50%);\n  pointer-events: none;\n}\n.hb-vc8-half[data-side=\"left\"] .hb-vc8-title { color: #dbe8ff; text-shadow: 0 0 60px rgba(90, 150, 255, .45); }\n.hb-vc8-half[data-side=\"right\"] .hb-vc8-title { color: #fff1e0; text-shadow: 0 0 60px rgba(255, 140, 60, .45); }\n.hb-vc8-tag {\n  position: absolute;\n  left: 50%;\n  top: 18px;\n  z-index: 4;\n  padding: 6px 12px;\n  border: 1px solid rgba(255, 255, 255, .18);\n  border-radius: 999px;\n  background: rgba(0, 0, 0, .4);\n  color: rgba(255, 255, 255, .82);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 10.5px;\n  letter-spacing: .18em;\n  text-transform: uppercase;\n  white-space: nowrap;\n  transform: translateX(-50%);\n  backdrop-filter: blur(8px);\n}\n.hb-vc8-seam {\n  position: absolute;\n  inset: 0;\n  z-index: 3;\n  width: 100%;\n  height: 100%;\n  pointer-events: none;\n  overflow: visible;\n}\n.hb-vc8-seam line {\n  stroke: #ffffff;\n  stroke-width: 1.5;\n  vector-effect: non-scaling-stroke;\n  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .8));\n  transition: transform 1.1s cubic-bezier(.76, 0, .24, 1);\n}\n@container (max-width: 560px) {\n  .hb-vc8-card { max-width: 44cqi; }\n  .hb-vc8-quote { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vc8-half, .hb-vc8-art, .hb-vc8-card, .hb-vc8-quote, .hb-vc8-seam line { transition: none; }\n  .hb-vc8-rain, .hb-vc8-heat { animation: none; }\n}\n`;\n\nconst defaultLeft: CinemaSplitSide = {\n  name: \"Mara\",\n  role: \"Harbor police · Night shift\",\n  quote: \"She has been chasing the same signal across the bay for nine years.\",\n  accent: \"#6fa8ff\",\n};\n\nconst defaultRight: CinemaSplitSide = {\n  name: \"Elias\",\n  role: \"Salvage pilot · Day crew\",\n  quote: \"He knows exactly where it comes from, and why it must never be found.\",\n  accent: \"#ffa04d\",\n};\n\nconst drops = Array.from({ length: 26 }, (_, i) => {\n  const h = Math.imul(i + 5, 2654435761) >>> 0;\n  return { x: (h % 1600), y: 420 + ((h >>> 7) % 380), w: 20 + ((h >>> 3) % 60), o: (0.15 + ((h >>> 11) % 40) / 100).toFixed(2) };\n});\n\nexport function CinemaSplitReveal({\n  title = \"Two Shores\",\n  tagline = \"A Coldwater original · Season one\",\n  left = defaultLeft,\n  right = defaultRight,\n  autoPlay = true,\n  interval = 2600,\n  slant = 6,\n  onSideChange,\n  headingAs = \"h1\",\n  className,\n  style,\n  ...rest\n}: CinemaSplitRevealProps) {\n  const Heading = headingAs;\n  const [active, setActive] = React.useState<CinemaSplitActive>(null);\n  const [touched, setTouched] = React.useState(false);\n  const changeRef = React.useRef(onSideChange);\n\n  React.useEffect(() => {\n    changeRef.current = onSideChange;\n  }, [onSideChange]);\n\n  React.useEffect(() => {\n    if (!autoPlay || touched) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    const order: CinemaSplitActive[] = [null, \"left\", null, \"right\"];\n    let i = 0;\n    const id = window.setInterval(() => {\n      i = (i + 1) % order.length;\n      setActive(order[i]);\n    }, interval);\n    return () => window.clearInterval(id);\n  }, [autoPlay, touched, interval]);\n\n  const choose = (side: CinemaSplitActive) => {\n    setTouched(true);\n    setActive(side);\n    changeRef.current?.(side);\n  };\n\n  const s = active === \"left\" ? 70 : active === \"right\" ? 30 : 50;\n  const leftClip = `polygon(0% 0%, ${s + slant}% 0%, ${s - slant}% 100%, 0% 100%)`;\n  const rightClip = `polygon(${s + slant}% 0%, 100% 0%, 100% 100%, ${s - slant}% 100%)`;\n  const stateOf = (side: \"left\" | \"right\") => (active === null ? \"idle\" : active === side ? \"grow\" : \"shrink\");\n\n  const sides: { key: \"left\" | \"right\"; data: CinemaSplitSide; clip: string }[] = [\n    { key: \"left\", data: left, clip: leftClip },\n    { key: \"right\", data: right, clip: rightClip },\n  ];\n\n  return (\n    <section\n      className={[\"hb-vc8\", className].filter(Boolean).join(\" \")}\n      style={style}\n      onPointerLeave={() => {\n        if (touched) {\n          setActive(null);\n          changeRef.current?.(null);\n        }\n      }}\n      {...rest}\n    >\n      <style href=\"hb-cinema-split-reveal\" precedence=\"default\">{css}</style>\n      {sides.map(({ key, data, clip }) => (\n        <div\n          key={key}\n          className=\"hb-vc8-half\"\n          data-side={key}\n          data-state={stateOf(key)}\n          style={{ clipPath: clip, \"--hb-vc8-c\": data.accent } as React.CSSProperties}\n          onPointerEnter={(e) => {\n            if (e.pointerType !== \"touch\") choose(key);\n          }}\n        >\n          <div className=\"hb-vc8-art\" aria-hidden=\"true\">\n            {key === \"left\" ? (\n              <>\n                <svg viewBox=\"0 0 1600 900\" preserveAspectRatio=\"xMidYMid slice\">\n                  {[[40, 300, 120], [170, 220, 90], [270, 340, 130], [420, 180, 110], [540, 280, 100], [650, 380, 140]].map(([x, y, w], i) => (\n                    <g key={i}>\n                      <rect x={x} y={y} width={w} height={720 - y} fill=\"#081224\" />\n                      {Array.from({ length: 10 }, (_, r) => (\n                        <rect key={r} x={x + 12} y={y + 20 + r * 34} width={w - 24} height=\"3\" fill=\"#6fa8ff\" opacity={((Math.imul(i * 13 + r, 2654435761) >>> 0) % 3 === 0 ? 0.5 : 0.08).toFixed(2)} />\n                      ))}\n                    </g>\n                  ))}\n                  <rect y=\"720\" width=\"1600\" height=\"180\" fill=\"#050a14\" />\n                  {drops.map((d, i) => (\n                    <rect key={i} x={d.x} y={d.y + 320} width={d.w} height=\"2\" fill=\"#6fa8ff\" opacity={d.o} />\n                  ))}\n                </svg>\n                <span className=\"hb-vc8-rain\" />\n              </>\n            ) : (\n              <>\n                <svg viewBox=\"0 0 1600 900\" preserveAspectRatio=\"xMidYMid slice\">\n                  <circle cx=\"1150\" cy=\"560\" r=\"90\" fill=\"#ffe2b0\" opacity=\".9\" />\n                  <path d=\"M800 660 C980 600 1140 640 1300 620 C1420 606 1520 630 1600 640 L1600 900 L800 900Z\" fill=\"#8a3a14\" />\n                  <path d=\"M800 720 C960 690 1120 740 1280 712 C1400 694 1500 716 1600 726 L1600 900 L800 900Z\" fill=\"#4a1c08\" />\n                  <path d=\"M800 800 C1000 770 1200 820 1600 790 L1600 900 L800 900Z\" fill=\"#200b04\" />\n                  <path d=\"M1240 700 L1246 640 L1252 700Z\" fill=\"#1a0803\" />\n                </svg>\n                <span className=\"hb-vc8-heat\" />\n              </>\n            )}\n            <span className=\"hb-vc8-shade\" />\n          </div>\n          {key === \"left\" ? <Heading className=\"hb-vc8-title\">{title}</Heading> : <div className=\"hb-vc8-title\" aria-hidden=\"true\">{title}</div>}\n          <button\n            type=\"button\"\n            className=\"hb-vc8-card\"\n            aria-pressed={active === key}\n            onClick={() => choose(active === key ? null : key)}\n            onFocus={() => choose(key)}\n          >\n            <span className=\"hb-vc8-role\">{data.role}</span>\n            <span className=\"hb-vc8-name\">{data.name}</span>\n            <span className=\"hb-vc8-quote\">{data.quote}</span>\n            <span className=\"hb-vc8-hint\">Follow {data.name}</span>\n          </button>\n        </div>\n      ))}\n      <svg className=\"hb-vc8-seam\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n        <line x1={50 + slant} y1=\"0\" x2={50 - slant} y2=\"100\" style={{ transform: `translateX(${s - 50}px)` }} />\n      </svg>\n      {tagline ? <span className=\"hb-vc8-tag\">{tagline}</span> : null}\n    </section>\n  );\n}\n"
    }
  ]
}