{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cinema-depth-fog",
  "type": "registry:component",
  "title": "Cinema Depth Fog",
  "description": "Five mountain ridges at different depths with fog banks drifting between them, a pale sun and birds crossing the sky. Each layer shifts with the pointer by its own depth, and an altitude scale runs down the right edge.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "cinematic",
    "cinematic",
    "parallax",
    "fog",
    "landscape",
    "documentary",
    "hero"
  ],
  "docs": "https://hyperblur.dev/effects/cinema-depth-fog",
  "files": [
    {
      "path": "registry/hyperblur/cinema-depth-fog.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/cinema-depth-fog.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface CinemaDepthFogAction {\n  label: string;\n  href: string;\n}\n\nexport interface CinemaDepthFogProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  kicker?: string;\n  title?: string;\n  subtitle?: string;\n  cta?: CinemaDepthFogAction | null;\n  altitudes?: string[];\n  tint?: string;\n  fog?: number;\n  depth?: number;\n  speed?: number;\n  headingAs?: \"h1\" | \"h2\";\n}\n\nconst css = `\n.hb-vc7 {\n  --hb-vc7-tint: #7fa6c4;\n  --hb-vc7-fog: .7;\n  --hb-vc7-depth: 1;\n  --hb-vc7-speed: 1;\n  --hb-vc7-px: 0;\n  --hb-vc7-py: 0;\n  position: relative;\n  box-sizing: border-box;\n  display: block;\n  width: 100%;\n  height: 600px;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: linear-gradient(180deg, #0b1118 0%, color-mix(in srgb, var(--hb-vc7-tint) 32%, #0b1118) 55%, color-mix(in srgb, var(--hb-vc7-tint) 55%, #1a2230) 72%, #05070a 100%);\n  color: #eef3f7;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vc7 *, .hb-vc7 *::before, .hb-vc7 *::after { box-sizing: border-box; }\n.hb-vc7-sway {\n  position: absolute;\n  inset: -4% -6%;\n  animation: hb-vc7-sway calc(22s / var(--hb-vc7-speed)) ease-in-out infinite alternate;\n}\n@keyframes hb-vc7-sway {\n  from { transform: translate3d(-1.2%, .4%, 0) scale(1.02); }\n  to { transform: translate3d(1.2%, -.4%, 0) scale(1.05); }\n}\n.hb-vc7-sun {\n  position: absolute;\n  left: 58%;\n  top: 22%;\n  width: clamp(120px, 20cqi, 220px);\n  aspect-ratio: 1;\n  border-radius: 50%;\n  background: radial-gradient(circle, #fdf6e8 0 34%, color-mix(in srgb, #fdf6e8 40%, transparent) 36%, transparent 70%);\n  opacity: .8;\n  transform: translate3d(calc(var(--hb-vc7-px) * -6px * var(--hb-vc7-depth)), calc(var(--hb-vc7-py) * -4px * var(--hb-vc7-depth)), 0);\n  transition: transform .9s cubic-bezier(.2, .7, .2, 1);\n}\n.hb-vc7-layer {\n  position: absolute;\n  left: -4%;\n  right: -4%;\n  bottom: 0;\n  height: 100%;\n  transform: translate3d(calc(var(--hb-vc7-px) * var(--hb-vc7-d) * 34px * var(--hb-vc7-depth)), calc(var(--hb-vc7-py) * var(--hb-vc7-d) * 14px * var(--hb-vc7-depth)), 0);\n  transition: transform 1s cubic-bezier(.2, .7, .2, 1);\n}\n.hb-vc7-layer svg { display: block; width: 100%; height: 100%; }\n.hb-vc7-fog {\n  position: absolute;\n  left: 0;\n  width: 200%;\n  height: 26%;\n  pointer-events: none;\n  background:\n    radial-gradient(18% 50% at 12% 50%, rgba(220, 232, 242, var(--hb-vc7-a)), transparent 70%),\n    radial-gradient(22% 60% at 36% 55%, rgba(220, 232, 242, var(--hb-vc7-a)), transparent 70%),\n    radial-gradient(16% 50% at 62% 45%, rgba(220, 232, 242, var(--hb-vc7-a)), transparent 70%),\n    radial-gradient(20% 55% at 86% 52%, rgba(220, 232, 242, var(--hb-vc7-a)), transparent 70%);\n  filter: blur(14px);\n  opacity: var(--hb-vc7-fog);\n  animation: hb-vc7-fog var(--hb-vc7-t) linear infinite;\n}\n@keyframes hb-vc7-fog {\n  from { transform: translate3d(0, 0, 0); }\n  to { transform: translate3d(-50%, 0, 0); }\n}\n.hb-vc7-bird {\n  position: absolute;\n  color: rgba(10, 14, 20, .7);\n  animation: hb-vc7-bird calc(26s / var(--hb-vc7-speed)) linear infinite;\n}\n@keyframes hb-vc7-bird {\n  from { transform: translate3d(-10cqi, 0, 0); }\n  to { transform: translate3d(110cqi, -40px, 0); }\n}\n.hb-vc7-shade {\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  background: linear-gradient(90deg, rgba(5, 8, 12, .78), rgba(5, 8, 12, .2) 50%, transparent), linear-gradient(0deg, rgba(4, 6, 9, .9), transparent 30%);\n}\n.hb-vc7-copy {\n  position: absolute;\n  left: clamp(22px, 6cqi, 72px);\n  top: 50%;\n  z-index: 3;\n  max-width: 500px;\n  padding-right: 22px;\n  transform: translateY(-58%);\n}\n.hb-vc7-kicker {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  margin: 0 0 16px;\n  color: color-mix(in srgb, var(--hb-vc7-tint) 50%, #ffffff);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 11px;\n  letter-spacing: .28em;\n  text-transform: uppercase;\n}\n.hb-vc7-kicker::before { content: \"\"; width: 26px; height: 1px; background: currentColor; }\n.hb-vc7-title {\n  margin: 0;\n  font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif));\n  font-size: clamp(40px, 7.6cqi, 96px);\n  font-weight: 600;\n  line-height: .92;\n  letter-spacing: -.04em;\n  text-shadow: 0 8px 40px rgba(0, 0, 0, .35);\n}\n.hb-vc7-sub {\n  max-width: 400px;\n  margin: 18px 0 0;\n  color: rgba(238, 243, 247, .74);\n  font-size: clamp(14px, 1.7cqi, 16px);\n  line-height: 1.6;\n}\n.hb-vc7-cta {\n  display: inline-flex;\n  align-items: center;\n  gap: 12px;\n  height: 46px;\n  margin-top: 26px;\n  padding: 0 8px 0 20px;\n  border-radius: 999px;\n  background: #eef3f7;\n  color: #0a0f14;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: transform .2s ease, background .25s ease;\n}\n.hb-vc7-cta span {\n  display: grid;\n  place-items: center;\n  width: 32px;\n  height: 32px;\n  border-radius: 50%;\n  background: #0a0f14;\n  color: #eef3f7;\n}\n.hb-vc7-cta:hover { background: #ffffff; }\n.hb-vc7-cta:active { transform: scale(.97); }\n.hb-vc7-cta:focus-visible { outline: 2px solid var(--hb-vc7-tint); outline-offset: 3px; }\n.hb-vc7-alt {\n  position: absolute;\n  right: clamp(16px, 4cqi, 44px);\n  top: 50%;\n  z-index: 3;\n  display: flex;\n  flex-direction: column;\n  gap: 18px;\n  margin: 0;\n  padding: 0 0 0 14px;\n  border-left: 1px solid rgba(238, 243, 247, .18);\n  list-style: none;\n  transform: translateY(-50%);\n}\n.hb-vc7-alt li {\n  position: relative;\n  color: rgba(238, 243, 247, .5);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 10.5px;\n  letter-spacing: .12em;\n  font-variant-numeric: tabular-nums;\n}\n.hb-vc7-alt li::before {\n  content: \"\";\n  position: absolute;\n  left: -18px;\n  top: 50%;\n  width: 7px;\n  height: 1px;\n  background: rgba(238, 243, 247, .5);\n}\n.hb-vc7-alt li:first-child { color: #eef3f7; }\n@container (max-width: 620px) {\n  .hb-vc7-alt { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vc7-sway, .hb-vc7-fog, .hb-vc7-bird { animation: none; }\n  .hb-vc7-layer, .hb-vc7-sun { transition: none; transform: none; }\n}\n`;\n\nfunction ridge(seed: number, base: number, amp: number, rough: number) {\n  const pts: [number, number][] = [];\n  for (let x = -80, i = 0; x <= 1680; x += 80, i++) {\n    const h1 = (Math.imul(seed * 977 + i * 131 + 3, 2654435761) >>> 0) % 1000;\n    const h2 = (Math.imul(seed * 389 + (i >> 1) * 71 + 9, 2246822519) >>> 0) % 1000;\n    const y = base - (h1 / 1000) * amp * rough - (h2 / 1000) * amp;\n    pts.push([x, y]);\n  }\n  let d = `M${pts[0][0]} 900 L${pts[0][0]} ${pts[0][1].toFixed(1)}`;\n  for (let i = 1; i < pts.length; i++) {\n    const [x0, y0] = pts[i - 1];\n    const [x1, y1] = pts[i];\n    d += ` Q${x0} ${y0.toFixed(1)} ${((x0 + x1) / 2).toFixed(1)} ${((y0 + y1) / 2).toFixed(1)}`;\n  }\n  d += ` L1680 900Z`;\n  return d;\n}\n\nconst layers = [\n  { d: ridge(1, 520, 170, 0.6), mix: 52, depth: 0.15 },\n  { d: ridge(2, 600, 150, 0.8), mix: 38, depth: 0.32 },\n  { d: ridge(3, 680, 140, 1), mix: 24, depth: 0.55 },\n  { d: ridge(4, 760, 120, 1.2), mix: 12, depth: 0.8 },\n  { d: ridge(5, 850, 110, 1.6), mix: 3, depth: 1.15 },\n];\n\nconst fogs = [\n  { top: 46, a: 0.5, t: 70 },\n  { top: 56, a: 0.45, t: 54 },\n  { top: 66, a: 0.42, t: 40 },\n  { top: 78, a: 0.36, t: 30 },\n];\n\nexport function CinemaDepthFog({\n  kicker = \"A documentary in five altitudes\",\n  title = \"Above the Treeline\",\n  subtitle = \"Two winters with the last fire lookouts of the northern range, where the fog decides what you get to see.\",\n  cta = { label: \"Watch the first chapter\", href: \"#\" },\n  altitudes = [\"3,240 m\", \"2,610 m\", \"1,980 m\", \"1,150 m\", \"620 m\"],\n  tint = \"#7fa6c4\",\n  fog = 0.7,\n  depth = 1,\n  speed = 1,\n  headingAs = \"h1\",\n  className,\n  style,\n  onPointerMove,\n  onPointerLeave,\n  ...rest\n}: CinemaDepthFogProps) {\n  const Heading = headingAs;\n  const ref = React.useRef<HTMLElement>(null);\n\n  const move = (e: React.PointerEvent<HTMLElement>) => {\n    onPointerMove?.(e);\n    const el = ref.current;\n    if (!el || e.pointerType === \"touch\") return;\n    const r = el.getBoundingClientRect();\n    el.style.setProperty(\"--hb-vc7-px\", (((e.clientX - r.left) / r.width) * 2 - 1).toFixed(3));\n    el.style.setProperty(\"--hb-vc7-py\", (((e.clientY - r.top) / r.height) * 2 - 1).toFixed(3));\n  };\n  const leave = (e: React.PointerEvent<HTMLElement>) => {\n    onPointerLeave?.(e);\n    ref.current?.style.setProperty(\"--hb-vc7-px\", \"0\");\n    ref.current?.style.setProperty(\"--hb-vc7-py\", \"0\");\n  };\n\n  const vars = {\n    \"--hb-vc7-tint\": tint,\n    \"--hb-vc7-fog\": String(fog),\n    \"--hb-vc7-depth\": String(depth),\n    \"--hb-vc7-speed\": String(speed),\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <section\n      ref={ref}\n      className={[\"hb-vc7\", className].filter(Boolean).join(\" \")}\n      style={vars}\n      onPointerMove={move}\n      onPointerLeave={leave}\n      {...rest}\n    >\n      <style href=\"hb-cinema-depth-fog\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vc7-sway\" aria-hidden=\"true\">\n        <span className=\"hb-vc7-sun\" />\n        {[0, 1, 2].map((i) => (\n          <svg\n            key={i}\n            className=\"hb-vc7-bird\"\n            width=\"16\"\n            height=\"8\"\n            viewBox=\"0 0 16 8\"\n            style={{ top: `${18 + i * 5}%`, left: 0, animationDelay: `${-i * 7}s` }}\n          >\n            <path d=\"M0 4 Q4 0 8 5 Q12 0 16 4\" stroke=\"currentColor\" strokeWidth=\"1.4\" fill=\"none\" />\n          </svg>\n        ))}\n        {layers.map((l, i) => (\n          <React.Fragment key={i}>\n            <div className=\"hb-vc7-layer\" style={{ \"--hb-vc7-d\": String(l.depth) } as React.CSSProperties}>\n              <svg viewBox=\"0 0 1600 900\" preserveAspectRatio=\"xMidYMax slice\">\n                <path d={l.d} style={{ fill: `color-mix(in srgb, var(--hb-vc7-tint) ${l.mix}%, #06090d)` }} />\n              </svg>\n            </div>\n            {fogs[i] ? (\n              <span\n                className=\"hb-vc7-fog\"\n                style={{\n                  top: `${fogs[i].top}%`,\n                  \"--hb-vc7-a\": String(fogs[i].a),\n                  \"--hb-vc7-t\": `${(fogs[i].t / speed).toFixed(1)}s`,\n                } as React.CSSProperties}\n              />\n            ) : null}\n          </React.Fragment>\n        ))}\n      </div>\n      <div className=\"hb-vc7-shade\" aria-hidden=\"true\" />\n      <div className=\"hb-vc7-copy\">\n        {kicker ? <p className=\"hb-vc7-kicker\">{kicker}</p> : null}\n        <Heading className=\"hb-vc7-title\">{title}</Heading>\n        {subtitle ? <p className=\"hb-vc7-sub\">{subtitle}</p> : null}\n        {cta ? (\n          <a className=\"hb-vc7-cta\" href={cta.href}>\n            {cta.label}\n            <span aria-hidden=\"true\">\n              <svg width=\"10\" height=\"11\" viewBox=\"0 0 8 9\"><path d=\"M0 0 L8 4.5 L0 9Z\" fill=\"currentColor\" /></svg>\n            </span>\n          </a>\n        ) : null}\n      </div>\n      {altitudes.length ? (\n        <ul className=\"hb-vc7-alt\" aria-label=\"Altitudes\">\n          {altitudes.map((a) => (\n            <li key={a}>{a}</li>\n          ))}\n        </ul>\n      ) : null}\n    </section>\n  );\n}\n"
    }
  ]
}