<!-- SAGA3 · part 38 -->
0, 3500, 2500, 3800);

    /* East — stretched */
    mountainChain(4500, 0, 2000, 500, 300);
    lake(4200, 300, 100);

    /* West — scenic valley */
    mountainChain(-4500, 500, 2500, -700, 380);
    lake(-4200, 200, 130);
    lake(-4000, 600, 90);
    river(-4200, 200, -4000, 600);

    /* Waterfalls — from mountains to lakes */
    function waterfall(x, y, z){
      var fall = new THREE.Mesh(new THREE.PlaneGeometry(15, 80),
        new THREE.MeshBasicMaterial({color: 0xaaddff, transparent: true, opacity: 0.6, side: THREE.DoubleSide}));
      fall.position.set(x, y - 40, z);
      scene.add(fall);
      window._dynamics.push(function(t){
        fall.material.opacity = 0.5 + Math.sin(t * 3) * 0.15;
      });
    }
    waterfall(-2000, 200, -3580);
    waterfall(2000, 220, 3580);

  }catch(e){}
}
if(typeof buildScenic === 'function'){ try{ buildScenic(); }catch(e){} }

/* TOPOGRAPHY WOVEN IN — real Earth shapes in the districts. 2026-10-04.
   Shield volcanoes (Hawaii), stratovolcanoes (Fuji), canyon layers, sea cliffs. */
function buildTopographyWoven(){
  try{
    var basaltMat = new THREE.MeshStandardMaterial({color: 0x2a2a2a, roughness: 0.95});
    var greenMat = new THREE.MeshStandardMaterial({color: 0x1a5a1a, roughness: 0.9});
    var sandstoneMat = new THREE.MeshStandardMaterial({color: 0xc4844a, roughness: 0.9});
    var limestoneMat = new THREE.MeshStandardMaterial({color: 0xd4c4a0, roughness: 0.85});
    var shaleMat = new THREE.MeshStandardMaterial({color: 0x8a7a6a, roughness: 0.95});

    /* SHIELD VOLCANO — broad dome, gentle slopes (Hawaii/Mauna Loa: 2-10 deg) */
    function shieldVolcano(x, z, r, h){
      var segments = 16;
      for(var i = 0; i < segments; i++){
        var t = i / segments;
        var rr = r * (1 - t);
        var yy = h * Math.pow(1 - t, 1.5); /* Gentle dome curve */
        var ring = new THREE.Mesh(new THREE.CylinderGeometry(rr, rr + r/segments, h/segments, 24), basaltMat);
        ring.position.set(x, yy, z);
        scene.add(ring);
      }
      /* Caldera at summit */
      var caldera = new THREE.Mesh(new THREE.CylinderGeometry(r*0.15, r*0.2, 10, 16), basaltMat);
      caldera.position.set(x, h, z);
      scene.add(caldera);
      /* Vegetation zones — green at base, bare at top */
      for(var v = 0; v < 20; v++){
        var vt = Math.random() * 0.6; /* Only lower 60% */
        var vr = r * (1 - vt) * 0.9;
        var va = Math.random() * Math.PI * 2;
        var vx = x + Math.cos(va) * vr;
        var vz = z + Math.sin(va) * vr;
        var vy = h * Math.pow(1 - vt, 1.5);
        var tree = new THREE.Mesh(new THREE.ConeGeometry(3, 8, 6), greenMat);
        tree.position.set(vx, vy + 4, vz);
        scene.add(tree);
      }
    }

    /* STRATOVOLCANO — concave cone, steep at top (Fuji: 35-40 deg summit) */
    function stratovolcano(x, z, r, h){
      var pts = [];
      var segs = 20;
      for(var i = 0; i <= segs; i++){
        var t = i / segs;
        /* Concave profile: steep at top, flat at base */
        var pr = r * Math.pow(1 - t, 1.8);
        var py = h * t;
        pts.push(new THREE.Vector2(Math.max(pr, 0.1), py));
      }
      var geo = new THREE.LatheGeometry(pts, 24);
      var mtn = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({color: 0x4a4a4a, roughness: 0.9}));
      mtn.position.set(x, 0.13, z);
      scene.add(mtn);
      /* Snow cap */
      var cap = new THREE.Mesh(new THREE.ConeGeometry(r*0.25, h*0.25, 16),
        new THREE.MeshStandardMaterial({color: 0xffffff, roughness: 0.3}));
      cap.position.set(x, h - h*0.12, z);
      scene.add(cap);
      /* Radial gullies */
      for(var g = 0; g < 8; g++){
        var ga = (g / 8) * Math.PI * 2;
        var gully = new THREE.Mesh(new THREE.BoxGeometry(4, h*0.6, 8), basaltMat);
        gully.position.set(x + Math.cos(ga)*r*0.5, h*0.3, z + Math.sin(ga)*r*0.5);
        gully.rotation.y = -ga;
        gully.rotation.z = 0.3;
        scene.add(gully);
      }
    }

    /* CANYON LAYERS — wedding cake cliffs (Grand Canyon) */
    function canyonLayers(x, z, w, h){
      var layers = [
        {mat: limestoneMat, h: h*0.2},  /* Kaibab Limestone — cliff */
        {mat: shaleMat, h: h*0.15},     /* Shale — slope */
        {mat: sandstoneMat, h: h*0.25}, /* Coconino — cliff */
        {mat: shaleMat, h: h*0.15},     /* Shale — slope */
        {mat: new THREE.MeshStandardMaterial({color: 0xa03a2a}), h: h*0.25} /* Redwall — cliff */
      ];
      var yy = 0.13;
      var ww = w;
      for(var l = 0; l < layers.length; l++){
        var lh = layers[l].h;
        /* Cliff layers: vertical, narrower. Slope layers: wider, gentler */
        var isCliff = (l % 2 === 0);
        var layer = new THREE.Mesh(new THREE.BoxGeometry(ww, lh, ww*0.6), layers[l].mat);
        layer.position.set(x, yy + lh/2, z);
        scene.add(layer);
        yy += lh;
        if(isCliff) ww *= 0.85; /* Cliffs step inward */
        else ww *= 1.1; /* Slopes spread outward */
    