<!-- RUBY-BACKUP · part 361 -->
ainted = 0;
    body.traverse(function(o){
      if(!o.isMesh) return;
      var n = (o.name||'').toLowerCase();
      var tex = skinTex;
      if(n.indexOf('thigh')>=0||n.indexOf('upperarm')>=0||n.indexOf('chest')>=0||n.indexOf('abdomen')>=0) tex = muscleTex;
      if(n.indexOf('elbow')>=0||n.indexOf('knee')>=0||n.indexOf('wrist')>=0||n.indexOf('ankle')>=0) tex = jointTex;
      if(o.material && tex){
        o.material.map = tex;
        o.material.needsUpdate = true;
        painted++;
      }
    });
    codeStatus('painted ' + painted + ' parts — intaglio anatomy');
  }catch(e){ codeStatus('paint failed'); }
}
/* SOLID HAND — the solid of reality, built for the wrap */
function buildSolidHand(){
  try{
    var g = new THREE.Group();
    var skinMat = new THREE.MeshStandardMaterial({color:0xc8966a, roughness:0.6});
    /* palm — the solid base */
    var palm = new THREE.Mesh(new THREE.BoxGeometry(2.2, 2.8, 0.9), skinMat);
    palm.position.set(0, 0, 0);
    palm.name = 'palm';
    g.add(palm);
    /* knuckle mounds */
    for(var k=0; k<4; k++){
      var kn = new THREE.Mesh(new THREE.SphereGeometry(0.28, 10, 8), skinMat);
      kn.position.set(-0.75 + k*0.5, 1.55, 0);
      kn.name = 'knuckle';
      g.add(kn);
    }
    /* fingers — 3 segments each for articulation */
    var fingerX = [-0.75, -0.25, 0.25, 0.75];
    var fingerLen = [1.0, 1.15, 1.05, 0.85];
    for(var f=0; f<4; f++){
      var fx = fingerX[f];
      var fl = fingerLen[f];
      /* proximal */
      var p1 = new THREE.Mesh(new THREE.CylinderGeometry(0.16, 0.15, fl*0.45, 8), skinMat);
      p1.position.set(fx, 1.4 + fl*0.22, 0);
      p1.name = 'finger-proximal';
      g.add(p1);
      /* middle */
      var p2 = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.13, fl*0.32, 8), skinMat);
      p2.position.set(fx, 1.4 + fl*0.45 + fl*0.16, 0);
      p2.name = 'finger-middle';
      g.add(p2);
      /* distal + fingertip */
      var p3 = new THREE.Mesh(new THREE.CylinderGeometry(0.12, 0.1, fl*0.23, 8), skinMat);
      p3.position.set(fx, 1.4 + fl*0.45 + fl*0.32 + fl*0.11, 0);
      p3.name = 'finger-distal';
      g.add(p3);
      var tip = new THREE.Mesh(new THREE.SphereGeometry(0.11, 8, 6), skinMat);
      tip.position.set(fx, 1.4 + fl*0.45 + fl*0.32 + fl*0.23, 0);
      tip.name = 'fingertip';
      g.add(tip);
      /* nail */
      var nail = new THREE.Mesh(new THREE.BoxGeometry(0.16, 0.2, 0.04), new THREE.MeshStandardMaterial({color:0xe8d0b8, roughness:0.4}));
      nail.position.set(fx, 1.4 + fl*0.45 + fl*0.32 + fl*0.18, 0.12);
      nail.name = 'nail';
      g.add(nail);
    }
    /* thumb — 2 segments, angled */
    var th1 = new THREE.Mesh(new THREE.CylinderGeometry(0.18, 0.16, 0.9, 8), skinMat);
    th1.position.set(-1.35, 0.3, 0.15);
    th1.rotation.z = 0.7;
    th1.name = 'thumb-proximal';
    g.add(th1);
    var th2 = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.12, 0.7, 8), skinMat);
    th2.position.set(-1.75, 0.85, 0.2);
    th2.rotation.z = 0.5;
    th2.name = 'thumb-distal';
    g.add(th2);
    var thTip = new THREE.Mesh(new THREE.SphereGeometry(0.13, 8, 6), skinMat);
    thTip.position.set(-1.92, 1.15, 0.22);
    thTip.name = 'thumb-tip';
    g.add(thTip);
    /* wrist */
    var wrist = new THREE.Mesh(new THREE.CylinderGeometry(0.85, 0.9, 1.2, 12), skinMat);
    wrist.position.set(0, -1.9, 0);
    wrist.name = 'wrist';
    g.add(wrist);
    g.position.set(12, 2, -24);
    g.scale.set(0.6, 0.6, 0.6);
    if(typeof scene!=='undefined') scene.add(g);
    window._solidHand = g;
    codeStatus('the solid hand — wrap it');
  }catch(e){ codeStatus('hand failed'); }
}
/* TRUE INTAGLIO — each line has boundaries, born from the 3D form */
function applyTrueIntaglio(){
  try{
    var target = window._solidHand || window._humanBody || window._intaglioEyes;
    if(!target){ try{ codeStatus('Build something first — solidhand, body, or eyes.'); }catch(e){} return; }
    var count = 0;
    target.traverse(function(o){
      if(!o.isMesh || !o.material) return;
      try{
        /* hatch shader — lines bounded by the surface, never crossing */
        o.material.onBeforeCompile = function(shader){
          shader.fragmentShader = shader.fragmentShader.replace(
            '#include <dithering_fragment>',
            [
              '/* intaglio hatch — lines respect the 3D boundaries */',
              'vec3 nrm = normalize(vNormal);',
              'vec3 viewDir = normalize(vViewPosition);',
              'float ndl = dot(nrm, normalize(vec3(0.5, 0.8, 0.6)));',
              'float shade = smoothstep(-0.5, 0.8, ndl);',
              '/* hatch density follows the shadow — like the engraver */',
              'float hatchScale = 180.0;',
              'vec2 huv = vUv * hatchScale;',
              'float hatch1 = step(0.5, fract(huv.y + huv.x*0.15));',
              'float hatch2 = step(0.5, fract((huv.x - huv.y)*0.7));',
              '/* more lines where darker — boundaries respected */',
 