<!-- SOLIDIVISM-STAGING · part 21 -->

  <h1>SOLIDIVISM</h1>
  <p>THE MOST IMPRESSIVE KIND</p>
  <button id="enter-btn">▶ ENTER</button>
</div>
<script>
window.solidivismErrors = [];
window.onerror = function(msg, url, line, col, err) {
  var d = document.createElement('div');
  d.id = 'global-error';
  d.style.cssText = 'position:fixed;bottom:10px;left:10px;background:#ff0000;color:#fff;padding:20px;z-index:99999;font-family:monospace;max-width:80%;';
  d.textContent = 'GLOBAL_ERROR: ' + msg + ' | URL: ' + url + ' | LINE: ' + line + ' | COL: ' + col;
  document.body.appendChild(d);
  window.solidivismErrors.push({msg: msg, url: url, line: line});
};
window.addEventListener('unhandledrejection', function(e) {
  var d = document.createElement('div');
  d.style.cssText = 'position:fixed;bottom:100px;left:10px;background:#ff6600;color:#fff;padding:20px;z-index:99999;font-family:monospace;max-width:80%;';
  d.textContent = 'UNHANDLED_REJECTION: ' + (e.reason && e.reason.message || e.reason);
  document.body.appendChild(d);
});
</script>
<script src="/solidability/js/three.min.js"></script>
<script src="/solidivism-staging/foundation.js?v=20261009stage003"></script>
<script>
document.getElementById('enter-btn').onclick = () => {
  document.getElementById('enter-overlay').classList.add('hidden');
  Solidivism.init('scene-container');
  Solidivism.setupInput();
  
  // Epistemology: begin observation (staging only)
  if (Solidivism.epistemology) { Solidivism.epistemology.sync(); }
  
  // Build the world: 8 tactical fortifications in a circle
  // Each one is SOLID and VISIBLE — created together, together forever
  // Spread out so you can see past each building to the ones behind
  const names = ['HEART', 'GATE', 'FORGE', 'VAULT', 'SPIRE', 'BASTION', 'CITADEL', 'NEXUS'];
  for (let i = 0; i < 8; i++) {
    const angle = (i / 8) * Math.PI * 2;
    const radius = 45; // Wider spacing — see between buildings
    const bx = Math.cos(angle) * radius;
    const bz = Math.sin(angle) * radius;
    const size = 10 + (i % 3) * 3;
    const height = 12 + (i % 4) * 4;
    Solidivism.addBuilding(bx, bz, size, height, size, names[i]);
  }

  // Command tower — the tallest, in the distance ahead
  Solidivism.addBuilding(0, 70, 16, 30, 16, 'COMMAND');

  // Toolbar buttons
  document.getElementById('btn-cam').onclick = () => {
    const p = Solidivism.getPlayer();
    const c = Solidivism.getCamera();
    if (p && c) {
      c.position.set(p.position.x, p.position.y + 12, p.position.z + 25);
    }
  };
  document.getElementById('btn-ctrl').onclick = () => {
    const p = Solidivism.getPlayer();
    if (p) { p.position.set(-25, 0, 38); } // Outside control room door
  };
  document.getElementById('btn-help').onclick = () => {
    alert('SOLIDIVISM\n\nJoystick: move\n📷: reset camera\n🎛️: go to control room\nWalk through doors to enter buildings.');
  };

  // CONTROL ROOM — walled architecture with glass video screen inside
  // Walk through the door to see the video playing on the back wall
  Solidivism.createControlRoom(
    -25, 30,
    'https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4',
    'CONTROL'
  );
};
</script>
</body>
</html>


