<!-- NEW1 — TEST 1 · THE LIVING DISTRICT · part 12 -->
t);
  if (mode === 'sky') {
    stage.update(dt, t);
  } else if (mode === 'diving' || mode === 'rising') {
    trans.k += dt / trans.dur;
    const s = smooth(Math.min(1, trans.k));
    king.update(dt);
    if (mode === 'diving') {
      const bt = boomTarget();
      _v1.copy(bt.position);
      _v2.lerpVectors(trans.fromLook, bt.look, s);
      camera.position.lerpVectors(trans.fromPos, _v1, s);
      camera.lookAt(_v2);
      if (trans.k >= 1) { mode = 'street'; document.body.classList.add('inside'); enterBtn.textContent = 'EXIT TO THE SKY'; }
    } else {
      camera.position.lerpVectors(trans.fromPos, trans.toPos, s);
      _v1.lerpVectors(trans.fromLook, trans.toLook, s);
      camera.lookAt(_v1);
      if (trans.k >= 1) { mode = 'sky'; document.body.classList.remove('inside'); enterBtn.textContent = 'ENTER THE CITY'; king.hide(); }
    }
  } else { // street
    king.update(dt);
    king.boom(camera, dt);
  }
  const cen = life.census();
  applySky(cen.clock);
  renderer.render(scene, camera);
  diag.frames++;
  const c0 = life.citizens[0];
  if (!firstPos) firstPos = { x: c0.x, z: c0.z };
  else if (diag.frames % 30 === 0) diag.moved = Math.max(diag.moved, Math.hypot(c0.x - firstPos.x, c0.z - firstPos.z));
  censusTimer += dt;
  if (censusTimer > 0.5) {
    censusTimer = 0;
    const k = cen.counts;
    censusEl.innerHTML =
      '<b>THE WITNESS</b> · DAY ' + cen.day + ' · ' + cen.clock + '\n' +
      'complexes ' + diag.complexes + ' · stop lights ' + diag.stoplights + '\n' +
      'at work ' + (k.work || 0) + ' · traveling ' + (k.travel || 0) + ' · grocery ' + (k.errand || 0) +
      ' · leisure ' + (k.leisure || 0) + ' · asleep ' + (k.sleep || 0) + '\n' +
      '<span class="spot">' + cen.spotlight + '</span>' +
      (mode !== 'sky' ? '\n<span class="spot">You are in the city — near ' + nearestComplex() + '</span>' : '') +
      (diag.errors.length ? '\n<span class="err">errors: ' + diag.errors[0] + '</span>' : '');
  }
}
frame();

window.addEventListener('resize', () => {
  renderer.setSize(window.innerWidth, window.innerHeight);
  stage.setAspect(window.innerWidth, window.innerHeight);
});
</script>
</body>
</html>


===== FILE: public/new1/lib/three.core.js =====
/**
 * @license
 * Copyright 2010-2026 Three.js Authors
 * SPDX-License-Identifier: MIT
 */
const REVISION = '186';

/**
 * Represents mouse buttons and interaction types in context of controls.
 *
 * @type {ConstantsMouse}
 * @constant
 */
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };

/**
 * Represents touch interaction types in context of controls.
 *
 * @type {ConstantsTouch}
 * @constant
 */
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };

/**
 * Disables face culling.
 *
 * @type {number}
 * @constant
 */
const CullFaceNone = 0;

/**
 * Culls back faces.
 *
 * @type {number}
 * @constant
 */
const CullFaceBack = 1;

/**
 * Culls front faces.
 *
 * @type {number}
 * @constant
 */
const CullFaceFront = 2;

/**
 * Culls both front and back faces.
 *
 * @type {number}
 * @constant
 */
const CullFaceFrontBack = 3;

/**
 * Gives unfiltered shadow maps - fastest, but lowest quality.
 *
 * @type {number}
 * @constant
 */
const BasicShadowMap = 0;

/**
 * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm.
 *
 * @type {number}
 * @constant
 */
const PCFShadowMap = 1;

/**
 * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with
 * better soft shadows especially when using low-resolution shadow maps.
 *
 * @type {number}
 * @constant
 * @deprecated since r186. Use `PCFShadowMap` instead.
 */
const PCFSoftShadowMap = 2;

/**
 * Filters shadow maps using the Variance Shadow Map (VSM) algorithm.
 * When using VSMShadowMap all shadow receivers will also cast shadows.
 *
 * @type {number}
 * @constant
 */
const VSMShadowMap = 3;

/**
 * Only front faces are rendered.
 *
 * @type {number}
 * @constant
 */
const FrontSide = 0;

/**
 * Only back faces are rendered.
 *
 * @type {number}
 * @constant
 */
const BackSide = 1;

/**
 * Both front and back faces are rendered.
 *
 * @type {number}
 * @constant
 */
const DoubleSide = 2;

/**
 * No blending is performed which effectively disables
 * alpha transparency.
 *
 * @type {number}
 * @constant
 */
const NoBlending = 0;

/**
 * The default blending.
 *
 * @type {number}
 * @constant
 */
const NormalBlending = 1;

/**
 * Represents additive blending.
 *
 * @type {number}
 * @constant
 */
const AdditiveBlending = 2;

/**
 * Represents subtractive blending.
 *
 * @type {number}
 * @constant
 */
const SubtractiveBlending = 3;

/**
 * Represents multiply blending.
 *
 * @type {number}
 * @constant
 */
const MultiplyBlending = 4;

/**
 * Represents custom blending.
 *
 * @type {number}
 * @constant
 */
const CustomBlending = 5;

/**
 * Represents material blending.
 *
 * @type {number}
 * @constant
 */
const MaterialBlending = 6;

/**
 * A `source