<!-- SOLID CITY · part 2700 -->
ing < 11; ring++) {
      var rr = rad * ring / 10;
      for (var k = 0; k < 16; k++) {
        var a = (k / 16) * Math.PI * 2 + ring * 0.7 + R() * 0.3;
        var x = cx + Math.cos(a) * rr, z = cz + Math.sin(a) * rr;
        if (benchAt(x, z, lotR) >= 0 && clearOf(x, z, lotR + 4) && roadClear(x, z, lotR)) return [x, z];
      }
    }
    // the lattice fallback: where the polar search cannot see a
    // lawful pocket, walk the disc plainly before refusing the home.
    for (var gx = -rad; gx <= rad; gx += 6) for (var gz = -rad; gz <= rad; gz += 6) {
      if (gx * gx + gz * gz > rad * rad) continue;
      var x2 = cx + gx, z2 = cz + gz;
      if (benchAt(x2, z2, lotR) >= 0 && clearOf(x2, z2, lotR + 4) && roadClear(x2, z2, lotR)) return [x2, z2];
    }
    return null;
  }
  function faceAngle(x, z, tx, tz) { return Math.atan2(tx - x, tz - z); }
  function plantAt(x, z, fn) {
    BASE = M4(x, groundAt(x, z) - 0.15, z, R() * Math.PI * 2, 0, 0); PLANTBODY = true; fn(); PLANTBODY = false; BASE = new T.Matrix4();
  }
  /* THE BODY OF THE TREE (the King's finding, 2026-10-13 ~23:34:
   * "Why is collision not on for the road solid? I can walk through
   * it"). The city's own comment says everything visible is solid —
   * but the trees were drawn and never registered. A trunk planted
   * by plantAt or set by a home's dressing now registers its body:
   * a 0.9 m square from the ground to 2.4 m, where the wood is. The
   * canopy stays unbodies — a walker passes under a tree, never
   * through it. */
  function trunkBody() {
    if (!PLANTBODY || !BASE || !BASE.elements) return;
    var bx = BASE.elements[12], bz = BASE.elements[14], bgy = groundAt(bx, bz);
    foot.push([bx, bz, 0.9, 0.9, bgy - 0.2, bgy + 2.4, 0]);
  }

  // drive + parking + path for one home (the placement law: every house has a driveway)
  function serveHome(rec, roadPt) {
    var fx = Math.sin(rec.ry), fz = Math.cos(rec.ry);            // front dir
    var rx = Math.cos(rec.ry), rz = -Math.sin(rec.ry);           // right dir
    var frontL = rec.padCz + rec.padD / 2;
    var doorX = rec.x + fx * (frontL + 0.9), doorZ = rec.z + fz * (frontL + 0.9);
    // parking pad on the home's right-front side, at terrain height
    var pkX = rec.x + rx * (rec.padW / 2 + 3.6) + fx * (frontL - 3), pkZ = rec.z + rz * (rec.padW / 2 + 3.6) + fz * (frontL - 3);
    var pkY = groundAt(pkX, pkZ);
    BASE = M4(pkX, pkY + 0.06, pkZ, rec.ry, 0, 0);
    box(solid, 5.6, 0.16, 5.6, 0, 0, 0, C.path);
    standQuad(pkX, pkY + 0.06, pkZ, rec.ry, 0, 5.6, 5.6, 0.08);
    BASE = new T.Matrix4();
    if (R() < 0.55) { BASE = M4(pkX, pkY + 0.14, pkZ, rec.ry + (R() - 0.5) * 0.2, 0, 0); car(CAR_COLS[Math.floor(R() * CAR_COLS.length)]); BASE = new T.Matrix4(); }
    // driveway: parking pad -> nearest road (shared/short spurs are fine)
    if (roadPt.dist < 85) {
      // THE DRIVEWAY GRADE LAW: the nearest point of road is not
      // always a lawful target — a pad 3.4 m below a road's edge
      // and 3 m from it can only be reached by a paved wall.
      // Choose, among every station within reach, the gentlest
      // climb: rise over run, the pad's height against the
      // station's. The drive still ends at the road's own
      // surface (endY), on whichever road asks the least of it.
      var tgt = null, tScore = 1e12;
      for (var rn2 in smithRoads) { var ests = smithRoads[rn2].stations; for (var eq = 0; eq < ests.length; eq++) { var es = ests[eq], edx = es.x - pkX, edz = es.z - pkZ, edist = Math.sqrt(edx * edx + edz * edz); if (edist > 40) continue; var esc = Math.abs(es.y - (pkY + 0.06)) / Math.max(edist, 2.5); if (esc < tScore) { tScore = esc; tgt = es; } } }
      if (tgt) { steppedPath(pkX, pkZ, tgt.x, tgt.z, 3.4, C.drive, 3.6, tgt.y); driveMouths.push([tgt.x, tgt.z]); }
    }
    // walking path: parking pad -> front steps, lined with small yellow stones (the King's photos)
    steppedPath(pkX, pkZ, doorX, doorZ, 1.7, C.path, 2.6);
    var plen = Math.hypot(doorX - pkX, doorZ - pkZ), pn = Math.max(2, Math.floor(plen / 2.2));
    for (var i = 0; i <= pn; i++) {
      var t = i / pn, sx2 = pkX + (doorX - pkX) * t, sz2 = pkZ + (doorZ - pkZ) * t;
      var ox = -(doorZ - pkZ) / (plen || 1) * 1.25, oz = (doorX - pkX) / (plen || 1) * 1.25;
      BASE = M4(sx2 + ox, groundAt(sx2 + ox, sz2 + oz) + 0.02, sz2 + oz, 0, 0, 0);
      rock(solid, 0.3, 0, 0.1, 0, C.yellowStone);
      BASE = new T.Matrix4();
    }
    // a mailbox where the path meets the drive
    BASE = M4(pkX - rx * 2.2, groundAt(pkX - rx * 2.2, pkZ - rz * 2.2), pkZ - rz * 2.2, rec.ry, 0, 0);
    box(solid, 0.14, 1.05, 0.14, 0, 0.52, 0, C.woodDark);
    box(solid, 0.75, 0.4, 0.45, 0, 1.2, 0, R() < 0.5 ? 0x8a3030 : C.stoneDark);
    BASE = new T.Matrix4();
    rec.door = [doorX, doorZ]; rec.park = [pkX, pkZ];
  }
  var CAR_COLS = [0xb8bcc2, 0x7a2e2e, 0x2e4a6a, 0xd8d3c3, 0x3a3a3e, 0x6a7a4a];

  /* ================= CLUSTERS — homes for Hawaiian families ==========