<!-- SOLID CITY · part 2532 -->
');
      c2.fillStyle = '#23272e'; c2.fillRect(0, 0, 1024, 224);
      c2.strokeStyle = '#c9a44a'; c2.lineWidth = 6; c2.strokeRect(12, 12, 1000, 200);
      c2.fillStyle = '#e8c86a'; c2.textAlign = 'center'; c2.textBaseline = 'middle';
      c2.font = 'bold 148px Georgia, serif';
      c2.fillText('SOLID', 512, 118);
      var tex = new T.CanvasTexture(cv);
      [1, -1].forEach(function (sgn) {
        var m = new T.Mesh(new T.PlaneGeometry(3.4, 0.74), new T.MeshBasicMaterial({ map: tex, side: T.DoubleSide }));
        m.position.set(cx + s.fx * sgn * 3.53, TOP - 0.55, cz + s.fz * sgn * 3.53);
        m.rotation.y = sgn > 0 ? ry : ry + Math.PI;
        extras.push(m);
      });
    } catch (e) {}
  }
  buildRoads();
  compound(700, -1290, "THE GATE ROAD 'OHANA", 'plantation', ['waa', 'noa', 'plantation']);
  compound(880, -1180, "THE EAST PLAIN 'OHANA", 'plantation', ['dickey', 'waa', 'noa']);
  compound(-480, -1150, "THE SHORE ROAD 'OHANA", 'dickey', ['noa', 'plantation', 'waa']);
  singles(560, -1330, 'THE MERIDIAN BENCHES', 6, ['plantation', 'noa', 'waa', 'dickey']);
  compound(1080, -1620, 'THE EASTERN BENCHES', 'dickey', ['plantation', 'waa', 'mission'], { ring: 33 });
  singles(1270, -1560, 'THE HIGH BENCHES', 6, ['dickey', 'plantation', 'noa']);
  singles(950, -1830, 'THE OVERLOOK BENCHES', 4, ['waa', 'dickey', 'plantation']);
  singles(790, -1900, 'THE EAST CLIMB HOMES', 4, ['plantation', 'waa', 'noa']);
  compound(660, -2080, 'THE NORTH BENCHES', 'plantation', ['waa', 'plantation', 'noa']);
  singles(430, -2330, 'THE COLOSSEUM ROAD HOMES', 7, ['plantation', 'dickey', 'noa', 'waa']);
  compound(470, -2430, "THE FAR NORTH 'OHANA", 'noa', ['waa', 'plantation', 'noa']);
  singles(-350, -1080, 'THE WESTERN BENCHES', 5, ['noa', 'plantation', 'waa'], 100);
  // the base flats — two small apartment blocks where the ground gentles
  var aptSites = [[705, -1005, -Math.PI / 2], [-625, -1155, Math.PI / 2], [820, -1120, -Math.PI / 2]];
  for (var ai = 0; ai < aptSites.length && homes.filter(function (h) { return h.style === 'apartment'; }).length < 2; ai++) {
    var as = aptSites[ai];
    if (benchAt(as[0], as[1], 16) >= 0 && clearOf(as[0], as[1], 20) && roadClear(as[0], as[1], 16)) {
      var arec = buildApartment(as[0], as[1], as[2]);
      placed.push([as[0], as[1], 26]);
      serveApartment(arec);
      dressHome({ x: as[0], z: as[1], ry: as[2], w: 27, d: 11, lanaiDepth: 0 }, { palm: true });
    }
  }
  var treeCount = scatterTrees(130);
  buildPlates();
  /* THE RAILS STAND DOWN (the King's word, 2026-10-14 ~00:57):
   * collision on the roads, banks and slopes — but NOT the rails.
   * railBodies() stands uncalled below as the record of the era
   * when the rails were felt; a car on a hairpin brushed them
   * (the body gate's worst push, 0.74 m, was a rail). The rails
   * are seen now, not felt. */
  roadBodies();
  buildSolidBridge();

  /* ================= ASSEMBLY ================= */
  var group = new T.Group();
  group.add(solid.build(new T.MeshLambertMaterial({ vertexColors: true })));
  group.add(glassB.build(new T.MeshLambertMaterial({ vertexColors: true, transparent: true, opacity: 0.55 })));
  group.add(glowB.build(new T.MeshBasicMaterial({ vertexColors: true })));
  extras.forEach(function (m) { group.add(m); });

  var houseCount = 0, unitCount = 0;
  homes.forEach(function (h) { if (h.style === 'apartment') unitCount += (h.units || 6); else houseCount++; });
  function standYAt(x, z) {
    var best = -Infinity;
    for (var i = 0; i < standRects.length; i++) {
      var r = standRects[i], dx = x - r.cx, dz = z - r.cz;
      var lx = dx * r.cos - dz * r.sin, lz = dx * r.sin + dz * r.cos;
      if (Math.abs(lx - r.lx) <= r.hw && Math.abs(lz - r.lz) <= r.hd && r.y > best) best = r.y;
    }
    return best;
  }
  group.userData = {
    footprint: foot,
    standRects: standRects,
    standTris: standTris,
    homes: homes,
    counts: { houses: houseCount, apartmentUnits: unitCount, dwellings: houseCount + unitCount, trees: treeCount, styles: STYLE_COUNT },
    center: { x: 300, z: -1500 },
    standYAt: standYAt,
    update: null
  };
  return group;
}


===== FILE: public/city/mountain-homes.js.bak-atan2-20261013 =====
/* SOLID CITY — NĀ HALE O NĀ KŪPUNA: THE ANCESTORS' HOMES (2026-10-12, by order of the King)
 * "We need to build homes for hawaiians." — homes woven into the green coastal
 * benches around THE ANCESTRAL ROADS (0,-1600), on the ancestors' own land:
 * 'ohana compounds (a main hale, a kupuna hale, a keiki hale around a shared yard),
 * plantation homes, Dickey-roof residences, traditional hale, small apartment
 * blocks at the base — following the verified historic style guide (hale →
 * plantation → Dickey → mission).
 *
 * Design sources (the King's method): three AI reference images (compound / plantation
 * home / mountainside pattern) + his real Hilo ground photos (steep roofs, A-frame gables,
 * earth-tone stucco, lawn-and-path lay