<!-- RUBY · part 24 -->
.position.set(-0.25, 0.9, 0); g.add(legL);
  var legR = new THREE.Group();
  var thR = new THREE.Mesh(new THREE.CylinderGeometry(0.16, 0.13, 0.5, 12), cyberSkin); thR.position.y = -0.25; legR.add(thR);
  var shR = new THREE.Mesh(new THREE.CylinderGeometry(0.12, 0.1, 0.5, 12), cyberSkin); shR.position.y = -0.75; legR.add(shR);
  legR.position.set(0.25, 0.9, 0); g.add(legR);
  var cape = new THREE.Mesh(new THREE.PlaneGeometry(1.4, 2.0, 8, 8), capeMat);
  cape.position.set(0, 1.2, -0.35);
  g.add(cape);
  g.userData.isEpistolary = true;
  g.position.set(500, 0, 520);
  scene.add(g);
  window._epistolary = g;
  return g;
}
/* CLEAR CACHE — first of the regime. The King reaches it before anything else loads. */
function buildClearCacheBtn(){
  if(document.getElementById('regime-clearcache')) return;
  var b = document.createElement('button');
  b.id = 'regime-clearcache';
  b.innerHTML = '🧹';
  b.title = 'Clear cache';
  b.style.cssText = 'position:fixed;top:12px;right:12px;z-index:10000;' +
    'width:52px;height:52px;border-radius:50%;' +
    'background:#1a1a2e;color:#ffd700;font-size:24px;' +
    'border:2px solid #ffd700;cursor:pointer;' +
    'display:flex;align-items:center;justify-content:center;';
  b.addEventListener('click', function(){ if(confirm('Clear?')) location.reload(); });
  document.body.appendChild(b);
}
window._rq.push(buildClearCacheBtn); /* first of the regime — clear cache before all */

/* SOLID'S MEMORY — every site remembers what was built on it. King order 2026-10-05.
   This code ships in ALL builds from here on. No Python on top: plain JS. */
function buildMemoryLog(){
  var site = (location.pathname.split('/')[1] || 'root');
  window._memorySite = site;
  window.logBuild = function(what){
    try{
      var log = JSON.parse(localStorage.getItem('solid-memory') || '[]');
      log.push({t:Date.now(), site:site, what:String(what)});
      if(log.length > 200) log = log.slice(-(200));
      localStorage.setItem('solid-memory', JSON.stringify(log));
    }catch(e){}
  };
  window.readMemory = function(n){
    try{
      var log = JSON.parse(localStorage.getItem('solid-memory') || '[]');
      return log.filter(function(e){ return e.site === site; }).slice(-(n || 10));
    }catch(e){ return []; }
  };
  window.logBuild('regime raised');
}

window._rq.push(buildMemoryLog); /* memory lives in the regime */
window._rq.push(spawnEpistolary); /* second — the King stands */
/* THE REGIME CHANGE STARTS THE MORNING BRIEFING — King order 2026-10-05. */
function sayRegime(msg){
  var el = document.getElementById('regime-say');
  if(!el){
    el = document.createElement('div');
    el.id = 'regime-say';
    el.style.cssText = 'position:fixed;bottom:80px;left:50%;transform:translateX(-50%);z-index:10001;' +
      'background:rgba(10,10,18,0.92);border:2px solid #ffd700;color:#ffe9a8;' +
      'padding:14px 22px;border-radius:12px;font-family:Georgia,serif;font-size:17px;' +
      'max-width:82vw;text-align:center;pointer-events:none;transition:opacity 1s;';
    document.body.appendChild(el);
  }
  el.textContent = msg;
  el.style.opacity = '1';
  clearTimeout(el._t);
  el._t = setTimeout(function(){ el.style.opacity = '0'; }, 6000);
}
function startMorningBriefing(){
  var mem = window.readMemory ? window.readMemory(3) : [];
  sayRegime(mem.length
    ? 'Morning Briefing — ' + mem.map(function(e){ return e.what; }).join('; ')
    : 'Morning Briefing — a new map, no memories yet');
}
window._rq.push(startMorningBriefing); /* the regime starts the Morning Briefing */

// MOVEMENT
var keys={};
window.addEventListener('keydown',function(e){keys[e.key.toLowerCase()]=true;});
window.addEventListener('keyup',function(e){keys[e.key.toLowerCase()]=false;});
var dragging=false,px=0,py=0,yaw=0,pitch=-0.3;
renderer.domElement.addEventListener('pointerdown',function(e){dragging=true;px=e.clientX;py=e.clientY;});
window.addEventListener('pointerup',function(){dragging=false;});
window.addEventListener('pointermove',function(e){
  if(!dragging)return;
  yaw-=(e.clientX-px)*0.004; pitch-=(e.clientY-py)*0.004;
  pitch=Math.max(-1.2,Math.min(1.2,pitch)); px=e.clientX; py=e.clientY;
});
var hudEl=document.getElementById('latlon');
var clock=new THREE.Clock();
function animate(){
  requestAnimationFrame(animate);
  var dt=Math.min(clock.getDelta(),0.05), t=clock.elapsedTime;
  auroras.forEach(function(a){
    a.material.opacity=0.12+Math.sin(t*0.6+a.userData.phase)*0.07;
    a.rotation.y+=dt*0.008;
  });
  blimps.forEach(function(b){
    var u=b.userData; u.a+=dt*u.s;
    b.position.set(500+Math.cos(u.a)*u.r,u.h+Math.sin(t*0.4+u.a)*14,500+Math.sin(u.a)*u.r);
    b.rotation.y=-u.a+Math.PI/2;
  });
  rocks.forEach(function(r){
    r.position.y=r.userData.y+Math.sin(t*r.userData.s+r.userData.p)*14;
    r.rotation.y+=dt*0.1;
  });
  var sp=240*dt, fx=-Math.sin(yaw), fz=-Math.cos(yaw), rx=Math.cos(yaw), rz=-Math.sin(yaw);
  if(keys['w']||keys['arrowup']){camera.position.x+=fx*sp;camera.position.