{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"curved-rail-nav","type":"registry:component","title":"Curved Rail Nav","description":"A nav whose links ride a shallow cylinder in real perspective: the active link stands forward and underlit in copper, and choosing another turns the rail toward it on a spring.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/curved-rail-nav.tsx","content":"\"use client\";\n\nimport { useEffect, useId, useRef, useState, useSyncExternalStore } from \"react\";\nimport type { CSSProperties, KeyboardEvent as ReactKeyboardEvent, PointerEvent as ReactPointerEvent, ReactNode } from \"react\";\n\n/**\n * CurvedRailNav — a nav whose links ride a shallow cylinder.\n *\n * In real perspective, the active link stands forward, lifted and underlit\n * in copper; choose another and the rail turns toward it on a spring while\n * the rest recede along the curve. Hover or focus lifts a link 12px, and the\n * rail leans toward the pointer. Controlled or not; folds into a menu on\n * narrow containers. CSS 3D.\n *\n * Part of the Spatial 3D kit: a dark studio (#0a0a0d, panels #101114 and\n * #16171b, ink #f2f1ee) with anodised copper #ff7a3d only as light, and\n * one object in three finishes (titanium, ceramic, soft-touch polymer) under\n * one rig: key, fill and rim, soft shadows, occlusion and a softbox\n * reflection. Hanken Grotesk through var(--font-hanken) for display over\n * Geist. Respects prefers-reduced-motion. No dependencies beyond React.\n * Paste it as its own file: it repeats the kit's small helpers, which would\n * clash in one module. Load Hanken Grotesk with next/font (variable:\n * \"--font-hanken\") on a parent, or from Google Fonts or @fontsource.\n * Needs Tailwind v4 (on v3.4, add the @tailwindcss/container-queries plugin).\n */\n\nconst SANS = 'var(--font-sans, \"Geist\", \"Inter\", ui-sans-serif, system-ui, sans-serif)';\n\nconst MONO = 'var(--font-mono, \"Geist Mono\", ui-monospace, \"SFMono-Regular\", Menlo, Consolas, monospace)';\n\nconst DISPLAY = 'var(--font-hanken, \"Hanken Grotesk\", var(--font-sans, \"Geist\"), ui-sans-serif, system-ui, sans-serif)';\n\nconst EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\n\n/** The dark studio the kit is set in. */\nconst ROOM = {\n  ground: \"#0a0a0d\",\n  panel: \"#101114\",\n  raised: \"#16171b\",\n  ink: \"rgba(242,241,238,0.92)\",\n  ink2: \"rgba(242,241,238,0.6)\",\n  ink3: \"rgba(242,241,238,0.38)\",\n  line: \"rgba(242,241,238,0.08)\",\n  line2: \"rgba(242,241,238,0.16)\",\n  copper: \"#ff7a3d\",\n} as const;\n\n/**\n * The three finishes the object can wear. `base` is the colour; the rest are\n * shader parameters: gloss (0-1), specular strength, rim, subsurface wrap, and\n * how metallic it is. `css` holds the colours the CSS-3D parts draw with.\n */\nexport const S3_FINISHES = {\n  titanium: {\n    label: \"Titanium\",\n    base: [0.725, 0.737, 0.761],\n    gloss: 0.62,\n    spec: 0.8,\n    rim: 0.3,\n    sss: 0,\n    metal: 1,\n    css: { face: \"#c9ccd2\", side: \"#8d9098\", edge: \"#e6e8ec\", shade: \"#5d6068\" },\n  },\n  ceramic: {\n    label: \"Ceramic\",\n    base: [0.925, 0.906, 0.867],\n    gloss: 0.4,\n    spec: 0.25,\n    rim: 0.18,\n    sss: 0.08,\n    metal: 0,\n    css: { face: \"#ece7dd\", side: \"#c9c2b5\", edge: \"#faf7f1\", shade: \"#9a9386\" },\n  },\n  polymer: {\n    label: \"Polymer\",\n    base: [0.106, 0.11, 0.125],\n    gloss: 0.3,\n    spec: 0.12,\n    rim: 0.22,\n    sss: 0,\n    metal: 0,\n    css: { face: \"#26272c\", side: \"#18191d\", edge: \"#3a3b41\", shade: \"#0e0f12\" },\n  },\n} as const;\n\nexport type S3Finish = keyof typeof S3_FINISHES;\n\nfunction own<T extends object>(map: T, key: string): key is Extract<keyof T, string> {\n  return Object.prototype.hasOwnProperty.call(map, key);\n}\n\nfunction finishOf(name: string) {\n  return own(S3_FINISHES, name) ? S3_FINISHES[name] : S3_FINISHES.titanium;\n}\n\nfunction clamp(v: number, lo: number, hi: number): number {\n  return v < lo ? lo : v > hi ? hi : v;\n}\n\n/** Links: strip tabs and newlines, refuse backslashes, allow http(s), mailto, tel and same-site paths. */\nfunction safeHref(raw: string): string {\n  const v = raw.replace(/[\\t\\n\\r]/g, \"\").trim();\n  if (!v || v.includes(\"\\\\\")) return \"#\";\n  if (/^(https?:|mailto:|tel:)/i.test(v)) return v;\n  if (/^[/#?]/.test(v) && !/^\\/\\//.test(v)) return v;\n  return \"#\";\n}\n\nfunction subscribeMotion(cb: () => void) {\n  const m = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n  m.addEventListener(\"change\", cb);\n  return () => m.removeEventListener(\"change\", cb);\n}\n\n/** True when the visitor asked for reduced motion. False on the server. */\nfunction useReducedMotion(): boolean {\n  return useSyncExternalStore(\n    subscribeMotion,\n    () => window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches,\n    () => false,\n  );\n}\n\n// Each part carries only the CSS it needs, so any one of them works on its own.\n// Nothing is interpolated into these sheets; colours arrive as CSS variables.\n// revert-layer keeps an element's own rounded corners when a host page's focus rule flattens them.\nconst FOCUS_CSS = \".s3-scope :focus-visible,.s3-scope:focus-visible{outline:2px solid var(--s3-ring,#ff7a3d);outline-offset:3px;border-radius:revert-layer}\";\n\nexport type S3Link = { label: string; href: string };\n\n// The cap's travel and its spring: down in 90ms, back with a slight overshoot in 320ms.\nconst KEYCAP_CSS =\n  \".s3-key{--s3-depth:7px;transform:translateY(0);box-shadow:0 1px 0 var(--s3-side),0 2px 0 var(--s3-side),0 3px 0 var(--s3-side),0 4px 0 var(--s3-side),0 5px 0 var(--s3-side),0 6px 0 var(--s3-side),0 7px 0 var(--s3-shade),0 16px 26px -10px rgba(0,0,0,.65);transition:transform 320ms cubic-bezier(.34,1.56,.64,1),box-shadow 320ms cubic-bezier(.34,1.56,.64,1)}\" +\n  \".s3-key:hover{transform:translateY(-1px);box-shadow:0 1px 0 var(--s3-side),0 2px 0 var(--s3-side),0 3px 0 var(--s3-side),0 4px 0 var(--s3-side),0 5px 0 var(--s3-side),0 6px 0 var(--s3-side),0 7px 0 var(--s3-side),0 8px 0 var(--s3-shade),0 20px 30px -10px rgba(0,0,0,.7)}\" +\n  \".s3-key[data-down]{transform:translateY(6px);box-shadow:0 1px 0 var(--s3-shade),0 6px 12px -8px rgba(0,0,0,.6);transition-duration:90ms;transition-timing-function:ease-out}\" +\n  \".s3-key .s3-spec{background:radial-gradient(120px 70px at var(--s3-mx,30%) var(--s3-my,0%),rgba(255,255,255,.34),transparent 70%);opacity:.8;transition:opacity 220ms}\" +\n  \".s3-key:hover .s3-spec{opacity:1}\" +\n  \".s3-key .s3-led{background:var(--s3-led-off);box-shadow:none;transition:background-color 180ms,box-shadow 180ms}\" +\n  \".s3-key[data-down] .s3-led,.s3-key[data-lit] .s3-led{background:#ff7a3d;box-shadow:0 0 6px 1px rgba(255,122,61,.9),0 0 16px 2px rgba(255,122,61,.45)}\" +\n  \"@media (prefers-reduced-motion: reduce){.s3-key,.s3-key[data-down]{transition:none}}\";\n\nexport type KeycapButtonProps = {\n  children: ReactNode;\n  href?: string;\n  onClick?: () => void;\n  type?: \"button\" | \"submit\";\n  /** \"key\": a raised keycap in a finish; \"ghost\": a hairline key for the second action. */\n  variant?: \"key\" | \"ghost\";\n  finish?: S3Finish;\n  size?: \"lg\" | \"md\";\n  /** Keep the status light on (a chosen option). */\n  lit?: boolean;\n  disabled?: boolean;\n  ariaLabel?: string;\n  ariaPressed?: boolean;\n  className?: string;\n};\n\n/**\n * A button machined like a keycap. Its skirt is a stack of hard shadows, so\n * pressing it (pointer, Enter or Space) drops the cap 6px and the skirt\n * collapses in 90ms; letting go springs it back past rest in 320ms. A soft\n * specular sits where the pointer is, the cap lifts 1px on hover, and a\n * copper status light in the corner glows while it is held (or stays lit\n * with `lit`). Finishes: titanium, ceramic, polymer. Renders a link when\n * given an href, else a button.\n */\nexport function KeycapButton({ children, href, onClick, type = \"button\", variant = \"key\", finish = \"titanium\", size = \"lg\", lit, disabled, ariaLabel, ariaPressed, className }: KeycapButtonProps) {\n  const [down, setDown] = useState(false);\n  const f = finishOf(finish).css;\n  const ghost = variant === \"ghost\";\n  const dark = finish === \"polymer\" || ghost;\n  const style = {\n    \"--s3-side\": ghost ? \"rgba(242,241,238,0.14)\" : f.side,\n    \"--s3-shade\": ghost ? \"rgba(242,241,238,0.06)\" : f.shade,\n    \"--s3-led-off\": dark ? \"rgba(242,241,238,0.18)\" : \"rgba(10,10,13,0.18)\",\n    \"--s3-ring\": \"#ff7a3d\",\n    background: ghost ? \"rgba(22,23,27,0.9)\" : `linear-gradient(180deg, ${f.edge}, ${f.face} 38%, ${f.face} 70%, ${f.side})`,\n    color: dark ? \"rgba(242,241,238,0.92)\" : \"#16171b\",\n    border: ghost ? \"1px solid rgba(242,241,238,0.16)\" : `1px solid ${f.edge}`,\n    touchAction: \"manipulation\",\n  } as CSSProperties;\n  const cls =\n    \"s3-scope s3-key relative inline-flex select-none items-center justify-center gap-3 overflow-hidden rounded-[14px] font-semibold outline-none \" +\n    (size === \"lg\" ? \"h-[52px] px-6 text-[15px] \" : \"h-11 px-5 text-[14px] \") +\n    (disabled ? \"pointer-events-none opacity-45 \" : \"cursor-pointer \") +\n    (className ?? \"\");\n  const press = (on: boolean) => {\n    if (!disabled) setDown(on);\n  };\n  const handlers = {\n    onPointerDown: () => press(true),\n    onPointerUp: () => press(false),\n    onPointerLeave: () => press(false),\n    onPointerCancel: () => press(false),\n    onPointerMove: (e: ReactPointerEvent<HTMLElement>) => {\n      const r = e.currentTarget.getBoundingClientRect();\n      e.currentTarget.style.setProperty(\"--s3-mx\", `${(((e.clientX - r.left) / r.width) * 100).toFixed(1)}%`);\n      e.currentTarget.style.setProperty(\"--s3-my\", `${(((e.clientY - r.top) / r.height) * 100).toFixed(1)}%`);\n    },\n    onKeyDown: (e: ReactKeyboardEvent) => {\n      if (!e.repeat && (e.key === \"Enter\" || e.key === \" \")) press(true);\n    },\n    onKeyUp: () => press(false),\n    onBlur: () => press(false),\n  };\n  const inner = (\n    <>\n      <span aria-hidden className=\"s3-spec pointer-events-none absolute inset-0\" />\n      <span aria-hidden className=\"s3-led absolute left-2.5 top-2.5 size-[5px] rounded-full\" />\n      <span className=\"relative\" style={{ fontFamily: SANS, letterSpacing: \"-0.005em\" }}>\n        {children}\n      </span>\n    </>\n  );\n  const data = { \"data-down\": down ? \"\" : undefined, \"data-lit\": lit ? \"\" : undefined };\n  if (href) {\n    return (\n      <>\n        <style>{FOCUS_CSS + KEYCAP_CSS}</style>\n        <a href={safeHref(href)} onClick={onClick} aria-label={ariaLabel} className={cls} style={style} {...data} {...handlers}>\n          {inner}\n        </a>\n      </>\n    );\n  }\n  return (\n    <>\n      <style>{FOCUS_CSS + KEYCAP_CSS}</style>\n      <button type={type} onClick={onClick} disabled={disabled} aria-label={ariaLabel} aria-pressed={ariaPressed} className={cls} style={style} {...data} {...handlers}>\n        {inner}\n      </button>\n    </>\n  );\n}\n\nconst RAIL_STEP = 8.5;\n\nconst RAIL_SLOT = 132;\n\nconst RAIL_CSS =\n  \".s3-rail{transition:transform 560ms cubic-bezier(.34,1.3,.64,1)}\" +\n  \".s3-rail-item{transition:transform 420ms cubic-bezier(.34,1.3,.64,1),color 220ms,opacity 220ms}\" +\n  \".s3-rail-glow{transition:opacity 260ms,transform 420ms cubic-bezier(.34,1.3,.64,1)}\" +\n  \"@keyframes s3-drop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}\" +\n  \"@media (prefers-reduced-motion: reduce){.s3-rail,.s3-rail-item,.s3-rail-glow{transition:none!important}.s3-drop{animation:none!important}}\";\n\nexport type CurvedRailNavProps = {\n  brand: string;\n  links: S3Link[];\n  cta?: S3Link;\n  /** The active link's href, when the page controls it (a scroll spy). */\n  active?: string;\n  defaultActive?: string;\n  onNavigate?: (href: string) => void;\n  className?: string;\n};\n\n/**\n * A nav whose links ride a shallow cylinder in real perspective. The active\n * link stands forward, lifted and underlit in copper; choose another and the\n * whole rail turns toward it (560ms, a spring with a slight overshoot) while\n * the rest recede along the curve, never so far that they stop reading. Hovering or focusing a link lifts it 12px toward you, and the rail\n * leans a few degrees toward the pointer. Controlled (a scroll spy) or not;\n * on a narrow container the links fold into a menu. The call to action is the\n * kit's keycap.\n */\nexport function CurvedRailNav({ brand, links, cta, active, defaultActive, onNavigate, className }: CurvedRailNavProps) {\n  const [chosen, setChosen] = useState(defaultActive ?? links[0]?.href ?? \"\");\n  const [open, setOpen] = useState(false);\n  const [lean, setLean] = useState(0);\n  const [hover, setHover] = useState(-1);\n  const current = active ?? chosen;\n  const on = Math.max(0, links.findIndex((l) => l.href === current));\n  const menuRef = useRef<HTMLDivElement>(null);\n  const toggleRef = useRef<HTMLButtonElement>(null);\n  const panelId = useId();\n  const reduced = useReducedMotion();\n  const railRef = useRef<HTMLDivElement>(null);\n  const [room, setRoom] = useState(0);\n  useEffect(() => {\n    const el = railRef.current;\n    if (!el) return;\n    const ro = new ResizeObserver(() => setRoom(el.offsetWidth));\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, []);\n  // Turning the rail toward an end link also slides the row sideways (by about 0.4 of a slot per link from the middle), so budget for it.\n  const slot = room ? clamp(Math.floor(room / (links.length + (links.length - 1) * 0.4)), 80, RAIL_SLOT) : RAIL_SLOT;\n  const R = slot / (2 * Math.tan((RAIL_STEP * Math.PI) / 360));\n  const mid = (links.length - 1) / 2;\n\n  useEffect(() => {\n    if (!open) return;\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setOpen(false);\n        toggleRef.current?.focus();\n      }\n    };\n    const onDown = (e: PointerEvent) => {\n      const n = e.target as Node;\n      if (!menuRef.current?.contains(n) && !toggleRef.current?.contains(n)) setOpen(false);\n    };\n    document.addEventListener(\"keydown\", onKey);\n    document.addEventListener(\"pointerdown\", onDown);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      document.removeEventListener(\"pointerdown\", onDown);\n    };\n  }, [open]);\n\n  const go = (href: string) => {\n    setChosen(href);\n    setOpen(false);\n    onNavigate?.(href);\n  };\n  const click = (e: { preventDefault: () => void }, href: string) => {\n    if (href.startsWith(\"#\") && onNavigate) e.preventDefault();\n    go(href);\n  };\n\n  return (\n    <header className={\"s3-scope @container relative w-full \" + (className ?? \"\")} style={{ background: \"rgba(10,10,13,0.82)\", color: ROOM.ink, backdropFilter: \"blur(14px) saturate(120%)\", \"--s3-ring\": ROOM.copper } as CSSProperties}>\n      <style>{FOCUS_CSS + RAIL_CSS}</style>\n      <nav aria-label=\"Main\" className=\"flex h-16 items-center gap-6 border-b px-5 @3xl:h-[76px] @3xl:px-8\" style={{ borderColor: ROOM.line }}>\n        <a\n          href=\"#\"\n          className=\"flex shrink-0 items-center gap-2 text-[20px] font-bold tracking-[-0.02em]\"\n          style={{ fontFamily: DISPLAY, color: \"#f2f1ee\" }}\n          onClick={(e) => {\n            if (!onNavigate) return;\n            e.preventDefault();\n            onNavigate(\"#top\");\n          }}\n        >\n          <span aria-hidden className=\"size-2 rounded-full\" style={{ background: ROOM.copper, boxShadow: \"0 0 10px rgba(255,122,61,0.8)\" }} />\n          {brand}\n        </a>\n        <div\n          ref={railRef}\n          className=\"relative mx-auto hidden h-full min-w-0 flex-1 overflow-hidden @3xl:block\"\n          style={{ perspective: 900 }}\n          onPointerMove={(e) => {\n            const r = e.currentTarget.getBoundingClientRect();\n            if (!reduced) setLean(((e.clientX - r.left) / r.width - 0.5) * 6);\n          }}\n          onPointerLeave={() => setLean(0)}\n        >\n          <ul className=\"s3-rail absolute left-1/2 top-1/2 m-0 h-0 w-0 list-none p-0\" style={{ transformStyle: \"preserve-3d\", transform: `translateZ(${(-R).toFixed(1)}px) rotateY(${(-(on - mid) * RAIL_STEP * 0.4 + lean).toFixed(2)}deg)` }}>\n            {links.map((l, i) => {\n              const isOn = i === on;\n              const lift = isOn ? 26 : i === hover ? 12 : 0;\n              return (\n                <li key={l.href} className=\"absolute\" style={{ transformStyle: \"preserve-3d\", transform: `rotateY(${((i - mid) * RAIL_STEP).toFixed(2)}deg) translateZ(${R.toFixed(1)}px)` }}>\n                  <a\n                    href={safeHref(l.href)}\n                    aria-current={isOn ? \"page\" : undefined}\n                    onClick={(e) => click(e, l.href)}\n                    onPointerEnter={() => setHover(i)}\n                    onPointerLeave={() => setHover(-1)}\n                    onFocus={() => setHover(i)}\n                    onBlur={() => setHover(-1)}\n                    className=\"s3-rail-item absolute flex items-center justify-center whitespace-nowrap rounded-[14px] px-3 py-2.5 text-[14px]\"\n                    style={{\n                      width: slot - 8,\n                      transform: `translate(-50%, -50%) translateZ(${lift}px)`,\n                      color: isOn ? \"#f2f1ee\" : ROOM.ink2,\n                      fontFamily: SANS,\n                      fontWeight: isOn ? 600 : 500,\n                      background: isOn ? \"linear-gradient(180deg, rgba(242,241,238,0.08), rgba(242,241,238,0.02))\" : \"transparent\",\n                      boxShadow: isOn ? \"inset 0 0 0 1px rgba(242,241,238,0.14)\" : \"none\",\n                    }}\n                  >\n                    {l.label}\n                    <span aria-hidden className=\"s3-rail-glow absolute inset-x-5 -bottom-px h-px\" style={{ opacity: isOn ? 1 : 0, background: ROOM.copper, boxShadow: \"0 0 10px 1px rgba(255,122,61,0.7)\" }} />\n                  </a>\n                </li>\n              );\n            })}\n          </ul>\n        </div>\n        <div className=\"ml-auto flex items-center gap-3 @3xl:ml-0\">\n          {cta ? (\n            <span className=\"hidden @xl:inline-flex\">\n              <KeycapButton href={cta.href} size=\"md\">\n                {cta.label}\n              </KeycapButton>\n            </span>\n          ) : null}\n          <button\n            ref={toggleRef}\n            type=\"button\"\n            aria-expanded={open}\n            aria-controls={panelId}\n            onClick={() => setOpen((v) => !v)}\n            className=\"inline-flex h-11 items-center rounded-[14px] border px-4 text-[12px] uppercase tracking-[0.14em] @3xl:hidden\"\n            style={{ fontFamily: MONO, borderColor: ROOM.line2 }}\n          >\n            {open ? \"Close\" : \"Menu\"}\n          </button>\n        </div>\n      </nav>\n      <div ref={menuRef} id={panelId} hidden={!open} className=\"s3-drop absolute inset-x-0 top-full z-20 border-b px-5 pb-6 pt-3 @3xl:hidden\" style={{ background: ROOM.ground, borderColor: ROOM.line, animation: `s3-drop 240ms ${EASE}` }}>\n        <ul className=\"m-0 list-none p-0\">\n          {links.map((l, i) => (\n            <li key={l.href} className=\"border-b last:border-b-0\" style={{ borderColor: ROOM.line }}>\n              <a href={safeHref(l.href)} aria-current={i === on ? \"page\" : undefined} onClick={(e) => click(e, l.href)} className=\"flex items-center gap-3 py-3.5 text-[22px] font-semibold tracking-[-0.02em]\" style={{ fontFamily: DISPLAY, color: i === on ? \"#f2f1ee\" : ROOM.ink2 }}>\n                <span aria-hidden className=\"size-1.5 rounded-full\" style={{ background: i === on ? ROOM.copper : \"transparent\" }} />\n                {l.label}\n              </a>\n            </li>\n          ))}\n          {cta ? (\n            <li className=\"pt-4 @xl:hidden\">\n              <KeycapButton href={cta.href} size=\"md\">\n                {cta.label}\n              </KeycapButton>\n            </li>\n          ) : null}\n        </ul>\n      </div>\n    </header>\n  );\n}\n","type":"registry:component","target":"components/viberdy/curved-rail-nav.tsx"}],"meta":{"tier":"free","tags":["navigation","navbar","3d","css 3d","perspective","scroll spy"],"href":"https://viberdy.dev/library/curved-rail-nav","aiPrompt":"Build a React + Tailwind nav, `CurvedRailNav({ brand, links, cta, active, defaultActive, onNavigate, className })`.\n\nFrom @3xl, a rail in a perspective (900px) box: a preserve-3d list at the centre, translateZ(-R) rotateY(-(active - mid) x 8.5 x 0.55 + lean) degrees, where each item sits at rotateY((i - mid) x 8.5deg) translateZ(R) and R = slot / (2 tan(4.25deg)) for a 132px slot. The active link: translateZ(26px), full ink, a faint panel and a 1px copper underglow; hover or focus: translateZ(12px); the rail transition 560ms cubic-bezier(.34,1.3,.64,1). The pointer leans the rail up to 3 degrees either way. A brand with a copper dot, the kit's KeycapButton as the call to action, and below @3xl a Menu disclosure (Escape and outside click close it). A glassy dark bar (backdrop blur 14px) with a hairline.\n\nSpatial 3D grammar: a dark studio, ground #0a0a0d (panels #101114, raised #16171b, ink #f2f1ee at 92/60/38%, hairlines at 8% and 16%), and one accent, anodised copper #ff7a3d, used only as light (a status arc, a detent marker, an active underglow), never as a fill. One object in three finishes, as material parameters: titanium (base #b9bcc2, gloss 0.62, specular 0.8, fully metallic), ceramic (#ece7dd, gloss 0.4, specular 0.25, a little subsurface wrap) and soft-touch polymer (#1b1c20, gloss 0.3, specular 0.12, the rim kept up so it holds against the ground). One rig for everything: a warm key from (0.55, 0.65, 0.42) at 1.15, a cool fill from (-0.4, -0.15, 0.55) at 0.3, a rim from behind at 0.65, soft shadows (k 16), five-tap occlusion and a studio reflection (a big softbox overhead left, a strip behind right), in linear light with a filmic curve and a 1/255 dither. Parts are blended with small smooth-min radii (8-15% of the smaller part) so the object reads as machined, not melted. Hanken Grotesk through var(--font-hanken, \"Hanken Grotesk\", ...) at 600-800 for display, Geist for reading, Geist Mono uppercase for readouts. Radii 24px panels, 20px cards, 14px controls, the dial full round. Motion: detent springs (stiffness 340, damping 26, ~380ms), orbit inertia that decays in ~270ms, an idle drift of 6 degrees a second on the page clock after 2.5s of stillness, hovers and presses in 90-420ms. Respect prefers-reduced-motion (a still three-quarter view you can still turn by hand; no drift, no scatter). No dependencies beyond React.","license":"https://viberdy.dev/license"}}