<!-- RUBY-BACKUP · part 363 -->
++){
      var ring = new THREE.Mesh(new THREE.TorusGeometry(0.52, 0.06, 8, 16), goldMat);
      ring.position.y = 1.2 + r*1.4;
      ring.rotation.x = Math.PI/2;
      ring.name = 'pylon-ring';
      g.add(ring);
    }
    /* capital */
    var cap = new THREE.Mesh(new THREE.BoxGeometry(1.4, 0.35, 1.4), goldMat);
    cap.position.y = 5.05;
    cap.name = 'pylon-capital';
    g.add(cap);
    g.position.set(-24, 0, -20);
    if(typeof scene!=='undefined') scene.add(g);
    window._pylon = g;
    g.userData.isPrimitive = true;
    var sceneRef = (typeof scene!=='undefined') ? scene : null;
    pushCommand({
      name: 'build pylon',
      execute: function(){ if(sceneRef) sceneRef.add(g); },
      undo: function(){ if(sceneRef) sceneRef.remove(g); }
    });
    codeStatus('refined pylon — real');
  }catch(e){ codeStatus('pylon failed'); }
}
function buildHollowTetra(){
  try{
    var g = new THREE.Group();
    var mat = new THREE.MeshStandardMaterial({color:0x2a2a2a, roughness:0.5, metalness:0.4, side:THREE.DoubleSide});
    /* wall depth (Playa 2.0 spec) — adjustable */
    var wallDepth = (typeof window._tetraWallDepth!=='undefined') ? window._tetraWallDepth : 0.13;
    /* tetrahedron — hollow with wall depth */
    var geo = new THREE.TetrahedronGeometry(1.8);
    // outer shell
    var outer = new THREE.Mesh(geo, mat);
    outer.name = 'tetra-outer';
    g.add(outer);
    // inner hollow (scaled by wall depth)
    var innerScale = 1 - (wallDepth / 1.8);
    var inner = new THREE.Mesh(
      new THREE.TetrahedronGeometry(1.8 * innerScale),
      new THREE.MeshStandardMaterial({color:0x111111, roughness:0.9, side:THREE.BackSide})
    );
    inner.name = 'tetra-inner';
    g.add(inner);
    /* edges */
    var edges = new THREE.EdgesGeometry(geo);
    var lines = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({color:0xffd700}));
    lines.name = 'tetra-edges';
    g.add(lines);
    /* wall-depth control */
    window._setTetraWallDepth = function(d){
      window._tetraWallDepth = Math.max(0.05, Math.min(0.5, d));
      if(typeof codeStatus==='function') codeStatus('tetra wall: '+window._tetraWallDepth.toFixed(2));
    };
    /* corner nodes */
    var pos = geo.attributes.position;
    var seen = {};
    for(var i=0; i<pos.count; i++){
      var k = pos.getX(i).toFixed(2)+','+pos.getY(i).toFixed(2)+','+pos.getZ(i).toFixed(2);
      if(!seen[k]){
        seen[k] = true;
        var node = new THREE.Mesh(new THREE.SphereGeometry(0.15, 10, 8), new THREE.MeshStandardMaterial({color:0xffd700, metalness:0.8, roughness:0.2}));
        node.position.set(pos.getX(i), pos.getY(i), pos.getZ(i));
        node.name = 'tetra-node';
        g.add(node);
      }
    }
    g.position.set(-20, 2, -26);
    if(typeof scene!=='undefined') scene.add(g);
    window._hollowTetra = g;
    g.userData.isPrimitive = true;
    var sceneRef = (typeof scene!=='undefined') ? scene : null;
    pushCommand({
      name: 'build hollow tetra',
      execute: function(){ if(sceneRef) sceneRef.add(g); },
      undo: function(){ if(sceneRef) sceneRef.remove(g); }
    });
    codeStatus('hollow tetra — real');
  }catch(e){ codeStatus('tetra failed'); }
}
function buildLayeredPyramid(){
  try{
    var g = new THREE.Group();
    var mat = new THREE.MeshStandardMaterial({color:0x9a9a9a, roughness:0.7});
    var goldMat = new THREE.MeshStandardMaterial({color:0xffd700, metalness:0.8, roughness:0.2});
    /* TRUE 0.13 SLICES (Playa 2.0 spec) — each layer exactly 0.13 */
    var SLICE = 0.13;
    var size = 3.0;
    var numLayers = 12;
    for(var l=0; l<numLayers; l++){
      var isTop = (l === numLayers-1);
      var layer = new THREE.Mesh(new THREE.BoxGeometry(size, SLICE, size), isTop ? goldMat : mat);
      layer.position.y = (SLICE/2) + l*SLICE;
      layer.name = 'pyramid-slice-' + l;
      g.add(layer);
      size -= 0.24;
      if(size < SLICE) size = SLICE;
    }
    g.position.set(-26, 0, -26);
    if(typeof scene!=='undefined') scene.add(g);
    window._layeredPyramid = g;
    g.userData.isPrimitive = true;
    var sceneRef = (typeof scene!=='undefined') ? scene : null;
    pushCommand({
      name: 'build layered pyramid',
      execute: function(){ if(sceneRef) sceneRef.add(g); },
      undo: function(){ if(sceneRef) sceneRef.remove(g); }
    });
    codeStatus('layered pyramid — real');
  }catch(e){ codeStatus('pyramid failed'); }
}
function placeProvoltaInCity(){
  try{
    if(typeof PROVOLTA_MODEL==='undefined' || !PROVOLTA_MODEL) return;
    var cc = getCityCenter();
    PROVOLTA_MODEL.position.set(cc.x + 2, 0, cc.z + 2);
    try{
      var site = getLandingSite();
      PROVOLTA_MODEL.lookAt(site.x, 0, site.z);
    }catch(e){}
    /* she waits — she does not advance. You must engage. */
  }catch(e){}
}
setTimeout(function(){
  try{
    buildCity();
    if(typeof getProvoltaModel==='function'){
      getProvoltaModel(function(){ placeProvoltaInCity(); });
    }
  }catch(e){}
}, 6000);
/* 