<!-- RUBY-BACKUP · part 296 -->
200]], 14);
    // a scenic loop — big
    curvedRoad([[60,60], [120,110], [200,100], [280,150], [220,220], [140,200], [80,240]], 14);
    /* CIVIL ENGINEERING — proper cross-section */
    // Add to each road: crowned surface, shoulders, drainage, guardrails
    (function(){
      var shoulderMat = new THREE.MeshStandardMaterial({color:0x5a5a5a, roughness:0.95});
      var drainMat = new THREE.MeshStandardMaterial({color:0x2a2a2a, roughness:1.0});
      var railMat = new THREE.MeshStandardMaterial({color:0xcccccc, metalness:0.7, roughness:0.4});
      var wallMat = new THREE.MeshStandardMaterial({color:0x6a6a6a, roughness:0.85});
      g.children.forEach(function(child){
        if(child.name==='street-curve'){
          // guardrails on both edges
          [-1,1].forEach(function(side){
            var railGeo = new THREE.TubeGeometry(
              child.geometry.parameters.path,
              32, 0.15, 6, false
            );
            // offset to the side (approximate)
            var rail = new THREE.Mesh(railGeo, railMat);
            rail.position.y = 1.2;
            rail.position.x = side * 7;
            rail.name = 'guardrail';
            // match the road elevation
            rail.position.y += 10;
            g.add(rail);
            // posts every ~20 units
            for(var d=0; d<1; d+=0.05){
              var pt = child.geometry.parameters.path.getPoint(d);
              var post = new THREE.Mesh(new THREE.BoxGeometry(0.3, 1.2, 0.3), railMat);
              post.position.set(pt.x + side*7, pt.y+0.6, pt.z);
              post.name = 'rail-post';
              g.add(post);
            }
          });
        }
      });
      // retaining walls where highways cut through terrain
      // (placed at intervals along each highway)
      if(typeof _highwayPts!=='undefined'){
        _highwayPts.forEach(function(pts){
          for(var i=2; i<pts.length-1; i+=3){
            var wx=pts[i][0], wz=pts[i][1];
            var th = (typeof getTerrainH==='function') ? getTerrainH(wx, wz) : 0;
            var rh = 10 + Math.sin(Math.sqrt(wx*wx+wz*wz)*0.02)*4; // road height
            var cut = rh - th;
            if(cut > 6){
              // retaining wall needed
              [-1,1].forEach(function(s){
                var wall = new THREE.Mesh(new THREE.BoxGeometry(2, cut, 30), wallMat);
                wall.position.set(wx+s*9, th+cut/2, wz);
                wall.rotation.y = Math.atan2(pts[i+1][0]-pts[i-1][0], pts[i+1][1]-pts[i-1][1]);
                wall.name = 'retaining-wall';
                g.add(wall);
              });
            }
          }
        });
      }
      // drainage culverts under highways at low points
      for(var ci=0; ci<7; ci++){
        var ang = ci/7*Math.PI*2;
        var dx = Math.cos(ang)*150, dz = Math.sin(ang)*150;
        var culvert = new THREE.Mesh(new THREE.CylinderGeometry(1, 1, 20, 8), drainMat);
        culvert.position.set(dx, 2, dz);
        culvert.rotation.z = Math.PI/2;
        culvert.rotation.y = ang;
        culvert.name = 'culvert';
        g.add(culvert);
      }
    })();
    // support pillars — 5 large blocks stacked under the highways
    var pillarMat = new THREE.MeshStandardMaterial({color:0x3a3a3a, roughness:0.8});
    var _hpts = [[100,10],[300,25],[500,35],[700,50],[900,55],[1100,65],[-100,-30],[-300,-40],[-500,-45],[-700,-55],[-900,-50],[-30,200],[-25,400],[-40,600],[-60,800],[30,220],[30,420],[50,600],[70,1000],[-200,-30],[-400,-20],[-600,-40],[-800,-60],[30,-200],[20,-400],[40,-600],[60,-1000]];
    _hpts.forEach(function(pt){
      for(var b=0; b<5; b++){
        var pillar = new THREE.Mesh(new THREE.BoxGeometry(3, 2, 3), pillarMat);
        pillar.position.set(pt[0], 1 + b*2, pt[1]);
        pillar.name = 'highway-pillar';
        g.add(pillar);
      }
    });
    /* GOLDEN RATIO LATTICE — ring roads at φ intervals */
    (function(){
      var PHI = 1.618033988749895;
      var maxR = 1200;
      var radii = [];
      var r = maxR;
      while(r > 80){
        radii.push(r);
        r = r / PHI;
      }
      // radii: 1200, 741, 458, 283, 175, 108
      var ringMat = new THREE.MeshStandardMaterial({color:0x2a2a2a, roughness:0.9});
      var ringLineMat = new THREE.MeshStandardMaterial({color:0xffd700, emissive:0xffd700, emissiveIntensity:0.5});
      radii.forEach(function(rad, ri){
        // golden ring — circle at this radius, following terrain elevation
        var pts = [];
        var segs = 64;
        for(var s=0; s<=segs; s++){
          var a = (s/segs)*Math.PI*2;
          var wx = Math.cos(a)*rad, wz = Math.sin(a)*rad;
          var wh = (10 + Math.sin(rad*0.02)*4 + Math.sin(rad*0.05+1.3)*2) * 10;
          pts.push(new THREE.Vector3(wx, wh, wz));
        }
        var curve = new THREE.CatmullRomCurve3(pts, true);
        var width = 12 - ri; // inner rings slightly narrower (φ proportion)
        var geo = new THREE.TubeGeometry(curve, 96, width/2, 8, true);
        geo.