{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"skyline-footer","type":"registry:block","title":"Skyline footer","description":"A footer set in a city at night, drawn on a 6px grid: the towers build up as it comes into view, windows come and go, and a click in the sky sends a plane across.","author":"Hairline UI","dependencies":[],"files":[{"path":"registry/skyline-footer.tsx","type":"registry:component","content":"// Hairline UI · skyline-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { FooterCaption, FooterLockup, FooterNav, plateColors, resolveColor, type FooterColumn, type FooterLink } from \"./footer-parts\";\nimport { buildSkylinePalette, readSkylineRgb, SkylineEngine, type SkylinePreset } from \"./skyline-matrix\";\nimport { useInteractionReducedMotion } from \"./ui-interaction-motion\";\n\n/*\n * A footer set in a city at night, drawn on a 6px grid. The text sits in the sky; the towers\n * build up from the foot when the footer comes into view, then live on their own: windows\n * switch on and off, beacons blink on the spires, a plane crosses now and then. Reading a\n * column lights the district under it, the pointer wakes windows near it, and a click in\n * the sky sends a plane across.\n */\n\nexport type SkylineLink = FooterLink;\nexport type SkylineColumn = FooterColumn;\n\nexport interface SkylineCity {\n  /** The city's name, shown with its local time in the small print, e.g. \"San Francisco\". */\n  label: string;\n  /** IANA time zone, e.g. \"America/Los_Angeles\". */\n  timeZone: string;\n}\n\nexport interface SkylineFooterProps {\n  /** Brand name: shown in the lockup, and it seeds the skyline so every brand gets its own city. */\n  brand: string;\n  /** Optional logo beside the name. */\n  logo?: React.ReactNode;\n  /** One short line about the product. */\n  tagline?: string;\n  /** The main action under the tagline. */\n  action?: SkylineLink;\n  /** Link columns. */\n  columns?: SkylineColumn[];\n  /** Optional local clock beside the copyright. */\n  city?: SkylineCity;\n  /** The shape of the skyline. */\n  preset?: SkylinePreset;\n  /** \"auto\" follows the theme (a pale dusk city in light); \"night\" keeps the night plate on any page. */\n  tone?: \"auto\" | \"night\";\n  /** Window and beacon light. Any CSS colour or token. Defaults to `var(--chart-5)`. */\n  accent?: string;\n  /** Copyright line. */\n  legal?: string;\n  /** Small links beside the copyright. */\n  legalLinks?: SkylineLink[];\n  className?: string;\n}\n\nconst NO_COLUMNS: SkylineColumn[] = [];\nconst NO_LINKS: SkylineLink[] = [];\nconst DEFAULT_ACCENT = \"var(--chart-5, var(--primary))\";\n\nfunction DefaultMark() {\n  return (\n    <svg viewBox=\"0 0 26 26\" className=\"size-[26px] shrink-0\" aria-hidden=\"true\">\n      <rect x=\"0.5\" y=\"0.5\" width=\"25\" height=\"25\" rx=\"6.5\" fill=\"color-mix(in oklab, currentColor 7%, transparent)\" stroke=\"color-mix(in oklab, currentColor 20%, transparent)\" />\n      <rect x=\"6\" y=\"13\" width=\"3.5\" height=\"7\" rx=\"0.5\" fill=\"currentColor\" opacity=\"0.45\" />\n      <rect x=\"11.25\" y=\"6\" width=\"3.5\" height=\"14\" rx=\"0.5\" fill=\"var(--fp-accent)\" />\n      <rect x=\"16.5\" y=\"10\" width=\"3.5\" height=\"10\" rx=\"0.5\" fill=\"currentColor\" opacity=\"0.7\" />\n    </svg>\n  );\n}\n\nfunction formatClock(city: SkylineCity, now: Date): string {\n  try {\n    const t = new Intl.DateTimeFormat(\"en-US\", { timeZone: city.timeZone, hour: \"numeric\", minute: \"2-digit\" }).format(now).toLowerCase();\n    return `${t} in ${city.label}`;\n  } catch {\n    return city.label;\n  }\n}\n\nexport function SkylineFooter({\n  brand,\n  logo,\n  tagline,\n  action,\n  columns = NO_COLUMNS,\n  city,\n  preset = \"metropolis\",\n  tone = \"auto\",\n  accent = DEFAULT_ACCENT,\n  legal,\n  legalLinks = NO_LINKS,\n  className = \"\",\n}: SkylineFooterProps) {\n  const reduced = useInteractionReducedMotion();\n  const plateRef = React.useRef<HTMLDivElement>(null);\n  const stageRef = React.useRef<HTMLDivElement>(null);\n  const canvasRef = React.useRef<HTMLCanvasElement>(null);\n  const clockRef = React.useRef<HTMLSpanElement>(null);\n  const engineRef = React.useRef<SkylineEngine | null>(null);\n  const cityRef = React.useRef(city);\n\n  React.useLayoutEffect(() => {\n    cityRef.current = city;\n  });\n\n  // The clock is written straight into its node once a minute, after mount, so the server's time\n  // zone never shows and React never re-renders for it.\n  React.useEffect(() => {\n    if (!city) return;\n    let timer = 0;\n    const tick = () => {\n      const current = cityRef.current;\n      if (!current || !clockRef.current) return;\n      clockRef.current.textContent = formatClock(current, new Date());\n      timer = window.setTimeout(tick, 60000 - (Date.now() % 60000) + 20);\n    };\n    tick();\n    return () => window.clearTimeout(timer);\n  }, [city]);\n\n  React.useEffect(() => {\n    const plate = plateRef.current;\n    const stage = stageRef.current;\n    const canvas = canvasRef.current;\n    if (!plate || !stage || !canvas) return;\n    const ctx = canvas.getContext(\"2d\", { alpha: false });\n    if (!ctx) return;\n\n    const readPalette = () => {\n      const css = getComputedStyle(plate);\n      const bg = readSkylineRgb(css.backgroundColor, [0.05, 0.05, 0.05]);\n      const fg = readSkylineRgb(css.color, [0.94, 0.92, 0.89]);\n      const accentRgb = readSkylineRgb(resolveColor(plate, \"var(--fp-accent)\"), [0.91, 0.66, 0.29]);\n      return buildSkylinePalette(bg, fg, accentRgb, tone === \"night\");\n    };\n\n    const engine = new SkylineEngine(readPalette(), brand, preset);\n    engineRef.current = engine;\n\n    let raf = 0;\n    let visible = false;\n    let hidden = document.hidden;\n    let disposed = false;\n    let lastTime = performance.now();\n\n    const measure = () => {\n      if (disposed) return;\n      const box = plate.getBoundingClientRect();\n      const city = stage.getBoundingClientRect();\n      const w = Math.max(1, Math.round(box.width));\n      const h = Math.max(1, Math.round(box.height));\n      const dpr = Math.min(window.devicePixelRatio || 1, 2);\n      canvas.width = Math.round(w * dpr);\n      canvas.height = Math.round(h * dpr);\n      engine.setPalette(readPalette());\n      engine.resize(w, h, dpr, (box.bottom - city.top) / h);\n      if (reduced) {\n        engine.setRevealedImmediate();\n        engine.draw(ctx);\n      }\n    };\n\n    const loop = (now: number) => {\n      raf = 0;\n      if (disposed || !visible || hidden || reduced) return;\n      const dt = (now - lastTime) / 1000;\n      lastTime = now;\n      engine.step(dt, now / 1000, false);\n      engine.draw(ctx);\n      raf = requestAnimationFrame(loop);\n    };\n\n    const kick = () => {\n      if (disposed || reduced) return;\n      if (visible && !hidden && !raf) {\n        lastTime = performance.now();\n        raf = requestAnimationFrame(loop);\n      }\n    };\n\n    measure();\n    plate.dataset.ready = \"\";\n\n    const ro = new ResizeObserver(() => measure());\n    ro.observe(plate);\n\n    const io = new IntersectionObserver(\n      ([entry]) => {\n        visible = entry.isIntersecting;\n        if (visible) {\n          engine.startReveal(performance.now() / 1000);\n          if (reduced) {\n            engine.setRevealedImmediate();\n            engine.draw(ctx);\n          } else {\n            kick();\n          }\n        }\n      },\n      { threshold: 0.15 },\n    );\n    io.observe(plate);\n\n    const onVis = () => {\n      hidden = document.hidden;\n      if (!hidden) kick();\n    };\n    document.addEventListener(\"visibilitychange\", onVis);\n\n    const mo = new MutationObserver(() => {\n      engine.setPalette(readPalette());\n      if (reduced) engine.draw(ctx);\n    });\n    mo.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-theme\"] });\n\n    const onMove = (e: PointerEvent) => {\n      if (reduced || e.pointerType === \"touch\") return;\n      const r = plate.getBoundingClientRect();\n      const nx = (e.clientX - r.left) / Math.max(1, r.width);\n      const ny = (e.clientY - r.top) / Math.max(1, r.height);\n      engine.setPointer(nx, ny, nx >= 0 && nx <= 1 && ny >= 0 && ny <= 1);\n    };\n    const onLeave = () => engine.setPointer(0, 0, false);\n    // A click in the sky sends a plane across; clicks on links never do.\n    const onDown = (e: PointerEvent) => {\n      if (reduced || (e.target as Element | null)?.closest(\"a, button\")) return;\n      const r = plate.getBoundingClientRect();\n      const nx = (e.clientX - r.left) / Math.max(1, r.width);\n      const ny = (e.clientY - r.top) / Math.max(1, r.height);\n      if (nx >= 0 && nx <= 1) engine.dispatchAircraft(nx, ny);\n    };\n\n    plate.addEventListener(\"pointermove\", onMove);\n    plate.addEventListener(\"pointerleave\", onLeave);\n    plate.addEventListener(\"pointerdown\", onDown);\n\n    return () => {\n      disposed = true;\n      cancelAnimationFrame(raf);\n      raf = 0;\n      ro.disconnect();\n      io.disconnect();\n      mo.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVis);\n      plate.removeEventListener(\"pointermove\", onMove);\n      plate.removeEventListener(\"pointerleave\", onLeave);\n      plate.removeEventListener(\"pointerdown\", onDown);\n      engineRef.current = null;\n      delete plate.dataset.ready;\n    };\n  }, [brand, preset, tone, accent, reduced]);\n\n  const focusDistrict = (el: HTMLElement | null) => {\n    const plate = plateRef.current;\n    const engine = engineRef.current;\n    if (!plate || !engine || reduced) return;\n    if (!el) {\n      engine.setDistrict(null);\n      return;\n    }\n    const pr = plate.getBoundingClientRect();\n    const er = el.getBoundingClientRect();\n    engine.setDistrict((er.left + er.width * 0.5 - pr.left) / Math.max(1, pr.width));\n  };\n\n  return (\n    <footer className={`w-full max-w-[1200px] ${className}`}>\n      <div aria-hidden=\"true\" data-natural-width className=\"grid h-0\" style={{ gridTemplateColumns: \"minmax(0, 1200px)\" }} />\n      <div className=\"@container w-full\">\n        <div ref={plateRef} className=\"group/plate relative isolate touch-pan-y overflow-clip rounded-[28px]\" style={plateColors(tone === \"night\", accent)}>\n          <canvas\n            ref={canvasRef}\n            aria-hidden=\"true\"\n            className=\"pointer-events-none absolute inset-0 -z-10 size-full opacity-0 transition-opacity duration-500 group-data-[ready]/plate:opacity-100\"\n          />\n\n          <div className=\"grid grid-cols-1 gap-x-10 gap-y-9 px-[max(20px,5cqi)] pt-[clamp(28px,4.5cqi,56px)] @[700px]:grid-cols-[minmax(0,1fr)_auto]\">\n            <FooterLockup logo={logo ?? <DefaultMark />} name={brand} tagline={tagline} action={action} />\n            <FooterNav columns={columns} onAim={(el) => focusDistrict(el)} />\n          </div>\n\n          {/* The city rises in this space; the canvas behind the whole plate draws it. */}\n          <div ref={stageRef} aria-hidden=\"true\" className=\"mt-[clamp(8px,2cqi,24px)] h-[clamp(200px,30cqi,360px)] w-full\" />\n\n          <FooterCaption\n            legal={legal}\n            links={legalLinks}\n            note={city ? <span ref={clockRef} className=\"tabular-nums opacity-80\" /> : undefined}\n            className=\"relative px-[max(20px,5cqi)] pb-[clamp(18px,2.4cqi,26px)] pt-3\"\n          />\n        </div>\n      </div>\n    </footer>\n  );\n}\n"},{"path":"registry/skyline-matrix.ts","type":"registry:component","content":"// Hairline UI · skyline-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n/* ─────────────────────────────────────────────────────────\n * SKYLINE MATRIX (React-free 6px pixel-grid skyline engine)\n *\n * Draws a parametric architectural skyline quantized to a crisp\n * 6px cell grid (5px tile + 1px hairline gutter) in warm\n * sodium-vapor amber & smoked basalt charcoal (or archival\n * graphite & amber in light mode), overrideable via `accent`.\n *\n *   Act I   staggered bottom-up tower construction with sparkling\n *           leading-edge pixels dancing above each rising roofline\n *   Act II  upward light wave across the foreground canopy that\n *           settles into layered silhouette depth\n *   Act III asynchronous office windows, out-of-phase 5-tile '+'\n *           spire beacons, twinkling stars / daylight clouds, faint\n *           atmospheric shafts, and a periodic pixel aircraft with\n *           a fading contrail\n * ───────────────────────────────────────────────────────── */\n\nexport type Rgb = [number, number, number];\nexport type SkylinePreset = \"metropolis\" | \"harbor\" | \"campus\";\n\nexport interface SkylinePalette {\n  bg: Rgb;\n  farTower: Rgb;\n  midTower: Rgb;\n  nearTower: Rgb;\n  rim: Rgb;\n  windowDim: Rgb;\n  windowLit: Rgb;\n  canopyDark: Rgb;\n  canopyLit: Rgb;\n  star: Rgb;\n  beacon: Rgb;\n  craft: Rgb;\n  isDark: boolean;\n}\n\ninterface Tower {\n  x0: number;\n  x1: number;\n  height: number;\n  crown: \"flat\" | \"stepped\" | \"pyramid\" | \"gable\" | \"spire\" | \"dome\";\n  spireHeight: number;\n  layer: 0 | 1 | 2;\n  delay: number;\n  duration: number;\n  hasBeacon: boolean;\n  beaconPhase: number;\n  beaconPeriod: number;\n  ribPhase: number;\n}\n\ninterface WindowCell {\n  col: number;\n  row: number;\n  towerIdx: number;\n  level: number;\n  target: number;\n  nextToggle: number;\n  warm: boolean;\n}\n\ninterface Star {\n  col: number;\n  row: number;\n  phase: number;\n  speed: number;\n  maxAlpha: number;\n}\n\ninterface CloudBand {\n  x: number;\n  row: number;\n  width: number;\n  height: number;\n  speed: number;\n}\n\ninterface Aircraft {\n  x: number;\n  row: number;\n  dir: 1 | -1;\n  speed: number;\n  trail: number;\n}\n\nconst CELL = 6;\nconst TILE = 5;\n\nfunction mulberry32(seed: number) {\n  let a = seed >>> 0;\n  return () => {\n    a |= 0;\n    a = (a + 0x6d2b79f5) | 0;\n    let t = Math.imul(a ^ (a >>> 15), 1 | a);\n    t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n  };\n}\n\nfunction hashSeed(text: string, preset: SkylinePreset): number {\n  let h = preset === \"metropolis\" ? 0x51f23a : preset === \"harbor\" ? 0x9c41b7 : 0x2a7e5d;\n  for (let i = 0; i < text.length; i++) h = Math.imul(h ^ text.charCodeAt(i), 0x01000193);\n  return h >>> 0;\n}\n\nfunction hash2d(x: number, y: number, step: number): number {\n  let h = Math.imul(x, 374761393) ^ Math.imul(y, 668265263) ^ Math.imul(step, 2147483647);\n  h = Math.imul(h ^ (h >>> 13), 1274126177);\n  return ((h ^ (h >>> 16)) >>> 0) / 4294967296;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => (v < lo ? lo : v > hi ? hi : v);\nconst mixRgb = (a: Rgb, b: Rgb, t: number): Rgb => [\n  a[0] + (b[0] - a[0]) * t,\n  a[1] + (b[1] - a[1]) * t,\n  a[2] + (b[2] - a[2]) * t,\n];\nconst rgba = (c: Rgb, a = 1) =>\n  `rgba(${Math.round(clamp(c[0], 0, 1) * 255)},${Math.round(clamp(c[1], 0, 1) * 255)},${Math.round(clamp(c[2], 0, 1) * 255)},${clamp(a, 0, 1).toFixed(3)})`;\n\nexport function readSkylineRgb(css: string, fallback: Rgb): Rgb {\n  if (typeof document === \"undefined\" || !css) return fallback;\n  const c = document.createElement(\"canvas\");\n  c.width = c.height = 1;\n  const ctx = c.getContext(\"2d\");\n  if (!ctx) return fallback;\n  ctx.fillStyle = css;\n  ctx.fillRect(0, 0, 1, 1);\n  const [r, g, b] = ctx.getImageData(0, 0, 1, 1).data;\n  return [r / 255, g / 255, b / 255];\n}\n\nexport function buildSkylinePalette(bg: Rgb, fg: Rgb, accent: Rgb, forceNight: boolean): SkylinePalette {\n  const lum = 0.2126 * bg[0] + 0.7152 * bg[1] + 0.0722 * bg[2];\n  const isDark = forceNight || lum < 0.42;\n  if (isDark) {\n    // Smoked basalt architecture lit by warm accent highlights (no blue/purple cast)\n    const stone = mixRgb([0.52, 0.5, 0.47], accent, 0.24);\n    const brightGlow = mixRgb(accent, [1.0, 0.96, 0.88], 0.48);\n    return {\n      bg,\n      farTower: mixRgb(bg, stone, 0.22),\n      midTower: mixRgb(bg, stone, 0.36),\n      nearTower: mixRgb(bg, stone, 0.52),\n      rim: mixRgb(stone, accent, 0.58),\n      windowDim: mixRgb(bg, accent, 0.65),\n      windowLit: brightGlow,\n      canopyDark: mixRgb(bg, stone, 0.2),\n      canopyLit: mixRgb(stone, brightGlow, 0.64),\n      star: mixRgb([0.96, 0.93, 0.88], accent, 0.22),\n      beacon: mixRgb(accent, [1.0, 0.95, 0.85], 0.35),\n      craft: brightGlow,\n      isDark: true,\n    };\n  }\n  // Light theme: warm architectural graphite drafting plate with amber-gold glazed windows\n  const graphite = mixRgb(fg, [0.32, 0.3, 0.28], 0.35);\n  return {\n    bg,\n    farTower: mixRgb(bg, graphite, 0.16),\n    midTower: mixRgb(bg, graphite, 0.3),\n    nearTower: mixRgb(bg, graphite, 0.48),\n    rim: mixRgb(graphite, accent, 0.55),\n    windowDim: mixRgb(bg, accent, 0.48),\n    windowLit: accent,\n    canopyDark: mixRgb(bg, graphite, 0.68),\n    canopyLit: mixRgb(bg, accent, 0.58),\n    star: mixRgb(bg, graphite, 0.16),\n    beacon: accent,\n    craft: mixRgb(graphite, accent, 0.55),\n    isDark: false,\n  };\n}\n\nfunction towerMask(t: Tower, col: number, row: number): { inside: boolean; rim: number; isSpire: boolean } {\n  if (col < t.x0 || col > t.x1 || row < 0 || row >= t.height) return { inside: false, rim: 0, isSpire: false };\n  const w = t.x1 - t.x0 + 1;\n  const cx = (t.x0 + t.x1) * 0.5;\n  const bodyH = t.height - t.spireHeight;\n\n  if (row >= bodyH) {\n    const dist = Math.abs(col - Math.round(cx));\n    const frac = (row - bodyH) / Math.max(1, t.spireHeight);\n    const halfW = frac < 0.35 ? 1 : 0;\n    const inside = dist <= halfW;\n    return { inside, rim: inside ? 0.84 : 0, isSpire: inside };\n  }\n\n  const topFrac = row / Math.max(1, bodyH);\n  let inset = 0;\n\n  if (t.crown === \"stepped\" && topFrac > 0.52) {\n    const step = Math.floor(((topFrac - 0.52) / 0.48) * 3.4);\n    inset = Math.min(Math.floor((w - 3) / 2), step * Math.max(1, Math.floor(w * 0.14)));\n  } else if (t.crown === \"spire\" && topFrac > 0.38) {\n    const step = Math.floor(((topFrac - 0.38) / 0.62) * 4.5);\n    inset = Math.min(Math.floor((w - 3) / 2), step * Math.max(1, Math.floor(w * 0.13)));\n  } else if (t.crown === \"pyramid\" && topFrac > 0.72) {\n    const f = (topFrac - 0.72) / 0.28;\n    inset = Math.min(Math.floor((w - 1) / 2), Math.floor(f * (w * 0.5)));\n  } else if (t.crown === \"gable\" && topFrac > 0.68) {\n    const f = (topFrac - 0.68) / 0.32;\n    inset = Math.min(Math.floor((w - 2) / 2), Math.round(f * (w * 0.48)));\n  } else if (t.crown === \"dome\" && topFrac > 0.76) {\n    const f = (topFrac - 0.76) / 0.24;\n    inset = Math.min(Math.floor((w - 2) / 2), Math.floor((1 - Math.sqrt(Math.max(0, 1 - f * f))) * (w * 0.48)));\n  }\n\n  const left = t.x0 + inset;\n  const right = t.x1 - inset;\n  if (col < left || col > right) return { inside: false, rim: 0, isSpire: false };\n\n  const rim = row >= bodyH - 1 ? 0.7 : col === right ? 0.5 : col === left ? 0.26 : 0;\n  return { inside: true, rim, isSpire: false };\n}\n\nexport class SkylineEngine {\n  private cols = 0;\n  private rows = 0;\n  /** Rows the city may rise into, counted from the bottom; the sky above it holds the text. */\n  private cityRows = 0;\n  private cssW = 0;\n  private cssH = 0;\n  private dpr = 1;\n  private towers: Tower[] = [];\n  private windows: WindowCell[] = [];\n  private stars: Star[] = [];\n  private clouds: CloudBand[] = [];\n  private canopyHeight: Float32Array = new Float32Array(0);\n  private aircraft: Aircraft[] = [];\n  private nextCraftAt = 5.4;\n\n  private pointerX = -1;\n  private pointerY = -1;\n  private smoothPointerX = -1;\n  private smoothPointerY = -1;\n  private pointerStrength = 0;\n  private districtX = -1;\n  private districtStrength = 0;\n\n  private revealStart = -1;\n  private elapsed = 0;\n  private seedKey = \"\";\n  private preset: SkylinePreset = \"metropolis\";\n  private palette: SkylinePalette;\n\n  constructor(palette: SkylinePalette, seedKey: string, preset: SkylinePreset) {\n    this.palette = palette;\n    this.seedKey = seedKey;\n    this.preset = preset;\n  }\n\n  setPalette(palette: SkylinePalette) {\n    this.palette = palette;\n  }\n\n  /** `cityFraction`: how much of the height (from the bottom) the towers may use. */\n  resize(cssW: number, cssH: number, dpr: number, cityFraction = 1) {\n    const nextCols = Math.max(24, Math.ceil(cssW / CELL));\n    const nextRows = Math.max(24, Math.ceil(cssH / CELL));\n    const nextCity = Math.max(24, Math.min(nextRows, Math.round(nextRows * cityFraction)));\n    const changed = nextCols !== this.cols || nextRows !== this.rows || nextCity !== this.cityRows;\n    this.cssW = cssW;\n    this.cssH = cssH;\n    this.dpr = dpr;\n    this.cols = nextCols;\n    this.rows = nextRows;\n    this.cityRows = nextCity;\n    if (changed) this.generate();\n  }\n\n  startReveal(nowSec: number) {\n    if (this.revealStart < 0) this.revealStart = nowSec;\n  }\n\n  setRevealedImmediate() {\n    this.revealStart = 0;\n    this.elapsed = 12;\n  }\n\n  setPointer(normX: number, normY: number, active: boolean) {\n    if (!active) {\n      this.pointerX = -1;\n      this.pointerY = -1;\n      return;\n    }\n    this.pointerX = clamp(normX, 0, 1) * this.cols;\n    this.pointerY = clamp(normY, 0, 1) * this.rows;\n    if (this.smoothPointerX < 0) {\n      this.smoothPointerX = this.pointerX;\n      this.smoothPointerY = this.pointerY;\n    }\n  }\n\n  setDistrict(normX: number | null) {\n    this.districtX = normX === null ? -1 : clamp(normX, 0, 1) * this.cols;\n  }\n\n  dispatchAircraft(normX?: number, normY?: number) {\n    if (this.aircraft.length >= 3 || this.cols < 20) return;\n    const dir: 1 | -1 = normX !== undefined ? (normX > 0.5 ? -1 : 1) : -1;\n    // Planes cross the sky just above the towers, below the text.\n    const minRow = this.rows - this.cityRows + 2;\n    const maxRow = Math.max(minRow + 4, minRow + Math.floor(this.cityRows * 0.3));\n    const row =\n      normY !== undefined\n        ? Math.round(clamp(normY * this.rows, minRow, maxRow))\n        : minRow + Math.floor(Math.random() * (maxRow - minRow));\n    this.aircraft.push({\n      x: dir === -1 ? this.cols + 4 : -4,\n      row,\n      dir,\n      speed: 13 + Math.random() * 4,\n      trail: 16,\n    });\n  }\n\n  private generate() {\n    const rand = mulberry32(hashSeed(this.seedKey, this.preset));\n    const { cols, rows, preset } = this;\n    const city = this.cityRows || rows;\n    const sky = rows - city;\n    const towers: Tower[] = [];\n\n    let x = -2;\n    while (x < cols + 2) {\n      const w = Math.max(6, Math.round(7 + rand() * 9));\n      const hFrac = preset === \"campus\" ? 0.28 + rand() * 0.22 : 0.32 + rand() * 0.34;\n      towers.push({\n        x0: x,\n        x1: x + w - 1,\n        height: Math.max(10, Math.round(city * hFrac)),\n        crown: rand() > 0.62 ? \"stepped\" : \"flat\",\n        spireHeight: 0,\n        layer: 0,\n        delay: 0.04 + rand() * 0.14,\n        duration: 0.36 + rand() * 0.14,\n        hasBeacon: false,\n        beaconPhase: rand() * Math.PI * 2,\n        beaconPeriod: 2.2 + rand() * 0.8,\n        ribPhase: Math.floor(rand() * 2),\n      });\n      x += w + Math.floor(rand() * 3) - 1;\n    }\n\n    const centerCol = Math.round(cols * 0.45);\n    const heroHalf = Math.max(5, Math.round(Math.min(11, cols * 0.055)));\n    const heroHeight = Math.round(city * (preset === \"campus\" ? 0.7 : 0.88));\n    const heroSpire = preset === \"campus\" ? 5 : Math.max(7, Math.round(city * 0.14));\n\n    towers.push({\n      x0: centerCol - heroHalf,\n      x1: centerCol + heroHalf,\n      height: heroHeight,\n      crown: preset === \"campus\" ? \"dome\" : \"spire\",\n      spireHeight: heroSpire,\n      layer: 2,\n      delay: 0.02,\n      duration: 0.44,\n      hasBeacon: true,\n      beaconPhase: 0.4,\n      beaconPeriod: 2.35,\n      ribPhase: 0,\n    });\n\n    const crownPool: Tower[\"crown\"][] =\n      preset === \"harbor\"\n        ? [\"flat\", \"stepped\", \"gable\", \"flat\", \"dome\"]\n        : preset === \"campus\"\n          ? [\"gable\", \"dome\", \"flat\", \"stepped\", \"pyramid\"]\n          : [\"stepped\", \"pyramid\", \"flat\", \"gable\", \"stepped\", \"dome\"];\n\n    const fillSpan = (startX: number, endX: number, sideDir: -1 | 1) => {\n      let cur = startX;\n      let idx = 0;\n      while (sideDir === 1 ? cur < endX : cur > endX) {\n        const w = Math.max(7, Math.round(9 + rand() * 10));\n        const distNorm = Math.abs(cur - centerCol) / Math.max(1, cols * 0.55);\n        const envelope = 1 - 0.34 * distNorm;\n        const baseFrac = (preset === \"campus\" ? 0.34 : 0.42) + rand() * (preset === \"campus\" ? 0.24 : 0.34);\n        const crown = crownPool[(idx + Math.floor(rand() * crownPool.length)) % crownPool.length];\n        const wantsSpire = (crown === \"stepped\" || crown === \"pyramid\" || crown === \"gable\") && rand() > 0.35;\n        const spireHeight = wantsSpire ? Math.max(3, Math.round(city * (0.06 + rand() * 0.05))) : 0;\n        const height = Math.max(12, Math.min(Math.round(city * 0.78), Math.round(city * baseFrac * envelope) + spireHeight));\n\n        const x0 = sideDir === 1 ? cur : cur - w + 1;\n        const x1 = sideDir === 1 ? cur + w - 1 : cur;\n        towers.push({\n          x0,\n          x1,\n          height,\n          crown,\n          spireHeight,\n          layer: idx % 2 === 0 ? 2 : 1,\n          delay: 0.03 + clamp(distNorm * 0.14 + rand() * 0.08, 0, 0.2),\n          duration: 0.36 + rand() * 0.14,\n          hasBeacon: spireHeight >= 4 && rand() > 0.25,\n          beaconPhase: rand() * Math.PI * 2,\n          beaconPeriod: 2.1 + rand() * 1.1,\n          ribPhase: idx % 2,\n        });\n\n        cur += sideDir * Math.max(6, Math.round(w * (0.76 + rand() * 0.34)));\n        idx++;\n      }\n    };\n\n    fillSpan(centerCol - heroHalf - 2, -6, -1);\n    fillSpan(centerCol + heroHalf + 2, cols + 6, 1);\n\n    towers.sort((a, b) => a.layer - b.layer || a.height - b.height);\n    this.towers = towers;\n\n    const canopy = new Float32Array(cols);\n    const numMounds = Math.max(7, Math.round(cols / 16));\n    const mounds: { cx: number; r: number; h: number }[] = [];\n    for (let i = 0; i < numMounds; i++) {\n      mounds.push({\n        cx: ((i + 0.2 + rand() * 0.6) / numMounds) * cols,\n        r: 7 + rand() * 11,\n        h: Math.round(city * (preset === \"harbor\" ? 0.09 + rand() * 0.09 : 0.14 + rand() * 0.13)),\n      });\n    }\n    for (let c = 0; c < cols; c++) {\n      let h = Math.round(city * (preset === \"harbor\" ? 0.04 : 0.07));\n      for (let m = 0; m < mounds.length; m++) {\n        const md = mounds[m];\n        const dx = (c - md.cx) / md.r;\n        if (Math.abs(dx) < 1) {\n          const dome = Math.sqrt(1 - dx * dx) * md.h;\n          if (dome > h) h = dome;\n        }\n      }\n      canopy[c] = Math.max(2, Math.round(h + (hash2d(c, 19, 7) - 0.5) * 2.2));\n    }\n    this.canopyHeight = canopy;\n\n    const windows: WindowCell[] = [];\n    for (let ti = 0; ti < towers.length; ti++) {\n      const t = towers[ti];\n      if (t.layer === 0) continue;\n      const bodyH = t.height - t.spireHeight;\n      for (let r = 3; r < bodyH - 2; r += 2) {\n        for (let c = t.x0 + 1; c <= t.x1 - 1; c += 2) {\n          if (c < 0 || c >= cols) continue;\n          const m = towerMask(t, c, r);\n          if (!m.inside || m.isSpire || r < canopy[c] + 1) continue;\n          if (rand() > 0.48) continue;\n          const startOn = rand() > 0.54;\n          windows.push({\n            col: c,\n            row: r,\n            towerIdx: ti,\n            level: startOn ? 0.65 + rand() * 0.35 : 0,\n            target: startOn ? 0.65 + rand() * 0.35 : 0,\n            nextToggle: 1.5 + rand() * 9.5,\n            warm: rand() > 0.42,\n          });\n        }\n      }\n    }\n    this.windows = windows;\n\n    this.stars = Array.from({ length: Math.max(28, Math.round(cols * 0.34)) }, () => ({\n      col: Math.floor(rand() * cols),\n      row: 1 + Math.floor(rand() * Math.max(8, rows - Math.floor(city * 0.45))),\n      phase: rand() * Math.PI * 2,\n      speed: 0.7 + rand() * 1.4,\n      maxAlpha: 0.25 + rand() * 0.65,\n    }));\n\n    this.clouds = Array.from({ length: 5 }, () => ({\n      x: rand() * cols,\n      row: sky + Math.floor(rand() * Math.max(6, Math.floor(city * 0.28))),\n      width: 14 + Math.floor(rand() * 20),\n      height: 2 + Math.floor(rand() * 2),\n      speed: 0.55 + rand() * 0.65,\n    }));\n  }\n\n  step(dt: number, nowSec: number, reduced: boolean) {\n    const safeDt = Math.min(0.05, Math.max(0.001, dt));\n    if (reduced) {\n      this.elapsed = 12;\n      return;\n    }\n    if (this.revealStart < 0) return;\n    this.elapsed = Math.max(0, nowSec - this.revealStart);\n\n    const pTarget = this.pointerX >= 0 ? 1 : 0;\n    this.pointerStrength += (pTarget - this.pointerStrength) * Math.min(1, safeDt * 7);\n    if (this.pointerX >= 0) {\n      this.smoothPointerX += (this.pointerX - this.smoothPointerX) * Math.min(1, safeDt * 10);\n      this.smoothPointerY += (this.pointerY - this.smoothPointerY) * Math.min(1, safeDt * 10);\n    }\n    const dTarget = this.districtX >= 0 ? 1 : 0;\n    this.districtStrength += (dTarget - this.districtStrength) * Math.min(1, safeDt * 6);\n\n    for (let i = 0; i < this.windows.length; i++) {\n      const w = this.windows[i];\n      if (this.elapsed > w.nextToggle) {\n        const turnOn = w.target < 0.2 ? Math.random() < 0.45 : Math.random() < 0.35;\n        w.target = turnOn ? 0.55 + Math.random() * 0.45 : 0;\n        w.nextToggle = this.elapsed + 2.8 + Math.random() * 9.0;\n      }\n      let boost = 0;\n      if (this.pointerStrength > 0.05) {\n        const wy = this.rows - 1 - w.row;\n        const dist = Math.hypot(w.col - this.smoothPointerX, wy - this.smoothPointerY);\n        if (dist < 14) boost = (1 - dist / 14) * 0.72 * this.pointerStrength;\n      }\n      if (this.districtStrength > 0.05 && this.districtX >= 0) {\n        const dx = Math.abs(w.col - this.districtX);\n        if (dx < 16) boost = Math.max(boost, (1 - dx / 16) * 0.48 * this.districtStrength);\n      }\n      w.level += (Math.min(1, w.target + boost) - w.level) * Math.min(1, safeDt * 3.2);\n    }\n\n    for (let i = 0; i < this.clouds.length; i++) {\n      const cl = this.clouds[i];\n      cl.x += cl.speed * safeDt;\n      if (cl.x > this.cols + 8) cl.x = -cl.width - 4;\n    }\n\n    if (this.elapsed >= this.nextCraftAt) {\n      this.dispatchAircraft();\n      this.nextCraftAt = this.elapsed + 8.5 + Math.random() * 4.5;\n    }\n    for (let i = this.aircraft.length - 1; i >= 0; i--) {\n      const a = this.aircraft[i];\n      a.x += a.dir * a.speed * safeDt;\n      if ((a.dir === -1 && a.x < -a.trail - 6) || (a.dir === 1 && a.x > this.cols + a.trail + 6)) {\n        this.aircraft.splice(i, 1);\n      }\n    }\n  }\n\n  draw(ctx: CanvasRenderingContext2D) {\n    const { cols, rows, palette, elapsed, dpr } = this;\n    if (cols <= 0 || rows <= 0) return;\n\n    ctx.save();\n    ctx.scale(dpr, dpr);\n    ctx.fillStyle = rgba(palette.bg, 1);\n    ctx.fillRect(0, 0, this.cssW, this.cssH);\n\n    // Subtle warm sodium horizon glow behind the midtown core in dark mode\n    if (palette.isDark) {\n      const glow = ctx.createRadialGradient(this.cssW * 0.46, this.cssH * 0.92, 12, this.cssW * 0.46, this.cssH * 0.85, this.cssW * 0.52);\n      glow.addColorStop(0, rgba(palette.beacon, 0.11));\n      glow.addColorStop(1, rgba(palette.bg, 0));\n      ctx.fillStyle = glow;\n      ctx.fillRect(0, 0, this.cssW, this.cssH);\n    }\n\n    const skyOpacity = clamp((elapsed - 0.42) / 0.55, 0, 1);\n\n    if (palette.isDark) {\n      if (skyOpacity > 0.01) {\n        const shaftCount = Math.max(5, Math.floor(cols / 28));\n        for (let s = 0; s < shaftCount; s++) {\n          const sx = Math.floor(((s + 0.5) / shaftCount) * cols + Math.sin(elapsed * 0.25 + s * 2.1) * 5);\n          const topR = this.rows - this.cityRows + 3 + ((s * 7) % Math.max(4, Math.floor(this.cityRows * 0.22)));\n          const len = 8 + ((s * 5) % 10);\n          const pulse = (Math.sin(elapsed * 0.8 + s * 1.9) * 0.5 + 0.5) * 0.1 * skyOpacity;\n          if (pulse < 0.015) continue;\n          for (let k = 0; k < len; k++) {\n            ctx.fillStyle = rgba(palette.midTower, pulse * Math.sin((k / len) * Math.PI));\n            ctx.fillRect(sx * CELL, (topR + k) * CELL, TILE, TILE);\n          }\n        }\n        for (let i = 0; i < this.stars.length; i++) {\n          const st = this.stars[i];\n          const tw = Math.sin(elapsed * st.speed + st.phase) * 0.5 + 0.5;\n          ctx.fillStyle = rgba(palette.star, (0.14 + tw * tw * st.maxAlpha) * skyOpacity);\n          ctx.fillRect(st.col * CELL, st.row * CELL, TILE, TILE);\n        }\n      }\n    } else if (skyOpacity > 0.01) {\n      for (let i = 0; i < this.clouds.length; i++) {\n        const cl = this.clouds[i];\n        const xStart = Math.floor(cl.x);\n        for (let r = 0; r < cl.height; r++) {\n          const inset = r === 0 ? 2 : 0;\n          for (let c = xStart + inset; c < xStart + cl.width - inset; c++) {\n            if (c < 0 || c >= cols) continue;\n            const edge = Math.min(c - (xStart + inset), xStart + cl.width - inset - 1 - c);\n            ctx.fillStyle = rgba(palette.farTower, clamp((edge + 1) / 4, 0.25, 1) * 0.45 * skyOpacity);\n            ctx.fillRect(c * CELL, (cl.row + r) * CELL, TILE, TILE);\n          }\n        }\n      }\n    }\n\n    if (this.districtStrength > 0.02 && this.districtX >= 0) {\n      const cx = this.districtX * CELL;\n      const grad = ctx.createRadialGradient(cx, 0, CELL * 2, cx, this.cssH * 0.45, CELL * 28);\n      grad.addColorStop(0, rgba(palette.beacon, (palette.isDark ? 0.15 : 0.1) * this.districtStrength));\n      grad.addColorStop(1, rgba(palette.beacon, 0));\n      ctx.fillStyle = grad;\n      ctx.fillRect(0, 0, this.cssW, this.cssH);\n    }\n\n    const sparkStep = Math.floor(elapsed * 22);\n    for (let ti = 0; ti < this.towers.length; ti++) {\n      const t = this.towers[ti];\n      const rawP = clamp((elapsed - t.delay) / t.duration, 0, 1);\n      if (rawP <= 0) continue;\n      const buildP = 1 - Math.pow(1 - rawP, 3);\n      const maxRow = Math.ceil(t.height * buildP);\n      const building = rawP < 0.995;\n\n      const baseCol = t.layer === 0 ? palette.farTower : t.layer === 1 ? palette.midTower : palette.nearTower;\n      const towerCenter = (t.x0 + t.x1) * 0.5;\n\n      let focusLift = 0;\n      if (this.districtStrength > 0.02 && this.districtX >= 0) {\n        const d = Math.abs(towerCenter - this.districtX);\n        if (d < 18) focusLift = Math.max(focusLift, (1 - d / 18) * 0.26 * this.districtStrength);\n      }\n      if (this.pointerStrength > 0.02) {\n        const d = Math.abs(towerCenter - this.smoothPointerX);\n        if (d < 16) focusLift = Math.max(focusLift, (1 - d / 16) * 0.22 * this.pointerStrength);\n      }\n\n      const xMin = Math.max(0, t.x0);\n      const xMax = Math.min(cols - 1, t.x1);\n      const upperLimit = Math.min(t.height, maxRow + (building ? 4 : 0));\n\n      for (let r = 0; r < upperLimit; r++) {\n        const yPx = (rows - 1 - r) * CELL;\n        if (yPx < -CELL) continue;\n        const heightShade = 0.62 + 0.38 * (r / Math.max(1, t.height));\n\n        for (let c = xMin; c <= xMax; c++) {\n          const m = towerMask(t, c, r);\n          if (!m.inside) continue;\n\n          if (building && r >= maxRow - 2) {\n            const distAbove = r - (maxRow - 2);\n            if (hash2d(c, r, sparkStep) > clamp(0.88 - distAbove * 0.22, 0.08, 0.9)) continue;\n            ctx.fillStyle = rgba(palette.windowLit, clamp(0.95 - distAbove * 0.16, 0.35, 0.95));\n            ctx.fillRect(c * CELL, yPx, TILE, TILE);\n            continue;\n          }\n\n          const isRib = ((c - t.x0 + t.ribPhase) & 1) === 0;\n          const ribFactor = t.layer === 0 ? 0.92 : isRib ? 1.0 : 0.72;\n          const cellRgb = mixRgb(baseCol, palette.rim, clamp(m.rim * 0.6 + focusLift, 0, 0.85));\n          const shade = clamp(heightShade * ribFactor + focusLift * 0.24, 0.34, 1.0);\n          ctx.fillStyle = rgba(mixRgb(palette.bg, cellRgb, shade), 1);\n          ctx.fillRect(c * CELL, yPx, TILE, TILE);\n        }\n      }\n\n      if (t.hasBeacon && !building) {\n        const cx = Math.round(towerCenter);\n        const topY = (rows - 1 - (t.height - 1)) * CELL;\n        const wave = Math.sin((elapsed * Math.PI * 2) / t.beaconPeriod + t.beaconPhase) * 0.5 + 0.5;\n        const pulse = Math.pow(wave, 3.2);\n        if (cx >= 0 && cx < cols && topY >= 0) {\n          ctx.fillStyle = rgba(palette.beacon, 0.38 + pulse * 0.62);\n          ctx.fillRect(cx * CELL, topY, TILE, TILE);\n          if (pulse > 0.22) {\n            ctx.fillStyle = rgba(palette.beacon, (pulse - 0.22) * 0.72);\n            if (cx > 0) ctx.fillRect((cx - 1) * CELL, topY, TILE, TILE);\n            if (cx + 1 < cols) ctx.fillRect((cx + 1) * CELL, topY, TILE, TILE);\n            if (topY >= CELL) ctx.fillRect(cx * CELL, topY - CELL, TILE, TILE);\n            ctx.fillRect(cx * CELL, topY + CELL, TILE, TILE);\n          }\n        }\n      }\n    }\n\n    for (let i = 0; i < this.windows.length; i++) {\n      const w = this.windows[i];\n      const t = this.towers[w.towerIdx];\n      if (clamp((elapsed - t.delay) / t.duration, 0, 1) < 0.98 || w.level < 0.08) continue;\n      const yPx = (rows - 1 - w.row) * CELL;\n      const c = w.warm ? palette.windowLit : mixRgb(palette.windowDim, palette.windowLit, 0.55);\n      ctx.fillStyle = rgba(c, w.level * (palette.isDark ? 0.94 : 0.84));\n      ctx.fillRect(w.col * CELL, yPx, TILE, TILE);\n    }\n\n    const canopyReveal = clamp((elapsed - 0.34) / 0.52, 0, 1);\n    if (canopyReveal > 0) {\n      const sweepPos = (elapsed - 0.44) / 0.64;\n      const sweepActive = sweepPos > -0.1 && sweepPos < 1.35;\n      for (let c = 0; c < cols; c++) {\n        const fullH = this.canopyHeight[c];\n        const maxR = Math.ceil(fullH * (1 - Math.pow(1 - canopyReveal, 2.6)));\n        for (let r = 0; r < maxR; r++) {\n          const fromTop = fullH - 1 - r;\n          if (fromTop <= 1 && hash2d(c, r, 31) > 0.72) continue;\n          const yPx = (rows - 1 - r) * CELL;\n          const normH = r / Math.max(1, fullH);\n          const lit = sweepActive ? clamp(1 - Math.abs(normH - sweepPos) / 0.36, 0, 1) * clamp(1.3 - sweepPos, 0, 1) : 0;\n          const base = mixRgb(palette.bg, palette.canopyDark, 0.48 + hash2d(c, r, 13) * 0.32 + (fromTop <= 2 ? 0.18 : 0));\n          ctx.fillStyle = rgba(lit > 0.02 ? mixRgb(base, palette.canopyLit, lit * 0.85) : base, 1);\n          ctx.fillRect(c * CELL, yPx, TILE, TILE);\n        }\n      }\n    }\n\n    for (let i = 0; i < this.aircraft.length; i++) {\n      const a = this.aircraft[i];\n      const headCol = Math.round(a.x);\n      const yPx = a.row * CELL;\n      for (let k = 1; k <= a.trail; k++) {\n        const tc = headCol - a.dir * (k + 2);\n        if (tc < 0 || tc >= cols) continue;\n        ctx.fillStyle = rgba(palette.craft, Math.pow(1 - k / a.trail, 1.8) * (palette.isDark ? 0.36 : 0.3));\n        ctx.fillRect(tc * CELL, yPx, TILE, TILE);\n      }\n      const body: [number, number, number][] = [\n        [headCol, a.row, 1.0],\n        [headCol - a.dir, a.row, 0.92],\n        [headCol - a.dir * 2, a.row, 0.78],\n        [headCol - a.dir, a.row - 1, 0.72],\n        [headCol - a.dir, a.row + 1, 0.58],\n      ];\n      for (let b = 0; b < body.length; b++) {\n        const [bc, br, alpha] = body[b];\n        if (bc < 0 || bc >= cols || br < 0 || br >= rows) continue;\n        ctx.fillStyle = rgba(palette.craft, alpha);\n        ctx.fillRect(bc * CELL, br * CELL, TILE, TILE);\n      }\n    }\n\n    // The small print sits on the foot of the city: on a pale plate, mist settles there so it reads.\n    if (!palette.isDark) {\n      const foot = Math.min(104, this.cssH * 0.18);\n      const mist = ctx.createLinearGradient(0, this.cssH - foot, 0, this.cssH);\n      mist.addColorStop(0, rgba(palette.bg, 0));\n      mist.addColorStop(0.55, rgba(palette.bg, 0.82));\n      mist.addColorStop(1, rgba(palette.bg, 0.9));\n      ctx.fillStyle = mist;\n      ctx.fillRect(0, this.cssH - foot, this.cssW, foot);\n    }\n\n    ctx.restore();\n  }\n}\n"},{"path":"registry/footer-parts.tsx","type":"registry:component","content":"// Hairline UI · skyline-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { INTERACTION_FOCUS, INTERACTION_PRESS } from \"./ui-interaction-motion\";\n\n/*\n * The text of an art-led footer: brand lockup, link columns and small print.\n * It sits inside the picture, so it carries no panels, rules or labels of its own:\n * the plate sets the colours (--fp-fg, --fp-muted, --fp-accent) and the art does the rest.\n */\n\nexport interface FooterLink {\n  label: string;\n  href: string;\n}\n\nexport interface FooterColumn {\n  title: string;\n  links: FooterLink[];\n}\n\nexport const mixColor = (color: string, amount: number, into = \"transparent\") => `color-mix(in oklab, ${color} ${amount}%, ${into})`;\n\n/**\n * Plate colours. \"auto\" follows the theme (card in light, card in dark); \"night\" holds\n * a near-black plate tinted by the accent on any page, for art that only reads at night.\n */\nexport function plateColors(night: boolean, accent: string): React.CSSProperties {\n  return night\n    ? {\n        [\"--fp-accent\" as string]: accent,\n        [\"--fp-fg\" as string]: mixColor(\"white\", 94, accent),\n        [\"--fp-muted\" as string]: mixColor(\"white\", 60),\n        backgroundColor: mixColor(accent, 7, mixColor(\"white\", 5, \"black\")),\n        color: \"var(--fp-fg)\",\n        boxShadow: `0 0 0 1px ${mixColor(\"white\", 9)}, inset 0 1px 0 ${mixColor(\"white\", 9)}`,\n      }\n    : {\n        [\"--fp-accent\" as string]: accent,\n        [\"--fp-fg\" as string]: \"var(--card-foreground)\",\n        [\"--fp-muted\" as string]: \"var(--muted-foreground)\",\n        backgroundColor: \"var(--card)\",\n        color: \"var(--fp-fg)\",\n        boxShadow: \"0 0 0 1px var(--border)\",\n      };\n}\n\nexport function FooterLockup({\n  logo,\n  name,\n  tagline,\n  contact,\n  action,\n}: {\n  logo?: React.ReactNode;\n  name: string;\n  tagline?: string;\n  contact?: FooterLink;\n  action?: FooterLink;\n}) {\n  return (\n    <div className=\"flex max-w-[36ch] flex-col items-start gap-3.5\">\n      <div className=\"flex items-center gap-2.5\">\n        {logo}\n        <p className=\"text-[17px] font-semibold tracking-[-0.02em]\">{name}</p>\n      </div>\n      {tagline && <p className=\"text-pretty text-[14px] leading-6 text-[color:var(--fp-muted)]\">{tagline}</p>}\n      {contact && (\n        <a href={contact.href} className={`group/contact mt-1 inline-flex cursor-pointer items-center gap-1.5 rounded-sm text-[14px] font-medium ${INTERACTION_FOCUS}`}>\n          <span className=\"underline decoration-[color:var(--fp-muted)] decoration-1 underline-offset-[5px] transition-colors group-hover/contact:decoration-[color:var(--fp-accent)]\">\n            {contact.label}\n          </span>\n          <span aria-hidden=\"true\" className=\"transition-transform duration-200 group-hover/contact:translate-x-0.5\">\n            →\n          </span>\n        </a>\n      )}\n      {action && (\n        <a\n          href={action.href}\n          className={`group/action mt-1.5 inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-full px-4 text-[13.5px] font-medium ${INTERACTION_PRESS} ${INTERACTION_FOCUS}`}\n          style={{\n            backgroundColor: \"var(--fp-accent)\",\n            // The label picks its side from the accent itself, so any brand colour stays legible.\n            color: \"oklch(from var(--fp-accent) clamp(0.16, (0.68 - l) * 100, 0.985) calc(c * 0.25) h)\",\n          }}\n        >\n          {action.label}\n          <span aria-hidden=\"true\" className=\"transition-transform duration-200 group-hover/action:translate-x-0.5\">\n            →\n          </span>\n        </a>\n      )}\n    </div>\n  );\n}\n\n/**\n * Link columns. `onAim` reports the column the pointer or keyboard is in (null when it leaves),\n * so the picture can answer it.\n */\nexport function FooterNav({ columns, onAim }: { columns: FooterColumn[]; onAim?: (column: HTMLElement | null, index: number) => void }) {\n  if (!columns.length) return null;\n  return (\n    <nav\n      aria-label=\"Footer\"\n      onPointerLeave={() => onAim?.(null, -1)}\n      className=\"grid grid-cols-2 gap-x-[clamp(16px,4cqi,56px)] gap-y-7 @[440px]:grid-cols-[repeat(3,auto)]\"\n    >\n      {columns.map((col, index) => (\n        <div\n          key={col.title}\n          onPointerEnter={(e) => onAim?.(e.currentTarget, index)}\n          onFocus={(e) => onAim?.(e.currentTarget, index)}\n          onBlur={(e) => {\n            if (!e.currentTarget.contains(e.relatedTarget as Node | null)) onAim?.(null, -1);\n          }}\n          className=\"flex min-w-0 flex-col gap-2.5\"\n        >\n          <p className=\"text-[12px] text-[color:var(--fp-muted)]\">{col.title}</p>\n          <ul className=\"flex flex-col gap-1.5\">\n            {col.links.map((l) => (\n              <li key={l.label}>\n                <a\n                  href={l.href}\n                  className={`cursor-pointer rounded-sm text-[13.5px] transition-colors duration-150 hover:text-[color:var(--fp-accent)] @[480px]:text-[14px] ${INTERACTION_FOCUS}`}\n                >\n                  {l.label}\n                </a>\n              </li>\n            ))}\n          </ul>\n        </div>\n      ))}\n    </nav>\n  );\n}\n\n/** The small print, set as the picture's caption: no rule above it. */\nexport function FooterCaption({\n  legal,\n  links,\n  note,\n  className = \"\",\n}: {\n  legal?: string;\n  links: FooterLink[];\n  /** Anything that belongs beside the copyright, e.g. a local clock. */\n  note?: React.ReactNode;\n  className?: string;\n}) {\n  if (!legal && !links.length && !note) return null;\n  return (\n    <div className={`flex flex-wrap items-center justify-between gap-x-6 gap-y-2 text-[12.5px] ${className}`}>\n      {(legal || note) && (\n        <p className=\"flex flex-wrap items-center gap-x-3 gap-y-1\">\n          {legal && <span>{legal}</span>}\n          {note}\n        </p>\n      )}\n      {links.length > 0 && (\n        <ul className=\"flex flex-wrap gap-x-5 gap-y-1\">\n          {links.map((l) => (\n            <li key={l.label}>\n              <a href={l.href} className={`cursor-pointer rounded-sm opacity-80 transition-opacity hover:opacity-100 ${INTERACTION_FOCUS}`}>\n                {l.label}\n              </a>\n            </li>\n          ))}\n        </ul>\n      )}\n    </div>\n  );\n}\n\n/** A theme colour (any CSS colour, `var(...)` included) resolved to what the browser paints, for canvas and WebGL. */\nexport function resolveColor(host: HTMLElement, value: string): string {\n  const probe = document.createElement(\"span\");\n  probe.style.cssText = \"position:absolute;display:none\";\n  probe.style.color = value;\n  host.appendChild(probe);\n  const out = getComputedStyle(probe).color;\n  probe.remove();\n  return out;\n}\n"},{"path":"registry/ui-interaction-motion.ts","type":"registry:component","content":"// Hairline UI · skyline-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n'use client';\n\nimport * as React from 'react';\n\nexport const EASE_OUT = 'cubic-bezier(0.16, 1, 0.3, 1)';\nexport const EASE_SETTLE = 'cubic-bezier(0.22, 1.18, 0.36, 1)';\n/** Thrown things (indicators, thumbs): a slight overshoot on transform only. */\nexport const EASE_THROW = 'cubic-bezier(0.34, 1.36, 0.64, 1)';\n/**\n * The press every button primitive shares: a 3% give that eases in and settles back.\n * Tailwind v4's scale-* writes the `scale` property, so `scale` has to be in the list\n * or the press snaps.\n */\nexport const INTERACTION_PRESS =\n  'transition-[background-color,color,box-shadow,opacity,scale] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100';\nexport const INTERACTION_FOCUS ='focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background';\n\nconst query = '(prefers-reduced-motion: reduce)';\nconst subscribe = (notify: () => void) => {\n  const media = window.matchMedia(query);\n  media.addEventListener('change', notify);\n  return () => media.removeEventListener('change', notify);\n};\nexport const useInteractionReducedMotion = () => React.useSyncExternalStore(subscribe, () => window.matchMedia(query).matches, () => false);\n\nexport function useInteractionActivity<T extends Element>() {\n  const ref = React.useRef<T>(null);\n  const [visible, setVisible] = React.useState(false);\n  const [hidden, setHidden] = React.useState(false);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    const observer = new IntersectionObserver(([entry]) => setVisible(entry.isIntersecting));\n    observer.observe(el);\n    const visibility = () => setHidden(document.hidden);\n    visibility(); document.addEventListener('visibilitychange', visibility);\n    return () => { observer.disconnect(); document.removeEventListener('visibilitychange', visibility); };\n  }, []);\n  return { ref, active: visible && !hidden };\n}\n\nexport function interactionIcon(on: boolean, reduced: boolean): React.CSSProperties {\n  return { opacity: on ? 1 : 0, transform: on ? 'none' : 'scale(0.6)', filter: on ? 'blur(0px)' : 'blur(3px)', transition: reduced ? 'none' : `opacity 220ms ${EASE_OUT}, transform 380ms ${EASE_OUT}, filter 220ms ${EASE_OUT}` };\n}\n\n/** A raised object: one tight contact shadow, one short ambient, a hairline of light on its top edge. */\nexport const MATERIAL_LIFT =\n  'shadow-[0_1px_1.5px_rgb(0_0_0/0.07),0_3px_8px_-2px_rgb(0_0_0/0.1),inset_0_0.5px_0_rgb(255_255_255/0.8)] dark:shadow-[0_1px_2px_rgb(0_0_0/0.5),0_4px_10px_-2px_rgb(0_0_0/0.35),inset_0_0.5px_0_rgb(255_255_255/0.1)]';\n/** A trough something sits in, shaded from above, lit along its bottom edge. */\nexport const MATERIAL_RECESS =\n  'shadow-[inset_0_1px_2.5px_rgb(0_0_0/0.09),inset_0_-0.5px_0_rgb(255_255_255/0.7)] dark:shadow-[inset_0_1px_3px_rgb(0_0_0/0.45),inset_0_-0.5px_0_rgb(255_255_255/0.07)]';\n\nexport type SpringConfig = { stiffness: number; damping: number; mass?: number };\nexport interface Spring {\n  get(): number;\n  getVelocity(): number;\n  getTarget(): number;\n  /** Aim somewhere new from wherever it is now, keeping its speed. */\n  set(target: number): void;\n  /** Add speed (units per second), on top of what it already has. */\n  push(velocity: number): void;\n  /** Be there now, at rest. */\n  jump(value: number): void;\n  configure(config: SpringConfig): void;\n  stop(): void;\n}\n\n// Every moving spring on the page shares one frame loop, which sleeps when the last one rests. Each spring's onFrame runs\n// once per frame after all of them have stepped, so several springs that draw one shape paint it once.\nconst SPRING_STEP = 1 / 240;\ntype Running = { step: () => void };\nconst runningSprings = new Set<Running>();\nconst springPainters = new Set<() => void>();\nlet springFrame = 0;\nlet springLast = 0;\nlet springSpare = 0;\n\nfunction springTick(now: number) {\n  // A hidden tab stops the frames, so the first one back must not count the whole gap as time passed.\n  springSpare += Math.min((now - springLast) / 1000, 0.05);\n  springLast = now;\n  while (springSpare >= SPRING_STEP) {\n    runningSprings.forEach((spring) => spring.step());\n    springSpare -= SPRING_STEP;\n  }\n  const painters = [...springPainters];\n  springPainters.clear();\n  painters.forEach((paint) => paint());\n  springFrame = runningSprings.size ? requestAnimationFrame(springTick) : 0;\n}\n\nfunction wakeSprings(spring: Running) {\n  runningSprings.add(spring);\n  if (springFrame) return;\n  springSpare = 0;\n  springFrame = requestAnimationFrame((now) => {\n    springLast = now - 1000 / 60;\n    springTick(now);\n  });\n}\n\n/**\n * A spring that carries its speed: re-aim it mid-flight and it curves on from where it is, push it while it swings and the\n * push adds to the swing. Use it for anything that can be interrupted; a curve restarts from a standstill every time.\n * `onFrame` should write straight to the DOM. `precision` is how close counts as there, in the value's own units.\n */\nexport function createSpring(initial: number, config: SpringConfig, onFrame: () => void, precision = 0.01): Spring {\n  let value = initial;\n  let velocity = 0;\n  let target = initial;\n  let { stiffness, damping, mass = 1 } = config;\n  const running: Running = {\n    step() {\n      velocity += ((-stiffness * (value - target) - damping * velocity) / mass) * SPRING_STEP;\n      value += velocity * SPRING_STEP;\n      if (Math.abs(value - target) < precision && Math.abs(velocity) < precision * 10) {\n        value = target;\n        velocity = 0;\n        runningSprings.delete(running);\n      }\n      springPainters.add(onFrame);\n    },\n  };\n  return {\n    get: () => value,\n    getVelocity: () => velocity,\n    getTarget: () => target,\n    set(next) {\n      if (next === target && !runningSprings.has(running)) return;\n      target = next;\n      wakeSprings(running);\n    },\n    push(speed) {\n      velocity += speed;\n      wakeSprings(running);\n    },\n    jump(next) {\n      value = next;\n      target = next;\n      velocity = 0;\n      runningSprings.delete(running);\n      onFrame();\n    },\n    configure(next) {\n      ({ stiffness, damping, mass = 1 } = next);\n    },\n    stop() {\n      runningSprings.delete(running);\n    },\n  };\n}\n\n/** Sample recent movement rather than averaging a long drag and losing its release velocity. */\nexport type PointerSample = { x: number; time: number };\nexport function samplePointer(samples: PointerSample[], x: number, time: number) {\n  samples.push({ x, time });\n  while (samples.length > 2 && time - samples[0].time > 100) samples.shift();\n}\nexport function releaseVelocity(samples: PointerSample[], now: number) {\n  if (samples.length < 2 || now - samples[samples.length - 1].time > 100) return 0;\n  const first = samples[0], last = samples[samples.length - 1];\n  return (last.x - first.x) / Math.max(1, last.time - first.time);\n}\n\n/** Smooth Apple/rational rubber-band curve: continuous exponential-like resistance without linear kinks. */\nexport function rubberBand(overshoot: number, dimension = 320, constant = 0.55): number {\n  const d = dimension || 320;\n  const abs = Math.abs(overshoot);\n  return Math.sign(overshoot) * (1 - 1 / ((abs * constant) / d + 1)) * d;\n}\n\n/** Projects resting travel from release velocity (velocity in px/ms; time in seconds). */\nexport function projectInertia(distance: number, velocity: number, time = 0.12): number {\n  return distance + velocity * 1000 * time;\n}\n\n/** Smooths incoming release velocity toward a boundary so springs don't slam or clip into walls. */\nexport function softenVelocity(velocity: number, distanceToTarget: number, factor = 10): number {\n  const maxAllowed = Math.abs(distanceToTarget) * factor;\n  return Math.sign(velocity) * Math.min(Math.abs(velocity), maxAllowed);\n}\n\n/** A damped spring sampled by WAAPI: tuned for organic lightness with a hint of life (3% breath). */\nexport function springFrames(\n  from: number,\n  to: number,\n  velocity = 0,\n  duration = 480,\n  config: { omega?: number; damping?: number; steps?: number } = {},\n) {\n  const { omega = 16, damping = 0.74, steps = 36 } = config;\n  const damped = omega * Math.sqrt(Math.max(0.001, 1 - damping * damping));\n  const displacement = from - to;\n  const coefficient = (velocity * 1000 + damping * omega * displacement) / damped;\n  return Array.from({ length: steps + 1 }, (_, i) => {\n    const t = (i / steps) * (duration / 1000);\n    const value = to + Math.exp(-damping * omega * t) * (displacement * Math.cos(damped * t) + coefficient * Math.sin(damped * t));\n    return { value: i === steps ? to : value, offset: i / steps };\n  });\n}\n\n"}],"css":{},"docs":"Docs and live preview: https://hairlineui.com/blocks/skyline-footer. MIT licensed: https://hairlineui.com/license#components","meta":{"license":"MIT"}}