<!-- SAGA-SOLID · part 88 -->
ndow._targets.push(mountainMesh);
  }
  mountainMesh.userData.isSolidTerrain = true;
  if(!window._mountains.includes(mountainMesh)) window._mountains.push(mountainMesh);
}
/* Apply to all existing mountains */
/* DISABLED 2026-10-07 — stale mountain clear, King's word: traverse misclassified city geometry as mountains, trapping the King */
setTimeout(function(){
  return;
  scene.traverse(function(obj){
    if(obj.isMesh && obj.geometry){
      var t = obj.geometry.type;
      if(t === 'ConeGeometry' || t === 'CylinderGeometry' || t === 'SphereGeometry'){
        obj.geometry.computeBoundingBox();
        var h = obj.geometry.boundingBox.max.y - obj.geometry.boundingBox.min.y;
        if(h > 25) solidifyTerrain(obj);
      }
    }
  });
  if(typeof say === 'function') say('Mountains are solid');
}, 10000);

/* ===== CARVE MOUNTAINS — Soul Print's code, King's order 2026-10-06 ===== */
function carveMountain(mesh){
  var geometry = mesh.geometry;
  var position = geometry.attributes.position;
  for(var i = 0; i < position.count; i++){
    var x = position.getX(i);
    var y = position.getY(i);
    var z = position.getZ(i);
    if(y > 0 && y < 50){
      var noise = Math.sin(x * 0.1) * Math.cos(z * 0.1) * 3.5;
      position.setX(i, x + noise);
      position.setZ(i, z + noise);
    }
  }
  geometry.computeVertexNormals();
  position.needsUpdate = true;
}
/* Apply to all cone mountains */
setTimeout(function(){
  return; /* DISABLED 2026-10-06 — moved to startup */
  scene.traverse(function(obj){
    if(obj.isMesh && obj.geometry && obj.geometry.type === 'ConeGeometry'){
      obj.geometry.computeBoundingBox();
      var h = obj.geometry.boundingBox.max.y - obj.geometry.boundingBox.min.y;
      if(h > 25){
        carveMountain(obj);
        solidifyTerrain(obj);
      }
    }
  });
  if(typeof say === 'function') say('Mountains carved');
}, 11000);

/* ===== ADVANCED MOUNTAIN CARVING — ridged multifractal + domain warp + erosion. King's order 2026-10-06 ===== */
function advancedCarve(mesh){
  var geo = mesh.geometry;
  var pos = geo.attributes.position;
  /* Simplex-like noise approximation */
  function noise2(x, z){
    return Math.sin(x * 12.9898 + z * 78.233) * 43758.5453 % 1;
  }
  function smoothNoise(x, z){
    var xi = Math.floor(x), zi = Math.floor(z);
    var xf = x - xi, zf = z - zi;
    var u = xf*xf*(3-2*xf), v = zf*zf*(3-2*zf);
    var a = noise2(xi, zi), b = noise2(xi+1, zi);
    var cc = noise2(xi, zi+1), d = noise2(xi+1, zi+1);
    return a + (b-a)*u + (cc-a)*v + (a-b-cc+d)*u*v;
  }
  /* Ridged multifractal: 1 - |noise|, creates sharp ridges */
  function ridged(x, z, octaves){
    var sum = 0, amp = 0.5, freq = 1;
    for(var o = 0; o < octaves; o++){
      var n = smoothNoise(x * freq, z * freq);
      n = 1 - Math.abs(n * 2 - 1); /* Ridge */
      n = n * n; /* Sharpen */
      sum += n * amp;
      amp *= 0.5; freq *= 2.1;
    }
    return sum;
  }
  for(var i = 0; i < pos.count; i++){
    var x = pos.getX(i), y = pos.getY(i), z = pos.getZ(i);
    /* Domain warping: perturb coordinates with noise to break grid */
    var wx = x + ridged(x * 0.02, z * 0.02, 3) * 20;
    var wz = z + ridged(x * 0.02 + 100, z * 0.02, 3) * 20;
    /* Ridged multifractal for mountain detail */
    var r = ridged(wx * 0.05, wz * 0.05, 4);
    /* Height factor: more displacement mid-slope */
    geo.computeBoundingBox();
    var h = geo.boundingBox.max.y - geo.boundingBox.min.y;
    var hNorm = (y - geo.boundingBox.min.y) / (h || 1);
    var hFactor = Math.sin(hNorm * Math.PI); /* 0 at base/top, 1 in middle */
    var disp = (r - 0.5) * 15 * hFactor;
    /* Radial displacement */
    var len = Math.sqrt(x*x + z*z);
    if(len > 0.01){
      var s = 1 + disp / len;
      pos.setX(i, x * s);
      pos.setZ(i, z * s);
    }
    /* Vertical: carve valleys where ridged noise is low */
    var valley = (0.5 - r) * 8 * hFactor;
    pos.setY(i, y - Math.max(0, valley));
  }
  geo.computeVertexNormals();
  pos.needsUpdate = true;
}
/* Apply advanced carve to all mountains */
setTimeout(function(){
  return; /* DISABLED 2026-10-06 — broke valleys */
  var count = 0;
  scene.traverse(function(obj){
    if(obj.isMesh && obj.geometry && obj.geometry.type === 'ConeGeometry'){
      obj.geometry.computeBoundingBox();
      var h = obj.geometry.boundingBox.max.y - obj.geometry.boundingBox.min.y;
      if(h > 25){
        advancedCarve(obj);
        count++;
      }
    }
  });
  if(typeof say === 'function') say('Advanced carve: ' + count + ' mountains');
}, 12000);

/* ===== RAISE CITY UPON MOUNTAINS — King's order 2026-10-06 ===== */
setTimeout(function raiseCity(){
  return; /* DISABLED 2026-10-06 — valleys first */
  var cityX = 100, cityZ = -100, cityR = 300;
  var liftHeight = 120; /* Raise to mountain level */
  var raised = 0;
  scene.traverse(function(obj){
    if(obj.isMesh){
      var dx = obj.position.x - cityX;
      var dz = obj.position.z - cityZ;
      var dist = Math.sqrt(dx*