<!-- SOLID CITY · part 3619 -->
 3.4 - 1.2, ty + 4.4, lz - 4.6); root.add(pr);
    }
    var rail = new T.Mesh(new T.BoxGeometry(16, 0.25, 0.25), woodDarkMat);
    rail.position.set(lx - 1.2, ty + 5.6, lz - 4.6); root.add(rail);
    // support poles down the slope
    [[-6, -3], [6, -3], [-6, 3], [6, 3]].forEach(function (p) {
      var pole = new T.Mesh(new T.CylinderGeometry(0.35, 0.35, 9, 6), woodDarkMat);
      pole.position.set(lx + p[0], ty - 1.5, lz + p[1]); root.add(pole);
    });
    // a small warm lantern on the rail
    var lant = new T.Mesh(new T.SphereGeometry(0.5, 8, 6), winMat);
    lant.position.set(lx - 1.2, ty + 6.3, lz - 4.6); root.add(lant);
    foot.push([lx, lz, 16, 10, ty, ty + 3.2, 0]);
  })();

  // ---------- GIANT TREES — the King's wish: 25-40 m ancients ----------
  // Two kinds: tall kine-pine (layered cones) and broad ohia (sphere canopy).
  // Seeded scatter, clustered, never in a grid, kept off terraces and road.
  var trees = [];
  function pineTree(x, z, ty, h) {
    var g = new T.Group();
    var trunkH = h * 0.32, trunkR = 1.1 + h * 0.022;
    var trunk = new T.Mesh(new T.CylinderGeometry(trunkR * 0.75, trunkR, trunkH, 8), trunkMat);
    trunk.position.y = trunkH / 2; g.add(trunk);
    var layers = 4, ch = h * 0.72, baseR = h * 0.20;
    for (var i = 0; i < layers; i++) {
      var lr = baseR * (1 - i / (layers + 0.6)), lh = ch / layers * 1.5;
      var cone = new T.Mesh(new T.ConeGeometry(lr, lh, 9), i % 2 ? leafDeepMat : leafMat);
      cone.position.y = trunkH + ch * (i + 0.7) / layers; g.add(cone);
    }
    g.position.set(x, ty, z);
    g.rotation.y = R() * Math.PI * 2;
    root.add(g); trees.push(g);
    foot.push([x, z, trunkR * 2.6, trunkR * 2.6, ty, ty + trunkH, 0]);
  }
  function ohiaTree(x, z, ty, h) {
    var g = new T.Group();
    var trunkH = h * 0.30, trunkR = 1.3 + h * 0.024;
    var trunk = new T.Mesh(new T.CylinderGeometry(trunkR * 0.7, trunkR, trunkH, 8), trunkMat);
    trunk.position.y = trunkH / 2; g.add(trunk);
    var n = 3, cr = h * 0.22;
    for (var i = 0; i < n; i++) {
      var s = new T.Mesh(new T.SphereGeometry(cr * (1 - i * 0.18), 10, 8), i % 2 ? leafMat : leafDeepMat);
      s.position.set((R() - 0.5) * cr * 0.9, trunkH + cr * 0.75 + i * cr * 0.55, (R() - 0.5) * cr * 0.9);
      s.scale.y = 0.82; g.add(s);
    }
    g.position.set(x, ty, z);
    root.add(g); trees.push(g);
    foot.push([x, z, trunkR * 2.6, trunkR * 2.6, ty, ty + trunkH, 0]);
  }
  // scatter: ring r=130..300 around village center, plus groves between terraces
  var placed = 0, guard = 0;
  function clearOf(x, z) {
    // keep off terraces (r 60 + margin) and the road corridor
    for (var i = 0; i < TER.length; i++) {
      if (Math.hypot(x - TER[i].x, z - TER[i].z) < TER[i].r + 14) return false;
    }
    return true;
  }
  while (placed < 96 && guard++ < 900) {
    var a = R() * Math.PI * 2, rr = 130 + R() * 170;
    var tx = Math.cos(a) * rr, tz = Math.sin(a) * rr;
    if (!clearOf(tx, tz)) continue;
    // the Bore's corridor: keep the tunnel's perfect line clear (bore tie-in, 2026-10-11)
    // nudges consume no RNG — the forest is otherwise exactly as the King saw it
    if (Math.abs(tx) < 18 && tz < -100 && tz > -340) tx += tx < 0 ? -16 : 16;
    // elders: first 10 are the truly massive ones
    var h = placed < 10 ? 37 + R() * 5 : 25 + R() * 12;
    var ty = -20 - R() * 30;  // trees root into the mountainside around the terraces
    if (R() < 0.55) pineTree(tx, tz, ty, h); else ohiaTree(tx, tz, ty, h);
    placed++;
  }
  // a few ancients standing close among the huts (edges only)
  [[-52, -40, -14], [52, 30, -14], [-55, 60, -30], [55, 120, -32]].forEach(function (p) {
    var h = 34 + R() * 6;
    if (R() < 0.5) pineTree(p[0], p[1], p[2], h); else ohiaTree(p[0], p[1], p[2], h);
  });

  // ---------- switchback road: climbs C → B → A ----------
  var roadMat = new T.MeshLambertMaterial({ color: 0x4a3f30 });
  function roadSeg(x1, z1, y1, x2, z2, y2, w) {
    w = w || 9;
    var len = Math.hypot(x2 - x1, z2 - z1);
    var len3 = Math.hypot(len, y2 - y1);                 // true length once the climb is in it
    var seg = new T.Mesh(new T.BoxGeometry(len3, 1.1, w), roadMat);
    seg.position.set((x1 + x2) / 2, (y1 + y2) / 2 - 0.2, (z1 + z2) / 2);
    seg.rotation.y = -Math.atan2(z2 - z1, x2 - x1);
    // THE ONE ROAD (2026-10-12, the King's word: the roads become one, so
    // smooth): the pitch this function always computed and threw away is
    // now APPLIED — each segment leans into its climb, so both ends land
    // exactly on the heights they join. No more flat bridges floating over
    // the slope; the road itself carries the mountain's shape.
    var pitch = Math.atan2(y2 - y1, len);
    seg.rotateOnAxis(new T.Vector3(0, 0, 1), pitch);
    root.add(seg);
  }
  // road path: enters low from the south, switchbacks up
  var P1 = [0, 150, -36], P2 = [-44, 120, -36], P3 = [-44, 40, -27],
      P4 = [40, 40, -27], P5 = [40, -40, -9], P6 = [-36, -40, -9]