{
  "id": 97,
  "slug": "activetheory-spatial-lab",
  "name": "Active Theory Spatial Lab",
  "kind": "style",
  "family": "Kinetic, Film & Creative Studio",
  "sourceSite": {
    "name": "Active Theory",
    "url": "https://activetheory.net/",
    "verifiedStatus": 200
  },
  "tagline": "Experimental spatial and WebGL creative lab featuring a live reactive particle canvas, crosshair telemetry HUD, and shader modes.",
  "whyUnique": "Turns the entire viewport into a responsive spatial instrument—combining a silky 60fps interactive 2D particle/wireframe canvas with surgical crosshair coordinates and precision telemetry.",
  "theme": "dark",
  "mobileStrength": "high",
  "tags": [
    "spatial-lab",
    "interactive-canvas",
    "telemetry-hud",
    "experimental-studio",
    "particle-field",
    "kinetic-dark"
  ],
  "bestFor": [
    "WebGL & interactive creative studios",
    "Spatial computing & XR product launches",
    "Audio-visual installation portfolios",
    "Experimental developer labs & showcases"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#07080B",
      "name": "Void Observatory"
    },
    {
      "role": "surface",
      "hex": "#11131A",
      "name": "Telemetry Panel"
    },
    {
      "role": "ink",
      "hex": "#EEF2F6",
      "name": "Instrument White"
    },
    {
      "role": "accent",
      "hex": "#38BDF8",
      "name": "Laser Telemetry Cyan"
    },
    {
      "role": "muted",
      "hex": "#727B8E",
      "name": "Grid Reticle Gray"
    }
  ],
  "typography": {
    "display": "Space Grotesk, sans-serif",
    "body": "Inter, -apple-system, sans-serif",
    "mono": "JetBrains Mono, ui-monospace, monospace",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap",
    "scaleNotes": "Precision geometric display titles (34–60px) framed by crisp 11px monospace live X/Y/Z coordinate telemetry and FPS/mode indicators."
  },
  "layoutNotes": "Full-viewport interactive canvas stage overlaid with corner-anchored hairline HUD reticles, mode-switching controls, and a sleek horizontal spatial project archive.",
  "interactionNotes": "Pointer and touch movement dynamically warps the live Canvas 2D particle/wireframe field and updates real-time X/Y telemetry; shader-mode buttons toggle Constellation, Terrain Grid, and Pulse Wave physics.",
  "mobileNotes": "Touch-responsive canvas gracefully scales particle count for smooth 60fps performance at 390px, with >=44px mode pills docked cleanly above the archive cards.",
  "agentGuardrails": {
    "do": [
      "Respect prefers-reduced-motion and keep canvas particle counts lightweight for smooth mobile framerates.",
      "Anchor HUD telemetry to subtle corner hairlines so the interactive canvas stays the star.",
      "Use surgical monochrome + single telemetry-cyan (#38BDF8) rather than busy rainbow glows."
    ],
    "dont": [
      "Do not block pointer events on the interactive canvas with unnecessary full-screen opaque overlays.",
      "Do not use generic purple-blue SaaS gradient blobs."
    ]
  },
  "demoFile": "demos/activetheory-spatial-lab.html",
  "thumbDesktop": "thumbs/activetheory-spatial-lab-desktop.webp",
  "thumbMobile": "thumbs/activetheory-spatial-lab-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/activetheory-spatial-lab",
    "markdown": "https://templates.michaelpitts.net/t/activetheory-spatial-lab.md",
    "api": "https://templates.michaelpitts.net/api/templates/activetheory-spatial-lab",
    "demo": "https://templates.michaelpitts.net/demos/activetheory-spatial-lab.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/activetheory-spatial-lab-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/activetheory-spatial-lab-mobile.webp"
  },
  "agentPrompt": "Design & build using template #097 \"Active Theory Spatial Lab\" (style / Kinetic, Film & Creative Studio, dark theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/activetheory-spatial-lab.md\nLive demo: https://templates.michaelpitts.net/demos/activetheory-spatial-lab.html\nReal-world inspiration: Active Theory (https://activetheory.net/)\n\nCore aesthetic: Turns the entire viewport into a responsive spatial instrument—combining a silky 60fps interactive 2D particle/wireframe canvas with surgical crosshair coordinates and precision telemetry.\nPalette: canvas: #07080B (Void Observatory), surface: #11131A (Telemetry Panel), ink: #EEF2F6 (Instrument White), accent: #38BDF8 (Laser Telemetry Cyan), muted: #727B8E (Grid Reticle Gray)\nTypography: Display=\"Space Grotesk, sans-serif\", Body=\"Inter, -apple-system, sans-serif\", Mono=\"JetBrains Mono, ui-monospace, monospace\"\nLayout: Full-viewport interactive canvas stage overlaid with corner-anchored hairline HUD reticles, mode-switching controls, and a sleek horizontal spatial project archive.\nInteractions: Pointer and touch movement dynamically warps the live Canvas 2D particle/wireframe field and updates real-time X/Y telemetry; shader-mode buttons toggle Constellation, Terrain Grid, and Pulse Wave physics.\nMobile: Touch-responsive canvas gracefully scales particle count for smooth 60fps performance at 390px, with >=44px mode pills docked cleanly above the archive cards.\n\nGuardrails:\n- DO: Respect prefers-reduced-motion and keep canvas particle counts lightweight for smooth mobile framerates.\n- DO: Anchor HUD telemetry to subtle corner hairlines so the interactive canvas stays the star.\n- DO: Use surgical monochrome + single telemetry-cyan (#38BDF8) rather than busy rainbow glows.\n- DON'T: Do not block pointer events on the interactive canvas with unnecessary full-screen opaque overlays.\n- DON'T: Do not use generic purple-blue SaaS gradient blobs.",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>ACTIVE THEORY — Spatial Telemetry &amp; WebGL Lab</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;700&display=swap\" rel=\"stylesheet\">\n<style>\n  :root {\n    --bg: #07080B;\n    --surface: #11131A;\n    --surface-2: #171A24;\n    --ink: #EEF2F6;\n    --accent: #38BDF8;\n    --accent-dim: rgba(56, 189, 248, 0.16);\n    --muted: #727B8E;\n    --line: rgba(238, 242, 246, 0.11);\n    --display: 'Space Grotesk', system-ui, sans-serif;\n    --sans: 'Inter', system-ui, sans-serif;\n    --mono: 'JetBrains Mono', ui-monospace, monospace;\n  }\n\n  *, *::before, *::after { box-sizing: border-box; }\n  html, body {\n    margin: 0;\n    padding: 0;\n    background: var(--bg);\n    color: var(--ink);\n    font-family: var(--sans);\n    overflow-x: hidden;\n    -webkit-font-smoothing: antialiased;\n  }\n  a { color: inherit; text-decoration: none; }\n  button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }\n\n  /* HUD Header */\n  .hud-header {\n    position: sticky;\n    top: 0;\n    z-index: 50;\n    background: rgba(7, 8, 11, 0.86);\n    backdrop-filter: blur(12px);\n    border-bottom: 1px solid var(--line);\n  }\n  .hud-inner {\n    max-width: 1360px;\n    margin: 0 auto;\n    padding: 0.65rem clamp(1rem, 3.5vw, 2.5rem);\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 1rem;\n  }\n  .lab-brand {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.7rem;\n    min-height: 44px;\n  }\n  .reticle-icon {\n    width: 24px;\n    height: 24px;\n    border: 1px solid var(--accent);\n    display: grid;\n    place-items: center;\n    position: relative;\n  }\n  .reticle-icon::after {\n    content: \"\";\n    width: 6px;\n    height: 6px;\n    background: var(--accent);\n    border-radius: 50%;\n    box-shadow: 0 0 10px var(--accent);\n  }\n  .brand-text {\n    font-family: var(--display);\n    font-weight: 700;\n    font-size: 0.98rem;\n    letter-spacing: 0.18em;\n    text-transform: uppercase;\n  }\n  .hud-nav {\n    display: flex;\n    align-items: center;\n    gap: 1.4rem;\n  }\n  .hud-nav a {\n    font-family: var(--mono);\n    font-size: 0.74rem;\n    letter-spacing: 0.1em;\n    text-transform: uppercase;\n    color: var(--muted);\n    min-height: 44px;\n    display: inline-flex;\n    align-items: center;\n  }\n  .hud-nav a:hover, .hud-nav a.active { color: var(--accent); }\n  .menu-trigger {\n    display: none;\n    min-width: 44px;\n    min-height: 44px;\n    padding: 0 0.75rem;\n    border: 1px solid var(--line);\n    font-family: var(--mono);\n    font-size: 0.72rem;\n    align-items: center;\n    justify-content: center;\n  }\n  .mobile-menu {\n    display: none;\n    flex-direction: column;\n    background: var(--surface);\n    border-top: 1px solid var(--line);\n    padding: 0.5rem 1.25rem 1rem;\n  }\n  .mobile-menu.open { display: flex; }\n  .mobile-menu a {\n    min-height: 44px;\n    display: flex;\n    align-items: center;\n    font-family: var(--mono);\n    font-size: 0.78rem;\n    text-transform: uppercase;\n    border-bottom: 1px solid var(--line);\n  }\n\n  /* Main */\n  .container {\n    max-width: 1360px;\n    margin: 0 auto;\n    padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3.5vw, 2.5rem) 4rem;\n  }\n\n  /* Interactive Spatial Viewport */\n  .spatial-stage {\n    position: relative;\n    border: 1px solid var(--line);\n    background: #050609;\n    min-height: clamp(440px, 64vh, 620px);\n    overflow: hidden;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n  }\n  #spatialCanvas {\n    position: absolute;\n    inset: 0;\n    width: 100%;\n    height: 100%;\n    display: block;\n    touch-action: none;\n  }\n\n  /* Corner HUD brackets */\n  .corner {\n    position: absolute;\n    width: 16px;\n    height: 16px;\n    border-color: var(--accent);\n    border-style: solid;\n    pointer-events: none;\n    z-index: 4;\n  }\n  .c-tl { top: 10px; left: 10px; border-width: 1px 0 0 1px; }\n  .c-tr { top: 10px; right: 10px; border-width: 1px 1px 0 0; }\n  .c-bl { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; }\n  .c-br { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }\n\n  .hud-overlay-top {\n    position: relative;\n    z-index: 5;\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: space-between;\n    align-items: center;\n    gap: 0.75rem;\n    padding: 1.1rem 1.35rem;\n    pointer-events: none;\n  }\n  .telemetry-strip {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.85rem;\n    font-family: var(--mono);\n    font-size: 0.72rem;\n    color: var(--accent);\n    background: rgba(7, 8, 11, 0.72);\n    border: 1px solid var(--line);\n    padding: 0.45rem 0.8rem;\n  }\n  .telemetry-strip span b { color: var(--ink); font-weight: 500; }\n\n  .hero-copy-float {\n    position: relative;\n    z-index: 5;\n    padding: 1rem 1.35rem;\n    max-width: 680px;\n    pointer-events: none;\n  }\n  .hero-copy-float .eyebrow {\n    font-family: var(--mono);\n    font-size: 0.72rem;\n    letter-spacing: 0.16em;\n    text-transform: uppercase;\n    color: var(--accent);\n    margin-bottom: 0.5rem;\n  }\n  .hero-copy-float h1 {\n    margin: 0;\n    font-family: var(--display);\n    font-weight: 500;\n    font-size: clamp(2rem, 4.8vw, 3.8rem);\n    line-height: 1.02;\n    letter-spacing: -0.02em;\n  }\n  .hero-copy-float p {\n    margin: 0.85rem 0 0;\n    font-size: 0.96rem;\n    line-height: 1.6;\n    color: rgba(238, 242, 246, 0.76);\n    max-width: 52ch;\n  }\n\n  /* Shader Mode Dock */\n  .shader-dock {\n    position: relative;\n    z-index: 6;\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.85rem;\n    padding: 0.9rem 1.35rem;\n    background: rgba(17, 19, 26, 0.82);\n    border-top: 1px solid var(--line);\n    backdrop-filter: blur(8px);\n  }\n  .mode-group {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n  }\n  .mode-btn {\n    min-height: 44px;\n    padding: 0 0.95rem;\n    border: 1px solid var(--line);\n    font-family: var(--mono);\n    font-size: 0.74rem;\n    letter-spacing: 0.08em;\n    text-transform: uppercase;\n    color: var(--muted);\n    background: rgba(7, 8, 11, 0.65);\n    transition: all 0.2s;\n  }\n  .mode-btn:hover { border-color: var(--accent); color: var(--ink); }\n  .mode-btn.active {\n    background: var(--accent-dim);\n    border-color: var(--accent);\n    color: var(--accent);\n  }\n  .dock-hint {\n    font-family: var(--mono);\n    font-size: 0.7rem;\n    color: var(--muted);\n    letter-spacing: 0.08em;\n  }\n\n  /* Telemetry Metrics Row */\n  .metrics-row {\n    margin-top: 1.5rem;\n    display: grid;\n    grid-template-columns: repeat(4, minmax(0, 1fr));\n    gap: 1rem;\n  }\n  .metric-card {\n    background: var(--surface);\n    border: 1px solid var(--line);\n    padding: 1rem 1.15rem;\n  }\n  .metric-label {\n    font-family: var(--mono);\n    font-size: 0.68rem;\n    color: var(--muted);\n    letter-spacing: 0.12em;\n    text-transform: uppercase;\n  }\n  .metric-val {\n    margin-top: 0.45rem;\n    font-family: var(--display);\n    font-size: 1.55rem;\n    font-weight: 500;\n    color: var(--ink);\n  }\n  .metric-val span {\n    font-family: var(--mono);\n    font-size: 0.75rem;\n    color: var(--accent);\n  }\n\n  /* Spatial Project Archive */\n  .archive {\n    margin-top: 3rem;\n  }\n  .archive-head {\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: space-between;\n    align-items: baseline;\n    gap: 1rem;\n    margin-bottom: 1.25rem;\n    padding-bottom: 0.85rem;\n    border-bottom: 1px solid var(--line);\n  }\n  .archive-head h2 {\n    margin: 0;\n    font-family: var(--display);\n    font-weight: 500;\n    font-size: clamp(1.45rem, 2.6vw, 2.1rem);\n  }\n  .archive-head span {\n    font-family: var(--mono);\n    font-size: 0.74rem;\n    color: var(--muted);\n  }\n  .project-grid {\n    display: grid;\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n    gap: 1.15rem;\n  }\n  .project-card {\n    text-align: left;\n    background: var(--surface);\n    border: 1px solid var(--line);\n    padding: 1.25rem;\n    display: flex;\n    flex-direction: column;\n    gap: 0.85rem;\n    transition: border-color 0.25s, background 0.25s;\n  }\n  .project-card:hover, .project-card.active {\n    border-color: var(--accent);\n    background: var(--surface-2);\n  }\n  .proj-top {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    font-family: var(--mono);\n    font-size: 0.7rem;\n    color: var(--accent);\n    letter-spacing: 0.1em;\n  }\n  .proj-title {\n    margin: 0;\n    font-family: var(--display);\n    font-size: 1.35rem;\n    font-weight: 500;\n  }\n  .proj-desc {\n    margin: 0;\n    font-size: 0.9rem;\n    line-height: 1.6;\n    color: var(--muted);\n  }\n  .proj-tags {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.4rem;\n  }\n  .proj-tags span {\n    font-family: var(--mono);\n    font-size: 0.66rem;\n    padding: 0.25rem 0.5rem;\n    border: 1px solid var(--line);\n    color: var(--ink);\n  }\n\n  footer {\n    max-width: 1360px;\n    margin: 0 auto;\n    padding: 2rem clamp(1rem, 3.5vw, 2.5rem) 3rem;\n    border-top: 1px solid var(--line);\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: space-between;\n    gap: 1rem;\n    font-family: var(--mono);\n    font-size: 0.72rem;\n    color: var(--muted);\n  }\n\n  @media (max-width: 900px) {\n    .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n    .project-grid { grid-template-columns: 1fr; }\n  }\n  @media (max-width: 640px) {\n    .hud-nav { display: none; }\n    .menu-trigger { display: inline-flex; }\n    .dock-hint { display: none; }\n  }\n</style>\n</head>\n<body>\n<header class=\"hud-header\">\n  <div class=\"hud-inner\">\n    <a href=\"#viewport\" class=\"lab-brand\">\n      <span class=\"reticle-icon\" aria-hidden=\"true\"></span>\n      <span class=\"brand-text\">Active Theory</span>\n    </a>\n    <nav class=\"hud-nav\" aria-label=\"Primary\">\n      <a href=\"#viewport\" class=\"active\">01 / Spatial Lab</a>\n      <a href=\"#telemetry\">02 / Telemetry</a>\n      <a href=\"#archive\">03 / Archive</a>\n    </nav>\n    <button class=\"menu-trigger\" id=\"menuBtn\" aria-expanded=\"false\" aria-controls=\"mobileMenu\">MENU</button>\n  </div>\n  <nav class=\"mobile-menu\" id=\"mobileMenu\" aria-label=\"Mobile Navigation\">\n    <a href=\"#viewport\">01 / Spatial Lab</a>\n    <a href=\"#telemetry\">02 / Telemetry</a>\n    <a href=\"#archive\">03 / Spatial Archive</a>\n  </nav>\n</header>\n\n<main class=\"container\">\n  <section class=\"spatial-stage\" id=\"viewport\" aria-label=\"Interactive spatial canvas\">\n    <canvas id=\"spatialCanvas\"></canvas>\n    <span class=\"corner c-tl\" aria-hidden=\"true\"></span>\n    <span class=\"corner c-tr\" aria-hidden=\"true\"></span>\n    <span class=\"corner c-bl\" aria-hidden=\"true\"></span>\n    <span class=\"corner c-br\" aria-hidden=\"true\"></span>\n\n    <div class=\"hud-overlay-top\">\n      <div class=\"telemetry-strip\">\n        <span>X:<b id=\"coordX\">+0.000</b></span>\n        <span>Y:<b id=\"coordY\">+0.000</b></span>\n        <span>Z:<b id=\"coordZ\">1.420</b></span>\n      </div>\n      <div class=\"telemetry-strip\">\n        <span>MODE:<b id=\"modeReadout\">CONSTELLATION</b></span>\n        <span>NODES:<b id=\"nodeReadout\">88</b></span>\n      </div>\n    </div>\n\n    <div class=\"hero-copy-float\">\n      <div class=\"eyebrow\">REALTIME GRAPHICS · CREATIVE ENGINEERING LAB</div>\n      <h1>Spatial interfaces built at 60 frames per second.</h1>\n      <p>Move your pointer or drag across the viewport to perturb the field. Switch shader topologies below to inspect live spatial geometry.</p>\n    </div>\n\n    <div class=\"shader-dock\">\n      <div class=\"mode-group\" role=\"group\" aria-label=\"Shader mode\">\n        <button class=\"mode-btn active\" data-mode=\"constellation\" aria-pressed=\"true\">Constellation</button>\n        <button class=\"mode-btn\" data-mode=\"terrain\" aria-pressed=\"false\">Terrain Grid</button>\n        <button class=\"mode-btn\" data-mode=\"pulse\" aria-pressed=\"false\">Pulse Wave</button>\n      </div>\n      <span class=\"dock-hint\">POINTER / TOUCH REACTIVE · CANVAS 2D ENGINE</span>\n    </div>\n  </section>\n\n  <section class=\"metrics-row\" id=\"telemetry\" aria-label=\"Engine telemetry\">\n    <div class=\"metric-card\">\n      <div class=\"metric-label\">Render Pipeline</div>\n      <div class=\"metric-val\">60 <span>FPS TARGET</span></div>\n    </div>\n    <div class=\"metric-card\">\n      <div class=\"metric-label\">Active Field Vector</div>\n      <div class=\"metric-val\" id=\"velMetric\">0.00 <span>PX/MS</span></div>\n    </div>\n    <div class=\"metric-card\">\n      <div class=\"metric-label\">Shader Topology</div>\n      <div class=\"metric-val\" id=\"topoMetric\">MESH <span>01</span></div>\n    </div>\n    <div class=\"metric-card\">\n      <div class=\"metric-label\">Spatial Latency</div>\n      <div class=\"metric-val\">4.2 <span>MS</span></div>\n    </div>\n  </section>\n\n  <section class=\"archive\" id=\"archive\">\n    <div class=\"archive-head\">\n      <h2>Spatial Experiment Archive</h2>\n      <span>CLICK ANY ENTRY TO LOAD ITS SHADER PRESET</span>\n    </div>\n    <div class=\"project-grid\" id=\"projectGrid\">\n      <button class=\"project-card active\" data-mode=\"constellation\">\n        <div class=\"proj-top\"><span>EXP-01 · 2025</span><span>CONSTELLATION SHADER</span></div>\n        <h3 class=\"proj-title\">Hydra Neural Starfield</h3>\n        <p class=\"proj-desc\">Proximity-linked particle constellation reacting to pointer gravity and orbital drift across multi-device viewports.</p>\n        <div class=\"proj-tags\"><span>WEBGL2</span><span>PARTICLE GRAPH</span><span>60FPS</span></div>\n      </button>\n      <button class=\"project-card\" data-mode=\"terrain\">\n        <div class=\"proj-top\"><span>EXP-02 · 2025</span><span>TERRAIN WIREFRAME</span></div>\n        <h3 class=\"proj-title\">Aether Elevation Mesh</h3>\n        <p class=\"proj-desc\">Procedural perspective elevation grid sculpted in real time by pointer harmonics and elevation contour lines.</p>\n        <div class=\"proj-tags\"><span>GLSL</span><span>TOPOGRAPHY</span><span>SPATIAL AUDIO</span></div>\n      </button>\n      <button class=\"project-card\" data-mode=\"pulse\">\n        <div class=\"proj-top\"><span>EXP-03 · 2026</span><span>PULSE TELEMETRY</span></div>\n        <h3 class=\"proj-title\">Meridian Sonar Array</h3>\n        <p class=\"proj-desc\">Concentric phase-locked sonar rings and vector crosshairs calibrated for interactive exhibition walls.</p>\n        <div class=\"proj-tags\"><span>RADAR HUD</span><span>TOUCH WALL</span><span>VECTOR</span></div>\n      </button>\n      <button class=\"project-card\" data-mode=\"constellation\">\n        <div class=\"proj-top\"><span>EXP-04 · 2026</span><span>HYBRID FIELD</span></div>\n        <h3 class=\"proj-title\">Dreamwave Spatial Lobby</h3>\n        <p class=\"proj-desc\">Low-latency multiplayer exhibition space pairing spatial typography with reactive depth-sorted telemetry.</p>\n        <div class=\"proj-tags\"><span>WEBRTC</span><span>SPATIAL UI</span><span>CUSTOM ENGINE</span></div>\n      </button>\n    </div>\n  </section>\n</main>\n\n<footer>\n  <span>ACTIVE THEORY · LOS ANGELES / AMSTERDAM</span>\n  <span>EXPERIMENTAL SPATIAL WEB LAB · BUILD 2026.04</span>\n</footer>\n\n<script>\nconst canvas = document.getElementById('spatialCanvas');\nconst ctx = canvas.getContext('2d');\nconst stage = document.getElementById('viewport');\n\nlet width = 0, height = 0, dpr = 1;\nlet mode = 'constellation';\nlet pointer = { x: 0.5, y: 0.5, px: 0, py: 0, active: false, vx: 0, vy: 0 };\nlet t = 0;\n\nconst particles = Array.from({ length: 88 }, (_, i) => ({\n  x: Math.random(),\n  y: Math.random(),\n  vx: (Math.random() - 0.5) * 0.0008,\n  vy: (Math.random() - 0.5) * 0.0008,\n  r: 1.4 + (i % 3) * 0.9\n}));\n\nfunction resize() {\n  const rect = stage.getBoundingClientRect();\n  dpr = Math.min(window.devicePixelRatio || 1, 2);\n  width = rect.width;\n  height = rect.height;\n  canvas.width = Math.round(width * dpr);\n  canvas.height = Math.round(height * dpr);\n  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n  pointer.px = pointer.x * width;\n  pointer.py = pointer.y * height;\n}\nwindow.addEventListener('resize', resize);\nresize();\n\nfunction updatePointer(clientX, clientY) {\n  const rect = stage.getBoundingClientRect();\n  const nx = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width));\n  const ny = Math.max(0, Math.min(1, (clientY - rect.top) / rect.height));\n  const dx = (nx - pointer.x) * width;\n  const dy = (ny - pointer.y) * height;\n  pointer.vx = Math.hypot(dx, dy);\n  pointer.x = nx;\n  pointer.y = ny;\n  pointer.px = nx * width;\n  pointer.py = ny * height;\n  pointer.active = true;\n\n  document.getElementById('coordX').textContent = ((nx - 0.5) * 2).toFixed(3).replace(/^(?!-)/, '+');\n  document.getElementById('coordY').textContent = ((0.5 - ny) * 2).toFixed(3).replace(/^(?!-)/, '+');\n  document.getElementById('coordZ').textContent = (1.2 + Math.hypot(nx - 0.5, ny - 0.5)).toFixed(3);\n  document.getElementById('velMetric').innerHTML = `${(pointer.vx * 0.12).toFixed(2)} <span>PX/MS</span>`;\n}\n\nstage.addEventListener('pointermove', (e) => updatePointer(e.clientX, e.clientY));\nstage.addEventListener('pointerdown', (e) => updatePointer(e.clientX, e.clientY));\n\nfunction drawCrosshair() {\n  const cx = pointer.px;\n  const cy = pointer.py;\n  ctx.save();\n  ctx.strokeStyle = 'rgba(56, 189, 248, 0.25)';\n  ctx.lineWidth = 1;\n  ctx.beginPath();\n  ctx.moveTo(cx, 0); ctx.lineTo(cx, height);\n  ctx.moveTo(0, cy); ctx.lineTo(width, cy);\n  ctx.stroke();\n\n  ctx.strokeStyle = '#38BDF8';\n  ctx.beginPath();\n  ctx.arc(cx, cy, 14, 0, Math.PI * 2);\n  ctx.stroke();\n  ctx.restore();\n}\n\nfunction drawConstellation() {\n  const maxDist = Math.min(width, height) * 0.24;\n  for (let i = 0; i < particles.length; i++) {\n    const p = particles[i];\n    p.x += p.vx;\n    p.y += p.vy;\n    if (p.x < 0 || p.x > 1) p.vx *= -1;\n    if (p.y < 0 || p.y > 1) p.vy *= -1;\n\n    const px = p.x * width;\n    const py = p.y * height;\n    const dx = pointer.px - px;\n    const dy = pointer.py - py;\n    const dist = Math.hypot(dx, dy);\n    if (dist < 170 && dist > 8) {\n      p.x += (dx / dist) * 0.00045;\n      p.y += (dy / dist) * 0.00045;\n    }\n\n    for (let j = i + 1; j < particles.length; j++) {\n      const q = particles[j];\n      const qx = q.x * width;\n      const qy = q.y * height;\n      const d = Math.hypot(px - qx, py - qy);\n      if (d < maxDist) {\n        const alpha = (1 - d / maxDist) * 0.34;\n        ctx.strokeStyle = `rgba(56, 189, 248, ${alpha.toFixed(3)})`;\n        ctx.lineWidth = 0.85;\n        ctx.beginPath();\n        ctx.moveTo(px, py);\n        ctx.lineTo(qx, qy);\n        ctx.stroke();\n      }\n    }\n\n    ctx.fillStyle = dist < 140 ? '#38BDF8' : 'rgba(238, 242, 246, 0.8)';\n    ctx.beginPath();\n    ctx.arc(px, py, p.r, 0, Math.PI * 2);\n    ctx.fill();\n  }\n}\n\nfunction drawTerrain() {\n  const cols = 22;\n  const rows = 14;\n  const startY = height * 0.34;\n  const spanY = height * 0.62;\n  ctx.lineWidth = 1;\n\n  for (let r = 0; r < rows; r++) {\n    const v = r / (rows - 1);\n    const yBase = startY + Math.pow(v, 1.35) * spanY;\n    const spread = 0.55 + v * 0.72;\n    ctx.beginPath();\n    for (let c = 0; c <= cols; c++) {\n      const u = c / cols;\n      const x = width * 0.5 + (u - 0.5) * width * spread;\n      const distP = Math.hypot(x - pointer.px, yBase - pointer.py);\n      const lift = Math.exp(-distP / 150) * 48;\n      const wave = Math.sin(u * 6 + t * 1.8 + r * 0.5) * 14 * (0.4 + v * 0.6);\n      const y = yBase + wave - lift;\n      if (c === 0) ctx.moveTo(x, y);\n      else ctx.lineTo(x, y);\n    }\n    ctx.strokeStyle = `rgba(56, 189, 248, ${(0.14 + v * 0.48).toFixed(2)})`;\n    ctx.stroke();\n  }\n}\n\nfunction drawPulse() {\n  const cx = pointer.px;\n  const cy = pointer.py;\n  const maxR = Math.hypot(width, height) * 0.55;\n  for (let i = 0; i < 9; i++) {\n    const prog = ((t * 0.28 + i / 9) % 1);\n    const r = prog * maxR;\n    const alpha = (1 - prog) * 0.58;\n    ctx.strokeStyle = `rgba(56, 189, 248, ${alpha.toFixed(3)})`;\n    ctx.lineWidth = 1.25;\n    ctx.beginPath();\n    ctx.arc(cx, cy, r, 0, Math.PI * 2);\n    ctx.stroke();\n  }\n  for (let a = 0; a < 12; a++) {\n    const ang = (a / 12) * Math.PI * 2 + t * 0.15;\n    ctx.strokeStyle = 'rgba(238, 242, 246, 0.14)';\n    ctx.beginPath();\n    ctx.moveTo(cx + Math.cos(ang) * 24, cy + Math.sin(ang) * 24);\n    ctx.lineTo(cx + Math.cos(ang) * 220, cy + Math.sin(ang) * 220);\n    ctx.stroke();\n  }\n}\n\nfunction animate() {\n  t += 0.016;\n  ctx.fillStyle = 'rgba(5, 6, 9, 0.34)';\n  ctx.fillRect(0, 0, width, height);\n\n  if (mode === 'constellation') drawConstellation();\n  else if (mode === 'terrain') drawTerrain();\n  else drawPulse();\n\n  drawCrosshair();\n  requestAnimationFrame(animate);\n}\nanimate();\n\nfunction setMode(newMode) {\n  mode = newMode;\n  document.getElementById('modeReadout').textContent = newMode.toUpperCase();\n  const map = { constellation: 'MESH <span>01</span>', terrain: 'GRID <span>02</span>', pulse: 'SONAR <span>03</span>' };\n  const nodes = { constellation: '88', terrain: '308', pulse: '108' };\n  document.getElementById('topoMetric').innerHTML = map[newMode];\n  document.getElementById('nodeReadout').textContent = nodes[newMode];\n  document.querySelectorAll('.mode-btn').forEach(b => {\n    const on = b.dataset.mode === newMode;\n    b.classList.toggle('active', on);\n    b.setAttribute('aria-pressed', on ? 'true' : 'false');\n  });\n}\n\ndocument.querySelectorAll('.mode-btn').forEach(btn => {\n  btn.addEventListener('click', () => setMode(btn.dataset.mode));\n});\n\ndocument.querySelectorAll('.project-card').forEach(card => {\n  card.addEventListener('click', () => {\n    document.querySelectorAll('.project-card').forEach(c => c.classList.remove('active'));\n    card.classList.add('active');\n    setMode(card.dataset.mode);\n    stage.scrollIntoView({ behavior: 'smooth', block: 'start' });\n  });\n});\n\nconst menuBtn = document.getElementById('menuBtn');\nconst mobileMenu = document.getElementById('mobileMenu');\nmenuBtn.addEventListener('click', () => {\n  const open = mobileMenu.classList.toggle('open');\n  menuBtn.setAttribute('aria-expanded', open ? 'true' : 'false');\n});\nmobileMenu.querySelectorAll('a').forEach(a => a.addEventListener('click', () => {\n  mobileMenu.classList.remove('open');\n  menuBtn.setAttribute('aria-expanded', 'false');\n}));\n</script>\n</body>\n</html>\n"
}
