{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"atlas-footer","type":"registry:block","title":"Atlas footer","description":"A footer that ends on the curve of a dotted globe, with your hubs marked and light running between them. Drag to spin it.","author":"Hairline UI","dependencies":[],"files":[{"path":"registry/atlas-footer.tsx","type":"registry:component","content":"// Hairline UI · atlas-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 { AtlasEngine, buildAtlasPalette, readAtlasRgb, type AtlasHub } from \"./atlas-globe\";\nimport { FooterCaption, FooterLockup, FooterNav, plateColors, resolveColor, type FooterColumn, type FooterLink } from \"./footer-parts\";\nimport { useInteractionReducedMotion } from \"./ui-interaction-motion\";\n\n/*\n * A footer that ends on the curve of a dotted globe: about 6,500 points on a sphere, with\n * the brand's hubs marked and light running along the great circles between them. It turns\n * on its own; drag to spin it (it keeps its momentum), and reading a column nudges it round.\n */\n\nexport type AtlasLink = FooterLink;\nexport type AtlasColumn = FooterColumn;\n\nexport interface AtlasFooterProps {\n  /** Brand name: shown in the lockup. */\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?: AtlasLink;\n  /** Link columns. */\n  columns?: AtlasColumn[];\n  /** Places marked on the globe and joined by arcs: your offices, regions or ports. */\n  hubs?: AtlasHub[];\n  /** \"auto\" follows the theme; \"night\" keeps the dark plate on light pages too. */\n  tone?: \"auto\" | \"night\";\n  /** The colour of the land, hubs and arcs. Any CSS colour or token. Defaults to `var(--chart-3)`. */\n  accent?: string;\n  /** Copyright line. */\n  legal?: string;\n  /** Small links beside the copyright. */\n  legalLinks?: AtlasLink[];\n  className?: string;\n}\n\nconst NO_COLUMNS: AtlasColumn[] = [];\nconst NO_LINKS: AtlasLink[] = [];\n\nconst DEFAULT_HUBS: AtlasHub[] = [\n  { label: \"SFO\", lat: 37.77, lon: -122.42 },\n  { label: \"NYC\", lat: 40.71, lon: -74.01 },\n  { label: \"LDN\", lat: 51.51, lon: -0.13 },\n  { label: \"FRA\", lat: 50.11, lon: 8.68 },\n  { label: \"BLR\", lat: 12.97, lon: 77.59 },\n  { label: \"SIN\", lat: 1.35, lon: 103.82 },\n  { label: \"TYO\", lat: 35.68, lon: 139.65 },\n];\n\n\nconst DEFAULT_ACCENT = \"var(--chart-3, 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, var(--fp-accent) 12%, transparent)\" stroke=\"color-mix(in oklab, var(--fp-accent) 34%, transparent)\" />\n      <circle cx=\"13\" cy=\"13\" r=\"6.8\" fill=\"none\" stroke=\"currentColor\" strokeOpacity=\"0.55\" strokeWidth=\"1.3\" />\n      <ellipse cx=\"13\" cy=\"13\" rx=\"3.3\" ry=\"6.8\" fill=\"none\" stroke=\"var(--fp-accent)\" strokeWidth=\"1.35\" />\n      <path d=\"M6.2 13h13.6\" stroke=\"currentColor\" strokeOpacity=\"0.4\" strokeWidth=\"1.2\" />\n    </svg>\n  );\n}\n\nexport function AtlasFooter({\n  brand,\n  logo,\n  tagline,\n  action,\n  columns = NO_COLUMNS,\n  hubs = DEFAULT_HUBS,\n  tone = \"auto\",\n  accent = DEFAULT_ACCENT,\n  legal,\n  legalLinks = NO_LINKS,\n  className = \"\",\n}: AtlasFooterProps) {\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 engineRef = React.useRef<AtlasEngine | null>(null);\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 = readAtlasRgb(css.backgroundColor, [0.03, 0.06, 0.07]);\n      const fg = readAtlasRgb(css.color, [0.94, 0.96, 0.95]);\n      const lum = 0.2126 * bg[0] + 0.7152 * bg[1] + 0.0722 * bg[2];\n      const darkSurface = tone === \"night\" || lum < 0.42;\n      const accentRgb = readAtlasRgb(resolveColor(plate, \"var(--fp-accent)\"), darkSurface ? [0.27, 0.82, 0.66] : [0.12, 0.52, 0.44]);\n      return buildAtlasPalette(bg, fg, accentRgb, tone === \"night\");\n    };\n\n    const engine = new AtlasEngine(readPalette(), hubs);\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 = 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.setFont(getComputedStyle(stage).fontFamily || \"ui-monospace, SFMono-Regular, Menlo, monospace\");\n      engine.setPalette(readPalette());\n      engine.resize(w, h, dpr);\n      if (reduced) {\n        engine.setRevealedImmediate();\n        engine.draw(ctx, true);\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, false);\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(stage);\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, true);\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, true);\n    });\n    mo.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\", \"style\", \"data-theme\"] });\n\n    let activePointerId: number | null = null;\n    const onDown = (e: PointerEvent) => {\n      if (reduced) return;\n      activePointerId = e.pointerId;\n      stage.setPointerCapture(e.pointerId);\n      const r = stage.getBoundingClientRect();\n      engine.onDragStart(e.clientX - r.left);\n    };\n    const onMove = (e: PointerEvent) => {\n      if (reduced || activePointerId !== e.pointerId) return;\n      const r = stage.getBoundingClientRect();\n      engine.onDragMove(e.clientX - r.left);\n    };\n    const onUp = (e: PointerEvent) => {\n      if (activePointerId !== e.pointerId) return;\n      activePointerId = null;\n      if (stage.hasPointerCapture(e.pointerId)) stage.releasePointerCapture(e.pointerId);\n      engine.onDragEnd();\n    };\n\n    stage.addEventListener(\"pointerdown\", onDown);\n    stage.addEventListener(\"pointermove\", onMove);\n    stage.addEventListener(\"pointerup\", onUp);\n    stage.addEventListener(\"pointercancel\", onUp);\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      stage.removeEventListener(\"pointerdown\", onDown);\n      stage.removeEventListener(\"pointermove\", onMove);\n      stage.removeEventListener(\"pointerup\", onUp);\n      stage.removeEventListener(\"pointercancel\", onUp);\n      engineRef.current = null;\n      delete plate.dataset.ready;\n    };\n  }, [hubs, tone, accent, reduced]);\n\n  const nudgeColumn = (index: number) => {\n    if (reduced || !engineRef.current) return;\n    engineRef.current.nudgeSpin(index === 0 ? -1 : 1);\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          <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, index) => el && nudgeColumn(index)} />\n          </div>\n\n          {/* The globe; its canvas paints the plate's own colour, so there's no seam. Drag to spin. */}\n          <div\n            ref={stageRef}\n            aria-hidden=\"true\"\n            className=\"relative mt-[clamp(8px,2cqi,24px)] h-[calc(clamp(220px,32cqi,375px)_+_56px)] w-full cursor-grab select-none active:cursor-grabbing\"\n          >\n            <canvas ref={canvasRef} className=\"block size-full opacity-0 transition-opacity duration-500 group-data-[ready]/plate:opacity-100\" />\n          </div>\n\n          {/* The small print lies over the foot of the globe, which runs to the plate's edge. */}\n          <FooterCaption\n            legal={legal}\n            links={legalLinks}\n            className=\"relative -mt-[56px] min-h-[56px] px-[max(20px,5cqi)] pb-[clamp(18px,2.4cqi,26px)] pt-3 text-[color:var(--fp-muted)]\"\n          />\n        </div>\n      </div>\n    </footer>\n  );\n}\n"},{"path":"registry/atlas-globe.ts","type":"registry:component","content":"// Hairline UI · atlas-footer · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n/*\n * The dotted globe, in Canvas 2D: points on a Fibonacci sphere kept where there's land,\n * projected onto the curve of a hemisphere at the foot of the plate. Hubs are marked with\n * rings; light travels along the great circles (slerp) between them. The globe turns slowly,\n * takes a fling with momentum, and settles back to its drift.\n */\n\nexport type Rgb = [number, number, number];\n\nexport interface AtlasHub {\n  label: string;\n  lat: number;\n  lon: number;\n}\n\nexport interface AtlasPalette {\n  bg: Rgb;\n  oceanCenter: Rgb;\n  oceanEdge: Rgb;\n  rim: Rgb;\n  graticule: Rgb;\n  landDim: Rgb;\n  landBright: Rgb;\n  arcBase: Rgb;\n  accent: Rgb;\n  spark: Rgb;\n  isDark: boolean;\n}\n\ninterface LandDot {\n  x: number;\n  y: number;\n  z: number;\n}\n\ninterface ArcRoute {\n  fromIdx: number;\n  toIdx: number;\n  from: [number, number, number];\n  to: [number, number, number];\n  peak: number;\n  phase: number;\n  speed: number;\n}\n\nconst DEG = Math.PI / 180;\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\n// Compact continent outlines [lon, lat, ...]\nconst LAND: number[][] = [\n  [-166,68.9,-156.5,71.3,-141,69.7,-135,69.3,-125,70,-115,68.6,-108,68.3,-98,68,-94,71.5,-90,69,-86,68,-82,66.5,-87,64,-94,61,-93,58.8,-88,56.5,-82,55,-80,51.5,-79,54.5,-77,60,-78,62.5,-73,62,-69,60,-65,60.3,-61,56,-57,52.5,-56,51.5,-60,50,-66,50,-64.5,48.8,-65,47,-61,45.5,-66,43.8,-70,43.5,-70,41.7,-74,40.5,-75.5,38.5,-76,37,-75.5,35.2,-78,33.8,-81,31.5,-80.5,28.5,-80,25.5,-81.5,25.5,-82.5,27.5,-83,29.5,-85,29.7,-89,30.2,-89.5,29.2,-94,29.6,-97,27.5,-97.5,25,-97.8,22,-97,20,-95,18.6,-92,18.5,-91,19.5,-90.5,21,-87,21.5,-87.5,18,-88.3,16,-84,15.8,-83.3,12,-82.5,9.5,-79.5,9.5,-77.5,8.5,-78,7.5,-80,7.4,-82,8.2,-85.8,10,-87.5,13,-90,13.8,-92.3,14.5,-94.5,16,-96.5,15.7,-99.5,16.8,-103,18.3,-105.5,20.5,-105.2,22,-106.5,23.5,-109,25.5,-112,28.8,-114.7,31.6,-112.8,28,-110.5,24.2,-109.5,23,-112,24.8,-114,27.5,-115,30,-117,32.5,-118.5,34,-120.6,34.6,-122.5,37.7,-124,40.4,-124.3,43,-124,46.2,-124.7,48.4,-123,49,-127,50.5,-130,54.5,-133,57,-137,58.5,-140,59.8,-146,60.8,-151.5,59.2,-154,57.5,-158,56,-162,54.8,-164.5,54.4,-161,58.6,-162,59.9,-165,60.8,-164.5,63,-161,64.5,-165.5,64.6,-168,65.6],\n  [-62,67,-65,63.5,-72,63,-78,64.5,-80,67,-84,69.5,-88,71,-86,73.5,-78,73.5,-72,72,-67,69.5],\n  [-72,78,-66,76,-58,75.5,-55,72,-52,69.5,-54,67,-51,64,-48,61,-44,60,-42,60.5,-40,64,-37,65.5,-30,68.2,-22,70.2,-22,73,-18,75.5,-18,78],\n  [-24,65.5,-22,66.4,-15,66.5,-13.5,65,-18,63.4,-22.5,63.8],\n  [-77.5,8.5,-75.5,10.6,-72,12.4,-71.5,10.7,-68,10.6,-64,10.7,-61,10.5,-60,8.5,-57.5,6.3,-53,5.6,-51,4,-50,1.8,-50,0,-48,-1,-44,-2.5,-40,-2.8,-37,-4.8,-35,-5.5,-34.8,-7.5,-35.5,-9.5,-37.5,-12,-39,-14,-39,-17.5,-40,-20,-41,-22,-43.2,-23,-45.5,-23.8,-48.5,-26,-48.6,-28.5,-50.5,-30.8,-52.5,-33.2,-53.5,-34.5,-56,-34.9,-57.5,-36.3,-57.5,-38.2,-62,-39,-62.3,-40.8,-65,-41,-64.3,-42.7,-65.5,-45,-67.5,-46.5,-66,-48,-68,-50.2,-69,-52,-68.5,-53.5,-66.5,-55,-70,-55.3,-74,-52.5,-75.5,-50,-74.8,-47,-74,-44,-73.5,-41.8,-73.7,-37,-71.6,-33,-71.5,-30,-71.3,-27,-70.4,-23.5,-70.2,-18.5,-75.5,-15,-77,-12,-79.5,-7,-81.3,-5,-80.3,-3.4,-80,-1,-80.5,1,-78.8,1.8,-77.5,4,-77.4,6.5],\n  [-6,35.8,-1,35.2,2,36.7,10,37.2,11,35.5,10,34,11.5,33,15,32.4,19,30.3,20,32,24,32.6,29,31,32.3,31.3,32.5,29.9,33.5,27.5,35.5,24,37.3,21,38.5,18,39.5,15.5,41.5,13.5,43.3,12.5,45,10.4,48,11.2,51.3,11.8,51,10.4,49,6,47.5,4,45,1.8,42,-1,40.2,-3,39.3,-6.5,39.5,-8.5,40.5,-10.5,40.6,-14.5,39,-16.5,36,-19,35.3,-22,35.5,-24,32.9,-26,32.5,-28.5,31,-30,28.5,-32.5,25.6,-34,22,-34.2,20,-34.8,18.4,-34.2,18,-32.5,17.2,-29,15.5,-26.5,14.5,-23,13,-20.5,11.8,-17.3,12,-14,13.5,-11,13,-8.8,12.3,-6,11.5,-4,9.5,-1.5,9.4,1,9.8,3.5,8.5,4.6,6,4.3,4.5,6.4,2,6.3,-1,5.1,-3,5,-5,5.1,-7.5,4.4,-10,6,-12.5,7.6,-13.3,9.2,-15,11,-16.7,12.5,-17.5,14.7,-16.5,16.5,-16.2,19.5,-17,21,-15,24,-13.5,27.5,-10,29.5,-9.7,32,-7,33.8],\n  [49.3,-12,50.5,-15.5,49.5,-18,48,-22,47,-25,45,-25.4,43.6,-23,44,-20,44.3,-17,46.5,-15.8,48,-13.5],\n  [-9,43,-8.9,38.7,-8.9,37,-6,36.7,-5.5,36,-2,36.7,0,38.8,0.5,40.5,3.2,41.9,3,43.3,6,43.1,7.5,43.8,9,44.4,10.3,42.9,12.3,41.7,15.6,40,15.7,37.9,17,39,18.5,40.1,16.2,41.5,14,42.6,12.4,44.5,12.4,45.5,13.7,45.6,16.5,43.5,18.5,42.4,19.5,41.8,19.3,40.3,21,38.4,21.6,37,22.5,36.4,23.1,37.8,24,38.2,22.8,40.5,26,40.8,26.2,39.5,27,38,28.3,36.8,30.5,36.3,32.8,36.1,36,36.6,35.9,34.7,35.5,33.8,34.9,32.5,34.3,31.3,34.9,29.5,35.5,27.6,37,25,39,21.5,40.5,19.5,42.5,16.5,43.4,12.7,45,12.8,48.6,14,52,15.6,55.5,17.8,57.5,18.9,58.8,20.5,59.8,22.5,58.5,23.7,56.4,26.2,56,24.8,54.5,24.3,51.5,24.5,50.2,26.5,48.8,28,48,29.9,50,30.2,51.5,27.9,54,26.7,56.3,27.1,57.5,25.7,61.5,25.1,66.5,25.4,68.5,23.5,69,22.3,70.5,20.8,72.6,21.5,72.8,19,73.5,16,74.5,13.5,75.8,11,76.5,9,77.5,8.1,78.3,9,79.8,10.3,80.2,13,80.3,15.5,82,17,84.5,19.2,86.5,20,87,21.5,89,21.8,90.5,22.5,91.8,22.3,92.3,20.7,94.3,18.5,94.5,16.3,95.5,15.8,97.5,16.5,97.8,14.5,98.5,12,98.7,9.8,98.3,8.2,100.3,6,100.5,4,101.4,2.8,103.5,1.3,104.2,1.5,103.4,4,102.2,6.2,100.5,7.5,100,9.5,99.2,10.5,100,13.5,101,12.7,102.5,12,103,10.8,104.6,10.4,105,8.6,106.7,10.4,109.2,11.5,109.3,13.5,108.8,15.5,106.5,17.5,105.7,18.8,106.5,20.3,108,21.5,110,21,111,21.5,113.5,22.2,116.5,23,118.5,24.5,119.5,26,120.5,28,122,30,121.8,31.3,120.5,33.5,119.2,34.8,120.3,36,122.5,37,119,37.3,117.7,38.8,119.5,39.9,121.5,40.8,122.2,39.5,124.3,39.9,125.3,37.7,126.6,37.4,126.3,35,127.5,34.7,129.3,35.3,129.5,36.9,128.5,38.6,127.5,39.8,129.7,41,130.6,42.4,132,43.2,135,43.6,138,46.5,140.4,48.5,141,52,140.5,53.5,137.5,54,135.2,54.7,137,56.5,141,59,143,59.3,148,59.4,152,59,155,59.4,156.7,61.6,156.5,57,156.7,51,158.6,53,160,54.5,162.5,56.2,163.3,58,164.5,59.8,170,60,173.5,61.7,177.5,62.5,180,65,180,68.8,176,69.8,170,70,161,69.6,155,71,150,71.5,142,72.7,134,71.5,128,72.7,120,73,113,73.7,107,76.8,100,77.8,96,76.1,88,75.3,82,73.5,80,72.2,76,72.5,72,72.8,69,72.8,68,68.5,66,69.4,60,68.8,55,68.4,50,67.8,44,68.4,40,67.8,33,69.4,28.5,70.9,23,70.5,18,69.6,15,68.3,12.5,66,10.5,64,7.5,63,5,61.5,5.2,59.3,6,58.1,8,58,10.5,59.5,11.2,58.4,12.5,56.3,12.8,55.4,14.3,55.6,16.2,56.6,16.6,57.9,18.3,59.3,17.5,61,17.5,62.5,21,64.2,22.3,65.7,25.3,65.2,25,64,21.5,62,21.4,60.6,23,59.9,25,60.2,28.5,60.5,30,59.9,28,59.4,24,59.4,23.4,58.3,24.3,57.2,21.6,57.4,21,56,21.2,55.2,20,54.5,18.6,54.4,16,54.3,14.2,53.9,12,54.2,10.6,57.7,8.2,56.6,8.6,55.5,9,54.5,8.6,54,7,53.6,4.8,53,4.2,52,3.3,51.4,1.6,50.9,0.1,49.6,-1.6,49.7,-1.5,48.6,-4.7,48.4,-2.2,47.3,-1.3,44.5,-1.7,43.4,-4,43.4,-8,43.7],\n  [-5.7,50.1,-3.5,50.3,1.3,51.1,1.7,52.6,0.3,53.5,-0.2,54.3,-1.5,55.6,-2.1,57.1,-1.8,57.6,-3.2,58.6,-5,58.6,-6,57.5,-5.6,56.3,-5,55,-3,54.9,-3.4,54.4,-3,53.4,-4.5,53.3,-4.2,52.2,-5.2,51.8,-3.3,51.4,-4.2,51.2],\n  [129.6,33.2,130.3,31.2,131.4,31.4,132,33.4,134.2,33.2,135.5,33.5,136.8,34.3,138.8,34.6,140.9,35.7,140.6,36.9,141,38.3,142,39.6,141.4,41.4,140,40.7,139.7,39,138.5,37.8,136.8,37.1,136,35.8,133.3,35.6,131.5,34.5,130.9,33.9],\n  [95.3,5.6,97.5,5.2,100.4,2.2,103.8,-1,106,-3.2,105.9,-5.8,104.5,-5.9,102.3,-4,100.4,-1,98.7,1.7,96.4,3.8],\n  [109,1.5,109.6,-1,110.2,-3,114.5,-3.9,116.3,-3.5,116.5,-1.5,117.5,0.8,118.5,1,119,5,117.7,6.5,116.5,6.9,115.4,5,113.8,4.3,111.5,2.6,109.6,2],\n  [113.2,-22,114.1,-21.8,116.7,-20.6,121,-19.5,122.2,-17.5,123.5,-16.4,125,-14.5,127,-13.8,129.5,-14.9,130.2,-13,131,-12.2,132.7,-11.4,136.5,-12,136,-13.5,135.5,-14.8,137.5,-16.2,139.5,-17.5,140.8,-17.4,141.6,-15,141.6,-12.6,142.5,-10.7,143.5,-14,145.3,-15,146,-18.3,149,-20.5,150.8,-22.5,153.2,-25.5,153.6,-28.2,152.9,-31.5,151.2,-33.9,150,-37.5,147.8,-37.9,146.2,-39,144.8,-38.1,143,-38.8,140.5,-38,138,-35.6,137.7,-33,135.6,-34.8,134,-32.7,131.5,-31.5,128,-32.2,124,-33.8,121.8,-33.8,118,-35,115.1,-34.3,115.7,-31.7,114.9,-29,113.4,-26.3,114,-24.5,113.4,-23.5],\n];\n\nconst WATER: number[][] = [\n  [27.5,42.5,28,44,30,45.5,33.5,46,36.5,45.4,38,47,41.5,41.6,39,41,35,42,31,41.2,29,41.2],\n  [49,46.5,53,46.8,53.5,44,53,41,54,38,51,36.8,49,37.6,49.5,40.5,47.5,42.5,47,44.5],\n];\n\nfunction pointInPoly(poly: number[], lon: number, lat: number): boolean {\n  let hit = false;\n  for (let i = 0, j = poly.length - 2; i < poly.length; j = i, i += 2) {\n    const xi = poly[i];\n    const yi = poly[i + 1];\n    const xj = poly[j];\n    const yj = poly[j + 1];\n    if (yi > lat !== yj > lat && lon < ((xj - xi) * (lat - yi)) / (yj - yi) + xi) hit = !hit;\n  }\n  return hit;\n}\n\nfunction isLand(lon: number, lat: number): boolean {\n  let hit = false;\n  for (let i = 0; i < LAND.length; i++) {\n    if (pointInPoly(LAND[i], lon, lat)) {\n      hit = true;\n      break;\n    }\n  }\n  if (!hit) return false;\n  for (let i = 0; i < WATER.length; i++) {\n    if (pointInPoly(WATER[i], lon, lat)) return false;\n  }\n  return true;\n}\n\nfunction latLonToVec(lat: number, lon: number): [number, number, number] {\n  const phi = (90 - lat) * DEG;\n  const theta = (lon + 180) * DEG;\n  const sinPhi = Math.sin(phi);\n  return [-sinPhi * Math.cos(theta), Math.cos(phi), sinPhi * Math.sin(theta)];\n}\n\n// Precompute ~6,500 uniform Fibonacci-sphere landmass points once per module load\nlet cachedLandDots: LandDot[] | null = null;\nfunction getLandDots(): LandDot[] {\n  if (cachedLandDots) return cachedLandDots;\n  const total = 22000;\n  const golden = Math.PI * (3 - Math.sqrt(5));\n  const dots: LandDot[] = [];\n  for (let i = 0; i < total; i++) {\n    const y = 1 - (i / (total - 1)) * 2;\n    const r = Math.sqrt(Math.max(0, 1 - y * y));\n    const theta = golden * i;\n    const x = Math.cos(theta) * r;\n    const z = Math.sin(theta) * r;\n    const lat = Math.asin(y) / DEG;\n    const lon = Math.atan2(z, -x) / DEG - 180;\n    const normLon = ((lon + 540) % 360) - 180;\n    if (lat > -58 && lat < 79 && isLand(normLon, lat)) {\n      dots.push({ x, y, z });\n    }\n  }\n  cachedLandDots = dots;\n  return dots;\n}\n\nexport function readAtlasRgb(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 buildAtlasPalette(bg: Rgb, fg: Rgb, accent: Rgb, forceNight: boolean): AtlasPalette {\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    return {\n      bg,\n      oceanCenter: mixRgb(bg, accent, 0.11),\n      oceanEdge: mixRgb(bg, accent, 0.25),\n      rim: mixRgb(accent, [0.88, 0.99, 0.94], 0.48),\n      graticule: mixRgb(bg, accent, 0.22),\n      landDim: mixRgb(bg, mixRgb(fg, accent, 0.44), 0.34),\n      landBright: mixRgb(fg, accent, 0.22),\n      arcBase: mixRgb(accent, [0.85, 0.97, 0.92], 0.24),\n      accent,\n      spark: mixRgb(accent, [0.97, 1.0, 0.98], 0.76),\n      isDark: true,\n    };\n  }\n  return {\n    bg,\n    oceanCenter: mixRgb(bg, accent, 0.08),\n    oceanEdge: mixRgb(bg, mixRgb(fg, accent, 0.52), 0.16),\n    rim: mixRgb(accent, fg, 0.18),\n    graticule: mixRgb(bg, fg, 0.14),\n    landDim: mixRgb(bg, mixRgb(fg, accent, 0.44), 0.34),\n    landBright: mixRgb(fg, accent, 0.34),\n    arcBase: accent,\n    accent,\n    spark: mixRgb(accent, [0.97, 1.0, 0.98], 0.56),\n    isDark: false,\n  };\n}\n\nexport class AtlasEngine {\n  private cssW = 0;\n  private cssH = 0;\n  private dpr = 1;\n  private palette: AtlasPalette;\n  private dots: LandDot[];\n  private hubs: { label: string; lat: number; vec: [number, number, number] }[] = [];\n  private routes: ArcRoute[] = [];\n  private fontFamily = \"ui-monospace, SFMono-Regular, Menlo, monospace\";\n\n  // 3D rotation, drag inertia & smooth spring focus-to-hub orbit\n  private yaw = -1.2;\n  private pitch = -0.18;\n  private pitchVel = 0;\n  private yawVel = 0.075;\n  private dragging = false;\n  private dragLastX = 0;\n  private focusedHub: number | null = null;\n  private targetYaw: number | null = null;\n  private targetPitch: number | null = null;\n  private focusHold = 0;\n\n  private revealStart = -1;\n  private elapsed = 0;\n\n  constructor(palette: AtlasPalette, hubs: AtlasHub[]) {\n    this.palette = palette;\n    this.dots = getLandDots();\n    this.setHubs(hubs);\n  }\n\n  setPalette(palette: AtlasPalette) {\n    this.palette = palette;\n  }\n\n  setFont(font: string) {\n    this.fontFamily = font;\n  }\n\n  setHubs(hubs: AtlasHub[]) {\n    this.hubs = hubs.map((h) => ({ label: h.label, lat: h.lat, vec: latLonToVec(h.lat, h.lon) }));\n    const routes: ArcRoute[] = [];\n    const tryAdd = (fromIdx: number, toIdx: number, phase: number, speed: number) => {\n      const a = this.hubs[fromIdx].vec;\n      const b = this.hubs[toIdx].vec;\n      const dot = clamp(a[0] * b[0] + a[1] * b[1] + a[2] * b[2], -1, 1);\n      // Skip near-antipodal pairs so arcs stay tight, clean orbital curves\n      if (dot < -0.35 || dot > 0.992) return;\n      const ang = Math.acos(dot);\n      const peak = clamp(ang * 0.085, 0.06, 0.16);\n      routes.push({ fromIdx, toIdx, from: a, to: b, peak, phase, speed });\n    };\n    for (let i = 0; i < this.hubs.length; i++) {\n      const j = (i + 1) % this.hubs.length;\n      const k = (i + 2) % this.hubs.length;\n      tryAdd(i, j, (i * 0.27) % 1, 0.16 + (i % 3) * 0.03);\n      if (this.hubs.length >= 4 && i % 2 === 0) tryAdd(i, k, (i * 0.41 + 0.35) % 1, 0.13 + (i % 2) * 0.04);\n    }\n    this.routes = routes;\n  }\n\n  focusHub(index: number | null, immediate = false) {\n    if (index === null || index < 0 || index >= this.hubs.length) {\n      this.focusedHub = null;\n      this.targetYaw = null;\n      this.targetPitch = null;\n      this.focusHold = 0;\n      return;\n    }\n    this.focusedHub = index;\n    const hub = this.hubs[index];\n    const [x, , z] = hub.vec;\n    const desiredYaw = Math.atan2(-x, z);\n    const desiredPitch = clamp((hub.lat - 51) * DEG, -0.88, 0.12);\n    let diff = ((desiredYaw - this.yaw + Math.PI) % (Math.PI * 2)) - Math.PI;\n    if (diff < -Math.PI) diff += Math.PI * 2;\n    if (immediate) {\n      this.yaw = desiredYaw;\n      this.pitch = desiredPitch;\n      this.targetYaw = null;\n      this.targetPitch = null;\n      this.yawVel = 0;\n      this.pitchVel = 0;\n      this.focusHold = 0;\n    } else {\n      this.targetYaw = this.yaw + diff;\n      this.targetPitch = desiredPitch;\n      this.focusHold = 4.2;\n    }\n  }\n\n  resize(cssW: number, cssH: number, dpr: number) {\n    this.cssW = cssW;\n    this.cssH = cssH;\n    this.dpr = dpr;\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  onDragStart(cssX: number) {\n    this.dragging = true;\n    this.dragLastX = cssX;\n    this.yawVel = 0;\n    this.targetYaw = null;\n    this.targetPitch = null;\n    this.focusHold = 0;\n  }\n\n  onDragMove(cssX: number) {\n    if (!this.dragging) return;\n    const dx = cssX - this.dragLastX;\n    this.dragLastX = cssX;\n    const delta = dx * 0.0052;\n    this.yaw += delta;\n    this.yawVel = clamp(delta * 42, -1.8, 1.8);\n  }\n\n  onDragEnd() {\n    this.dragging = false;\n  }\n\n  nudgeSpin(dir: number) {\n    if (this.focusHold > 0) return;\n    this.yawVel = clamp(this.yawVel + dir * 0.22, -0.9, 0.9);\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    if (!this.dragging) {\n      if (this.targetYaw !== null && this.focusHold > 0) {\n        this.focusHold -= safeDt;\n        const errY = this.targetYaw - this.yaw;\n        this.yawVel += (errY * 12 - this.yawVel * 6.0) * safeDt;\n        this.yaw += this.yawVel * safeDt;\n        if (this.targetPitch !== null) {\n          const errP = this.targetPitch - this.pitch;\n          this.pitchVel += (errP * 11 - this.pitchVel * 5.8) * safeDt;\n          this.pitch += this.pitchVel * safeDt;\n        }\n        if (this.focusHold <= 0) {\n          this.targetYaw = null;\n          this.targetPitch = null;\n        }\n      } else {\n        this.yaw += this.yawVel * safeDt;\n        const baseDrift = 0.075;\n        this.yawVel += (baseDrift - this.yawVel) * Math.min(1, safeDt * 1.9);\n        const basePitch = -0.18;\n        this.pitch += (basePitch - this.pitch) * Math.min(1, safeDt * 1.6);\n        this.pitchVel *= Math.max(0, 1 - safeDt * 4);\n      }\n    }\n  }\n\n  private project(x: number, y: number, z: number, cosY: number, sinY: number, cosP: number, sinP: number, cx: number, cy: number, R: number) {\n    const x1 = x * cosY + z * sinY;\n    const z1 = -x * sinY + z * cosY;\n    const y2 = y * cosP - z1 * sinP;\n    const z2 = y * sinP + z1 * cosP;\n    return { sx: cx + x1 * R, sy: cy - y2 * R, z: z2 };\n  }\n\n  draw(ctx: CanvasRenderingContext2D, reduced: boolean) {\n    const { cssW, cssH, dpr, palette, elapsed } = this;\n    if (cssW <= 0 || cssH <= 0) return;\n\n    ctx.save();\n    ctx.scale(dpr, dpr);\n    ctx.fillStyle = rgba(palette.bg, 1);\n    ctx.fillRect(0, 0, cssW, cssH);\n\n    const reveal = reduced ? 1 : 1 - Math.pow(1 - clamp(elapsed / 1.15, 0, 1), 3);\n\n    // Massive arching hemisphere filling the lower bay edge-to-edge\n    const R = Math.max(cssW * 0.56, cssH * 1.45);\n    const cx = cssW * 0.5;\n    const riseOffset = (1 - reveal) * 58;\n    const cy = cssH * 0.14 + R + riseOffset;\n\n    // 1. A thin atmosphere at the limb: a few pixels of light, never a halo.\n    const glowGrad = ctx.createRadialGradient(cx, cy, R * 0.995, cx, cy, R * 1.025);\n    glowGrad.addColorStop(0, rgba(palette.rim, (palette.isDark ? 0.22 : 0.14) * reveal));\n    glowGrad.addColorStop(1, rgba(palette.bg, 0));\n    ctx.fillStyle = glowGrad;\n    ctx.fillRect(0, 0, cssW, cssH);\n\n    // 2. Sphere body with deep oceanic gradient + crisp rim stroke\n    ctx.save();\n    ctx.beginPath();\n    ctx.arc(cx, cy, R, 0, Math.PI * 2);\n    const bodyGrad = ctx.createRadialGradient(cx, cy - R * 0.72, R * 0.08, cx, cy, R);\n    bodyGrad.addColorStop(0, rgba(palette.oceanEdge, 1));\n    bodyGrad.addColorStop(0.58, rgba(palette.oceanCenter, 1));\n    bodyGrad.addColorStop(1, rgba(palette.bg, 1));\n    ctx.fillStyle = bodyGrad;\n    ctx.fill();\n\n    ctx.strokeStyle = rgba(palette.rim, (palette.isDark ? 0.58 : 0.48) * reveal);\n    ctx.lineWidth = 1.25;\n    ctx.stroke();\n\n    ctx.clip();\n\n    const cosY = Math.cos(this.yaw);\n    const sinY = Math.sin(this.yaw);\n    const cosP = Math.cos(this.pitch);\n    const sinP = Math.sin(this.pitch);\n\n    // 3. Faint latitude graticule parallels\n    ctx.strokeStyle = rgba(palette.graticule, palette.isDark ? 0.30 : 0.42);\n    ctx.lineWidth = 0.75;\n    for (let lat = -30; lat <= 60; lat += 30) {\n      ctx.beginPath();\n      let started = false;\n      for (let lon = -180; lon <= 180; lon += 6) {\n        const [vx, vy, vz] = latLonToVec(lat, lon);\n        const pt = this.project(vx, vy, vz, cosY, sinY, cosP, sinP, cx, cy, R);\n        if (pt.z > 0 && pt.sy <= cssH + 8) {\n          if (!started) {\n            ctx.moveTo(pt.sx, pt.sy);\n            started = true;\n          } else {\n            ctx.lineTo(pt.sx, pt.sy);\n          }\n        } else {\n          started = false;\n        }\n      }\n      ctx.stroke();\n    }\n\n    // 4. High-density 3D Continent Dots (2 depth-shaded batches)\n    const dimBatch = new Path2D();\n    const brightBatch = new Path2D();\n    const dotBase = cssW < 520 ? 1.0 : 1.26;\n\n    for (let i = 0; i < this.dots.length; i++) {\n      const d = this.dots[i];\n      const pt = this.project(d.x, d.y, d.z, cosY, sinY, cosP, sinP, cx, cy, R);\n      if (pt.z <= 0.03 || pt.sy > cssH + 6 || pt.sx < -6 || pt.sx > cssW + 6) continue;\n      const rad = dotBase * (0.58 + 0.52 * pt.z);\n      if (pt.z > 0.42) {\n        brightBatch.moveTo(pt.sx + rad, pt.sy);\n        brightBatch.arc(pt.sx, pt.sy, rad, 0, Math.PI * 2);\n      } else {\n        dimBatch.moveTo(pt.sx + rad, pt.sy);\n        dimBatch.arc(pt.sx, pt.sy, rad, 0, Math.PI * 2);\n      }\n    }\n\n    ctx.fillStyle = rgba(palette.landDim, (palette.isDark ? 0.72 : 0.65) * reveal);\n    ctx.fill(dimBatch);\n    ctx.fillStyle = rgba(palette.landBright, (palette.isDark ? 0.9 : 0.86) * reveal);\n    ctx.fill(brightBatch);\n\n    ctx.restore();\n\n    // 5. Elevated 3D Great-Circle Network Arcs (true SLERP) + Traveling Pulses\n    const arcAlpha = clamp((reveal - 0.25) / 0.75, 0, 1);\n    if (arcAlpha > 0.02) {\n      for (let rIdx = 0; rIdx < this.routes.length; rIdx++) {\n        const rt = this.routes[rIdx];\n        const isHighlighted = this.focusedHub !== null && (rt.fromIdx === this.focusedHub || rt.toIdx === this.focusedHub);\n        const steps = 30;\n        const pts: { sx: number; sy: number; z: number }[] = [];\n        const dot = clamp(rt.from[0] * rt.to[0] + rt.from[1] * rt.to[1] + rt.from[2] * rt.to[2], -0.999, 0.999);\n        const omega = Math.acos(dot);\n        const sinOmega = Math.max(1e-4, Math.sin(omega));\n\n        for (let k = 0; k <= steps; k++) {\n          const t = k / steps;\n          const w0 = Math.sin((1 - t) * omega) / sinOmega;\n          const w1 = Math.sin(t * omega) / sinOmega;\n          const lift = 1 + Math.sin(t * Math.PI) * rt.peak;\n          const vx = (rt.from[0] * w0 + rt.to[0] * w1) * lift;\n          const vy = (rt.from[1] * w0 + rt.to[1] * w1) * lift;\n          const vz = (rt.from[2] * w0 + rt.to[2] * w1) * lift;\n          pts.push(this.project(vx, vy, vz, cosY, sinY, cosP, sinP, cx, cy, R));\n        }\n\n        ctx.beginPath();\n        let drawing = false;\n        for (let k = 0; k <= steps; k++) {\n          const pt = pts[k];\n          if (pt.z > 0.06 && pt.sy < cssH + 10) {\n            if (!drawing) {\n              ctx.moveTo(pt.sx, pt.sy);\n              drawing = true;\n            } else {\n              ctx.lineTo(pt.sx, pt.sy);\n            }\n          } else {\n            drawing = false;\n          }\n        }\n        ctx.strokeStyle = rgba(\n          palette.arcBase,\n          (isHighlighted ? 0.62 : palette.isDark ? 0.28 : 0.34) * arcAlpha,\n        );\n        ctx.lineWidth = isHighlighted ? 1.35 : 1;\n        ctx.stroke();\n\n        // Luminous traveling data comet along the arc\n        const head = reduced ? 0.55 : (rt.phase + elapsed * rt.speed) % 1;\n        const tailLen = isHighlighted ? 0.34 : 0.26;\n        for (let k = 0; k < steps; k++) {\n          const segT = k / steps;\n          const dist = head - segT;\n          if (dist < 0 || dist > tailLen) continue;\n          const p0 = pts[k];\n          const p1 = pts[k + 1];\n          if (p0.z <= 0.06 || p1.z <= 0.06) continue;\n          const zFade = clamp((Math.min(p0.z, p1.z) - 0.06) / 0.16, 0, 1);\n          const glow = Math.pow(1 - dist / tailLen, 1.5) * zFade;\n          ctx.strokeStyle = rgba(mixRgb(palette.accent, palette.spark, glow * 0.75), glow * (isHighlighted ? 1 : 0.92) * arcAlpha);\n          ctx.lineWidth = (isHighlighted ? 1.5 : 1.2) + glow * 1.4;\n          ctx.beginPath();\n          ctx.moveTo(p0.sx, p0.sy);\n          ctx.lineTo(p1.sx, p1.sy);\n          ctx.stroke();\n        }\n      }\n    }\n\n    // 6. Global Hub Beacons on the Front Hemisphere\n    if (arcAlpha > 0.02) {\n      ctx.font = `500 10px ${this.fontFamily}`;\n      ctx.textAlign = \"left\";\n      ctx.textBaseline = \"middle\";\n      for (let i = 0; i < this.hubs.length; i++) {\n        const h = this.hubs[i];\n        const pt = this.project(h.vec[0], h.vec[1], h.vec[2], cosY, sinY, cosP, sinP, cx, cy, R);\n        if (pt.z < 0.16 || pt.sy > cssH - 12 || pt.sx < 14 || pt.sx > cssW - 44) continue;\n\n        const isFocused = this.focusedHub === i;\n        const vis = clamp((pt.z - 0.16) / 0.35, 0, 1) * arcAlpha;\n        const pulse = reduced ? 0.45 : Math.sin(elapsed * 2.4 + i * 1.7) * 0.5 + 0.5;\n\n        ctx.strokeStyle = rgba(palette.accent, (isFocused ? 0.85 : 0.3 + 0.45 * pulse) * vis);\n        ctx.lineWidth = isFocused ? 1.4 : 1;\n        ctx.beginPath();\n        ctx.arc(pt.sx, pt.sy, (isFocused ? 6.5 : 4.5) + pulse * 3.5, 0, Math.PI * 2);\n        ctx.stroke();\n\n        if (isFocused) {\n          ctx.strokeStyle = rgba(palette.spark, (0.35 + 0.35 * (1 - pulse)) * vis);\n          ctx.lineWidth = 0.9;\n          ctx.beginPath();\n          ctx.arc(pt.sx, pt.sy, 12 + pulse * 4.5, 0, Math.PI * 2);\n          ctx.stroke();\n        }\n\n        ctx.fillStyle = rgba(palette.spark, 0.96 * vis);\n        ctx.beginPath();\n        ctx.arc(pt.sx, pt.sy, isFocused ? 3.0 : 2.3, 0, Math.PI * 2);\n        ctx.fill();\n\n        ctx.fillStyle = rgba(isFocused ? palette.spark : palette.landBright, (isFocused ? 0.98 : 0.84) * vis);\n        ctx.fillText(h.label, pt.sx + (isFocused ? 10 : 8), pt.sy);\n      }\n    }\n\n    // The small print lies over the foot of the globe: let it sink into the plate there.\n    const foot = Math.min(72, cssH * 0.2);\n    const sink = ctx.createLinearGradient(0, cssH - foot, 0, cssH);\n    sink.addColorStop(0, rgba(palette.bg, 0));\n    sink.addColorStop(0.6, rgba(palette.bg, 0.8));\n    sink.addColorStop(1, rgba(palette.bg, 0.92));\n    ctx.fillStyle = sink;\n    ctx.fillRect(0, cssH - foot, cssW, foot);\n\n    ctx.restore();\n  }\n}\n"},{"path":"registry/footer-parts.tsx","type":"registry:component","content":"// Hairline UI · atlas-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 · atlas-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/atlas-footer. MIT licensed: https://hairlineui.com/license#components","meta":{"license":"MIT"}}