<!-- SOLID CITY · part 2824 -->
2, len = Math.sqrt(dx * dx + dy * dy + dz * dz) || 1;
    arr.push({ x: bx2, y: by2, z: bz2, dx: dx / len, dy: dy / len, dz: dz / len, len: len, s: 1 });
  }
  leafs.forEach(function (p) {
    var bx = Math.cos(p.ry) * 0.42 * p.s, bz = -Math.sin(p.ry) * 0.42 * p.s;
    var hx = p.x + bx, hz = p.z + bz, hy = p.y + 5.9 * p.s;
    leafCanopies.push({ x: hx, z: hz, y: hy, s: p.s, ry: p.ry });
    leafSpawns.push({ x: hx, y: hy, z: hz });
    /* TRUE BRANCHES (the Algorithmic Beauty of Plants:
     * the crown is HELD UP by wood — limbs leave the trunk
     * below its bend-top and reach INTO the lobes they
     * carry, so leaf and limb tell one story) */
    var baseX = p.x + bx * 0.87, baseY = p.y + 4.3 * p.s, baseZ = p.z + bz * 0.87;
    branchTo(branches, baseX, baseY, baseZ, hx, hy - 0.5 * p.s, hz); branches[branches.length - 1].s = p.s;
    var nl = 3 + Math.floor(R() * 2);
    for (var li = 0; li < nl; li++) {
      var la2 = R() * Math.PI * 2, lr = (0.45 + R() * 0.4) * 2.6 * p.s;
      var sx = hx + Math.cos(la2) * lr, sz = hz + Math.sin(la2) * lr, sy = hy + (R() - 0.62) * 1.5 * p.s;
      leafCanopies.push({ x: sx, z: sz, y: sy, s: p.s * (0.42 + R() * 0.2), ry: R() * 6.28 });
      if (li < 2) { branchTo(branches, baseX, baseY - 0.3 * p.s, baseZ, sx, sy - 0.3 * p.s, sz); branches[branches.length - 1].s = p.s; }
    }
  });
  counts.branches = branches.length;
  var branchGeo = new T.CylinderGeometry(0.055, 0.12, 1, 5); branchGeo.translate(0, 0.5, 0);
  instanced('leaf-branches', branchGeo, trunkMat, branches,
    function (d, p) { DV.set(p.dx, p.dy, p.dz); d.quaternion.setFromUnitVectors(UPV, DV); d.position.set(p.x, p.y, p.z); d.scale.set(p.s, p.len, p.s); }, null);
  instanced('leaf-canopies', leafCanGeo, lambert(0xffffff, { flatShading: true }), leafCanopies,
    function (d, p) { d.position.set(p.x, p.y, p.z); d.rotation.set(0, p.ry, 0); d.scale.set(p.s, p.s * 0.74, p.s); },
    function (c) { greens(c, 0.19, 0.13); });

  /* ——— PINES ———
   * Reason: high conifers run 20–40 m in life with the
   * crown starting a third up; at world scale ours stack
   * two cones over a 3.6 m trunk to ~11–13 m of spire. */
  var pineTrunkGeo = new T.CylinderGeometry(0.16, 0.28, 3.6, 7); pineTrunkGeo.translate(0, 1.8, 0); bendGeo(pineTrunkGeo, 0.2, 3.6);
  var pineConeGeo = new T.ConeGeometry(2.0, 5.4, 8); pineConeGeo.translate(0, 2.7, 0); fbmDisplace(pineConeGeo, 0.8, 0.10, 8.4, 1);
  var pines = scatter(hiTier ? 120 : 65, function (x, z, h) { if (h < 40 || h > 330 || slope(x, z, h) > 0.75) return null; return { x: x, z: z, y: h, ry: R() * 6.28, s: 0.9 + R() * 0.6 }; });
  counts.pines = pines.length; note('pines', pines);
  instanced('pine-trunks', pineTrunkGeo, trunkMat, pines,
    function (d, p) { d.position.set(p.x, p.y - 0.1, p.z); d.rotation.set(0, p.ry, 0); d.scale.setScalar(p.s); }, null);
  var pineMat = lambert(0xffffff, { flatShading: true });
  instanced('pine-cones-1', pineConeGeo, pineMat, pines,
    function (d, p) { var t1 = 3.1 / 3.6; d.position.set(p.x + Math.cos(p.ry) * 0.2 * t1 * t1 * p.s, p.y + 3.1 * p.s, p.z - Math.sin(p.ry) * 0.2 * t1 * t1 * p.s); d.rotation.set(0, p.ry, 0); d.scale.setScalar(p.s); },
    function (c) { greens(c, 0.10, 0.07); });
  instanced('pine-cones-2', pineConeGeo, pineMat, pines,
    function (d, p) { d.position.set(p.x + Math.cos(p.ry) * 0.2 * p.s, p.y + 6.6 * p.s, p.z - Math.sin(p.ry) * 0.2 * p.s); d.rotation.set(0, p.ry + 0.4, 0); d.scale.setScalar(p.s * 0.60); },
    function (c) { greens(c, 0.10, 0.07); });

  /* ——— THE MONKEY PODS: umbrella crowns on short giants ——— */
  var podTrunkGeo = new T.CylinderGeometry(1.05, 1.45, 5.2, 9); podTrunkGeo.translate(0, 2.6, 0); bendGeo(podTrunkGeo, 0.5, 5.2);
  var podCanGeo = new T.IcosahedronGeometry(1, 1); fbmDisplace(podCanGeo, 0.85, 0.17, 5.3, 1);
  var pods = scatterGiants(hiTier ? 14 : 8, 80, function (x, z, h) { if (h < 3 || h > 120 || slope(x, z, h) > 0.5) return null; return { x: x, z: z, y: h, ry: R() * 6.28, cr: 10 + R() * 4.5 }; });
  counts.pods = pods.length; note('pods', pods, 14);
  pods.forEach(function (p) { leafSpawns.push({ x: p.x, y: p.y + 7.2, z: p.z }); });
  instanced('pod-trunks', podTrunkGeo, lambert(0x5d4630), pods,
    function (d, p) { d.position.set(p.x, p.y - 0.15, p.z); d.rotation.set(0, p.ry, 0); d.scale.setScalar(1); }, null);
  instanced('pod-canopies', podCanGeo, lambert(0xffffff, { flatShading: true }), pods,
    function (d, p) { d.position.set(p.x, p.y + 7.6, p.z); d.rotation.set(0, p.ry, 0); d.scale.set(p.cr, p.cr * 0.30, p.cr); },
    function (c) { greens(c, 0.20, 0.10); });
  instanced('pod-crowns', podCanGeo, lambert(0xffffff, { flatShading: true }), pods,
    function (d, p) { d.position.set(p.x, p.y + 9.3, p.z); d.rotation.set(0, p.ry + 2, 0); d.scale.set(p.cr * 0.6, p.cr * 0.22, p.cr * 0.6); },
    function (c) { greens(c, 0.23, 0.10); });
  /* the umbrella's underside, filled: a ring of lobes
   * hangs in the hollow beneath the great disc,