<!-- SOLID CITY · part 2449 -->
   var toeLen = P.bodyLen * (sp.id === 'dodo' ? 0.22 : 0.30);
    for (var i = -1; i <= 1; i++) {
      var toe = mesh(BOX(), mat(sp.colors.legs), i * thick * 0.9, 0.004, toeLen / 2);
      toe.scale.set(thick * 0.55, 0.008, toeLen);
      toe.rotation.y = i * 0.38;
      foot.add(toe);
    }
    var back = mesh(BOX(), mat(sp.colors.legs), 0, 0.004, -toeLen * 0.22);
    back.scale.set(thick * 0.55, 0.008, toeLen * 0.45);
    foot.add(back);
    knee.add(foot); hip.add(knee);
    return { hip: hip, knee: knee, foot: foot };
  }

  function buildBirdModel(sp) {
    var P = sp.proportions, C = sp.colors;
    var group = new THREE.Group();
    var body = new THREE.Group();
    body.position.y = P.legLen;
    group.add(body);
    var joints = { body: body };

    // torso — scaled sphere, long axis forward (+Z)
    var torso = mesh(SPHERE(), mat(C.body), 0, P.bodyRad * 0.55, 0);
    torso.scale.set(P.bodyRad * 1.55, P.bodyRad * 1.5, P.bodyLen * 0.62);
    body.add(torso);
    var belly = mesh(SPHERE(), mat(C.belly), 0, P.bodyRad * 0.28, P.bodyLen * 0.10);
    belly.scale.set(P.bodyRad * 1.25, P.bodyRad * 1.05, P.bodyLen * 0.5);
    body.add(belly);

    // neck + head
    var neck = new THREE.Group();
    neck.position.set(0, P.bodyRad * 0.95, P.bodyLen * 0.36);
    body.add(neck); joints.neck = neck;
    var neckMesh = mesh(CYL(), mat(C.body), 0, P.headRad * 0.30, P.headRad * 0.22);
    neckMesh.scale.set(P.headRad * 0.62, P.headRad * 0.85, P.headRad * 0.62);
    neckMesh.rotation.x = 0.7;
    neck.add(neckMesh);
    var head = new THREE.Group();
    head.position.set(0, P.headRad * 0.62, P.headRad * 0.45);
    neck.add(head); joints.head = head;
    var skull = mesh(SPHERE(), mat(C.head), 0, 0, 0);
    skull.scale.set(P.headRad * 0.92, P.headRad, P.headRad * 1.05);
    head.add(skull);
    if (sp.id === 'carolina-parakeet') {
      var face = mesh(SPHERE(), mat(C.face), 0, -P.headRad * 0.08, P.headRad * 0.52);
      face.scale.set(P.headRad * 0.72, P.headRad * 0.78, P.headRad * 0.55);
      head.add(face);
    }
    // beak / bill
    var beak = new THREE.Group();
    beak.position.set(0, -P.headRad * 0.05, P.headRad * 0.85);
    head.add(beak);
    if (sp.id === 'dodo') {
      var upper = mesh(BOX(), mat(C.beak), 0, P.headRad * 0.10, P.billLen * 0.30);
      upper.scale.set(P.headRad * 0.62, P.headRad * 0.42, P.billLen * 0.72);
      beak.add(upper);
      var hook = mesh(CONE(), mat(0xc9a83c), 0, -P.headRad * 0.16, P.billLen * 0.62);
      hook.scale.set(P.headRad * 0.30, P.headRad * 0.55, P.headRad * 0.30);
      hook.rotation.x = Math.PI; // point down: the hook
      beak.add(hook);
      var lowerB = mesh(BOX(), mat(C.beak), 0, -P.headRad * 0.22, P.billLen * 0.22);
      lowerB.scale.set(P.headRad * 0.5, P.headRad * 0.2, P.billLen * 0.5);
      beak.add(lowerB);
    } else {
      var bk = mesh(CONE(), mat(C.beak), 0, -P.headRad * 0.10, P.billLen * 0.4);
      bk.scale.set(P.headRad * 0.34, P.billLen * 1.5, P.headRad * 0.30);
      bk.rotation.x = Math.PI / 2 + 0.5; // curved parrot bill pointing forward-down
      beak.add(bk);
    }
    // eyes
    var eyeG = SPHERE();
    var eL = mesh(eyeG, mat(C.eye), P.headRad * 0.72, P.headRad * 0.22, P.headRad * 0.42);
    eL.scale.setScalar(P.headRad * 0.16);
    var eR = mesh(eyeG, mat(C.eye), -P.headRad * 0.72, P.headRad * 0.22, P.headRad * 0.42);
    eR.scale.setScalar(P.headRad * 0.16);
    head.add(eL); head.add(eR);

    // tail — pivot at base for balance/pitch control
    var tail = new THREE.Group();
    tail.position.set(0, P.bodyRad * 0.45, -P.bodyLen * 0.42);
    body.add(tail); joints.tail = tail;
    if (sp.id === 'dodo') {
      // the famous rear tuft of curled pale feathers
      for (var i = 0; i < 5; i++) {
        var tuft = mesh(CONE(), mat(C.tail), (i - 2) * 0.035, 0.05, -0.03);
        tuft.scale.set(0.028, 0.13, 0.028);
        tuft.rotation.x = -0.7 - Math.abs(i - 2) * 0.12;
        tuft.rotation.z = (i - 2) * 0.22;
        tail.add(tuft);
      }
    } else {
      var tailMesh = mesh(CONE(), mat(C.tail), 0, -0.01, -P.tailLen / 2);
      tailMesh.scale.set(0.030, P.tailLen, 0.010);
      tailMesh.rotation.x = -Math.PI / 2 + 0.18; // long pointed tail streaming back-down
      tail.add(tailMesh);
    }

    // wings
    if (sp.id === 'dodo') {
      // tiny tucked wings — present (documented) but NEVER flight-driven
      joints.wingL = { shoulder: new THREE.Group(), wrist: new THREE.Group() };
      joints.wingR = { shoulder: new THREE.Group(), wrist: new THREE.Group() };
      [1, -1].forEach(function (side) {
        var w = mesh(SPHERE(), mat(C.wing), side * P.bodyRad * 1.42, P.bodyRad * 0.62, -P.bodyLen * 0.05);
        w.scale.set(0.035, 0.10, 0.17);
        w.rotation.z = side * 0.25;
        body.add(w);
        (side > 0 ? joints.wingL : joints.wingR).shoulder.add(new THREE.Group()); // inert joint shell
      });
    } else {
      var wL = buildWing(1, sp, P), wR = buildWing(-1, sp, P);
      