{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"wren","type":"registry:block","title":"Wren","description":"A home-robot app that feels like hardware: a live camera card that tags what the robot sees, a voice orb that turns a sentence into a queued task, a CSS-3D floor plan you spin with a finger while the robot re-plans around a toy, and teach-by-demonstration with a projected 3D skeleton. Ships inside a scroll tour where the phone swings between chapters over the footage.","categories":["mobile"],"dependencies":["@fontsource-variable/literata@^5.3.0","@fontsource/onest@^5.3.1"],"files":[{"path":"components/nightmarquee/wren/_mobile/DeviceStage.tsx","type":"registry:component","target":"components/nightmarquee/wren/_mobile/DeviceStage.tsx","content":"\"use client\";\n/* NightMarquee design \"Wren\". Free for personal, portfolio, educational and non-commercial use; no republishing: nightmarquee.com/license */\n\n/* Shared stage for mobile-app demos. Desktop: a sticky scroll tour where a\n   CSS-3D phone (real edge thickness, depth callouts) swings between chapter\n   poses over full-bleed footage, while the app inside stays live. Phones and\n   narrow windows: the stage steps aside and the app IS the page.\n\n   Apps are authored at iPhone logical size (393 x 852) with fluid layout; the\n   whole device scales as one rasterized unit, so nothing inside needs to know\n   about the stage. */\n\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\n\nexport interface Callout {\n  label: string;\n  value: string;\n  side: \"left\" | \"right\";\n  /** vertical position along the phone, 0..100 */\n  top: number;\n}\n\nexport interface Chapter {\n  kicker: string;\n  title: string;\n  body: string;\n  callouts?: Callout[];\n}\n\nexport interface StageState {\n  /** Tour chapter driven by page scroll; stays 0 in app mode. */\n  chapter: number;\n  /** True when the app fills a real phone screen instead of the stage. */\n  appMode: boolean;\n}\n\ninterface Props {\n  brand: string;\n  /** Short line under the wordmark */\n  tagline: string;\n  palette: { bg: string; ink: string; muted: string; accent: string };\n  /** Font stacks; each demo imports its own @fontsource CSS for these faces. */\n  fonts: { display: string; body: string };\n  backdrop?: { video?: string; poster?: string; position?: string };\n  /** Status bar glyph colour over the app's top edge */\n  statusTone: \"light\" | \"dark\";\n  chapters: Chapter[];\n  /** Dynamic Island live-activity content for the current chapter, if any */\n  island?: (chapter: number) => ReactNode;\n  children: (state: StageState) => ReactNode;\n}\n\nconst APP_MQ = \"(max-width: 640px)\";\nconst BLANK_GIF = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\nconst W = 393;\nconst H = 852;\nconst POSES = [\n  { ry: -17, rx: 5, tx: 0 },\n  { ry: 15, rx: 3, tx: -2 },\n  { ry: -12, rx: 6, tx: 1 },\n  { ry: 19, rx: 2, tx: -1 },\n  { ry: -15, rx: 4, tx: 0 },\n];\n\n/* \"#rrggbb\" -> \"r,g,b\" so the stage can tint with plain rgba(): resolved\n   colours stay readable to every consumer, unlike color-mix() strings */\nconst rgb = (hex: string) => {\n  const h = hex.replace(\"#\", \"\");\n  const f = h.length === 3 ? h.split(\"\").map((c) => c + c).join(\"\") : h.slice(0, 6);\n  return [0, 2, 4].map((i) => parseInt(f.slice(i, i + 2), 16)).join(\",\");\n};\n\nconst smooth = (a: number, b: number, x: number) => {\n  const t = Math.min(1, Math.max(0, (x - a) / (b - a)));\n  return t * t * (3 - 2 * t);\n};\n\nexport function DeviceStage({\n  brand,\n  tagline,\n  palette,\n  fonts,\n  backdrop,\n  statusTone,\n  chapters,\n  island,\n  children,\n}: Props) {\n  const rootRef = useRef<HTMLDivElement>(null);\n  const [chapter, setChapter] = useState(0);\n  /* null until the client knows the viewport; STAGE_CSS already lays out app\n     mode on phones from the server HTML, so only media downloads wait on it */\n  const [mode, setAppMode] = useState<boolean | null>(null);\n  const appMode = mode === true;\n  const n = chapters.length;\n\n  useEffect(() => {\n    const mq = window.matchMedia(APP_MQ);\n    const sync = () => setAppMode(mq.matches);\n    sync();\n    mq.addEventListener(\"change\", sync);\n    return () => mq.removeEventListener(\"change\", sync);\n  }, []);\n\n  useEffect(() => {\n    const root = rootRef.current;\n    if (!root || mode !== false) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const fine = window.matchMedia(\"(pointer: fine)\").matches;\n    const tour = root.querySelector<HTMLElement>(\"[data-tour]\")!;\n    const video = root.querySelector<HTMLVideoElement>(\"[data-backdrop-video]\");\n\n    if (video) {\n      const mark = () => video.classList.add(\"ready\");\n      if (video.readyState >= 3) mark();\n      else video.addEventListener(\"canplay\", mark, { once: true });\n    }\n\n    const fit = () => {\n      const k = Math.min(1, (window.innerHeight * 0.84) / (H + 24), (window.innerWidth * 0.42) / (W + 24));\n      root.style.setProperty(\"--k\", k.toFixed(4));\n    };\n    fit();\n    window.addEventListener(\"resize\", fit);\n\n    let mx = 0, my = 0, cx = 0, cy = 0, raf = 0, shown = 0;\n    const onMove = (e: PointerEvent) => {\n      mx = (e.clientX / window.innerWidth) * 2 - 1;\n      my = (e.clientY / window.innerHeight) * 2 - 1;\n    };\n    if (fine && !reduce) window.addEventListener(\"pointermove\", onMove);\n\n    const tick = () => {\n      const r = tour.getBoundingClientRect();\n      const span = tour.offsetHeight - window.innerHeight;\n      const p = span <= 0 ? 0 : Math.min(1, Math.max(0, -r.top / span));\n      const cf = Math.min(n - 0.0001, p * n);\n      const i = Math.floor(cf);\n      const local = cf - i;\n      const next = Math.min(n - 1, i + 1);\n      const blend = reduce ? 0 : smooth(0.62, 1, local);\n      const a = POSES[i % POSES.length];\n      const b = POSES[next % POSES.length];\n      const dir = Math.sign(b.ry - a.ry) || 1;\n      const swing = reduce || next === i ? 0 : Math.sin(blend * Math.PI) * 9 * dir;\n\n      cx += (mx - cx) * 0.06;\n      cy += (my - cy) * 0.06;\n      const ry = a.ry + (b.ry - a.ry) * blend + swing + cx * 7;\n      const rx = a.rx + (b.rx - a.rx) * blend - cy * 5;\n      const tx = a.tx + (b.tx - a.tx) * blend;\n\n      root.style.setProperty(\"--ry\", `${ry.toFixed(2)}deg`);\n      root.style.setProperty(\"--rx\", `${rx.toFixed(2)}deg`);\n      root.style.setProperty(\"--tx\", `${tx.toFixed(2)}vw`);\n      root.style.setProperty(\"--tp\", p.toFixed(4));\n\n      const ch = Math.min(n - 1, Math.floor(cf + 0.2));\n      if (ch !== shown) {\n        shown = ch;\n        setChapter(ch);\n      }\n      raf = requestAnimationFrame(tick);\n    };\n    raf = requestAnimationFrame(tick);\n\n    return () => {\n      cancelAnimationFrame(raf);\n      window.removeEventListener(\"resize\", fit);\n      window.removeEventListener(\"pointermove\", onMove);\n    };\n  }, [mode, n]);\n\n  const state: StageState = { chapter: appMode ? 0 : chapter, appMode };\n  const active = chapters[state.chapter];\n\n  return (\n    <div\n      ref={rootRef}\n      className={`ds-root${appMode ? \" ds-app\" : \"\"}`}\n      style={{\n        [\"--bg\" as string]: palette.bg,\n        [\"--ink\" as string]: palette.ink,\n        [\"--bg-rgb\" as string]: rgb(palette.bg),\n        [\"--ink-rgb\" as string]: rgb(palette.ink),\n        [\"--muted\" as string]: palette.muted,\n        [\"--accent\" as string]: palette.accent,\n        [\"--display\" as string]: fonts.display,\n        [\"--body\" as string]: fonts.body,\n        [\"--tours\" as string]: n,\n      }}\n    >\n      <style>{STAGE_CSS}</style>\n\n      <section className=\"ds-tour\" data-tour>\n        <div className=\"ds-sticky\">\n          {!appMode && (\n            <div className=\"ds-backdrop\" aria-hidden=\"true\">\n              {backdrop?.poster && (\n                <picture>\n                  {/* phones never show the backdrop: a 1px source keeps them from fetching the poster */}\n                  <source media={APP_MQ} srcSet={BLANK_GIF} />\n                  <img src={backdrop.poster} alt=\"\" style={{ objectPosition: backdrop.position ?? \"center\" }} />\n                </picture>\n              )}\n              {mode === false && backdrop?.video && (\n                <video\n                  data-backdrop-video\n                  src={backdrop.video}\n                  poster={backdrop.poster}\n                  muted\n                  loop\n                  autoPlay\n                  playsInline\n                  preload=\"auto\"\n                  style={{ objectPosition: backdrop.position ?? \"center\" }}\n                />\n              )}\n              <div className=\"ds-shade\" />\n            </div>\n          )}\n\n          {!appMode && (\n            <div className=\"ds-copy\">\n              <p className=\"ds-brand\">{brand}</p>\n              <p className=\"ds-tagline\">{tagline}</p>\n              <div className=\"ds-chapter\" key={state.chapter}>\n                <h1 className=\"ds-title\">{active.title}</h1>\n                <p className=\"ds-body\">{active.body}</p>\n              </div>\n              {/* tour progress: the chapter label lives with the progress bar as a\n                  step counter, not as an eyebrow over the headline */}\n              <div className=\"ds-progress\">\n                <div className=\"ds-dots\" aria-hidden=\"true\">\n                  {chapters.map((c, i) => (\n                    <i key={c.kicker} className={i === state.chapter ? \"on\" : undefined} />\n                  ))}\n                </div>\n                <p className=\"ds-step\">\n                  <span className=\"ds-step-n\">{String(state.chapter + 1).padStart(2, \"0\")}</span>\n                  <span className=\"ds-step-of\">/ {String(n).padStart(2, \"0\")}</span>\n                  <span className=\"ds-step-k\">{active.kicker}</span>\n                </p>\n              </div>\n            </div>\n          )}\n\n          <div className=\"ds-rig\">\n            <div className=\"ds-phone\">\n              {!appMode && (\n                <>\n                  <i className=\"ds-edge l\" aria-hidden=\"true\" />\n                  <i className=\"ds-edge r\" aria-hidden=\"true\" />\n                  <i className=\"ds-back\" aria-hidden=\"true\" />\n                  <i className=\"ds-btn a\" aria-hidden=\"true\" />\n                  <i className=\"ds-btn b\" aria-hidden=\"true\" />\n                  <i className=\"ds-btn c\" aria-hidden=\"true\" />\n                </>\n              )}\n              <div className=\"ds-face\">\n                {/* the metal frame is its own part behind the glass, not a box the app sits inside */}\n                {!appMode && <i className=\"ds-bezel\" aria-hidden=\"true\" />}\n                <div className={`ds-screen tone-${statusTone}`}>\n                  {!appMode && (\n                    <div className=\"ds-status\" aria-hidden=\"true\">\n                      <span className=\"ds-time\">9:41</span>\n                      <span className=\"ds-glyphs\">\n                        <svg width=\"18\" height=\"11\" viewBox=\"0 0 18 11\"><rect x=\"0\" y=\"7\" width=\"3\" height=\"4\" rx=\"1\" /><rect x=\"5\" y=\"5\" width=\"3\" height=\"6\" rx=\"1\" /><rect x=\"10\" y=\"2.5\" width=\"3\" height=\"8.5\" rx=\"1\" /><rect x=\"15\" y=\"0\" width=\"3\" height=\"11\" rx=\"1\" /></svg>\n                        <svg width=\"16\" height=\"11\" viewBox=\"0 0 16 11\"><path d=\"M8 2.2c2.3 0 4.4.9 6 2.4l1.2-1.3A10.4 10.4 0 0 0 8 .4 10.4 10.4 0 0 0 .8 3.3L2 4.6a8.6 8.6 0 0 1 6-2.4Zm0 3.5c1.3 0 2.5.5 3.5 1.3l1.2-1.3A6.9 6.9 0 0 0 8 3.9a6.9 6.9 0 0 0-4.7 1.8L4.5 7c1-.8 2.2-1.3 3.5-1.3Zm0 3.4c.5 0 1 .2 1.3.5L8 11 6.7 9.6c.3-.3.8-.5 1.3-.5Z\" /></svg>\n                        <span className=\"ds-batt\"><i /></span>\n                      </span>\n                    </div>\n                  )}\n                  {!appMode && (\n                    <div className={`ds-island${island && island(state.chapter) ? \" live\" : \"\"}`} aria-hidden=\"true\">\n                      <div className=\"ds-island-in\">{island?.(state.chapter)}</div>\n                    </div>\n                  )}\n                  <div className=\"ds-app-root\">{children(state)}</div>\n                  {!appMode && <i className=\"ds-home\" aria-hidden=\"true\" />}\n                </div>\n              </div>\n              {!appMode && active.callouts && (\n                <div className=\"ds-callouts\" key={`c${state.chapter}`} aria-hidden=\"true\">\n                  {active.callouts.map((c, i) => (\n                    <div\n                      key={c.label}\n                      className={`ds-callout ${c.side}`}\n                      style={{ top: `${c.top}%`, [\"--i\" as string]: i }}\n                    >\n                      <span>{c.label}</span>\n                      <b>{c.value}</b>\n                    </div>\n                  ))}\n                </div>\n              )}\n            </div>\n            {!appMode && <div className=\"ds-floor\" aria-hidden=\"true\" />}\n          </div>\n        </div>\n      </section>\n    </div>\n  );\n}\n\nconst STAGE_CSS = `\n/* the page canvas clips sideways (clip, not hidden: no scroll container, so\n   the sticky stage still sticks); the sticky stage's own overflow never\n   extends the tour, so nothing else needs a clip box */\n.ds-root{--k:.8;--ry:-17deg;--rx:5deg;--tx:0vw;--tp:0;--safe-top:58px;--safe-bottom:30px;background:var(--bg);color:var(--ink);font-family:var(--body);overflow-x:clip;-webkit-font-smoothing:antialiased}\n.ds-root .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}\n.ds-tour{position:relative;height:calc((var(--tours) + .6) * 100vh)}\n.ds-sticky{position:sticky;top:0;height:100vh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center}\n\n.ds-backdrop{position:absolute;inset:0;z-index:0}\n.ds-backdrop img,.ds-backdrop video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transform:scale(calc(1.06 + var(--tp) * .14));transform-origin:60% 50%}\n.ds-backdrop video{opacity:0;transition:opacity 1.2s ease}\n.ds-backdrop video.ready{opacity:1}\n/* the copy column sits on solid ground colour; the footage opens up toward the phone */\n.ds-shade{position:absolute;inset:0;background:\n  linear-gradient(90deg,rgb(var(--bg-rgb)) min(560px,50%),rgba(var(--bg-rgb),.55) calc(min(560px,50%) + 9%),rgba(var(--bg-rgb),.18) 74%,rgba(var(--bg-rgb),.45) 100%),\n  radial-gradient(90% 70% at 70% 55%,transparent 30%,rgba(var(--bg-rgb),.80) 100%)}\n\n/* the copy column is a full-height panel of ground colour, so the words sit\n   on paper and the shade feathers the footage in from its edge */\n.ds-copy{position:relative;z-index:1;align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding:0 0 0 clamp(28px,7vw,120px);max-width:560px;background:rgb(var(--bg-rgb))}\n.ds-brand{font-family:var(--display);font-size:clamp(15px,1.2vw,18px);letter-spacing:.32em;text-transform:uppercase;margin:0;color:var(--ink);animation:ds-rise .9s cubic-bezier(.2,.7,.2,1) both}\n.ds-tagline{margin:.5em 0 0;color:var(--muted);font-size:14px;animation:ds-rise .9s .06s cubic-bezier(.2,.7,.2,1) both}\n.ds-chapter{margin-top:clamp(40px,9vh,96px)}\n.ds-chapter>*{animation:ds-in .7s cubic-bezier(.2,.7,.2,1) both}\n.ds-chapter>*:nth-child(2){animation-delay:.07s}\n.ds-title{font-family:var(--display);font-weight:500;font-size:clamp(34px,4.2vw,64px);line-height:1.02;letter-spacing:-.02em;margin:0 0 .4em;text-wrap:balance}\n.ds-body{margin:0;max-width:40ch;color:var(--muted);font-size:clamp(15px,1.15vw,17px);line-height:1.6}\n.ds-progress{display:flex;align-items:center;gap:20px;margin:clamp(28px,6vh,56px) 0 0}\n.ds-dots{display:flex}\n.ds-dots i{display:block;width:54px;height:3px;border-radius:3px;background:rgba(var(--ink-rgb),.22);transform:scaleX(.41);transform-origin:0 50%;margin-right:-24px;transition:transform .5s cubic-bezier(.2,.7,.2,1),background .5s}\n.ds-dots i.on{transform:scaleX(.85);background:var(--accent)}\n.ds-dots i.on~i{transform:translateX(24px) scaleX(.41)}\n.ds-dots i:last-child{margin-right:0}\n.ds-step{margin:0 0 0 24px;display:flex;align-items:baseline;gap:.5em;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}\n.ds-step-n{color:var(--accent);font-weight:600}\n.ds-step-k{color:var(--ink);margin-left:.4em}\n\n.ds-rig{position:relative;z-index:2;height:100%;display:grid;place-items:center;perspective:1800px;transform:translateX(var(--tx))}\n.ds-phone{position:relative;width:${W + 24}px;height:${H + 24}px;transform-style:preserve-3d;\n  transform:scale(var(--k)) rotateX(var(--rx)) rotateY(var(--ry));animation:ds-arrive 1.4s cubic-bezier(.16,.84,.24,1) both}\n.ds-face{position:absolute;inset:0;padding:12px;transform:translateZ(7px)}\n.ds-bezel{position:absolute;inset:0;border-radius:68px;background:linear-gradient(145deg,#5b5e63,#26282b 30%,#101113 60%,#3d4044);box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.14),inset 0 0 0 5px #050506}\n.ds-back{position:absolute;inset:0;border-radius:68px;transform:translateZ(-7px) rotateY(180deg);background:linear-gradient(160deg,#2a2c30,#0d0e10);box-shadow:0 60px 120px rgba(0,0,0,.55)}\n.ds-edge{position:absolute;top:70px;bottom:70px;width:14px;background:linear-gradient(90deg,#1b1c1f,#6a6d72 45%,#2b2d31)}\n.ds-edge.l{left:-7px;transform:rotateY(-90deg)}\n.ds-edge.r{right:-7px;transform:rotateY(90deg)}\n.ds-btn{position:absolute;width:14px;border-radius:3px;background:linear-gradient(90deg,#34363a,#7a7d82,#34363a)}\n.ds-btn.a{left:-9px;top:170px;height:34px;transform:rotateY(-90deg) translateZ(2px)}\n.ds-btn.b{left:-9px;top:230px;height:62px;transform:rotateY(-90deg) translateZ(2px)}\n.ds-btn.c{right:-9px;top:250px;height:96px;transform:rotateY(90deg) translateZ(2px)}\n/* the display is a shaped mask, so it is a clip-path, not an overflow box */\n/* opaque from the first frame: mid-arrival, text must never sit over the footage behind the phone */\n.ds-screen{position:relative;width:${W}px;height:${H}px;clip-path:inset(0 round 56px);isolation:isolate;background:rgb(var(--bg-rgb))}\n.ds-app-root{position:absolute;inset:0}\n/* app roots are never scroll containers: hidden overflow can still be\n   scrolled by focus, so a tapped control could drag the whole app sideways.\n   The screen mask above does the clipping. */\n.ds-app-root>*{overflow:visible!important}\n.ds-status{position:absolute;z-index:40;top:0;left:0;right:0;height:54px;display:flex;align-items:center;justify-content:space-between;padding:4px 30px 0 40px;font:600 16px/1 -apple-system,'SF Pro Text',system-ui,sans-serif;pointer-events:none}\n.ds-status svg{fill:currentColor}\n.ds-glyphs{display:flex;gap:6px;align-items:center}\n.ds-batt{width:25px;height:12px;border-radius:4px;border:1.2px solid currentColor;opacity:.9;padding:1.5px;position:relative}\n.ds-batt i{display:block;height:100%;width:78%;border-radius:2px;background:currentColor}\n.tone-light .ds-status{color:#fff}\n.tone-dark .ds-status{color:#0b0b0c}\n/* always laid out at the live width; the compact pill is a clip, so the\n   morph never touches layout */\n.ds-island{position:absolute;z-index:45;top:11px;left:50%;width:204px;height:37px;margin-left:-102px;background:#000;overflow:hidden;\n  clip-path:inset(0 39px round 24px);transition:clip-path .6s cubic-bezier(.22,1,.36,1)}\n.ds-island.live{clip-path:inset(0 0 round 24px)}\n.ds-island-in{height:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 13px;color:#fff;font:600 12px/1 -apple-system,system-ui,sans-serif;opacity:0;transition:opacity .3s .25s}\n.ds-island.live .ds-island-in{opacity:1}\n.ds-home{position:absolute;z-index:40;bottom:8px;left:50%;width:134px;height:5px;margin-left:-67px;border-radius:5px;background:currentColor;opacity:.75;pointer-events:none}\n.tone-light .ds-home{color:#fff}\n.tone-dark .ds-home{color:#000}\n\n.ds-callouts{position:absolute;inset:0;transform-style:preserve-3d;pointer-events:none}\n.ds-callout{position:absolute;display:flex;flex-direction:column;gap:3px;padding:12px 16px;border-radius:16px;white-space:nowrap;\n  /* smoked glass: a dense tint, hairline and top highlight carry the\n     material, so the label reads the same over any frame of footage */\n  background:rgba(var(--bg-rgb),.80);\n  border:1px solid rgba(var(--ink-rgb),.16);box-shadow:inset 0 1px 0 rgba(var(--ink-rgb),.12),0 2px 4px rgba(0,0,0,.25),0 14px 14px -6px rgba(0,0,0,.4);\n  animation:ds-pop .7s calc(.25s + var(--i) * .12s) cubic-bezier(.22,1,.36,1) both}\n.ds-callout span{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}\n.ds-callout b{font-family:var(--display);font-weight:500;font-size:22px;color:var(--ink);font-variant-numeric:tabular-nums}\n.ds-callout.left{right:calc(100% - 30px);transform:translateZ(110px)}\n.ds-callout.right{left:calc(100% - 30px);transform:translateZ(150px)}\n/* contact shadow: a neutral pool of dark under the phone, not a coloured glow */\n.ds-floor{position:absolute;left:50%;bottom:4vh;width:420px;height:60px;margin-left:-210px;border-radius:50%;background:rgba(0,0,0,.6);filter:blur(22px);transform:scale(var(--k))}\n\n/* entrances move, they never fade: copy and screen stay readable from the\n   first frame, the motion is carried by transform alone */\n@keyframes ds-arrive{from{transform:scale(var(--k)) translateY(14vh) rotateX(30deg) rotateY(-28deg)}}\n@keyframes ds-rise{from{transform:translateY(14px)}}\n@keyframes ds-in{from{transform:translateY(18px)}}\n@keyframes ds-pop{from{scale:.86}}\n\n@media (max-width:1000px) and (min-width:641px){\n  .ds-sticky{grid-template-columns:1fr}\n  .ds-copy{position:absolute;left:0;top:6vh;max-width:none;padding:0 32px;display:block;background:none}\n  .ds-chapter,.ds-progress{display:none}\n  .ds-callout{display:none}\n}\n\n/* tour mode: touch drags inside the phone must still scroll the page;\n   horizontal drags keep reaching the apps' pointer handlers */\n@media (min-width:641px){\n  .ds-app-root *{touch-action:pan-y!important}\n}\n\n/* app mode (media query, not the .ds-app class, so server HTML is already\n   laid out for phones): the phone is the device you are holding; the demo\n   chip moves up to sit where browser chrome would */\n@media (max-width:640px){\n  /* the fixed app shell paints the whole viewport, so the root neither\n     paints nor clips anything of its own here */\n  .ds-root{--safe-top:calc(env(safe-area-inset-top) + 66px);--safe-bottom:calc(env(safe-area-inset-bottom) + 12px);background:none;overflow:visible}\n  .ds-root + div.fixed.bottom-5{bottom:auto;top:calc(env(safe-area-inset-top) + 10px)}\n  .ds-root .ds-tour{height:auto}\n  .ds-root .ds-sticky{position:relative;display:block;height:100dvh}\n  .ds-root .ds-rig{display:block;height:100%;perspective:none;transform:none}\n  .ds-root .ds-phone{width:100%;height:100%;transform:none;transform-style:flat;animation:none}\n  .ds-root .ds-face{border-radius:0;padding:0;background:none;box-shadow:none;transform:none}\n  /* the app is a fixed full-viewport shell, like a native app: its sliding\n     screens park off the glass instead of growing the page */\n  .ds-root .ds-screen{position:fixed;inset:0;width:auto;height:auto;clip-path:none}\n  .ds-root :is(.ds-bezel,.ds-backdrop,.ds-copy,.ds-floor,.ds-callouts,.ds-status,.ds-island,.ds-home,.ds-edge,.ds-back,.ds-btn){display:none}\n}\n\n@media (prefers-reduced-motion:reduce){\n  .ds-phone,.ds-brand,.ds-tagline,.ds-chapter>*,.ds-callout{animation:none}\n  .ds-backdrop img,.ds-backdrop video{transform:scale(1.06)}\n}\n`;\n"},{"path":"components/nightmarquee/wren/lib/media-manifest.json","type":"registry:component","target":"components/nightmarquee/wren/lib/media-manifest.json","content":"{\n  \"base\": \"https://media.nightmarquee.com\",\n  \"files\": {\n    \"/drops/wren/backdrop.mp4\": \"drops/wren/backdrop.96fa97dfa0.mp4\",\n    \"/drops/wren/cam.mp4\": \"drops/wren/cam.e51105acdb.mp4\",\n    \"/drops/wren/site-hover.mp4\": \"drops/wren/site-hover.5cdb3bc5e1.mp4\",\n    \"/drops/wren/site-preview.mp4\": \"drops/wren/site-preview.962dd9b639.mp4\"\n  }\n}\n"},{"path":"components/nightmarquee/wren/lib/media.ts","type":"registry:component","target":"components/nightmarquee/wren/lib/media.ts","content":"import manifest from \"./media-manifest.json\";\n/* NightMarquee design \"Wren\". Free for personal, portfolio, educational and non-commercial use; no republishing: nightmarquee.com/license */\n\nconst files: Record<string, string> = manifest.files;\nconst ORIGIN = \"https://media.nightmarquee.com\";\n\n/**\n * Where a drop's file is served from. Video plays from the content-hashed copy\n * named in the manifest, any other drop file from media.nightmarquee.com. Set\n * NEXT_PUBLIC_FOOTAGE_LOCAL=1 once the footage pack is in public/drops/<slug>/\n * and every path resolves to the local copy instead.\n */\nexport function mediaUrl(path: string): string {\n  // A design that builds paths from a folder constant hands over the origin's absolute address.\n  const drop = path.startsWith(`${ORIGIN}/drops/`) ? path.slice(ORIGIN.length) : path;\n  if (process.env.NEXT_PUBLIC_FOOTAGE_LOCAL) return drop;\n  const key = files[drop];\n  if (key) return `${manifest.base}/${key}`;\n  return drop.startsWith(\"/drops/\") ? `${ORIGIN}${drop}` : drop;\n}\n"},{"path":"components/nightmarquee/wren/wren/demo.tsx","type":"registry:component","target":"components/nightmarquee/wren/wren/demo.tsx","content":"\"use client\";\n/* NightMarquee design \"Wren\". Free for personal, portfolio, educational and non-commercial use; no republishing: nightmarquee.com/license */\n\n/* Self-hosted through @fontsource: no request to Google at build or run time. */\nimport \"@fontsource-variable/literata/opsz.css\";\nimport \"@fontsource-variable/literata/opsz-italic.css\";\nimport \"@fontsource/onest/400.css\";\nimport \"@fontsource/onest/500.css\";\nimport \"@fontsource/onest/600.css\";\n\n/* Wren, companion app for a home robot. Four screens: live presence with\n   object tags, a voice orb that turns speech into a queued task, an\n   isometric CSS-3D floor plan you spin with a finger, and teach-by-\n   demonstration with a projected 3D skeleton. rAF loops run only for the\n   screen on show. */\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { DeviceStage, type Chapter } from \"../_mobile/DeviceStage\";\nimport { mediaUrl } from \"../lib/media\";\n\ntype Screen = \"home\" | \"talk\" | \"map\" | \"teach\";\nconst TOUR: Screen[] = [\"home\", \"talk\", \"map\", \"teach\"];\n\nconst CHAPTERS: Chapter[] = [\n  {\n    kicker: \"Presence\",\n    title: \"Someone's home, even when you're not\",\n    body: \"A live view of Wren's evening: what it sees, what it's doing, how far along it is. Everything it recognises gets tagged as it looks.\",\n    callouts: [\n      { label: \"Recognised\", value: \"14 objects\", side: \"left\", top: 26 },\n      { label: \"Battery\", value: \"78%\", side: \"right\", top: 60 },\n    ],\n  },\n  {\n    kicker: \"Voice\",\n    title: \"Ask it the way you'd ask a person\",\n    body: \"Hold the orb and talk. Wren answers, estimates the job and drops a task card into the queue before you've put the phone down.\",\n    callouts: [\n      { label: \"Understood in\", value: \"0.4 s\", side: \"right\", top: 30 },\n      { label: \"Estimate\", value: \"0:40\", side: \"left\", top: 68 },\n    ],\n  },\n  {\n    kicker: \"Spatial map\",\n    title: \"Watch it think its way through the house\",\n    body: \"A living floor plan you spin with one finger. Wren tries a route, rejects the one a toy is blocking, and walks the other.\",\n    callouts: [\n      { label: \"Route\", value: \"14 m\", side: \"left\", top: 24 },\n      { label: \"Avoided\", value: \"1 obstacle\", side: \"right\", top: 56 },\n    ],\n  },\n  {\n    kicker: \"Teach\",\n    title: \"Show it once. It keeps it.\",\n    body: \"Record a routine by doing it. The skeleton mirrors every joint as you move and each step lands as a keyframe you can edit.\",\n    callouts: [\n      { label: \"Joints tracked\", value: \"27\", side: \"right\", top: 28 },\n      { label: \"Steps learned\", value: \"4\", side: \"left\", top: 64 },\n    ],\n  },\n];\n\nexport function Demo() {\n  return (\n    <DeviceStage\n      brand=\"Wren\"\n      tagline=\"The companion app for a robot that lives with you\"\n      palette={{ bg: \"#12100e\", ink: \"#f3ede4\", muted: \"#a89e91\", accent: \"#f2b766\" }}\n      fonts={{\n        display: \"'Literata Variable', Georgia, serif\",\n        body: \"'Onest', system-ui, sans-serif\",\n      }}\n      backdrop={{ video: mediaUrl(\"/drops/wren/backdrop.mp4\"), poster: \"https://media.nightmarquee.com/drops/wren/backdrop.jpg\", position: \"70% 50%\" }}\n      statusTone=\"light\"\n      chapters={CHAPTERS}\n      island={(c) =>\n        [\n          <><span className=\"wr-il\"><i className=\"wr-ring\" /> Tidying</span><span className=\"wr-ir\">62%</span></>,\n          <><span className=\"wr-il\"><i className=\"wr-dot\" /> Listening</span><span className=\"wr-wave\"><i /><i /><i /><i /><i /></span></>,\n          <><span className=\"wr-il\"><i className=\"wr-dot cy\" /> Fetching</span><span className=\"wr-ir\">0:32</span></>,\n          <><span className=\"wr-il\"><i className=\"wr-dot red\" /> REC</span><span className=\"wr-ir\">00:14</span></>,\n        ][c]\n      }\n    >\n      {({ chapter, appMode }) => <WrenApp chapter={chapter} appMode={appMode} />}\n    </DeviceStage>\n  );\n}\n\nfunction WrenApp({ chapter, appMode }: { chapter: number; appMode: boolean }) {\n  // taps win until the tour moves to another chapter\n  const [nav, setNav] = useState<{ chapter: number; screen: Screen }>({ chapter: 0, screen: \"home\" });\n  const screen = appMode || nav.chapter === chapter ? nav.screen : TOUR[chapter];\n  const setScreen = (next: Screen) => setNav({ chapter, screen: next });\n\n  return (\n    <div className=\"wr\">\n      <style>{CSS}</style>\n      <HomeScreen active={screen === \"home\"} onTalk={() => setScreen(\"talk\")} />\n      <TalkScreen active={screen === \"talk\"} onClose={() => setScreen(\"home\")} />\n      <MapScreen active={screen === \"map\"} />\n      <TeachScreen active={screen === \"teach\"} />\n\n      <nav className={`wr-tabs${screen === \"talk\" ? \" hide\" : \"\"}`} aria-label=\"Wren\">\n        <TabButton label=\"Home\" on={screen === \"home\"} onClick={() => setScreen(\"home\")}>\n          <path d=\"M4 11.5 12 5l8 6.5V20a1 1 0 0 1-1 1h-4.5v-5.5h-5V21H5a1 1 0 0 1-1-1z\" />\n        </TabButton>\n        <TabButton label=\"Map\" on={screen === \"map\"} onClick={() => setScreen(\"map\")}>\n          <path d=\"m3 7 6-3 6 3 6-3v13l-6 3-6-3-6 3zM9 4v13M15 7v13\" />\n        </TabButton>\n        <button className=\"wr-orb-tab\" aria-label=\"Talk to Wren\" onClick={() => setScreen(\"talk\")}>\n          <span />\n        </button>\n        <TabButton label=\"Teach\" on={screen === \"teach\"} onClick={() => setScreen(\"teach\")}>\n          <path d=\"M12 3v3M12 18v3M4.2 7.5l2.6 1.5M17.2 15l2.6 1.5M4.2 16.5 6.8 15M17.2 9l2.6-1.5\" /><circle cx=\"12\" cy=\"12\" r=\"3.2\" />\n        </TabButton>\n        <TabButton label=\"Wren\" on={false} onClick={() => setScreen(\"home\")}>\n          <rect x=\"6\" y=\"4\" width=\"12\" height=\"9\" rx=\"4\" /><path d=\"M8 17h8l1 4H7zM10 8.5h.01M14 8.5h.01\" />\n        </TabButton>\n      </nav>\n    </div>\n  );\n}\n\nfunction TabButton({ label, on, onClick, children }: { label: string; on: boolean; onClick: () => void; children: React.ReactNode }) {\n  return (\n    <button className={on ? \"on\" : \"\"} onClick={onClick} aria-current={on ? \"page\" : undefined}>\n      <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">{children}</svg>\n      <span>{label}</span>\n    </button>\n  );\n}\n\n/* ---------- home ---------- */\n\nconst TAGS = [\n  { label: \"floor lamp\", conf: \"0.97\", x: 22, y: 20, w: 20, h: 26 },\n  { label: \"mug\", conf: \"0.93\", x: 80, y: 66, w: 11, h: 9 },\n  { label: \"cushion\", conf: \"0.88\", x: 3, y: 64, w: 22, h: 14 },\n];\n\nconst ACTIONS = [\n  { label: \"Fetch\", d: \"M5 12h11M12 7l5 5-5 5M19 5v14\" },\n  { label: \"Tidy\", d: \"M4 20h16M7 20l2-9h6l2 9M10 11V6a2 2 0 0 1 4 0v5\" },\n  { label: \"Plants\", d: \"M12 21v-8M12 13c0-4 3-7 7-7 0 4-3 7-7 7ZM12 15c0-3-2.5-5.5-6-5.5 0 3 2.5 5.5 6 5.5Z\" },\n  { label: \"Guard\", d: \"M12 3 5 6v5c0 4.5 3 8.4 7 10 4-1.6 7-5.5 7-10V6z\" },\n];\n\nconst QUEUE = [\n  { at: \"20:30\", t: \"Water plants\", room: \"3 rooms\" },\n  { at: \"21:15\", t: \"Load dishwasher\", room: \"Kitchen\" },\n  { at: \"22:00\", t: \"Lock up, lights low\", room: \"Whole home\" },\n];\n\nfunction HomeScreen({ active, onTalk }: { active: boolean; onTalk: () => void }) {\n  const [queued, setQueued] = useState<string | null>(null);\n  useEffect(() => {\n    if (!queued) return;\n    const t = setTimeout(() => setQueued(null), 1800);\n    return () => clearTimeout(t);\n  }, [queued]);\n\n  // the camera loop only runs while Home is on show, and never under reduced motion\n  const camRef = useRef<HTMLVideoElement>(null);\n  useEffect(() => {\n    const v = camRef.current;\n    if (!v) return;\n    if (active && !window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) v.play().catch(() => {});\n    else v.pause();\n  }, [active]);\n\n  return (\n    <section className={`wr-screen wr-home${active ? \" on\" : \"\"}`} aria-hidden={!active} inert={!active}>\n      <header className=\"wr-head\">\n        <div>\n          <p className=\"wr-hello\">Good evening, Maya</p>\n          <h2 className=\"wr-h\">Wren is <em>tidying</em></h2>\n        </div>\n        <button className=\"wr-avatar\" onClick={onTalk} aria-label=\"Talk to Wren\">M</button>\n      </header>\n\n      <div className=\"wr-cam\">\n        <video\n          ref={camRef}\n          src={mediaUrl(mediaUrl(\"/drops/wren/cam.mp4\"))}\n          poster=\"https://media.nightmarquee.com/drops/wren/cam.jpg\"\n          aria-label=\"Wren's live camera: the living room at dusk\"\n          muted\n          loop\n          playsInline\n          autoPlay\n          preload=\"auto\"\n        />\n        <div className=\"wr-scan\" aria-hidden=\"true\" />\n        {TAGS.map((t, i) => (\n          <div key={t.label} className=\"wr-tag\" style={{ left: `${t.x}%`, top: `${t.y}%`, width: `${t.w}%`, height: `${t.h}%`, [\"--i\" as string]: i }} aria-hidden=\"true\">\n            <b>{t.label} <span>{t.conf}</span></b>\n          </div>\n        ))}\n        <p className=\"wr-live\"><i /> Live · Living room</p>\n        <div className=\"wr-camfoot\">\n          <div className=\"wr-progress\" style={{ [\"--v\" as string]: 0.62 }}>\n            <svg viewBox=\"0 0 36 36\" aria-hidden=\"true\"><circle cx=\"18\" cy=\"18\" r=\"15\" /><circle className=\"fg\" cx=\"18\" cy=\"18\" r=\"15\" /></svg>\n            <span>62</span>\n          </div>\n          <div>\n            <p className=\"wr-task\">Tidying the living room</p>\n            <p className=\"wr-sub\">9 of 14 things put away · 6 min left</p>\n          </div>\n        </div>\n      </div>\n\n      <div className=\"wr-stats\">\n        <div className=\"wr-stat\">\n          <span>Battery</span>\n          <b>78%</b>\n          <i className=\"wr-bar\"><i style={{ width: \"78%\" }} /></i>\n        </div>\n        <div className=\"wr-stat\">\n          <span>Next up</span>\n          <b>Water plants</b>\n          <em>20:30 · 3 rooms</em>\n        </div>\n      </div>\n\n      <div className=\"wr-actions\">\n        {ACTIONS.map((a) => (\n          <button key={a.label} onClick={() => setQueued(a.label)}>\n            <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d={a.d} /></svg>\n            {a.label}\n          </button>\n        ))}\n      </div>\n      <div className=\"wr-queue\">\n        <p className=\"wr-qh\">Tonight <span>3 queued</span></p>\n        {QUEUE.map((q, i) => (\n          <div key={q.t} className=\"wr-qrow\" style={{ [\"--i\" as string]: i }}>\n            <b>{q.at}</b>\n            <span>{q.t}</span>\n            <em>{q.room}</em>\n          </div>\n        ))}\n      </div>\n      <p className={`wr-toast${queued ? \" show\" : \"\"}`} role=\"status\">{queued ? `${queued} added to the queue` : \"\"}</p>\n    </section>\n  );\n}\n\n/* ---------- talk ---------- */\n\nconst ASK = \"Can you bring my reading glasses from the bedroom?\";\nconst REPLY = \"On it. They're on the nightstand, left of the lamp. About forty seconds.\";\n\nfunction TalkScreen({ active, onClose }: { active: boolean; onClose: () => void }) {\n  const orbRef = useRef<HTMLDivElement>(null);\n  const [run, setRun] = useState(0);\n  const [ask, setAsk] = useState(\"\");\n  const [reply, setReply] = useState(\"\");\n  const [phase, setPhase] = useState<\"idle\" | \"listen\" | \"think\" | \"speak\" | \"done\">(\"idle\");\n\n  useEffect(() => {\n    if (!active) return;\n    let cancelled = false;\n    const timers: ReturnType<typeof setTimeout>[] = [];\n    const at = (ms: number, fn: () => void) => timers.push(setTimeout(() => !cancelled && fn(), ms));\n    at(0, () => {\n      setAsk(\"\");\n      setReply(\"\");\n      setPhase(\"listen\");\n    });\n    for (let i = 1; i <= ASK.length; i++) at(500 + i * 38, () => setAsk(ASK.slice(0, i)));\n    const t1 = 500 + ASK.length * 38 + 300;\n    at(t1, () => setPhase(\"think\"));\n    const t2 = t1 + 900;\n    at(t2, () => setPhase(\"speak\"));\n    for (let i = 1; i <= REPLY.length; i++) at(t2 + i * 30, () => setReply(REPLY.slice(0, i)));\n    at(t2 + REPLY.length * 30 + 350, () => setPhase(\"done\"));\n    return () => {\n      cancelled = true;\n      timers.forEach(clearTimeout);\n    };\n  }, [active, run]);\n\n  useEffect(() => {\n    const orb = orbRef.current;\n    if (!active || !orb) return;\n    let raf = 0, level = 0;\n    const loop = (now: number) => {\n      const loud = phase === \"listen\" || phase === \"speak\";\n      const target = loud ? 0.45 + 0.35 * Math.abs(Math.sin(now / 130) * Math.sin(now / 370 + 1.3)) : phase === \"think\" ? 0.18 : 0.08;\n      level += (target - level) * 0.18;\n      orb.style.setProperty(\"--amp\", level.toFixed(3));\n      raf = requestAnimationFrame(loop);\n    };\n    raf = requestAnimationFrame(loop);\n    return () => cancelAnimationFrame(raf);\n  }, [active, phase]);\n\n  return (\n    <section className={`wr-screen wr-talk${active ? \" on\" : \"\"} ph-${phase}`} aria-hidden={!active} inert={!active}>\n      <button className=\"wr-close\" onClick={onClose} aria-label=\"Close\">\n        <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 6l12 12M18 6 6 18\" /></svg>\n      </button>\n      <p className=\"wr-state\">{{ idle: \"Hold to talk\", listen: \"Listening\", think: \"Thinking\", speak: \"Wren\", done: \"Queued\" }[phase]}</p>\n\n      <div className=\"wr-orb\" ref={orbRef} onPointerDown={() => setRun((r) => r + 1)} role=\"button\" tabIndex={0} aria-label=\"Hold to talk to Wren\"\n        onKeyDown={(e) => (e.key === \"Enter\" || e.key === \" \") && setRun((r) => r + 1)}>\n        <i className=\"o1\" /><i className=\"o2\" /><i className=\"o3\" /><i className=\"core\" />\n      </div>\n\n      <div className=\"wr-transcript\" aria-hidden=\"true\">\n        <p className=\"you\">{ask}<span className={phase === \"listen\" ? \"caret\" : \"\"} /></p>\n        <p className=\"wren\">{reply}<span className={phase === \"speak\" ? \"caret\" : \"\"} /></p>\n      </div>\n      <div className=\"sr-only\" aria-live=\"polite\">\n        {phase !== \"idle\" && phase !== \"listen\" && <p>You: {ASK}</p>}\n        {phase === \"done\" && <p>Wren: {REPLY}</p>}\n      </div>\n\n      <div className={`wr-card${phase === \"done\" ? \" show\" : \"\"}`}>\n        <div className=\"wr-card-ic\"><svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M5 12h11M12 7l5 5-5 5M19 5v14\" /></svg></div>\n        <div>\n          <p className=\"t\">Fetch reading glasses</p>\n          <p className=\"s\">Bedroom → you · after tidying</p>\n        </div>\n        <b>0:40</b>\n      </div>\n    </section>\n  );\n}\n\n/* ---------- map ---------- */\n\nconst ROOMS = [\n  { name: \"Living\", x: 0, y: 0, w: 180, h: 170 },\n  { name: \"Kitchen\", x: 180, y: 0, w: 120, h: 115 },\n  { name: \"Hall\", x: 180, y: 115, w: 120, h: 55 },\n  { name: \"Bedroom\", x: 0, y: 170, w: 165, h: 130 },\n  { name: \"Bath\", x: 165, y: 170, w: 135, h: 130 },\n];\n/* standing walls: [x, y, length, axis] with door gaps left open */\nconst WALLS: [number, number, number, \"x\" | \"y\"][] = [\n  [0, 0, 300, \"x\"], [0, 300, 300, \"x\"], [0, 0, 300, \"y\"], [300, 0, 300, \"y\"],\n  [0, 170, 70, \"x\"], [110, 170, 110, \"x\"], [255, 170, 45, \"x\"],\n  [180, 0, 40, \"y\"], [180, 80, 60, \"y\"], [165, 170, 60, \"y\"], [165, 262, 38, \"y\"], [220, 115, 80, \"x\"],\n];\nconst ROUTE = \"M70 95 L118 132 L92 196 L78 246\";\nconst REJECTED = \"M70 95 L82 150 L78 246\";\n\nfunction MapScreen({ active }: { active: boolean }) {\n  const isoRef = useRef<HTMLDivElement>(null);\n  const botRef = useRef<HTMLDivElement>(null);\n  const pathRef = useRef<SVGPathElement>(null);\n  const [eta, setEta] = useState(40);\n\n  useEffect(() => {\n    const iso = isoRef.current, bot = botRef.current, path = pathRef.current;\n    if (!active || !iso || !bot || !path) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const len = path.getTotalLength();\n    let raf = 0, rot = -42, vel = 0, drag = false, lastX = 0, t0 = performance.now();\n\n    const down = (e: PointerEvent) => { drag = true; lastX = e.clientX; iso.setPointerCapture(e.pointerId); };\n    const move = (e: PointerEvent) => { if (!drag) return; vel = (e.clientX - lastX) * 0.5; rot += vel; lastX = e.clientX; };\n    const up = () => { drag = false; };\n    iso.addEventListener(\"pointerdown\", down);\n    iso.addEventListener(\"pointermove\", move);\n    iso.addEventListener(\"pointerup\", up);\n    iso.addEventListener(\"pointercancel\", up);\n\n    const loop = (now: number) => {\n      const t = (now - t0) / 1000;\n      if (!drag) {\n        vel *= 0.94;\n        rot += vel + (reduce ? 0 : Math.sin(t * 0.35) * 0.05);\n      }\n      iso.style.setProperty(\"--mz\", `${rot.toFixed(2)}deg`);\n      const walk = Math.min(1, Math.max(0, (t - 2.2) / 7));\n      const pt = path.getPointAtLength(len * walk);\n      bot.style.transform = `translate3d(${pt.x}px, ${pt.y}px, 0)`;\n      iso.style.setProperty(\"--walk\", walk.toFixed(3));\n      iso.classList.toggle(\"committed\", t > 2.2);\n      setEta(Math.max(0, Math.round(40 * (1 - walk))));\n      if (t > 12) t0 = now;\n      raf = requestAnimationFrame(loop);\n    };\n    raf = requestAnimationFrame(loop);\n    return () => {\n      cancelAnimationFrame(raf);\n      iso.removeEventListener(\"pointerdown\", down);\n      iso.removeEventListener(\"pointermove\", move);\n      iso.removeEventListener(\"pointerup\", up);\n      iso.removeEventListener(\"pointercancel\", up);\n    };\n  }, [active]);\n\n  return (\n    <section className={`wr-screen wr-map${active ? \" on\" : \"\"}`} aria-hidden={!active} inert={!active}>\n      <header className=\"wr-head\">\n        <div>\n          <p className=\"wr-hello\">Ground floor · live</p>\n          <h2 className=\"wr-h\">Fetching <em>glasses</em></h2>\n        </div>\n        <span className=\"wr-chip\">3D</span>\n      </header>\n\n      <div className=\"wr-iso-wrap\">\n        <div className=\"wr-iso\" ref={isoRef} aria-label=\"Floor plan, drag to rotate\" role=\"img\">\n          {ROOMS.map((r) => (\n            <div key={r.name} className=\"wr-room\" style={{ left: r.x, top: r.y, width: r.w, height: r.h }}>\n              <span className=\"wr-rl\">{r.name}</span>\n            </div>\n          ))}\n          {WALLS.map(([x, y, l, ax], i) => (\n            <i key={i} className={`wr-wall ${ax}`} style={ax === \"x\" ? { left: x, top: y, width: l } : { left: x, top: y, height: l }} />\n          ))}\n          <svg className=\"wr-routes\" viewBox=\"0 0 300 300\" aria-hidden=\"true\">\n            <path className=\"rej\" d={REJECTED} />\n            <path className=\"ok\" d={ROUTE} ref={pathRef} />\n          </svg>\n          <i className=\"wr-toy\" style={{ left: 80, top: 150 }} />\n          <i className=\"wr-pin\" style={{ left: 78, top: 246 }} />\n          <div className=\"wr-bot\" ref={botRef}><i /></div>\n        </div>\n      </div>\n\n      <div className=\"wr-sheet\">\n        <div className=\"wr-grab\" />\n        <div className=\"wr-sheet-row\">\n          <div>\n            <p className=\"t\">Living room → Bedroom</p>\n            <p className=\"s\">14 m · took the hall, a toy blocks the short way</p>\n          </div>\n          <b className=\"wr-eta\">0:{String(eta).padStart(2, \"0\")}</b>\n        </div>\n        <ol className=\"wr-steps\">\n          <li className=\"done\">Leave living room</li>\n          <li className=\"now\">Cross hall</li>\n          <li>Nightstand, left side</li>\n        </ol>\n      </div>\n    </section>\n  );\n}\n\n/* ---------- teach ---------- */\n\ntype V3 = [number, number, number];\nconst BODY: Record<string, V3> = {\n  head: [0, -1.64, 0], neck: [0, -1.44, 0], chest: [0, -1.22, 0.02], pelvis: [0, -0.9, 0],\n  ls: [-0.21, -1.4, 0], rs: [0.21, -1.4, 0], lh: [-0.11, -0.88, 0], rh: [0.11, -0.88, 0],\n  lk: [-0.13, -0.46, 0.03], rk: [0.13, -0.46, 0.03], la: [-0.14, 0, 0], ra: [0.14, 0, 0],\n};\nconst BONES: [string, string][] = [\n  [\"head\", \"neck\"], [\"neck\", \"chest\"], [\"chest\", \"pelvis\"], [\"neck\", \"ls\"], [\"neck\", \"rs\"],\n  [\"ls\", \"le\"], [\"le\", \"lw\"], [\"rs\", \"re\"], [\"re\", \"rw\"], [\"pelvis\", \"lh\"], [\"pelvis\", \"rh\"],\n  [\"lh\", \"lk\"], [\"lk\", \"la\"], [\"rh\", \"rk\"], [\"rk\", \"ra\"],\n];\nconst STEPS = [\"Pick the towel up by two corners\", \"Fold it in half, edges together\", \"Fold again lengthwise\", \"Stack on the shelf, crease out\"];\n\nfunction TeachScreen({ active }: { active: boolean }) {\n  const svgRef = useRef<SVGSVGElement>(null);\n  const [step, setStep] = useState(0);\n  const [secs, setSecs] = useState(0);\n\n  useEffect(() => {\n    const svg = svgRef.current;\n    if (!active || !svg) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const bones = Array.from(svg.querySelectorAll<SVGLineElement>(\"[data-bone]\"));\n    const joints = Array.from(svg.querySelectorAll<SVGCircleElement>(\"[data-joint]\"));\n    const cloth = svg.querySelector<SVGPolygonElement>(\"[data-cloth]\")!;\n    const ring = svg.querySelector<SVGPathElement>(\"[data-ring]\")!;\n    const ticks = svg.querySelector<SVGPathElement>(\"[data-ticks]\")!;\n    const CX = 170, BASE = 300, S = 160;\n    let raf = 0, theta = 0.5, drag = false, lastX = 0, vel = 0;\n    const t0 = performance.now();\n\n    const down = (e: PointerEvent) => { drag = true; lastX = e.clientX; svg.setPointerCapture(e.pointerId); };\n    const move = (e: PointerEvent) => { if (!drag) return; vel = (e.clientX - lastX) * 0.012; theta += vel; lastX = e.clientX; };\n    const up = () => { drag = false; };\n    svg.addEventListener(\"pointerdown\", down);\n    svg.addEventListener(\"pointermove\", move);\n    svg.addEventListener(\"pointerup\", up);\n\n    const PITCH = 0.3, PIVOT = -0.8;\n    const cp = Math.cos(PITCH), sp = Math.sin(PITCH);\n    const proj = ([x, y, z]: V3) => {\n      const c = Math.cos(theta), s = Math.sin(theta);\n      const xr = x * c + z * s, zr = -x * s + z * c;\n      const yc = y - PIVOT;\n      const yp = yc * cp - zr * sp, zp = yc * sp + zr * cp;\n      const f = 3.4 / (3.4 - zp);\n      return { x: CX + xr * S * f, y: BASE + (yp + PIVOT) * S * f, z: zp, f };\n    };\n\n    const loop = (now: number) => {\n      const t = (now - t0) / 1000;\n      if (!drag) {\n        vel *= 0.93;\n        theta += vel + (reduce ? 0 : 0.004);\n      }\n      const k = reduce ? 0.5 : (1 - Math.cos(t * 1.6)) / 2;\n      const P: Record<string, V3> = {\n        ...BODY,\n        le: [-0.33 + 0.12 * k, -1.14 - 0.1 * k, 0.16 + 0.06 * k],\n        re: [0.33 - 0.12 * k, -1.14 - 0.1 * k, 0.16 + 0.06 * k],\n        lw: [-0.34 + 0.25 * k, -0.98 - 0.3 * k, 0.36 + 0.06 * k],\n        rw: [0.34 - 0.25 * k, -0.98 - 0.3 * k, 0.36 + 0.06 * k],\n      };\n      const pp: Record<string, ReturnType<typeof proj>> = {};\n      for (const key in P) pp[key] = proj(P[key]);\n\n      bones.forEach((b) => {\n        const [a, c] = b.dataset.bone!.split(\":\");\n        const A = pp[a], C = pp[c];\n        b.setAttribute(\"x1\", A.x.toFixed(1)); b.setAttribute(\"y1\", A.y.toFixed(1));\n        b.setAttribute(\"x2\", C.x.toFixed(1)); b.setAttribute(\"y2\", C.y.toFixed(1));\n        const depth = (A.z + C.z) / 2;\n        b.style.opacity = (0.5 + depth * 1.4).toFixed(2);\n        b.style.strokeWidth = (3.2 * A.f).toFixed(2);\n      });\n      joints.forEach((j) => {\n        const J = pp[j.dataset.joint!];\n        j.setAttribute(\"cx\", J.x.toFixed(1)); j.setAttribute(\"cy\", J.y.toFixed(1));\n        j.setAttribute(\"r\", ((j.dataset.joint === \"head\" ? 13 : 4.2) * J.f).toFixed(1));\n        j.style.opacity = (0.55 + J.z * 1.4).toFixed(2);\n      });\n      const drop = 0.46 * (1 - k) + 0.08;\n      const lw = P.lw, rw = P.rw;\n      cloth.setAttribute(\"points\", [lw, rw, [rw[0], rw[1] + drop, rw[2] + 0.04] as V3, [lw[0], lw[1] + drop, lw[2] + 0.04] as V3]\n        .map((v) => { const q = proj(v); return `${q.x.toFixed(1)},${q.y.toFixed(1)}`; }).join(\" \"));\n\n      let d = \"\", dt = \"\";\n      for (let i = 0; i <= 48; i++) {\n        const a = (i / 48) * Math.PI * 2;\n        const q = proj([Math.cos(a) * 0.52, 0.02, Math.sin(a) * 0.52]);\n        d += `${i ? \"L\" : \"M\"}${q.x.toFixed(1)} ${q.y.toFixed(1)}`;\n        if (i % 4 === 0) {\n          const q2 = proj([Math.cos(a) * 0.6, 0.02, Math.sin(a) * 0.6]);\n          dt += `M${q.x.toFixed(1)} ${q.y.toFixed(1)}L${q2.x.toFixed(1)} ${q2.y.toFixed(1)}`;\n        }\n      }\n      ring.setAttribute(\"d\", d);\n      ticks.setAttribute(\"d\", dt);\n\n      const cycle = Math.floor(t / 2.4);\n      setStep(cycle % STEPS.length);\n      setSecs(Math.floor(t) % 60);\n      raf = requestAnimationFrame(loop);\n    };\n    raf = requestAnimationFrame(loop);\n    return () => {\n      cancelAnimationFrame(raf);\n      svg.removeEventListener(\"pointerdown\", down);\n      svg.removeEventListener(\"pointermove\", move);\n      svg.removeEventListener(\"pointerup\", up);\n    };\n  }, [active]);\n\n  return (\n    <section className={`wr-screen wr-teach${active ? \" on\" : \"\"}`} aria-hidden={!active} inert={!active}>\n      <header className=\"wr-head\">\n        <div>\n          <p className=\"wr-hello\">New routine</p>\n          <h2 className=\"wr-h\">Fold a <em>towel</em></h2>\n        </div>\n        <span className=\"wr-rec\"><i /> 00:{String(secs).padStart(2, \"0\")}</span>\n      </header>\n\n      <div className=\"wr-stagebox\">\n        <svg ref={svgRef} viewBox=\"0 0 340 380\" role=\"img\" aria-label=\"Your pose, mirrored as a 3D skeleton. Drag to turn it.\">\n          <path data-ring className=\"wr-ringp\" />\n          <path data-ticks className=\"wr-ticks\" />\n          <polygon data-cloth className=\"wr-cloth\" />\n          {BONES.map(([a, b]) => <line key={a + b} data-bone={`${a}:${b}`} className=\"wr-bone\" />)}\n          {[\"head\", \"neck\", \"chest\", \"pelvis\", \"ls\", \"rs\", \"le\", \"re\", \"lw\", \"rw\", \"lh\", \"rh\", \"lk\", \"rk\", \"la\", \"ra\"].map((j) => (\n            <circle key={j} data-joint={j} className={j === \"head\" ? \"wr-headj\" : \"wr-joint\"} />\n          ))}\n        </svg>\n        <p className=\"wr-hint\">Drag to turn</p>\n      </div>\n\n      <div className=\"wr-timeline\" aria-hidden=\"true\">\n        {STEPS.map((_, i) => <i key={i} className={i < step ? \"done\" : i === step ? \"now\" : \"\"} />)}\n      </div>\n      <ol className=\"wr-learn\">\n        {STEPS.map((s, i) => (\n          <li key={s} className={i < step ? \"done\" : i === step ? \"now\" : \"\"}>\n            <span>{i + 1}</span>{s}\n          </li>\n        ))}\n      </ol>\n    </section>\n  );\n}\n\nconst CSS = `\n.wr{--ink:#f3ede4;--mut:#a89e91;--cy:#f2b766;--amb:#9db8ff;--card:#201c18;--line:rgba(255,248,238,.1);\n  position:absolute;inset:0;background:#14110e linear-gradient(180deg,#241d16,#14110e 45%,#0c0a09);color:var(--ink);font-family:'Onest',system-ui,sans-serif}\n.wr button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}\n.wr svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}\n.wr-screen{position:absolute;inset:0;padding:var(--safe-top) 20px calc(var(--safe-bottom) + 86px);display:flex;flex-direction:column;gap:14px;\n  opacity:0;transform:translateX(24px) scale(.98);pointer-events:none;transition:opacity .45s cubic-bezier(.2,.7,.2,1),transform .55s cubic-bezier(.2,.7,.2,1)}\n.wr-screen.on{opacity:1;transform:none;pointer-events:auto}\n/* inactive screens are not rendered, like real tab panels; the incoming\n   screen slides in from its resting offset, readable on every frame */\n.wr-screen:not(.on){display:none}\n@starting-style{.wr-screen.on{transform:translateX(24px) scale(.98)}}\n.wr-head{display:flex;justify-content:space-between;align-items:flex-end}\n.wr-hello{margin:0;font-size:13px;color:var(--mut)}\n.wr-h{margin:2px 0 0;font:350 29px/1.1 'Literata Variable',Georgia,serif;letter-spacing:-.02em}\n.wr-h em{color:var(--cy)}\n.wr .wr-avatar{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#c9d6ff,#7f9be0);font-weight:600;color:#10141f;border:1px solid rgba(255,230,200,.35)}\n.wr-chip{font-size:12px;font-weight:600;padding:6px 10px;border-radius:99px;border:1px solid var(--line);color:var(--cy)}\n\n.wr-cam{position:relative;flex:0 0 auto;height:min(46%,330px);border-radius:28px;overflow:hidden;background:#000;box-shadow:0 20px 50px rgba(0,0,0,.45)}\n.wr-cam video{display:block;width:100%;height:100%;object-fit:cover;object-position:center 45%;animation:wr-kb 18s ease-in-out infinite alternate}\n.wr-scan{position:absolute;inset:0;background:linear-gradient(180deg,transparent 45%,rgba(242,183,102,.22) 50%,transparent 55%);background-size:100% 220%;animation:wr-scan 4.5s linear infinite;mix-blend-mode:screen}\n.wr-tag{position:absolute;border-radius:6px;animation:wr-tag .6s calc(.4s + var(--i) * .35s) cubic-bezier(.22,1,.36,1) both;\n  background:linear-gradient(var(--cy),var(--cy)) 0 0/10px 1.5px no-repeat,linear-gradient(var(--cy),var(--cy)) 0 0/1.5px 10px no-repeat,\n  linear-gradient(var(--cy),var(--cy)) 100% 0/10px 1.5px no-repeat,linear-gradient(var(--cy),var(--cy)) 100% 0/1.5px 10px no-repeat,\n  linear-gradient(var(--cy),var(--cy)) 0 100%/10px 1.5px no-repeat,linear-gradient(var(--cy),var(--cy)) 0 100%/1.5px 10px no-repeat,\n  linear-gradient(var(--cy),var(--cy)) 100% 100%/10px 1.5px no-repeat,linear-gradient(var(--cy),var(--cy)) 100% 100%/1.5px 10px no-repeat}\n.wr-tag b{position:absolute;left:0;bottom:calc(100% + 4px);font-size:11px;font-weight:600;white-space:nowrap;padding:3px 7px;border-radius:6px;background:rgba(12,14,22,.86);color:#fbe8cc}\n.wr-tag b span{color:var(--cy);font-variant-numeric:tabular-nums}\n.wr-live{position:absolute;top:12px;left:12px;margin:0;font-size:11px;font-weight:600;padding:5px 10px;border-radius:99px;background:rgba(14,12,10,.8);border:1px solid rgba(255,255,255,.1);display:flex;gap:6px;align-items:center}\n.wr-live i{width:7px;height:7px;border-radius:50%;background:#ff5b4a}\n/* a smoked strip across the foot of the feed, flush to its edges */\n.wr-camfoot{position:absolute;left:0;right:0;bottom:0;display:flex;gap:12px;align-items:center;padding:12px 16px 14px;background:rgba(16,13,10,.84);border-top:1px solid rgba(255,255,255,.1)}\n.wr-progress{position:relative;width:44px;height:44px;flex:none;display:grid;place-items:center;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}\n.wr-progress svg{position:absolute;inset:0;transform:rotate(-90deg);stroke-width:3}\n.wr-progress circle{stroke:rgba(255,255,255,.14)}\n.wr-progress .fg{stroke:var(--cy);stroke-dasharray:94.2;stroke-dashoffset:calc(94.2 * (1 - var(--v)));animation:wr-ring 1.6s .3s cubic-bezier(.2,.7,.2,1) both}\n.wr-task{margin:0;font-weight:600;font-size:15px}\n.wr-sub{margin:2px 0 0;font-size:12px;color:var(--mut)}\n\n.wr-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px}\n.wr-stat{padding:14px;border-radius:20px;background:var(--card);border:1px solid var(--line);display:flex;flex-direction:column;gap:4px}\n.wr-stat span{font-size:11px;color:var(--mut);text-transform:uppercase;letter-spacing:.1em}\n.wr-stat b{font:400 21px/1.1 'Literata Variable',serif;letter-spacing:-.01em}\n.wr-stat em{font-style:normal;font-size:12px;color:var(--amb)}\n.wr-bar{display:block;height:4px;border-radius:4px;background:rgba(255,255,255,.1);margin-top:6px;overflow:hidden}\n.wr-bar i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--cy),#f8dcb0);animation:wr-fill 1.4s .5s cubic-bezier(.2,.7,.2,1) both;transform-origin:left}\n.wr-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}\n.wr-actions button{display:flex;flex-direction:column;align-items:center;gap:7px;padding:14px 0 11px;border-radius:20px;background:var(--card);border:1px solid var(--line);font-size:12px;font-weight:500;transition:transform .25s cubic-bezier(.22,1,.36,1),background .25s}\n.wr-actions button:active{transform:scale(.92);background:rgba(242,183,102,.14)}\n.wr-actions svg{width:22px;height:22px;color:var(--cy)}\n.wr-queue{display:flex;flex-direction:column;gap:2px;min-height:0;overflow:hidden}\n.wr-qh{margin:4px 0 6px;display:flex;justify-content:space-between;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--mut)}\n.wr-qh span{color:var(--cy);letter-spacing:.04em;text-transform:none}\n.wr-qrow{display:grid;grid-template-columns:48px 1fr auto;gap:10px;align-items:center;padding:10px 2px;border-top:1px solid var(--line);font-size:14px;animation:wr-row .6s calc(.5s + var(--i) * .1s) cubic-bezier(.2,.7,.2,1) both}\n.wr-qrow b{font-weight:500;color:var(--mut);font-variant-numeric:tabular-nums}\n.wr-qrow em{font-style:normal;font-size:12px;color:var(--mut)}\n@keyframes wr-row{from{transform:translateY(10px)}}\n.wr-toast{position:absolute;left:50%;bottom:calc(var(--safe-bottom) + 96px);margin:0;translate:-50% 20px;opacity:0;padding:10px 16px;border-radius:99px;background:#f3ede4;color:#14110e;font-size:13px;font-weight:600;white-space:nowrap;transition:opacity .3s,translate .45s cubic-bezier(.22,1,.36,1)}\n.wr-toast.show{opacity:1;translate:-50% 0}\n\n.wr-tabs{position:absolute;z-index:30;left:14px;right:14px;bottom:var(--safe-bottom);height:70px;display:grid;grid-template-columns:repeat(5,1fr);align-items:center;border-radius:28px;\n  background:rgba(30,25,21,.92);border:1px solid rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 12px 24px rgba(0,0,0,.4);\n  transition:transform .5s cubic-bezier(.2,.7,.2,1),opacity .4s}\n.wr-tabs.hide{transform:translateY(130%);opacity:0}\n.wr-tabs>button{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11px;color:var(--mut);transition:color .3s}\n.wr-tabs>button svg{width:23px;height:23px}\n.wr-tabs>button.on{color:var(--ink)}\n.wr-tabs>button.on svg{color:var(--cy)}\n.wr-orb-tab{justify-self:center;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;margin-top:-26px;\n  background:conic-gradient(from 0deg,#f2b766,#9db8ff,#f3d2ae,#f2b766);animation:wr-spin 6s linear infinite;box-shadow:0 10px 22px rgba(0,0,0,.5)}\n.wr-orb-tab span{width:48px;height:48px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#f8dcb0 30%,#2a1f12 75%);animation:wr-spin 6s linear infinite reverse}\n\n.wr-il{display:flex;gap:7px;align-items:center}\n.wr-ir{color:#f2b766;font-variant-numeric:tabular-nums}\n.wr-ring{width:14px;height:14px;border-radius:50%;background:conic-gradient(#f2b766 62%,rgba(255,255,255,.2) 0)}\n.wr-dot{width:8px;height:8px;border-radius:50%;background:#9db8ff}\n.wr-dot.cy{background:#f2b766}.wr-dot.red{background:#ff5b4a}\n.wr-wave{display:flex;gap:2px;align-items:center;height:14px}\n.wr-wave i{width:3px;border-radius:2px;background:#f2b766;animation:wr-wave .8s ease-in-out infinite alternate}\n.wr-wave i:nth-child(2){animation-delay:-.2s}.wr-wave i:nth-child(3){animation-delay:-.5s}.wr-wave i:nth-child(4){animation-delay:-.1s}.wr-wave i:nth-child(5){animation-delay:-.35s}\n\n.wr-talk{background:#0b0a09;align-items:center;justify-content:flex-start;transform:translateY(40px) scale(.96)}\n.wr-talk.on{transform:none}\n.wr-close{align-self:flex-end;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.08);display:grid;place-items:center}\n.wr-close svg{width:18px;height:18px}\n.wr-state{margin:4px 0 0;font-size:12px;letter-spacing:.24em;text-transform:uppercase;color:var(--cy)}\n.wr-orb{--amp:.08;position:relative;width:210px;height:210px;margin:26px 0 20px;flex:none;touch-action:none;outline:none}\n.wr-orb i{position:absolute;inset:0;border-radius:50%}\n.wr-orb .o1{background:conic-gradient(from 90deg,#f2b766,#f3d2ae,#9db8ff,#f2b766);filter:blur(22px);opacity:.75;transform:scale(calc(.8 + var(--amp) * .55));animation:wr-spin 7s linear infinite}\n.wr-orb .o2{inset:14px;background:conic-gradient(from 200deg,#9db8ff,#f2b766,#f3d2ae,#9db8ff);filter:blur(10px);opacity:.8;transform:scale(calc(.9 + var(--amp) * .3));animation:wr-spin 5s linear infinite reverse}\n.wr-orb .o3{inset:34px;border:1.5px solid rgba(255,255,255,.35);transform:scale(calc(1 + var(--amp) * .5));opacity:calc(.2 + var(--amp))}\n.wr-orb .core{inset:48px;background:radial-gradient(circle at 36% 30%,#ffffff,#fae3c2 22%,#c98a3e 60%,#22180c);box-shadow:inset 0 -12px 30px rgba(0,0,0,.35),0 14px 24px rgba(0,0,0,.45);transform:scale(calc(.94 + var(--amp) * .14))}\n.wr-transcript{width:100%;display:flex;flex-direction:column;gap:14px;min-height:150px}\n.wr-transcript p{margin:0}\n.wr-transcript .you{font:italic 350 23px/1.3 'Literata Variable',serif;text-align:center;text-wrap:balance}\n.wr-transcript .wren{font-size:15px;line-height:1.55;color:var(--mut);text-align:center;text-wrap:balance}\n.caret{display:inline-block;width:2px;height:1em;background:var(--cy);margin-left:2px;vertical-align:-.12em;animation:wr-blink .9s steps(2) infinite}\n.wr-card{width:100%;display:flex;gap:12px;align-items:center;padding:14px;border-radius:22px;background:#211b14;border:1px solid rgba(242,183,102,.3);\n  opacity:0;transform:translateY(40px) scale(.9);transition:opacity .4s,transform .7s cubic-bezier(.22,1,.36,1)}\n.wr-card.show{opacity:1;transform:none}\n.wr-card-ic{width:42px;height:42px;border-radius:14px;background:var(--cy);color:#1f1508;display:grid;place-items:center;flex:none}\n.wr-card-ic svg{width:22px;height:22px}\n.wr-card .t{margin:0;font-weight:600}.wr-card .s{margin:2px 0 0;font-size:12px;color:var(--mut)}\n.wr-card b{margin-left:auto;font:400 23px/1 'Literata Variable',serif;font-variant-numeric:tabular-nums;color:var(--cy)}\n\n.wr-iso-wrap{position:relative;flex:1;min-height:0;display:grid;place-items:center;perspective:900px;margin:0 -20px}\n.wr-iso{--mz:-42deg;--walk:0;position:relative;width:300px;height:300px;transform-style:preserve-3d;transform:rotateX(58deg) rotateZ(var(--mz));touch-action:none;cursor:grab;scale:1.04}\n.wr-room{position:absolute;box-sizing:border-box;background:rgba(255,248,238,.05);border:1px solid rgba(255,248,238,.08);transform-style:preserve-3d}\n.wr-room:nth-child(1){background:rgba(157,184,255,.1)}\n.wr-room:nth-child(4){background:rgba(242,183,102,.1)}\n.wr-rl{position:absolute;left:50%;top:50%;font-size:11px;font-weight:600;color:var(--mut);white-space:nowrap;transform:translate(-50%,-50%) translateZ(40px) rotateZ(calc(-1 * var(--mz))) rotateX(-58deg)}\n.wr-wall{position:absolute;background:linear-gradient(0deg,rgba(242,183,102,.05),rgba(242,183,102,.22));border-top:1px solid rgba(248,220,176,.55)}\n.wr-wall.x{height:26px;transform-origin:0 0;transform:rotateX(-90deg)}\n.wr-wall.y{width:26px;transform-origin:0 0;transform:rotateY(90deg)}\n.wr-routes{position:absolute;inset:0;width:300px;height:300px;overflow:visible;transform:translateZ(1px)}\n.wr-routes path{fill:none;stroke-linecap:round;stroke-linejoin:round}\n.wr-routes .rej{stroke:#ff6b5a;stroke-width:3;stroke-dasharray:6 7;animation:wr-dash 1s linear infinite;transition:opacity .6s}\n.wr-routes .ok{stroke:var(--cy);stroke-width:4;stroke-dasharray:220;stroke-dashoffset:220;transition:stroke-dashoffset 1.2s cubic-bezier(.2,.7,.2,1)}\n.committed .wr-routes .rej{opacity:.12}\n.committed .wr-routes .ok{stroke-dashoffset:0}\n.wr-toy{position:absolute;width:12px;height:12px;margin:-6px;border-radius:3px;background:#ff6b5a;transform:translateZ(6px);box-shadow:0 2px 3px rgba(0,0,0,.5)}\n/* destination: a static target ring, filled at the centre */\n.wr-pin{position:absolute;width:16px;height:16px;margin:-8px;border-radius:50%;border:2px solid var(--amb);background:radial-gradient(circle,var(--amb) 0 3px,transparent 3.5px);transform:translateZ(2px)}\n.wr-bot{position:absolute;left:0;top:0;width:0;height:0;transform-style:preserve-3d}\n.wr-bot i{position:absolute;width:18px;height:18px;margin:-9px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff,#f8dcb0 35%,#9a6424);box-shadow:0 4px 6px rgba(0,0,0,.55);transform:translateZ(14px) rotateZ(calc(-1 * var(--mz))) rotateX(-58deg)}\n.wr-sheet{margin:0 -20px -86px;padding:10px 20px 100px;border-radius:30px 30px 0 0;background:#1c1713;border-top:1px solid var(--line)}\n.wr-grab{width:38px;height:5px;border-radius:5px;background:rgba(255,255,255,.2);margin:0 auto 12px}\n.wr-sheet-row{display:flex;justify-content:space-between;gap:12px;align-items:center}\n.wr-sheet .t{margin:0;font-weight:600}.wr-sheet .s{margin:3px 0 0;font-size:12px;color:var(--mut)}\n.wr-eta{font:350 30px/1 'Literata Variable',serif;color:var(--cy);font-variant-numeric:tabular-nums}\n.wr-steps{list-style:none;margin:14px 0 0;padding:0;display:flex;gap:6px}\n.wr-steps li{flex:1;font-size:11px;color:var(--mut);padding-top:9px;border-top:3px solid rgba(255,255,255,.1)}\n.wr-steps li.done{border-color:rgba(242,183,102,.55);color:var(--ink)}\n.wr-steps li.now{border-image:linear-gradient(90deg,var(--cy),rgba(255,255,255,.1)) 1;color:var(--ink)}\n\n.wr-rec{display:flex;gap:6px;align-items:center;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;padding:7px 11px;border-radius:99px;background:rgba(255,91,74,.14);color:#ffb3a8}\n.wr-rec i{width:8px;height:8px;border-radius:50%;background:#ff5b4a}\n.wr-stagebox{position:relative;flex:1;min-height:0;border-radius:28px;background:linear-gradient(180deg,rgba(255,248,238,.04),rgba(242,183,102,.05));border:1px solid var(--line);overflow:hidden}\n.wr-stagebox svg{width:100%;height:100%;touch-action:none;cursor:grab}\n.wr-bone{stroke:var(--cy);stroke-linecap:round}\n.wr-joint{fill:#fdf1de;stroke:none}\n.wr-headj{fill:rgba(242,183,102,.14);stroke:var(--cy);stroke-width:2}\n.wr-ringp{stroke:rgba(242,183,102,.45);stroke-width:1.2}\n.wr-ticks{stroke:rgba(242,183,102,.35);stroke-width:1}\n.wr-cloth{fill:rgba(157,184,255,.28);stroke:var(--amb);stroke-width:1.2}\n.wr-hint{position:absolute;right:14px;top:12px;margin:0;font-size:11px;color:var(--mut)}\n.wr-timeline{display:flex;gap:5px}\n.wr-timeline i{flex:1;height:4px;border-radius:4px;background:rgba(255,255,255,.1);transition:background .4s}\n.wr-timeline i.done{background:var(--cy)}\n.wr-timeline i.now{background:linear-gradient(90deg,var(--cy) 50%,rgba(255,255,255,.1) 50%);background-size:200% 100%;animation:wr-prog 2.4s linear infinite}\n.wr-learn{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}\n.wr-learn li{display:flex;gap:10px;align-items:center;font-size:13px;color:var(--mut);transition:color .3s,transform .4s cubic-bezier(.22,1,.36,1)}\n.wr-learn li span{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:600;border:1px solid var(--line);flex:none}\n.wr-learn li.done{color:var(--ink)}\n.wr-learn li.done span{background:var(--cy);color:#1f1508;border-color:transparent}\n.wr-learn li.now{color:var(--ink);transform:translateX(4px)}\n.wr-learn li.now span{border-color:var(--cy);color:var(--cy)}\n\n@keyframes wr-kb{to{transform:scale(1.12) translate(-2%,1%)}}\n@keyframes wr-scan{from{background-position:0 120%}to{background-position:0 -120%}}\n@keyframes wr-tag{from{transform:scale(1.4)}}\n@keyframes wr-blink{50%{opacity:.25}}\n@keyframes wr-ring{from{stroke-dashoffset:94.2}}\n@keyframes wr-fill{from{transform:scaleX(0)}}\n@keyframes wr-spin{to{transform:rotate(360deg)}}\n@keyframes wr-wave{from{height:3px}to{height:14px}}\n@keyframes wr-dash{to{stroke-dashoffset:-13}}\n@keyframes wr-prog{from{background-position:100% 0}to{background-position:0 0}}\n@media (prefers-reduced-motion:reduce){.wr *{animation-duration:.01ms!important;animation-iteration-count:1!important}}\n`;\n"},{"path":"app/wren/page.tsx","type":"registry:page","target":"app/wren/page.tsx","content":"import type { Metadata } from \"next\";\n/* NightMarquee design \"Wren\". Free for personal, portfolio, educational and non-commercial use; no republishing: nightmarquee.com/license */\nimport { Demo } from \"../../components/nightmarquee/wren/wren/demo\";\n\nexport const metadata: Metadata = {\n  title: \"Wren\",\n  description: \"A home-robot app that feels like hardware: a live camera card that tags what the robot sees, a voice orb that turns a sentence into a queued task, a CSS-3D floor plan you spin with a finger while the robot re-plans around a toy, and teach-by-demonstration with a projected 3D skeleton. Ships inside a scroll tour where the phone swings between chapters over the footage.\",\n};\n\nexport default function Page() {\n  return <Demo />;\n}\n"}],"docs":"The page is at app/wren/page.tsx.\nIts footage streams from media.nightmarquee.com.\nUse is covered by the NightMarquee licence: nightmarquee.com/license","meta":{"mappingVersion":3}}