<!-- SOLID CITY · part 3046 -->
0.14);
          quad(walk, wA0, wB0, wB1, wA1); standQuad(stand, wA0, wB0, wB1, wA1);
        }
        if (walkSide === sd) { out0 = 1.95; lift0 = 0.14; }
        } /* end street furniture */
        /* the skirt, and on the falling side THE BANK: from the built
         * edge a face at repose (0.55) marches outward until it meets
         * the land and tucks under it. It does not chase a cliff to
         * the bottom — a bank that meets the face and stops is the
         * bench's own line across the mountain, the line visible in
         * the King's photographs. On the rising side the same march
         * ends at once: the face there is the cut bank, standing at
         * the shoulder. */
        var eA = edgePt(A, sd, out0, lift0), eB = edgePt(B, sd, out0, lift0);
        var sk = sd < 0 ? skirtL : skirtR;
        var dCache = sd < 0 ? drapeCacheL : drapeCacheR;
        if (!dCache[i]) dCache[i] = drapeFrom(eA, A.rx * sd, A.rz * sd);
        if (!dCache[i + 1]) dCache[i + 1] = drapeFrom(eB, B.rx * sd, B.rz * sd);
        var pA = dCache[i].pts, pB = dCache[i + 1].pts;
        /* THE CLEAR BODY (the King's ruling, 2026-10-13 ~22:02):
         * only the road's skin renders colour. The drape's first
         * two segments — the brow that seals the seam where the
         * surface leaves the shoulder — stay painted, read from
         * either side. Everything deeper is the road's INSIDE:
         * it goes clear, emitting no triangles at all, because a
         * vertex spent painting the inside of a hill is a vertex
         * stolen from the frame. The drape's data still walks its
         * full profile (the census reads its drops and meets as
         * before), and standing truth never rode the skirts —
         * feet lose nothing when the inside stops dressing. */
        var SKIRT_BROW = 2;
        for (var dk = 0; dk < Math.min(SKIRT_BROW, pA.length - 1); dk++) {
          quad(sk, pA[dk], pB[dk], pB[dk + 1], pA[dk + 1], [sd * A.rx, sd * A.rz]);
          quad(sk, pB[dk], pA[dk], pA[dk + 1], pB[dk + 1], [sd * A.rx, sd * A.rz]);   // both faces: a bank is read from either side
        }
        var dropA = eA[1] - pA[pA.length - 1][1], riseA = pA[pA.length - 1][1] - eA[1];
        if (sd < 0 && Math.max(dropA, riseA) > stats.maxSkirtL) stats.maxSkirtL = Math.max(dropA, riseA);
        if (sd > 0 && Math.max(dropA, riseA) > stats.maxSkirtR) stats.maxSkirtR = Math.max(dropA, riseA);
        if (sd === upSide) { if (riseA > stats.cutBank) stats.cutBank = riseA; }
        else { if (dropA > stats.bank) stats.bank = dropA; if (!dCache[i].met) stats.bankUnmet++; }
      }
    }
    /* arrival fans at both ends. A fan is not a flat disc dropped on
     * the ramp's end — the first drive-through caught that step
     * (0.9 m at the seam). The fan is the road's own PLANE extended:
     * each rim vertex carries the end grade along the road's axis
     * and the end bank across it, so ribbon and fan meet as one
     * surface. Rim skirts below, so they never float. */
    var ends = [st[0], st[N - 1]];
    for (var e = 0; e < 2; e++) {
      var C0 = ends[e], fr = C0.hw + 0.9, SEG = 14;
      var src = e === 0 ? st[1] : st[N - 2];
      var fGrade = e === 0 ? src.grade : st[N - 1].grade;
      var fBank = Math.tan(src.bank);
      var rim = [];
      for (var k2 = 0; k2 < SEG; k2++) {
        var an = k2 / SEG * Math.PI * 2;
        var dxr = Math.cos(an) * fr, dzr = Math.sin(an) * fr;
        var along = dxr * C0.fx + dzr * C0.fz, across = dxr * C0.rx + dzr * C0.rz;
        rim.push([C0.x + dxr, C0.y + fGrade * along + fBank * across, C0.z + dzr]);
      }
      var rimProf = rim.map(function (rp) { var dl = Math.hypot(rp[0] - C0.x, rp[2] - C0.z) || 1; return drapeFrom(rp, (rp[0] - C0.x) / dl, (rp[2] - C0.z) / dl).pts; });
      for (k2 = 0; k2 < SEG; k2++) {
        var r1 = rim[k2], r2 = rim[(k2 + 1) % SEG];
        var ctr = [C0.x, C0.y + 0.02, C0.z];
        tri(fans, ctr, r1, r2); stand.push(ctr[0], ctr[1], ctr[2], r1[0], r1[1], r1[2], r2[0], r2[1], r2[2]);
        var qA = rimProf[k2], qB = rimProf[(k2 + 1) % SEG];
        var outw = [r1[0] - C0.x, r1[2] - C0.z];
        for (var dk2 = 0; dk2 < Math.min(2, qA.length - 1); dk2++) { quad(fans, qA[dk2], qB[dk2], qB[dk2 + 1], qA[dk2 + 1], outw); quad(fans, qB[dk2], qA[dk2], qA[dk2 + 1], qB[dk2 + 1], outw); }   // the fan's rim obeys the Clear Body too: brow painted, inside clear
      }
    }
    stats.fairDev = fairDev;
    return {
      stations: st, stats: stats, walkSide: walkSide, upSide: upSide,
      ribbon: ribbon, curbL: curbL, curbR: curbR, goldL: goldL, goldR: goldR,
      walk: walk, skirtL: skirtL, skirtR: skirtR, fans: fans,
      shoL: shoL, shoR: shoR, rail: rail, posts: posts,
      standTris: stand
    };
  }

  return { buildRoad: buildRoad };
}


===== FILE: public/city/roads.js.bak-harden-20261014 =====
/* SOLID CITY — THE ROAD SMITH (2026-10-13)
 * An epistle in code, from Solid to whoever