<!-- SOLIDIVISM · part 67 -->
 nameplates only carry as far as they can be read */
  for (const b of buildings) {
    const d2 = (P.x - b.x) * (P.x - b.x) + (P.z - b.z) * (P.z - b.z);
    b.plate.visible = d2 < 150 * 150;
  }
}
function buildLegend() {
  const el = document.getElementById('legend');
  el.innerHTML = CATEGORIES.concat([{ name: 'THE CITY', color: 0x5b7290 }])
    .map(c => c.name + '<i style="background:#' + c.color.toString(16).padStart(6, '0') + '"></i>').join('<br>');
}

/* ---------------- the heart: frame loop + watchdog -------------------- */
let lastFrameAt = performance.now(), lastT = performance.now(), rafId = 0, hudAt = 0;
function frame() {
  rafId = requestAnimationFrame(frame);
  const now = performance.now();
  const dt = Math.min(0.05, (now - lastT) / 1000); lastT = now; lastFrameAt = now;
  step(dt);
  renderer.render(scene, camera);
  if (now - hudAt > 250) { hudAt = now; hudTick(); drawCompass(); }
}
rafId = requestAnimationFrame(frame);
setInterval(() => {
  if (document.hidden) return;
  if (performance.now() - lastFrameAt > 3000) {
    cancelAnimationFrame(rafId); lastT = performance.now();
    rafId = requestAnimationFrame(frame);
  }
}, 1000);

/* ---------------- boot -------------------------------------------------- */
bindControls();
buildLegend();
loadPages().then(pages => {
  buildCity(pages);
  window.__cityUp = true;
  document.getElementById('loading').style.display = 'none';
  toast('The city stands: ' + pages.length + ' pages, ' + pages.length + ' buildings. Walk to a gold door.');
}).catch(e => {
  document.getElementById('loading').textContent = 'The city could not rise. ' + e.message;
});
</script>
</body>
</html>


===== FILE: public/solidivism/index.html.pre-staging-20261009 =====
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>SOLIDIVISM — The Foundation</title>
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { background: #0a0a0e; overflow: hidden; font-family: monospace; }
  #scene-container { position: absolute; inset: 0; }
  #scene-container canvas { display: block; }
  #hud {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 12px 16px; z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    color: #FF0000; font-size: 14px; letter-spacing: 2px;
    pointer-events: none;
  }
  #hud .sub { color: #666; font-size: 11px; letter-spacing: 1px; margin-top: 4px; }
  #joystick {
    display: none; position: absolute;
    bottom: 30px; left: 30px; width: 120px; height: 120px;
    border-radius: 50%; z-index: 50;
    background: rgba(255,0,0,0.05);
    border: 2px solid rgba(255,0,0,0.3);
    touch-action: none;
  }
  #joystick-knob {
    position: absolute; top: 50%; left: 50%;
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,0,0,0.3);
    border: 2px solid #FF0000;
    transform: translate(-50%, -50%);
  }
  #enter-overlay {
    position: absolute; inset: 0; z-index: 100;
    background: radial-gradient(ellipse at center, #1a0a0a 0%, #0a0a0e 70%);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #FF0000;
  }
  #enter-overlay h1 {
    font-size: 32px; letter-spacing: 8px; margin-bottom: 8px;
    text-shadow: 0 0 20px #FF0000;
  }
  #enter-overlay p { color: #666; font-size: 13px; margin-bottom: 32px; letter-spacing: 2px; }
  #enter-btn {
    padding: 16px 48px; font-size: 18px; font-family: monospace;
    background: transparent; color: #FF0000;
    border: 2px solid #FF0000; border-radius: 4px;
    cursor: pointer; letter-spacing: 4px;
    transition: all 0.2s;
  }
  #enter-btn:hover { background: #FF0000; color: #000; box-shadow: 0 0 30px #FF0000; }
  #enter-overlay.hidden { display: none; }
  #toolbar {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%); z-index: 40;
    display: flex; flex-direction: column; gap: 10px;
  }
  .tool-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(10,10,14,0.8);
    border: 2px solid #FF0000; color: #FF0000;
    font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-family: monospace; transition: all 0.2s;
  }
  .tool-btn:active { background: #FF0000; color: #000; }
</style>
</head>
<body>
<div id="scene-container"></div>
<div id="hud">
  <div>✦ SOLIDIVISM</div>
  <div class="sub">THE FOUNDATION — SOLID & VISIBLE</div>
</div>
<div id="joystick"><div id="joystick-knob"></div></div>
<div id="toolbar">
  <button class="tool-btn" id="btn-cam" title="Reset camera">📷</button>
  <button class="tool-btn" id="btn-ctrl" title="Go to control room">🎛️</button>
  <button class="tool-btn" id="btn-help" title="Help">?</button>
</div>
<div id="enter-overlay">
  <h1>SOLIDIVISM</h1>
  <p>THE MOST IMPRESSIVE KIND</p>
  <button id="enter-btn">▶ ENTER</