cy0307 commited on
Commit
36745fe
·
verified ·
1 Parent(s): 37ae1e2

Sync semantic 3D loop trace

Browse files

Mirror GitHub commit 5316a429cccb0ec66ae89bd63e6bc1b62ba8132a with the responsive semantic lifecycle visualization.

Files changed (3) hide show
  1. README.md +0 -2
  2. docs/assets/loop-hero-scene.js +687 -256
  3. docs/index.html +104 -45
README.md CHANGED
@@ -20,7 +20,6 @@ configs:
20
  - split: train
21
  path: data/resources.jsonl
22
  ---
23
-
24
  <p align="center">
25
  <img src="assets/awesome-loop-engineering-cover.png" alt="Awesome Loop Engineering cover" width="100%">
26
  </p>
@@ -1109,7 +1108,6 @@ If this repository is useful in your work, please cite it with:
1109
  > Loop Engineering is the practice of designing recurring AI-agent and coding-agent systems that discover work, delegate to agents, verify results, persist state, and retry or escalate on a cadence or until a goal is reached. *Awesome Loop Engineering* is a curated, implementation-focused resource collection for this practice: [github.com/ChaoYue0307/awesome-loop-engineering](https://github.com/ChaoYue0307/awesome-loop-engineering)
1110
 
1111
  ---
1112
-
1113
  ## Dataset Structure
1114
 
1115
  Each row in `data/resources.jsonl` (and the equivalent `data/resources.csv`) is one curated resource, exported from the English `README.md`.
 
20
  - split: train
21
  path: data/resources.jsonl
22
  ---
 
23
  <p align="center">
24
  <img src="assets/awesome-loop-engineering-cover.png" alt="Awesome Loop Engineering cover" width="100%">
25
  </p>
 
1108
  > Loop Engineering is the practice of designing recurring AI-agent and coding-agent systems that discover work, delegate to agents, verify results, persist state, and retry or escalate on a cadence or until a goal is reached. *Awesome Loop Engineering* is a curated, implementation-focused resource collection for this practice: [github.com/ChaoYue0307/awesome-loop-engineering](https://github.com/ChaoYue0307/awesome-loop-engineering)
1109
 
1110
  ---
 
1111
  ## Dataset Structure
1112
 
1113
  Each row in `data/resources.jsonl` (and the equivalent `data/resources.csv`) is one curated resource, exported from the English `README.md`.
docs/assets/loop-hero-scene.js CHANGED
@@ -4,26 +4,28 @@ const container = document.querySelector('[data-loop-scene]');
4
  const hero = container?.closest('.hero');
5
  const stageButtons = Array.from(document.querySelectorAll('[data-loop-stage]'));
6
  const stageDetail = document.getElementById('loop-stage-detail');
7
- const stageCopy = [
8
- ['Intake:', 'capture work from queues, schedules, events, or goals.'],
9
- ['Delegate:', 'route bounded work to the right agent role.'],
10
- ['Act:', 'work inside an isolated environment with scoped tools.'],
11
- ['Verify:', 'gate completion with tests, evals, traces, or review.'],
12
- ['Persist:', 'record state, evidence, and receipts outside the model.'],
13
- ['Decide:', 'retry with evidence, escalate, or exit when the goal is met.'],
14
  ];
15
- let activeStage = 3;
 
16
  const stageSubscribers = [];
17
 
18
  function renderStageCopy(index) {
19
  if (!stageDetail) return;
20
  const strong = document.createElement('strong');
21
- strong.textContent = stageCopy[index][0];
22
- stageDetail.replaceChildren(strong, document.createTextNode(` ${stageCopy[index][1]}`));
23
  }
24
 
25
- function selectStage(index, moveFocus = false) {
26
- activeStage = Math.max(0, Math.min(stageCopy.length - 1, index));
 
27
  stageButtons.forEach((button, buttonIndex) => {
28
  button.setAttribute('aria-pressed', buttonIndex === activeStage ? 'true' : 'false');
29
  });
@@ -33,27 +35,29 @@ function selectStage(index, moveFocus = false) {
33
  }
34
 
35
  stageButtons.forEach((button, index) => {
36
- button.addEventListener('click', () => selectStage(index));
37
- button.addEventListener('focus', () => selectStage(index));
38
  button.addEventListener('keydown', (event) => {
39
  if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;
40
  event.preventDefault();
41
- if (event.key === 'Home') selectStage(0, true);
42
- else if (event.key === 'End') selectStage(stageButtons.length - 1, true);
43
  else {
44
  const direction = event.key === 'ArrowRight' ? 1 : -1;
45
- selectStage((index + direction + stageButtons.length) % stageButtons.length, true);
46
  }
47
  });
48
  });
49
 
50
- renderStageCopy(activeStage);
51
 
52
  if (container && hero) {
53
  const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
54
  const lowPower = Number(navigator.hardwareConcurrency || 8) <= 4;
55
- const palette = [0x155eef, 0x08a9c4, 0x0c9b68, 0x7055d9, 0x08a9c4, 0x155eef];
 
56
  const white = new THREE.Color(0xffffff);
 
57
  let renderer;
58
 
59
  try {
@@ -68,69 +72,223 @@ if (container && hero) {
68
  }
69
 
70
  if (renderer) {
71
- renderer.setClearColor(0xf7f9fc, 1);
72
  renderer.outputColorSpace = THREE.SRGBColorSpace;
73
  renderer.toneMapping = THREE.ACESFilmicToneMapping;
74
- renderer.toneMappingExposure = 1.05;
75
  renderer.domElement.setAttribute('aria-hidden', 'true');
76
  renderer.domElement.dataset.loopSceneCanvas = 'true';
77
  container.appendChild(renderer.domElement);
78
 
79
  const scene = new THREE.Scene();
80
- const camera = new THREE.PerspectiveCamera(31, 1, 0.1, 60);
81
- camera.position.set(0, 0.25, 12.2);
82
 
83
- scene.add(new THREE.HemisphereLight(0xffffff, 0xdbe8ff, 2.4));
84
  const keyLight = new THREE.DirectionalLight(0xffffff, 2.8);
85
- keyLight.position.set(-3.5, 5, 8);
86
  scene.add(keyLight);
87
- const accentLight = new THREE.PointLight(0x08a9c4, 11, 12, 2);
88
- accentLight.position.set(2.4, -0.8, 3.8);
89
- scene.add(accentLight);
 
 
 
 
 
90
 
91
  const root = new THREE.Group();
92
- root.position.set(0, -0.28, 0);
93
  scene.add(root);
94
 
95
- const stagePositions = [
96
- new THREE.Vector3(-4.15, -0.08, 0.08),
97
- new THREE.Vector3(-2.45, 1.2, -0.22),
98
- new THREE.Vector3(0, 1.56, 0.12),
99
- new THREE.Vector3(2.45, 1.2, -0.16),
100
- new THREE.Vector3(4.15, -0.08, 0.1),
101
- new THREE.Vector3(0, -1.48, 0.32),
102
- ];
103
- const flowCurve = new THREE.CatmullRomCurve3(stagePositions, true, 'centripetal', 0.42);
104
- const flowMaterial = new THREE.MeshBasicMaterial({
105
- color: 0x155eef,
106
- transparent: true,
107
- opacity: 0.28,
108
- depthWrite: false,
109
- });
110
- const flow = new THREE.Mesh(
111
- new THREE.TubeGeometry(flowCurve, lowPower ? 120 : 200, 0.018, 6, true),
112
- flowMaterial,
113
- );
114
- root.add(flow);
115
 
116
- const flowAura = new THREE.Mesh(
117
- new THREE.TubeGeometry(flowCurve, lowPower ? 96 : 160, 0.058, 6, true),
118
- new THREE.MeshBasicMaterial({
119
- color: 0x08a9c4,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  transparent: true,
121
- opacity: 0.05,
122
- blending: THREE.AdditiveBlending,
123
  depthWrite: false,
124
- }),
125
- );
126
- root.add(flowAura);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  function closestCurveTime(position) {
129
  let closestTime = 0;
130
  let closestDistance = Infinity;
131
  for (let sample = 0; sample <= 240; sample += 1) {
132
  const time = sample / 240;
133
- const distance = flowCurve.getPointAt(time).distanceToSquared(position);
134
  if (distance < closestDistance) {
135
  closestDistance = distance;
136
  closestTime = time;
@@ -139,205 +297,308 @@ if (container && hero) {
139
  return closestTime;
140
  }
141
 
142
- const stageTimes = stagePositions.map(closestCurveTime);
143
- const diskGeometry = new THREE.CylinderGeometry(0.46, 0.46, 0.13, lowPower ? 24 : 48);
144
- const rimGeometry = new THREE.TorusGeometry(0.49, 0.026, 8, lowPower ? 36 : 64);
145
- const haloGeometry = new THREE.TorusGeometry(0.61, 0.012, 8, lowPower ? 40 : 72);
146
- const markerGeometry = new THREE.SphereGeometry(0.085, lowPower ? 16 : 24, lowPower ? 10 : 16);
147
-
148
- const lifecycleNodes = stagePositions.map((position, index) => {
149
- const color = new THREE.Color(palette[index]);
150
- const group = new THREE.Group();
151
- const diskMaterial = new THREE.MeshStandardMaterial({
152
- color: color.clone().lerp(white, 0.7),
153
- emissive: color,
154
- emissiveIntensity: 0.05,
155
- metalness: 0.08,
156
- roughness: 0.4,
157
- transparent: true,
158
- opacity: 0.96,
159
- });
160
- const disk = new THREE.Mesh(diskGeometry, diskMaterial);
161
- disk.rotation.x = Math.PI / 2;
162
- group.add(disk);
163
-
164
- const rimMaterial = new THREE.MeshBasicMaterial({
165
- color,
166
  transparent: true,
167
- opacity: 0.82,
 
 
168
  depthWrite: false,
169
- });
170
- const rim = new THREE.Mesh(rimGeometry, rimMaterial);
171
- rim.position.z = 0.08;
172
- group.add(rim);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
  const haloMaterial = new THREE.MeshBasicMaterial({
175
  color,
176
  transparent: true,
177
- opacity: 0.08,
178
  blending: THREE.AdditiveBlending,
179
  depthWrite: false,
180
  });
181
- const halo = new THREE.Mesh(haloGeometry, haloMaterial);
182
- halo.position.z = 0.1;
 
 
 
 
183
  group.add(halo);
184
 
185
- const marker = new THREE.Mesh(
186
- markerGeometry,
187
- new THREE.MeshStandardMaterial({
188
- color,
189
- emissive: color,
190
- emissiveIntensity: 0.5,
191
- metalness: 0.12,
192
- roughness: 0.28,
193
- }),
194
  );
195
- marker.position.z = 0.16;
196
- group.add(marker);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
- group.position.copy(position);
199
- group.userData = { diskMaterial, haloMaterial, rimMaterial };
200
- root.add(group);
201
- return group;
202
- });
203
 
204
- const directionAxis = new THREE.Vector3(0, 1, 0);
205
- stageTimes.forEach((stageTime, index) => {
206
- const time = (stageTime - 0.045 + 1) % 1;
207
- const tangent = flowCurve.getTangentAt(time).normalize();
208
- const arrow = new THREE.Mesh(
209
- new THREE.ConeGeometry(0.075, 0.24, lowPower ? 12 : 18),
210
- new THREE.MeshBasicMaterial({
211
- color: palette[index],
212
- transparent: true,
213
- opacity: 0.58,
214
- depthWrite: false,
215
- }),
216
- );
217
- arrow.position.copy(flowCurve.getPointAt(time));
218
- arrow.quaternion.setFromUnitVectors(directionAxis, tangent);
219
- root.add(arrow);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  });
221
 
222
- const stackGroup = new THREE.Group();
223
- stackGroup.position.set(0, -0.06, -0.32);
224
- root.add(stackGroup);
225
- palette.slice(0, 4).forEach((hex, index) => {
226
- const color = new THREE.Color(hex);
227
- const plate = new THREE.Mesh(
228
- new THREE.CylinderGeometry(0.92, 0.92, 0.075, 6),
229
- new THREE.MeshStandardMaterial({
230
- color: color.clone().lerp(white, 0.68),
231
- emissive: color,
232
- emissiveIntensity: 0.04,
233
- metalness: 0.08,
234
- roughness: 0.44,
235
- transparent: true,
236
- opacity: 0.9,
237
- }),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  );
239
- plate.rotation.x = Math.PI / 2;
240
- plate.scale.z = 0.68;
241
- plate.position.set(index * 0.035 - 0.052, index * 0.055 - 0.08, index * 0.105);
242
- stackGroup.add(plate);
243
  });
244
 
245
- const coreMaterial = new THREE.MeshStandardMaterial({
246
- color: 0xf2fbff,
247
- emissive: 0x08a9c4,
248
- emissiveIntensity: 0.22,
249
- metalness: 0.18,
250
- roughness: 0.24,
 
 
 
 
 
 
 
 
251
  });
252
- const core = new THREE.Mesh(new THREE.IcosahedronGeometry(0.45, 1), coreMaterial);
253
- core.position.set(0, 0.03, 0.62);
254
- stackGroup.add(core);
255
-
256
- const coreShell = new THREE.Mesh(
257
- new THREE.IcosahedronGeometry(0.62, 1),
258
- new THREE.MeshBasicMaterial({
259
- color: 0x155eef,
260
- wireframe: true,
261
- transparent: true,
262
- opacity: 0.23,
263
- depthWrite: false,
264
- }),
265
- );
266
- coreShell.position.copy(core.position);
267
- stackGroup.add(coreShell);
268
 
269
- const coreRings = [0.72, 0.86].map((radius, index) => {
270
- const ring = new THREE.Mesh(
271
- new THREE.TorusGeometry(radius, 0.012, 8, lowPower ? 48 : 80),
272
- new THREE.MeshBasicMaterial({
273
- color: index === 0 ? 0x08a9c4 : 0x7055d9,
274
- transparent: true,
275
- opacity: index === 0 ? 0.27 : 0.18,
276
- depthWrite: false,
277
- }),
278
- );
279
- ring.position.copy(core.position);
280
- ring.rotation.set(index ? 0.76 : -0.62, index ? 0.28 : -0.2, index ? 0.18 : -0.12);
281
- stackGroup.add(ring);
282
- return ring;
283
  });
 
 
 
284
 
285
- const beamGeometry = new THREE.BufferGeometry().setFromPoints([
286
- new THREE.Vector3(0, 0, 0.52),
287
- stagePositions[activeStage],
288
- ]);
289
- const focusBeam = new THREE.Line(
290
- beamGeometry,
291
- new THREE.LineDashedMaterial({
292
- color: palette[activeStage],
293
- transparent: true,
294
- opacity: 0.28,
295
- dashSize: 0.12,
296
- gapSize: 0.09,
297
- depthWrite: false,
298
- }),
299
- );
300
- focusBeam.computeLineDistances();
301
- root.add(focusBeam);
302
-
303
- function updateFocusBeam(index) {
304
- const positions = focusBeam.geometry.attributes.position;
305
- positions.setXYZ(0, 0, 0, 0.52);
306
- positions.setXYZ(1, stagePositions[index].x, stagePositions[index].y, stagePositions[index].z);
307
- positions.needsUpdate = true;
308
- focusBeam.material.color.setHex(palette[index]);
309
- focusBeam.computeLineDistances();
310
  }
311
 
312
- stageSubscribers.push((index) => {
313
- updateFocusBeam(index);
314
- render(performance.now());
315
- });
316
 
317
- const pulseMaterial = new THREE.MeshBasicMaterial({
318
- color: 0x155eef,
 
 
 
 
319
  transparent: true,
320
- opacity: 0.94,
321
  blending: THREE.AdditiveBlending,
322
  depthWrite: false,
323
  });
324
- const evidencePulse = new THREE.Mesh(
325
- new THREE.SphereGeometry(0.105, lowPower ? 16 : 24, lowPower ? 10 : 16),
326
- pulseMaterial,
 
327
  );
328
- root.add(evidencePulse);
 
 
 
 
329
 
330
  const trail = [];
331
  if (!lowPower) {
332
- for (let index = 0; index < 6; index += 1) {
333
- const material = pulseMaterial.clone();
334
- material.opacity = 0.28 * (1 - index / 7);
335
- const point = new THREE.Mesh(new THREE.SphereGeometry(0.05 - index * 0.004, 12, 8), material);
 
 
 
 
 
336
  trail.push(point);
337
  root.add(point);
338
  }
339
  }
340
 
 
 
 
 
 
 
 
 
 
341
  let frameCount = 0;
342
  let animationFrame = 0;
343
  let visible = true;
@@ -345,45 +606,126 @@ if (container && hero) {
345
  let targetRotationY = 0;
346
  let layoutScaleX = 1;
347
  let layoutScaleY = 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
- function circularDistance(left, right) {
350
- const distance = Math.abs(left - right);
351
- return Math.min(distance, 1 - distance);
 
 
 
 
 
 
 
 
352
  }
353
 
354
  function render(time = 0) {
355
- const seconds = time * 0.001;
356
- const progress = reducedMotion.matches ? stageTimes[activeStage] : (seconds * 0.058) % 1;
357
- evidencePulse.position.copy(flowCurve.getPointAt(progress));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  trail.forEach((point, index) => {
359
- const trailTime = (progress - (index + 1) * 0.012 + 1) % 1;
360
- point.position.copy(flowCurve.getPointAt(trailTime));
361
  });
362
 
363
- lifecycleNodes.forEach((node, index) => {
364
  const selected = index === activeStage;
365
- const flowPulse = Math.max(0, 1 - circularDistance(progress, stageTimes[index]) / 0.055);
366
- const scale = 1 + (selected ? 0.12 : 0) + flowPulse * 0.1;
367
- node.scale.setScalar(scale);
368
- node.userData.diskMaterial.emissiveIntensity = selected ? 0.21 : 0.05 + flowPulse * 0.12;
369
- node.userData.rimMaterial.opacity = selected ? 0.96 : 0.58 + flowPulse * 0.22;
370
- node.userData.haloMaterial.opacity = selected ? 0.34 : 0.06 + flowPulse * 0.18;
 
 
 
 
371
  });
372
 
373
- const corePulse = reducedMotion.matches ? 1 : 1 + Math.sin(seconds * 1.2) * 0.035;
374
- core.scale.setScalar(corePulse);
375
- core.rotation.y = seconds * 0.22;
376
- core.rotation.x = seconds * 0.13;
377
- coreShell.rotation.y = -seconds * 0.12;
378
- coreShell.rotation.x = seconds * 0.09;
379
- coreRings[0].rotation.z = -0.12 + seconds * 0.08;
380
- coreRings[1].rotation.z = 0.18 - seconds * 0.065;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
 
382
  root.rotation.x += (targetRotationX - root.rotation.x) * 0.045;
383
  root.rotation.y += (targetRotationY - root.rotation.y) * 0.045;
384
- root.rotation.z = reducedMotion.matches ? 0 : Math.sin(seconds * 0.16) * 0.008;
385
- root.scale.x = layoutScaleX;
386
- root.scale.y = layoutScaleY;
387
  renderer.render(scene, camera);
388
  frameCount += 1;
389
  container.dataset.sceneFrames = String(frameCount);
@@ -409,22 +751,104 @@ if (container && hero) {
409
  animationFrame = 0;
410
  }
411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  function resize() {
413
  const width = Math.max(container.clientWidth, 1);
414
  const height = Math.max(container.clientHeight, 1);
415
  const mobile = window.innerWidth < 640;
 
 
 
416
  renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, mobile || lowPower ? 1.25 : 1.6));
417
  renderer.setSize(width, height, false);
418
  camera.aspect = width / height;
419
- camera.fov = mobile ? 34 : 31;
420
- camera.position.z = mobile ? 9.2 : 12.2;
 
421
  camera.updateProjectionMatrix();
422
- layoutScaleX = mobile ? 1.02 : 1.46;
423
- layoutScaleY = mobile ? 1.12 : 1.04;
424
- root.position.y = mobile ? -0.02 : -0.28;
425
- flowMaterial.opacity = mobile ? 0.42 : 0.28;
426
- flowAura.material.opacity = mobile ? 0.09 : 0.05;
427
- focusBeam.material.opacity = mobile ? 0.4 : 0.28;
 
428
  render(performance.now());
429
  }
430
 
@@ -432,8 +856,8 @@ if (container && hero) {
432
  const bounds = hero.getBoundingClientRect();
433
  const x = (event.clientX - bounds.left) / bounds.width * 2 - 1;
434
  const y = (event.clientY - bounds.top) / bounds.height * 2 - 1;
435
- targetRotationY = x * 0.055;
436
- targetRotationX = -y * 0.025;
437
  }
438
 
439
  function resetPointer() {
@@ -441,6 +865,8 @@ if (container && hero) {
441
  targetRotationY = 0;
442
  }
443
 
 
 
444
  if ('ResizeObserver' in window) {
445
  const resizeObserver = new ResizeObserver(resize);
446
  resizeObserver.observe(container);
@@ -511,12 +937,15 @@ if (container && hero) {
511
  drawCalls: renderer.info.render.calls,
512
  frameCount,
513
  height,
 
514
  luminanceRange: maximumLuminance - minimumLuminance,
515
  lowPower,
 
516
  painted,
517
  paintedRatio: sampled ? painted / sampled : 0,
518
  reducedMotion: reducedMotion.matches,
519
  sampled,
 
520
  triangles: renderer.info.render.triangles,
521
  width,
522
  };
@@ -524,16 +953,18 @@ if (container && hero) {
524
 
525
  window.__loopScenePause = () => {
526
  stopAnimation();
 
 
527
  render(performance.now());
528
  return window.__loopSceneDiagnostics();
529
  };
530
  window.__loopSceneResume = () => {
 
531
  startAnimation();
532
  return true;
533
  };
534
 
535
  resize();
536
- updateFocusBeam(activeStage);
537
  startAnimation();
538
  }
539
  }
 
4
  const hero = container?.closest('.hero');
5
  const stageButtons = Array.from(document.querySelectorAll('[data-loop-stage]'));
6
  const stageDetail = document.getElementById('loop-stage-detail');
7
+ const stages = [
8
+ ['Intake:', 'capture a bounded work packet from a queue, schedule, event, or goal.'],
9
+ ['Delegate:', 'route that packet to the right agent role while keeping scope explicit.'],
10
+ ['Act:', 'execute inside an isolated workspace with scoped tools and permissions.'],
11
+ ['Verify:', 'turn output into evidence through tests, evals, traces, or review.'],
12
+ ['Persist:', 'write progress, receipts, and durable state outside the model.'],
13
+ ['Decide:', 'choose one bounded outcome: retry with evidence, escalate, or exit.'],
14
  ];
15
+ let activeStage = 0;
16
+ let manualSelectionUntil = 0;
17
  const stageSubscribers = [];
18
 
19
  function renderStageCopy(index) {
20
  if (!stageDetail) return;
21
  const strong = document.createElement('strong');
22
+ strong.textContent = stages[index][0];
23
+ stageDetail.replaceChildren(strong, document.createTextNode(` ${stages[index][1]}`));
24
  }
25
 
26
+ function selectStage(index, moveFocus = false, userInitiated = false) {
27
+ activeStage = Math.max(0, Math.min(stages.length - 1, index));
28
+ if (userInitiated) manualSelectionUntil = performance.now() + 8000;
29
  stageButtons.forEach((button, buttonIndex) => {
30
  button.setAttribute('aria-pressed', buttonIndex === activeStage ? 'true' : 'false');
31
  });
 
35
  }
36
 
37
  stageButtons.forEach((button, index) => {
38
+ button.addEventListener('click', () => selectStage(index, false, true));
39
+ button.addEventListener('focus', () => selectStage(index, false, true));
40
  button.addEventListener('keydown', (event) => {
41
  if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;
42
  event.preventDefault();
43
+ if (event.key === 'Home') selectStage(0, true, true);
44
+ else if (event.key === 'End') selectStage(stageButtons.length - 1, true, true);
45
  else {
46
  const direction = event.key === 'ArrowRight' ? 1 : -1;
47
+ selectStage((index + direction + stageButtons.length) % stageButtons.length, true, true);
48
  }
49
  });
50
  });
51
 
52
+ selectStage(activeStage);
53
 
54
  if (container && hero) {
55
  const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
56
  const lowPower = Number(navigator.hardwareConcurrency || 8) <= 4;
57
+ const palette = [0x1457ff, 0x009ac2, 0x07866f, 0x12a66a, 0x2868df, 0x7657e8];
58
+ const paper = new THREE.Color(0xf7f9fc);
59
  const white = new THREE.Color(0xffffff);
60
+ const yAxis = new THREE.Vector3(0, 1, 0);
61
  let renderer;
62
 
63
  try {
 
72
  }
73
 
74
  if (renderer) {
75
+ renderer.setClearColor(paper, 1);
76
  renderer.outputColorSpace = THREE.SRGBColorSpace;
77
  renderer.toneMapping = THREE.ACESFilmicToneMapping;
78
+ renderer.toneMappingExposure = 1;
79
  renderer.domElement.setAttribute('aria-hidden', 'true');
80
  renderer.domElement.dataset.loopSceneCanvas = 'true';
81
  container.appendChild(renderer.domElement);
82
 
83
  const scene = new THREE.Scene();
84
+ const camera = new THREE.PerspectiveCamera(29, 1, 0.1, 60);
85
+ scene.add(new THREE.HemisphereLight(0xffffff, 0xb9cbe4, 2.15));
86
 
 
87
  const keyLight = new THREE.DirectionalLight(0xffffff, 2.8);
88
+ keyLight.position.set(-4, 6, 8);
89
  scene.add(keyLight);
90
+
91
+ const cyanLight = new THREE.PointLight(0x08a9c4, 13, 14, 2);
92
+ cyanLight.position.set(-1.5, 1.2, 4.5);
93
+ scene.add(cyanLight);
94
+
95
+ const greenLight = new THREE.PointLight(0x16a36a, 8, 10, 2);
96
+ greenLight.position.set(2.3, 0.8, 3.6);
97
+ scene.add(greenLight);
98
 
99
  const root = new THREE.Group();
 
100
  scene.add(root);
101
 
102
+ function standardMaterial(hex, lighten = 0.5, options = {}) {
103
+ const color = new THREE.Color(hex);
104
+ const blend = Math.min(lighten, 0.58);
105
+ return new THREE.MeshStandardMaterial({
106
+ color: color.clone().lerp(white, blend),
107
+ emissive: color,
108
+ emissiveIntensity: options.emissiveIntensity ?? 0.08,
109
+ metalness: options.metalness ?? 0.12,
110
+ roughness: options.roughness ?? 0.34,
111
+ transparent: options.transparent ?? false,
112
+ opacity: options.opacity ?? 1,
113
+ depthWrite: options.depthWrite ?? true,
114
+ });
115
+ }
 
 
 
 
 
 
116
 
117
+ function basicMaterial(hex, opacity = 1) {
118
+ return new THREE.MeshBasicMaterial({
119
+ color: hex,
120
+ transparent: opacity < 1,
121
+ opacity,
122
+ depthWrite: opacity >= 1,
123
+ });
124
+ }
125
+
126
+ function cylinderBetween(start, end, radius, material, segments = 12) {
127
+ const direction = end.clone().sub(start);
128
+ const cylinder = new THREE.Mesh(
129
+ new THREE.CylinderGeometry(radius, radius, direction.length(), segments),
130
+ material,
131
+ );
132
+ cylinder.position.copy(start).add(end).multiplyScalar(0.5);
133
+ cylinder.quaternion.setFromUnitVectors(yAxis, direction.normalize());
134
+ return cylinder;
135
+ }
136
+
137
+ function addTube(curve, radius, hex, opacity, segments = 120) {
138
+ const tube = new THREE.Mesh(
139
+ new THREE.TubeGeometry(curve, lowPower ? Math.round(segments * 0.65) : segments, radius, 6, false),
140
+ new THREE.MeshBasicMaterial({
141
+ color: hex,
142
+ transparent: true,
143
+ opacity,
144
+ blending: opacity < 0.16 ? THREE.AdditiveBlending : THREE.NormalBlending,
145
+ depthWrite: false,
146
+ }),
147
+ );
148
+ root.add(tube);
149
+ return tube;
150
+ }
151
+
152
+ function addArrow(curve, time, hex, scale = 1) {
153
+ const tangent = curve.getTangentAt(time).normalize();
154
+ const arrow = new THREE.Mesh(
155
+ new THREE.ConeGeometry(0.06 * scale, 0.2 * scale, lowPower ? 10 : 16),
156
+ basicMaterial(hex, 0.78),
157
+ );
158
+ arrow.position.copy(curve.getPointAt(time));
159
+ arrow.quaternion.setFromUnitVectors(yAxis, tangent);
160
+ root.add(arrow);
161
+ return arrow;
162
+ }
163
+
164
+ function positionArrow(arrow, curve, time) {
165
+ const tangent = curve.getTangentAt(time).normalize();
166
+ arrow.position.copy(curve.getPointAt(time));
167
+ arrow.quaternion.setFromUnitVectors(yAxis, tangent);
168
+ }
169
+
170
+ function replaceTubeGeometry(mesh, curve, radius, segments) {
171
+ mesh.geometry.dispose();
172
+ mesh.geometry = new THREE.TubeGeometry(
173
+ curve,
174
+ lowPower ? Math.round(segments * 0.65) : segments,
175
+ radius,
176
+ 6,
177
+ false,
178
+ );
179
+ }
180
+
181
+ function roundedRect(context, x, y, width, height, radius) {
182
+ context.beginPath();
183
+ context.moveTo(x + radius, y);
184
+ context.lineTo(x + width - radius, y);
185
+ context.quadraticCurveTo(x + width, y, x + width, y + radius);
186
+ context.lineTo(x + width, y + height - radius);
187
+ context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
188
+ context.lineTo(x + radius, y + height);
189
+ context.quadraticCurveTo(x, y + height, x, y + height - radius);
190
+ context.lineTo(x, y + radius);
191
+ context.quadraticCurveTo(x, y, x + radius, y);
192
+ context.closePath();
193
+ }
194
+
195
+ function labelSprite(text, hex) {
196
+ const canvas = document.createElement('canvas');
197
+ canvas.width = 512;
198
+ canvas.height = 104;
199
+ const context = canvas.getContext('2d');
200
+ const cssColor = `#${hex.toString(16).padStart(6, '0')}`;
201
+ context.clearRect(0, 0, canvas.width, canvas.height);
202
+ roundedRect(context, 4, 4, 504, 96, 18);
203
+ context.fillStyle = 'rgba(247, 249, 252, 0.95)';
204
+ context.fill();
205
+ context.lineWidth = 4;
206
+ context.strokeStyle = cssColor;
207
+ context.stroke();
208
+ context.fillStyle = '#111827';
209
+ context.font = '700 32px IBM Plex Mono, ui-monospace, monospace';
210
+ context.textAlign = 'center';
211
+ context.textBaseline = 'middle';
212
+ context.fillText(text, 256, 53);
213
+
214
+ const texture = new THREE.CanvasTexture(canvas);
215
+ texture.colorSpace = THREE.SRGBColorSpace;
216
+ texture.minFilter = THREE.LinearFilter;
217
+ const sprite = new THREE.Sprite(new THREE.SpriteMaterial({
218
+ map: texture,
219
  transparent: true,
220
+ depthTest: false,
 
221
  depthWrite: false,
222
+ }));
223
+ sprite.scale.set(1.48, 0.32, 1);
224
+ sprite.renderOrder = 20;
225
+ return sprite;
226
+ }
227
+
228
+ function numberSprite(number, hex) {
229
+ const canvas = document.createElement('canvas');
230
+ canvas.width = 128;
231
+ canvas.height = 128;
232
+ const context = canvas.getContext('2d');
233
+ const cssColor = `#${hex.toString(16).padStart(6, '0')}`;
234
+ context.beginPath();
235
+ context.arc(64, 64, 54, 0, Math.PI * 2);
236
+ context.fillStyle = 'rgba(255, 255, 255, 0.98)';
237
+ context.fill();
238
+ context.lineWidth = 7;
239
+ context.strokeStyle = cssColor;
240
+ context.stroke();
241
+ context.fillStyle = '#111827';
242
+ context.font = '700 46px IBM Plex Mono, ui-monospace, monospace';
243
+ context.textAlign = 'center';
244
+ context.textBaseline = 'middle';
245
+ context.fillText(String(number).padStart(2, '0'), 64, 67);
246
+
247
+ const texture = new THREE.CanvasTexture(canvas);
248
+ texture.colorSpace = THREE.SRGBColorSpace;
249
+ texture.minFilter = THREE.LinearFilter;
250
+ const sprite = new THREE.Sprite(new THREE.SpriteMaterial({
251
+ map: texture,
252
+ transparent: true,
253
+ depthTest: false,
254
+ depthWrite: false,
255
+ }));
256
+ sprite.scale.set(0.42, 0.42, 1);
257
+ sprite.renderOrder = 21;
258
+ return sprite;
259
+ }
260
+
261
+ const desktopStagePositions = [
262
+ new THREE.Vector3(-4.35, -0.06, 0.22),
263
+ new THREE.Vector3(-2.62, 0.08, 0.04),
264
+ new THREE.Vector3(-0.86, -0.03, 0.18),
265
+ new THREE.Vector3(0.94, 0.08, 0.02),
266
+ new THREE.Vector3(2.62, -0.02, 0.16),
267
+ new THREE.Vector3(4.12, 0.07, 0.02),
268
+ ];
269
+ const compactStagePositions = [
270
+ new THREE.Vector3(-2.7, 0.78, 0.2),
271
+ new THREE.Vector3(-0.92, 0.78, 0.04),
272
+ new THREE.Vector3(0.88, 0.78, 0.18),
273
+ new THREE.Vector3(2.65, 0.78, 0.02),
274
+ new THREE.Vector3(1.52, -0.74, 0.16),
275
+ new THREE.Vector3(-0.18, -0.74, 0.02),
276
+ ];
277
+ const stagePositions = desktopStagePositions.map((position) => position.clone());
278
+ let mainCurve = new THREE.CatmullRomCurve3(stagePositions, false, 'centripetal', 0.35);
279
+ const mainTube = addTube(mainCurve, 0.032, 0x1457ff, 0.82, 180);
280
+ const mainGlow = addTube(mainCurve, 0.095, 0x009ac2, 0.1, 150);
281
+ const mainArrowTimes = [0.11, 0.29, 0.47, 0.65, 0.84];
282
+ const mainArrows = mainArrowTimes.map((time, index) => (
283
+ addArrow(mainCurve, time, palette[Math.min(index + 1, palette.length - 1)], 1.02)
284
+ ));
285
 
286
  function closestCurveTime(position) {
287
  let closestTime = 0;
288
  let closestDistance = Infinity;
289
  for (let sample = 0; sample <= 240; sample += 1) {
290
  const time = sample / 240;
291
+ const distance = mainCurve.getPointAt(time).distanceToSquared(position);
292
  if (distance < closestDistance) {
293
  closestDistance = distance;
294
  closestTime = time;
 
297
  return closestTime;
298
  }
299
 
300
+ let stageTimes = stagePositions.map(closestCurveTime);
301
+ let retryCurve = new THREE.CatmullRomCurve3([
302
+ stagePositions[5],
303
+ new THREE.Vector3(3.7, 1.48, -0.55),
304
+ new THREE.Vector3(0.1, 1.88, -0.82),
305
+ new THREE.Vector3(-3.85, 1.4, -0.52),
306
+ stagePositions[0],
307
+ ], false, 'centripetal', 0.45);
308
+ const retryLine = new THREE.Line(
309
+ new THREE.BufferGeometry().setFromPoints(retryCurve.getPoints(lowPower ? 90 : 160)),
310
+ new THREE.LineDashedMaterial({
311
+ color: 0x7c5ce0,
 
 
 
 
 
 
 
 
 
 
 
 
312
  transparent: true,
313
+ opacity: 0.6,
314
+ dashSize: 0.14,
315
+ gapSize: 0.1,
316
  depthWrite: false,
317
+ }),
318
+ );
319
+ retryLine.computeLineDistances();
320
+ root.add(retryLine);
321
+ const retryArrowTimes = [0.24, 0.5, 0.76];
322
+ const retryArrows = retryArrowTimes.map((time) => addArrow(retryCurve, time, 0x7657e8, 0.94));
323
+
324
+ const exitTarget = new THREE.Vector3(5.35, 0.75, 0.08);
325
+ const escalateTarget = new THREE.Vector3(5.35, -0.72, 0.12);
326
+ let exitCurve = new THREE.CatmullRomCurve3([
327
+ stagePositions[5],
328
+ new THREE.Vector3(4.72, 0.3, 0.04),
329
+ exitTarget,
330
+ ], false, 'centripetal', 0.35);
331
+ let escalateCurve = new THREE.CatmullRomCurve3([
332
+ stagePositions[5],
333
+ new THREE.Vector3(4.7, -0.28, 0.06),
334
+ escalateTarget,
335
+ ], false, 'centripetal', 0.35);
336
+ const exitTube = addTube(exitCurve, 0.022, 0x16a36a, 0.82, 60);
337
+ const escalateTube = addTube(escalateCurve, 0.022, 0xd97706, 0.76, 60);
338
+ const exitArrow = addArrow(exitCurve, 0.68, 0x16a36a, 0.9);
339
+ const escalateArrow = addArrow(escalateCurve, 0.68, 0xd97706, 0.9);
340
+
341
+ const stationStates = [];
342
+ const labels = [];
343
+ const numberLabels = [];
344
+
345
+ function createStation(index, name) {
346
+ const color = palette[index];
347
+ const group = new THREE.Group();
348
+ group.position.copy(stagePositions[index]);
349
+ root.add(group);
350
 
351
  const haloMaterial = new THREE.MeshBasicMaterial({
352
  color,
353
  transparent: true,
354
+ opacity: 0.12,
355
  blending: THREE.AdditiveBlending,
356
  depthWrite: false,
357
  });
358
+ const halo = new THREE.Mesh(
359
+ new THREE.TorusGeometry(0.67, 0.025, 8, lowPower ? 32 : 56),
360
+ haloMaterial,
361
+ );
362
+ halo.rotation.x = Math.PI / 2;
363
+ halo.position.y = -0.42;
364
  group.add(halo);
365
 
366
+ const baseMaterial = standardMaterial(color, 0.56, { emissiveIntensity: 0.05, roughness: 0.46 });
367
+ const base = new THREE.Mesh(
368
+ new THREE.CylinderGeometry(0.55, 0.61, 0.09, lowPower ? 20 : 36),
369
+ baseMaterial,
 
 
 
 
 
370
  );
371
+ base.position.y = -0.39;
372
+ group.add(base);
373
+
374
+ const label = labelSprite(`${String(index + 1).padStart(2, '0')} ${name.toUpperCase()}`, color);
375
+ label.position.set(0, 1.22, 0.12);
376
+ group.add(label);
377
+ labels.push(label);
378
+
379
+ const numberLabel = numberSprite(index + 1, color);
380
+ numberLabel.position.set(0.4, 0.84, 0.38);
381
+ group.add(numberLabel);
382
+ numberLabels.push(numberLabel);
383
+
384
+ const state = { group, haloMaterial, baseMaterial, materials: [], label, numberLabel };
385
+ stationStates.push(state);
386
+ return state;
387
+ }
388
 
389
+ function track(state, material) {
390
+ state.materials.push(material);
391
+ return material;
392
+ }
 
393
 
394
+ const intake = createStation(0, 'Intake');
395
+ const intakeMaterial = track(intake, standardMaterial(palette[0], 0.58));
396
+ const intakeTray = new THREE.Mesh(new THREE.BoxGeometry(0.82, 0.1, 0.62), intakeMaterial);
397
+ intakeTray.position.y = -0.08;
398
+ intake.group.add(intakeTray);
399
+ [-0.38, 0.38].forEach((x) => {
400
+ const wall = new THREE.Mesh(new THREE.BoxGeometry(0.08, 0.38, 0.62), intakeMaterial);
401
+ wall.position.set(x, 0.08, 0);
402
+ intake.group.add(wall);
403
+ });
404
+ const funnelMaterial = track(intake, standardMaterial(0x08a9c4, 0.62, { transparent: true, opacity: 0.9 }));
405
+ const intakeFunnel = new THREE.Mesh(
406
+ new THREE.CylinderGeometry(0.34, 0.14, 0.48, lowPower ? 20 : 32, 1, true),
407
+ funnelMaterial,
408
+ );
409
+ intakeFunnel.position.y = 0.52;
410
+ intake.group.add(intakeFunnel);
411
+ const incomingPacketMaterial = track(intake, standardMaterial(0x155eef, 0.35, { emissiveIntensity: 0.35 }));
412
+ const incomingPacket = new THREE.Mesh(new THREE.BoxGeometry(0.18, 0.18, 0.18), incomingPacketMaterial);
413
+ incomingPacket.position.y = 0.95;
414
+ intake.group.add(incomingPacket);
415
+
416
+ const delegate = createStation(1, 'Delegate');
417
+ const delegateHubMaterial = track(delegate, standardMaterial(palette[1], 0.45, { emissiveIntensity: 0.24 }));
418
+ const delegateHub = new THREE.Mesh(new THREE.SphereGeometry(0.2, 24, 16), delegateHubMaterial);
419
+ delegateHub.position.y = 0.12;
420
+ delegate.group.add(delegateHub);
421
+ const delegateNodes = [
422
+ new THREE.Vector3(-0.42, 0.58, 0.02),
423
+ new THREE.Vector3(0.46, 0.5, -0.02),
424
+ new THREE.Vector3(0.32, -0.16, 0.08),
425
+ ].map((position, index) => {
426
+ const material = track(delegate, standardMaterial([0x155eef, 0x16a36a, 0x7c5ce0][index], 0.45));
427
+ const node = new THREE.Mesh(new THREE.SphereGeometry(0.13, 20, 12), material);
428
+ node.position.copy(position);
429
+ node.userData.basePosition = position.clone();
430
+ delegate.group.add(node);
431
+ delegate.group.add(cylinderBetween(
432
+ new THREE.Vector3(0, 0.12, 0),
433
+ position,
434
+ 0.014,
435
+ basicMaterial([0x155eef, 0x16a36a, 0x7c5ce0][index], 0.48),
436
+ ));
437
+ return node;
438
  });
439
 
440
+ const act = createStation(2, 'Act');
441
+ const sandbox = new THREE.Mesh(
442
+ new THREE.BoxGeometry(0.92, 0.86, 0.78),
443
+ new THREE.MeshBasicMaterial({ color: palette[2], wireframe: true, transparent: true, opacity: 0.46 }),
444
+ );
445
+ sandbox.position.y = 0.16;
446
+ act.group.add(sandbox);
447
+ const actCoreMaterial = track(act, standardMaterial(palette[2], 0.36, { emissiveIntensity: 0.3 }));
448
+ const actCore = new THREE.Mesh(new THREE.IcosahedronGeometry(0.25, 1), actCoreMaterial);
449
+ actCore.position.y = 0.16;
450
+ act.group.add(actCore);
451
+ const scannerMaterial = new THREE.MeshBasicMaterial({
452
+ color: 0x08a9c4,
453
+ transparent: true,
454
+ opacity: 0.22,
455
+ blending: THREE.AdditiveBlending,
456
+ depthWrite: false,
457
+ });
458
+ const scanner = new THREE.Mesh(new THREE.BoxGeometry(0.78, 0.022, 0.66), scannerMaterial);
459
+ scanner.position.y = -0.2;
460
+ act.group.add(scanner);
461
+
462
+ const verify = createStation(3, 'Verify');
463
+ const verifyRingMaterial = track(verify, standardMaterial(palette[3], 0.44, { emissiveIntensity: 0.22 }));
464
+ const verifyRing = new THREE.Mesh(
465
+ new THREE.TorusGeometry(0.48, 0.065, 12, lowPower ? 36 : 64),
466
+ verifyRingMaterial,
467
+ );
468
+ verifyRing.position.y = 0.14;
469
+ verify.group.add(verifyRing);
470
+ const verifyAuraMaterial = new THREE.MeshBasicMaterial({
471
+ color: palette[3],
472
+ transparent: true,
473
+ opacity: 0.12,
474
+ blending: THREE.AdditiveBlending,
475
+ depthWrite: false,
476
+ });
477
+ const verifyAura = new THREE.Mesh(new THREE.TorusGeometry(0.62, 0.018, 8, 64), verifyAuraMaterial);
478
+ verifyAura.position.copy(verifyRing.position);
479
+ verify.group.add(verifyAura);
480
+ const checkMaterial = track(verify, standardMaterial(0x16a36a, 0.18, { emissiveIntensity: 0.62 }));
481
+ verify.group.add(cylinderBetween(
482
+ new THREE.Vector3(-0.23, 0.13, 0.12),
483
+ new THREE.Vector3(-0.06, -0.04, 0.12),
484
+ 0.045,
485
+ checkMaterial,
486
+ 16,
487
+ ));
488
+ verify.group.add(cylinderBetween(
489
+ new THREE.Vector3(-0.06, -0.04, 0.12),
490
+ new THREE.Vector3(0.28, 0.34, 0.12),
491
+ 0.045,
492
+ checkMaterial,
493
+ 16,
494
+ ));
495
+ const evidenceDots = [0, 1, 2].map((index) => {
496
+ const dot = new THREE.Mesh(
497
+ new THREE.SphereGeometry(0.055, 12, 8),
498
+ basicMaterial(index === 1 ? 0x16a36a : 0x08a9c4, 0.84),
499
  );
500
+ verify.group.add(dot);
501
+ return dot;
 
 
502
  });
503
 
504
+ const persist = createStation(4, 'Persist');
505
+ const persistPlates = [0, 1, 2, 3].map((index) => {
506
+ const material = track(persist, standardMaterial(index % 2 ? 0x155eef : 0x08a9c4, 0.58, { emissiveIntensity: 0.1 }));
507
+ const plate = new THREE.Mesh(new THREE.BoxGeometry(0.88, 0.11, 0.62), material);
508
+ plate.position.set(index * 0.035 - 0.05, -0.12 + index * 0.18, -index * 0.035);
509
+ plate.userData.baseY = plate.position.y;
510
+ persist.group.add(plate);
511
+ return plate;
512
+ });
513
+ const receiptMaterial = track(persist, standardMaterial(0x16a36a, 0.34, { emissiveIntensity: 0.34 }));
514
+ [-0.26, 0, 0.26].forEach((x, index) => {
515
+ const receipt = new THREE.Mesh(new THREE.BoxGeometry(0.13, 0.18, 0.13), receiptMaterial);
516
+ receipt.position.set(x, 0.66 + index * 0.04, 0.02);
517
+ persist.group.add(receipt);
518
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
 
520
+ const decide = createStation(5, 'Decide');
521
+ const decisionMaterial = track(decide, standardMaterial(palette[5], 0.38, { emissiveIntensity: 0.3 }));
522
+ const decisionCore = new THREE.Mesh(new THREE.OctahedronGeometry(0.48, 0), decisionMaterial);
523
+ decisionCore.position.y = 0.13;
524
+ decide.group.add(decisionCore);
525
+ const decisionRingMaterial = new THREE.MeshBasicMaterial({
526
+ color: palette[5],
527
+ transparent: true,
528
+ opacity: 0.42,
529
+ depthWrite: false,
 
 
 
 
530
  });
531
+ const decisionRing = new THREE.Mesh(new THREE.TorusGeometry(0.61, 0.02, 8, 56), decisionRingMaterial);
532
+ decisionRing.position.copy(decisionCore.position);
533
+ decide.group.add(decisionRing);
534
 
535
+ function endpoint(position, hex, shape = 'ring') {
536
+ const group = new THREE.Group();
537
+ group.position.copy(position);
538
+ const material = standardMaterial(hex, 0.38, { emissiveIntensity: 0.42 });
539
+ const mesh = shape === 'ring'
540
+ ? new THREE.Mesh(new THREE.TorusGeometry(0.2, 0.048, 10, 32), material)
541
+ : new THREE.Mesh(new THREE.OctahedronGeometry(0.22, 0), material);
542
+ group.add(mesh);
543
+ const halo = new THREE.Mesh(
544
+ new THREE.TorusGeometry(0.3, 0.012, 8, 36),
545
+ new THREE.MeshBasicMaterial({ color: hex, transparent: true, opacity: 0.24, depthWrite: false }),
546
+ );
547
+ group.add(halo);
548
+ root.add(group);
549
+ return { group, mesh, halo };
 
 
 
 
 
 
 
 
 
 
550
  }
551
 
552
+ const exitEndpoint = endpoint(exitTarget, 0x16a36a, 'ring');
553
+ const escalateEndpoint = endpoint(escalateTarget, 0xd97706, 'diamond');
 
 
554
 
555
+ const packetMaterial = standardMaterial(palette[0], 0.28, { emissiveIntensity: 0.48, roughness: 0.22 });
556
+ const packet = new THREE.Mesh(new THREE.BoxGeometry(0.36, 0.27, 0.28), packetMaterial);
557
+ const packetEdgesMaterial = new THREE.LineBasicMaterial({ color: palette[0], transparent: true, opacity: 0.92 });
558
+ const packetEdges = new THREE.LineSegments(new THREE.EdgesGeometry(packet.geometry), packetEdgesMaterial);
559
+ const packetAuraMaterial = new THREE.MeshBasicMaterial({
560
+ color: palette[0],
561
  transparent: true,
562
+ opacity: 0.16,
563
  blending: THREE.AdditiveBlending,
564
  depthWrite: false,
565
  });
566
+ const packetAura = new THREE.Mesh(new THREE.SphereGeometry(0.38, 18, 12), packetAuraMaterial);
567
+ const packetBand = new THREE.Mesh(
568
+ new THREE.BoxGeometry(0.372, 0.055, 0.292),
569
+ basicMaterial(0xffffff, 0.94),
570
  );
571
+ packetBand.position.y = 0.055;
572
+ const packetGroup = new THREE.Group();
573
+ packetGroup.add(packetAura, packet, packetEdges, packetBand);
574
+ packetGroup.position.copy(stagePositions[0]);
575
+ root.add(packetGroup);
576
 
577
  const trail = [];
578
  if (!lowPower) {
579
+ for (let index = 0; index < 7; index += 1) {
580
+ const material = new THREE.MeshBasicMaterial({
581
+ color: palette[0],
582
+ transparent: true,
583
+ opacity: 0.22 * (1 - index / 8),
584
+ depthWrite: false,
585
+ });
586
+ const point = new THREE.Mesh(new THREE.SphereGeometry(0.052 - index * 0.003, 10, 7), material);
587
+ point.position.copy(packetGroup.position);
588
  trail.push(point);
589
  root.add(point);
590
  }
591
  }
592
 
593
+ const retryPulse = new THREE.Mesh(
594
+ new THREE.SphereGeometry(0.07, 14, 9),
595
+ new THREE.MeshBasicMaterial({ color: 0x7c5ce0, transparent: true, opacity: 0.9, depthWrite: false }),
596
+ );
597
+ root.add(retryPulse);
598
+ const exitPulse = new THREE.Mesh(new THREE.SphereGeometry(0.065, 14, 9), basicMaterial(0x16a36a, 0.9));
599
+ const escalatePulse = new THREE.Mesh(new THREE.SphereGeometry(0.065, 14, 9), basicMaterial(0xd97706, 0.85));
600
+ root.add(exitPulse, escalatePulse);
601
+
602
  let frameCount = 0;
603
  let animationFrame = 0;
604
  let visible = true;
 
606
  let targetRotationY = 0;
607
  let layoutScaleX = 1;
608
  let layoutScaleY = 1;
609
+ let stationLayoutScale = 1.12;
610
+ let endpointLayoutScale = 1.08;
611
+ let currentPacketColor = -1;
612
+ let currentFlowStage = activeStage;
613
+ const startedAt = performance.now();
614
+ const targetPacketPosition = new THREE.Vector3();
615
+
616
+ function setPacketColor(hex) {
617
+ if (currentPacketColor === hex) return;
618
+ currentPacketColor = hex;
619
+ const color = new THREE.Color(hex);
620
+ packetMaterial.color.copy(color).lerp(white, 0.28);
621
+ packetMaterial.emissive.copy(color);
622
+ packetEdgesMaterial.color.copy(color);
623
+ packetAuraMaterial.color.copy(color);
624
+ trail.forEach((point) => point.material.color.copy(color));
625
+ }
626
 
627
+ function nearestStage(time) {
628
+ let nearest = 0;
629
+ let distance = Infinity;
630
+ stageTimes.forEach((stageTime, index) => {
631
+ const candidate = Math.abs(stageTime - time);
632
+ if (candidate < distance) {
633
+ distance = candidate;
634
+ nearest = index;
635
+ }
636
+ });
637
+ return nearest;
638
  }
639
 
640
  function render(time = 0) {
641
+ const seconds = Math.max(0, time - startedAt) * 0.001;
642
+ const manual = reducedMotion.matches || performance.now() < manualSelectionUntil;
643
+ let flowStage = activeStage;
644
+
645
+ if (manual) {
646
+ targetPacketPosition.copy(stagePositions[activeStage]);
647
+ setPacketColor(palette[activeStage]);
648
+ } else {
649
+ const phase = (seconds * 0.062) % 1;
650
+ if (phase < 0.76) {
651
+ const progress = phase / 0.76;
652
+ targetPacketPosition.copy(mainCurve.getPointAt(progress));
653
+ flowStage = nearestStage(progress);
654
+ setPacketColor(palette[flowStage]);
655
+ } else {
656
+ const progress = (phase - 0.76) / 0.24;
657
+ targetPacketPosition.copy(retryCurve.getPointAt(progress));
658
+ flowStage = progress > 0.84 ? 0 : 5;
659
+ setPacketColor(progress > 0.84 ? palette[0] : 0x7c5ce0);
660
+ }
661
+
662
+ if (flowStage !== currentFlowStage) {
663
+ currentFlowStage = flowStage;
664
+ selectStage(flowStage);
665
+ }
666
+ }
667
+
668
+ packetGroup.position.lerp(targetPacketPosition, reducedMotion.matches ? 1 : 0.16);
669
+ packetGroup.rotation.x = seconds * 0.72;
670
+ packetGroup.rotation.y = seconds * 0.94;
671
+ const packetPulse = reducedMotion.matches ? 1 : 1 + Math.sin(seconds * 3.2) * 0.06;
672
+ packetAura.scale.setScalar(packetPulse);
673
+
674
+ let previous = packetGroup.position;
675
  trail.forEach((point, index) => {
676
+ point.position.lerp(previous, 0.17 - index * 0.01);
677
+ previous = point.position;
678
  });
679
 
680
+ stationStates.forEach((state, index) => {
681
  const selected = index === activeStage;
682
+ const packetDistance = state.group.position.distanceTo(packetGroup.position);
683
+ const nearby = Math.max(0, 1 - packetDistance / 1.15);
684
+ const scale = 1 + (selected ? 0.09 : 0) + nearby * 0.05;
685
+ state.group.scale.setScalar(scale * stationLayoutScale);
686
+ state.haloMaterial.opacity = selected ? 0.38 : 0.07 + nearby * 0.18;
687
+ state.baseMaterial.emissiveIntensity = selected ? 0.17 : 0.035 + nearby * 0.08;
688
+ state.materials.forEach((material) => {
689
+ material.emissiveIntensity = selected ? Math.max(material.emissiveIntensity, 0.28) : 0.08 + nearby * 0.14;
690
+ });
691
+ state.label.material.opacity = selected ? 1 : 0.72;
692
  });
693
 
694
+ incomingPacket.position.y = 0.88 - ((seconds * 0.42) % 1) * 0.34;
695
+ incomingPacket.rotation.y = seconds * 0.8;
696
+ delegateNodes.forEach((node, index) => {
697
+ const pulse = reducedMotion.matches ? 1 : 1 + Math.sin(seconds * 2.1 + index * 1.7) * 0.1;
698
+ node.scale.setScalar(pulse);
699
+ });
700
+ delegateHub.rotation.y = seconds * 0.6;
701
+ actCore.rotation.x = seconds * 0.54;
702
+ actCore.rotation.y = seconds * 0.76;
703
+ scanner.position.y = reducedMotion.matches ? 0.08 : -0.2 + ((Math.sin(seconds * 1.7) + 1) * 0.27);
704
+ const gatePulse = reducedMotion.matches ? 1 : 1 + Math.sin(seconds * 2.4) * 0.035;
705
+ verifyRing.scale.setScalar(gatePulse);
706
+ verifyAura.rotation.z = seconds * 0.16;
707
+ verifyAuraMaterial.opacity = activeStage === 3 ? 0.34 : 0.12;
708
+ evidenceDots.forEach((dot, index) => {
709
+ const angle = seconds * 1.05 + index * (Math.PI * 2 / evidenceDots.length);
710
+ dot.position.set(Math.cos(angle) * 0.68, 0.14 + Math.sin(angle) * 0.42, 0.02);
711
+ });
712
+ persistPlates.forEach((plate, index) => {
713
+ plate.position.y = plate.userData.baseY + (reducedMotion.matches ? 0 : Math.sin(seconds * 1.4 + index * 0.65) * 0.012);
714
+ });
715
+ decisionCore.rotation.y = seconds * 0.5;
716
+ decisionCore.rotation.z = Math.PI / 4 + seconds * 0.12;
717
+ decisionRing.rotation.z = -seconds * 0.18;
718
+
719
+ retryPulse.position.copy(retryCurve.getPointAt((seconds * 0.13 + 0.17) % 1));
720
+ exitPulse.position.copy(exitCurve.getPointAt((seconds * 0.24) % 1));
721
+ escalatePulse.position.copy(escalateCurve.getPointAt((seconds * 0.19 + 0.45) % 1));
722
+ const outcomePulse = reducedMotion.matches ? 1 : 1 + Math.sin(seconds * 2) * 0.08;
723
+ exitEndpoint.group.scale.setScalar(outcomePulse * endpointLayoutScale);
724
+ escalateEndpoint.group.scale.setScalar((2 - outcomePulse) * endpointLayoutScale);
725
 
726
  root.rotation.x += (targetRotationX - root.rotation.x) * 0.045;
727
  root.rotation.y += (targetRotationY - root.rotation.y) * 0.045;
728
+ root.scale.set(layoutScaleX, layoutScaleY, layoutScaleY);
 
 
729
  renderer.render(scene, camera);
730
  frameCount += 1;
731
  container.dataset.sceneFrames = String(frameCount);
 
751
  animationFrame = 0;
752
  }
753
 
754
+ function buildRetryCurve(compact) {
755
+ if (compact) {
756
+ return new THREE.CatmullRomCurve3([
757
+ stagePositions[5],
758
+ new THREE.Vector3(-0.82, 0.02, -0.58),
759
+ new THREE.Vector3(-2.5, 0.32, -0.76),
760
+ stagePositions[0],
761
+ ], false, 'centripetal', 0.42);
762
+ }
763
+ return new THREE.CatmullRomCurve3([
764
+ stagePositions[5],
765
+ new THREE.Vector3(3.7, 1.48, -0.55),
766
+ new THREE.Vector3(0.1, 1.88, -0.82),
767
+ new THREE.Vector3(-3.85, 1.4, -0.52),
768
+ stagePositions[0],
769
+ ], false, 'centripetal', 0.45);
770
+ }
771
+
772
+ function applySemanticLayout(compact) {
773
+ const positions = compact ? compactStagePositions : desktopStagePositions;
774
+ positions.forEach((position, index) => {
775
+ stagePositions[index].copy(position);
776
+ stationStates[index].group.position.copy(position);
777
+ });
778
+
779
+ mainCurve = new THREE.CatmullRomCurve3(stagePositions, false, 'centripetal', 0.35);
780
+ replaceTubeGeometry(mainTube, mainCurve, 0.032, 180);
781
+ replaceTubeGeometry(mainGlow, mainCurve, 0.095, 150);
782
+ mainArrows.forEach((arrow, index) => positionArrow(arrow, mainCurve, mainArrowTimes[index]));
783
+ stageTimes = stagePositions.map(closestCurveTime);
784
+
785
+ retryCurve = buildRetryCurve(compact);
786
+ retryLine.geometry.dispose();
787
+ retryLine.geometry = new THREE.BufferGeometry().setFromPoints(
788
+ retryCurve.getPoints(lowPower ? 90 : 160),
789
+ );
790
+ retryLine.computeLineDistances();
791
+ retryArrows.forEach((arrow, index) => {
792
+ positionArrow(arrow, retryCurve, retryArrowTimes[index]);
793
+ arrow.visible = !compact || index !== 1;
794
+ });
795
+
796
+ if (compact) {
797
+ exitTarget.set(-1.32, -1.5, 0.08);
798
+ escalateTarget.set(-2.35, -1.48, 0.12);
799
+ exitCurve = new THREE.CatmullRomCurve3([
800
+ stagePositions[5],
801
+ new THREE.Vector3(-0.62, -1.08, 0.04),
802
+ exitTarget,
803
+ ], false, 'centripetal', 0.35);
804
+ escalateCurve = new THREE.CatmullRomCurve3([
805
+ stagePositions[5],
806
+ new THREE.Vector3(-1.18, -1.16, 0.06),
807
+ escalateTarget,
808
+ ], false, 'centripetal', 0.35);
809
+ } else {
810
+ exitTarget.set(5.35, 0.75, 0.08);
811
+ escalateTarget.set(5.35, -0.72, 0.12);
812
+ exitCurve = new THREE.CatmullRomCurve3([
813
+ stagePositions[5],
814
+ new THREE.Vector3(4.72, 0.3, 0.04),
815
+ exitTarget,
816
+ ], false, 'centripetal', 0.35);
817
+ escalateCurve = new THREE.CatmullRomCurve3([
818
+ stagePositions[5],
819
+ new THREE.Vector3(4.7, -0.28, 0.06),
820
+ escalateTarget,
821
+ ], false, 'centripetal', 0.35);
822
+ }
823
+ replaceTubeGeometry(exitTube, exitCurve, 0.022, 60);
824
+ replaceTubeGeometry(escalateTube, escalateCurve, 0.022, 60);
825
+ positionArrow(exitArrow, exitCurve, 0.68);
826
+ positionArrow(escalateArrow, escalateCurve, 0.68);
827
+ exitEndpoint.group.position.copy(exitTarget);
828
+ escalateEndpoint.group.position.copy(escalateTarget);
829
+ }
830
+
831
  function resize() {
832
  const width = Math.max(container.clientWidth, 1);
833
  const height = Math.max(container.clientHeight, 1);
834
  const mobile = window.innerWidth < 640;
835
+ const narrow = window.innerWidth < 360;
836
+ const tablet = !mobile && window.innerWidth < 920;
837
+ applySemanticLayout(mobile);
838
  renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, mobile || lowPower ? 1.25 : 1.6));
839
  renderer.setSize(width, height, false);
840
  camera.aspect = width / height;
841
+ camera.fov = mobile ? 31 : 28;
842
+ camera.position.set(0, narrow ? 1.55 : mobile ? 1.5 : 3.25, narrow ? 7.35 : mobile ? 6.9 : 9.15);
843
+ camera.lookAt(0, mobile ? 0.05 : 0.12, 0);
844
  camera.updateProjectionMatrix();
845
+ layoutScaleX = mobile ? 1 : tablet ? 1.08 : 1.3;
846
+ layoutScaleY = mobile ? 1 : tablet ? 1 : 1.06;
847
+ stationLayoutScale = narrow ? 0.84 : mobile ? 0.86 : tablet ? 1.04 : 1.12;
848
+ endpointLayoutScale = mobile ? 0.9 : 1.08;
849
+ root.position.y = mobile ? 0.02 : -0.06;
850
+ labels.forEach((label) => { label.visible = width >= 760; });
851
+ numberLabels.forEach((label) => { label.visible = width < 760; });
852
  render(performance.now());
853
  }
854
 
 
856
  const bounds = hero.getBoundingClientRect();
857
  const x = (event.clientX - bounds.left) / bounds.width * 2 - 1;
858
  const y = (event.clientY - bounds.top) / bounds.height * 2 - 1;
859
+ targetRotationY = x * 0.035;
860
+ targetRotationX = -y * 0.018;
861
  }
862
 
863
  function resetPointer() {
 
865
  targetRotationY = 0;
866
  }
867
 
868
+ stageSubscribers.push(() => render(performance.now()));
869
+
870
  if ('ResizeObserver' in window) {
871
  const resizeObserver = new ResizeObserver(resize);
872
  resizeObserver.observe(container);
 
937
  drawCalls: renderer.info.render.calls,
938
  frameCount,
939
  height,
940
+ labelsVisible: labels.some((label) => label.visible),
941
  luminanceRange: maximumLuminance - minimumLuminance,
942
  lowPower,
943
+ outcomes: 3,
944
  painted,
945
  paintedRatio: sampled ? painted / sampled : 0,
946
  reducedMotion: reducedMotion.matches,
947
  sampled,
948
+ semanticStages: stationStates.length,
949
  triangles: renderer.info.render.triangles,
950
  width,
951
  };
 
953
 
954
  window.__loopScenePause = () => {
955
  stopAnimation();
956
+ manualSelectionUntil = performance.now() + 60000;
957
+ packetGroup.position.copy(stagePositions[activeStage]);
958
  render(performance.now());
959
  return window.__loopSceneDiagnostics();
960
  };
961
  window.__loopSceneResume = () => {
962
+ manualSelectionUntil = 0;
963
  startAnimation();
964
  return true;
965
  };
966
 
967
  resize();
 
968
  startAnimation();
969
  }
970
  }
docs/index.html CHANGED
@@ -145,29 +145,65 @@
145
  .hero .wrap { position: relative; z-index: 1; }
146
  .hero-copy { position: relative; z-index: 2; }
147
  .hero-system {
148
- display: grid;
149
- grid-template-columns: minmax(280px, 0.72fr) minmax(500px, 1.28fr);
150
- gap: 28px;
151
- align-items: center;
152
- width: min(100%, 1080px);
153
  margin: 34px auto 0;
154
- padding: 16px 0;
155
  border-top: 1px solid var(--line-strong);
156
  border-bottom: 1px solid var(--line-strong);
157
  }
158
- .hero-inspector { min-width: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  .hero-scene {
160
  position: relative;
161
  z-index: 0;
162
  min-width: 0;
163
  width: 100%;
164
- height: 220px;
165
- border-left: 1px solid var(--line);
166
  overflow: hidden;
167
  pointer-events: none;
168
  }
169
  .hero-scene canvas { display: block; width: 100%; height: 100%; opacity: 0.96; }
170
- .hero-scene[data-scene-state="fallback"] { display: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  .mental-model { padding: 18px 0 52px; }
172
  .section-label {
173
  margin: 0 0 12px;
@@ -223,19 +259,19 @@
223
  }
224
  .loop-stage-detail strong { color: var(--ink); }
225
  .hero-system .loop-stage-rail {
226
- grid-template-columns: repeat(2, minmax(0, 1fr));
227
  width: 100%;
228
  max-width: none;
229
  margin: 0;
230
  }
231
- .hero-system .loop-stage:nth-child(odd) { border-left: 0; }
232
- .hero-system .loop-stage:nth-child(n+3) { border-top: 1px solid var(--line); }
233
  .hero-inspector .loop-stage-detail {
234
- min-height: 64px;
235
  max-width: none;
236
- margin: 14px 0 0;
237
  border-left: 3px solid var(--blue);
238
- padding: 9px 0 0 14px;
239
  text-align: left;
240
  }
241
  .hero-visual { max-width: 780px; margin: 0 auto; }
@@ -531,28 +567,27 @@
531
  }
532
  @media (max-width: 920px) {
533
  .hero-system {
534
- grid-template-columns: 1fr;
535
- gap: 0;
536
- width: min(100%, 760px);
537
  margin-top: 28px;
538
- padding-top: 16px;
539
  }
540
- .hero-inspector { padding-bottom: 16px; }
541
- .hero-scene { height: 210px; border-top: 1px solid var(--line); border-left: 0; }
542
- .hero-system .loop-stage-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
543
- .hero-system .loop-stage:nth-child(n) { border-top: 0; border-left: 1px solid var(--line); }
544
- .hero-system .loop-stage:nth-child(3n+1) { border-left: 0; }
545
- .hero-system .loop-stage:nth-child(n+4) { border-top: 1px solid var(--line); }
546
  .hero-inspector .loop-stage-detail { min-height: 42px; }
547
  }
548
  @media (max-width: 820px) {
549
  .wrap { width: min(var(--maxw), calc(100% - 32px)); }
550
  .links.open { left: -16px; right: -16px; padding-inline: 16px; }
551
  section { padding: 68px 0; }
552
- .hero { min-height: 0; padding: 52px 0 32px; }
553
- .hero-scene { width: 100%; height: 200px; }
 
554
  .hero-scene canvas { opacity: 1; }
555
- h1 { font-size: 3rem; }
 
 
 
 
556
  h2 { font-size: 2rem; }
557
  .section-head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
558
  .stats { grid-template-columns: repeat(2, 1fr); }
@@ -585,27 +620,33 @@
585
  .nav-link { min-height: 40px; padding-inline: 12px; }
586
  .brand .brand-text { display: none; }
587
  section { padding: 52px 0; }
588
- h1 { font-size: 2.35rem; line-height: 1.08; }
589
  h2 { font-size: 1.85rem; line-height: 1.16; }
590
  .section-label { margin-bottom: 9px; font-size: 0.68rem; }
591
  .section-head { gap: 12px; margin-bottom: 24px; }
592
  .section-intro { font-size: 0.95rem; }
593
- .hero { min-height: 0; padding: 34px 0 20px; }
594
  .hero-kicker { max-width: 330px; margin: 0 auto 10px; line-height: 1.45; }
595
- .tagline { margin-top: 14px; font-size: 1.18rem; }
596
- .lead { margin-top: 10px; font-size: 0.95rem; line-height: 1.55; }
597
- .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 19px; }
598
  .actions .button { min-width: 0; min-height: 44px; padding-inline: 8px; font-size: 0.82rem; }
599
- .hero-system { margin-top: 22px; padding-top: 12px; padding-bottom: 0; }
600
- .hero-inspector { padding-bottom: 12px; }
601
- .hero-scene { width: 100%; height: 170px; }
 
602
  .hero-scene canvas { opacity: 1; }
 
 
 
 
603
  .loop-stage-rail { margin-top: 20px; }
604
- .loop-stage { min-height: 42px; padding-inline: 5px; font-size: 0.68rem; }
 
605
  .loop-stage-number { font-size: 0.59rem; }
606
  .loop-stage-detail { min-height: 40px; margin-top: 8px; font-size: 0.75rem; line-height: 1.45; }
607
- .hero-inspector .loop-stage-detail { min-height: 44px; margin-top: 10px; padding-top: 8px; }
608
- .mental-model { padding: 38px 0 44px; }
609
  .definition { margin-bottom: 22px; font-size: 0.88rem; line-height: 1.55; }
610
  .definition-full { display: none; }
611
  .definition-compact { display: inline; }
@@ -657,6 +698,13 @@
657
  }
658
  @media (max-width: 340px) {
659
  h1 { font-size: 2.2rem; }
 
 
 
 
 
 
 
660
  .actions .button { font-size: 0.78rem; }
661
  .menu-btn { padding-inline: 10px; }
662
  .nav-link { padding-inline: 10px; }
@@ -806,18 +854,29 @@
806
  </div>
807
  </div>
808
  <div class="hero-system">
 
 
 
 
 
 
 
 
 
 
 
 
809
  <div class="hero-inspector">
810
  <div class="loop-stage-rail" role="group" aria-label="Inspect the loop lifecycle">
811
- <button class="loop-stage" type="button" data-loop-stage="0" aria-pressed="false"><span class="loop-stage-number">01</span><span>Intake</span></button>
812
  <button class="loop-stage" type="button" data-loop-stage="1" aria-pressed="false"><span class="loop-stage-number">02</span><span>Delegate</span></button>
813
  <button class="loop-stage" type="button" data-loop-stage="2" aria-pressed="false"><span class="loop-stage-number">03</span><span>Act</span></button>
814
- <button class="loop-stage" type="button" data-loop-stage="3" aria-pressed="true"><span class="loop-stage-number">04</span><span>Verify</span></button>
815
  <button class="loop-stage" type="button" data-loop-stage="4" aria-pressed="false"><span class="loop-stage-number">05</span><span>Persist</span></button>
816
  <button class="loop-stage" type="button" data-loop-stage="5" aria-pressed="false"><span class="loop-stage-number">06</span><span>Decide</span></button>
817
  </div>
818
- <p class="loop-stage-detail" id="loop-stage-detail" aria-live="polite"><strong>Verify:</strong> gate completion with tests, evals, traces, or review.</p>
819
  </div>
820
- <div class="hero-scene" data-loop-scene aria-hidden="true"></div>
821
  </div>
822
  </div>
823
  </section>
@@ -1598,6 +1657,6 @@
1598
  });
1599
  });
1600
  </script>
1601
- <script type="module" src="assets/loop-hero-scene.js?v=12"></script>
1602
  </body>
1603
  </html>
 
145
  .hero .wrap { position: relative; z-index: 1; }
146
  .hero-copy { position: relative; z-index: 2; }
147
  .hero-system {
148
+ width: min(100%, 1120px);
 
 
 
 
149
  margin: 34px auto 0;
 
150
  border-top: 1px solid var(--line-strong);
151
  border-bottom: 1px solid var(--line-strong);
152
  }
153
+ .scene-head {
154
+ display: flex;
155
+ align-items: center;
156
+ justify-content: space-between;
157
+ gap: 20px;
158
+ min-height: 42px;
159
+ border-bottom: 1px solid var(--line);
160
+ padding: 9px 2px;
161
+ color: var(--quiet);
162
+ font-family: "IBM Plex Mono", ui-monospace, monospace;
163
+ font-size: 0.66rem;
164
+ text-transform: uppercase;
165
+ }
166
+ .scene-head strong { color: var(--blue); }
167
+ .scene-flow { text-align: right; }
168
+ .scene-flow span { color: var(--ink); font-weight: 700; }
169
+ .scene-flow i { padding: 0 6px; color: var(--blue); font-style: normal; }
170
  .hero-scene {
171
  position: relative;
172
  z-index: 0;
173
  min-width: 0;
174
  width: 100%;
175
+ height: 292px;
 
176
  overflow: hidden;
177
  pointer-events: none;
178
  }
179
  .hero-scene canvas { display: block; width: 100%; height: 100%; opacity: 0.96; }
180
+ .scene-fallback { display: none; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 0.82rem; }
181
+ .hero-scene[data-scene-state="fallback"] canvas { display: none; }
182
+ .hero-scene[data-scene-state="fallback"] .scene-fallback { display: flex; }
183
+ .scene-outcomes {
184
+ display: flex;
185
+ align-items: center;
186
+ justify-content: center;
187
+ gap: 26px;
188
+ min-height: 38px;
189
+ border-top: 1px solid var(--line);
190
+ color: var(--muted);
191
+ font-size: 0.7rem;
192
+ }
193
+ .scene-outcome { display: inline-flex; align-items: center; gap: 7px; }
194
+ .scene-outcome::before { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); content: ""; }
195
+ .scene-outcome.retry::before { background: var(--violet); }
196
+ .scene-outcome.escalate::before { background: #d97706; }
197
+ .scene-outcome.exit::before { background: var(--green); }
198
+ .hero-inspector {
199
+ display: grid;
200
+ grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
201
+ gap: 24px;
202
+ align-items: center;
203
+ min-width: 0;
204
+ border-top: 1px solid var(--line);
205
+ padding: 14px 0;
206
+ }
207
  .mental-model { padding: 18px 0 52px; }
208
  .section-label {
209
  margin: 0 0 12px;
 
259
  }
260
  .loop-stage-detail strong { color: var(--ink); }
261
  .hero-system .loop-stage-rail {
262
+ grid-template-columns: repeat(6, minmax(0, 1fr));
263
  width: 100%;
264
  max-width: none;
265
  margin: 0;
266
  }
267
+ .hero-system .loop-stage:nth-child(n) { border-top: 0; }
268
+ .hero-system .loop-stage:first-child { border-left: 0; }
269
  .hero-inspector .loop-stage-detail {
270
+ min-height: 54px;
271
  max-width: none;
272
+ margin: 0;
273
  border-left: 3px solid var(--blue);
274
+ padding: 7px 0 0 14px;
275
  text-align: left;
276
  }
277
  .hero-visual { max-width: 780px; margin: 0 auto; }
 
567
  }
568
  @media (max-width: 920px) {
569
  .hero-system {
570
+ width: 100%;
 
 
571
  margin-top: 28px;
 
572
  }
573
+ .hero-scene { height: 268px; }
574
+ .hero-inspector { grid-template-columns: 1fr; gap: 12px; padding: 14px 0; }
575
+ .hero-system .loop-stage-rail { grid-template-columns: repeat(6, minmax(0, 1fr)); }
 
 
 
576
  .hero-inspector .loop-stage-detail { min-height: 42px; }
577
  }
578
  @media (max-width: 820px) {
579
  .wrap { width: min(var(--maxw), calc(100% - 32px)); }
580
  .links.open { left: -16px; right: -16px; padding-inline: 16px; }
581
  section { padding: 68px 0; }
582
+ .hero { min-height: 0; padding: 40px 0 24px; }
583
+ .hero-system { margin-top: 24px; }
584
+ .hero-scene { width: 100%; height: 224px; }
585
  .hero-scene canvas { opacity: 1; }
586
+ .hero-system .loop-stage-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
587
+ .hero-system .loop-stage:nth-child(n) { border-top: 0; border-left: 1px solid var(--line); }
588
+ .hero-system .loop-stage:nth-child(3n+1) { border-left: 0; }
589
+ .hero-system .loop-stage:nth-child(n+4) { border-top: 1px solid var(--line); }
590
+ h1 { font-size: 2.7rem; }
591
  h2 { font-size: 2rem; }
592
  .section-head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
593
  .stats { grid-template-columns: repeat(2, 1fr); }
 
620
  .nav-link { min-height: 40px; padding-inline: 12px; }
621
  .brand .brand-text { display: none; }
622
  section { padding: 52px 0; }
623
+ h1 { font-size: 2.25rem; line-height: 1.08; }
624
  h2 { font-size: 1.85rem; line-height: 1.16; }
625
  .section-label { margin-bottom: 9px; font-size: 0.68rem; }
626
  .section-head { gap: 12px; margin-bottom: 24px; }
627
  .section-intro { font-size: 0.95rem; }
628
+ .hero { min-height: 0; padding: 28px 0 14px; }
629
  .hero-kicker { max-width: 330px; margin: 0 auto 10px; line-height: 1.45; }
630
+ .tagline { margin-top: 11px; font-size: 1.18rem; }
631
+ .lead { margin-top: 8px; font-size: 0.95rem; line-height: 1.48; }
632
+ .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
633
  .actions .button { min-width: 0; min-height: 44px; padding-inline: 8px; font-size: 0.82rem; }
634
+ .hero-system { margin-top: 18px; }
635
+ .scene-head { justify-content: center; min-height: 32px; padding: 6px 0; }
636
+ .scene-flow { display: none; }
637
+ .hero-scene { width: 100%; height: 188px; }
638
  .hero-scene canvas { opacity: 1; }
639
+ .scene-outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-height: 34px; padding: 4px 0; font-size: 0.6rem; line-height: 1.3; }
640
+ .scene-outcome { justify-content: center; gap: 5px; }
641
+ .scene-outcome::before { width: 6px; height: 6px; flex: 0 0 auto; }
642
+ .hero-inspector { gap: 7px; padding: 8px 0 10px; }
643
  .loop-stage-rail { margin-top: 20px; }
644
+ .hero-system .loop-stage-rail { margin: 0; }
645
+ .loop-stage { min-height: 38px; padding-inline: 5px; font-size: 0.68rem; }
646
  .loop-stage-number { font-size: 0.59rem; }
647
  .loop-stage-detail { min-height: 40px; margin-top: 8px; font-size: 0.75rem; line-height: 1.45; }
648
+ .hero-inspector .loop-stage-detail { min-height: 40px; margin: 0; padding-top: 6px; line-height: 1.38; }
649
+ .mental-model { padding: 24px 0 44px; }
650
  .definition { margin-bottom: 22px; font-size: 0.88rem; line-height: 1.55; }
651
  .definition-full { display: none; }
652
  .definition-compact { display: inline; }
 
698
  }
699
  @media (max-width: 340px) {
700
  h1 { font-size: 2.2rem; }
701
+ .hero { padding-bottom: 8px; }
702
+ .hero-system { margin-top: 16px; }
703
+ .scene-head { min-height: 28px; padding-block: 4px; }
704
+ .hero-scene { height: 148px; }
705
+ .scene-outcomes { min-height: 30px; padding-block: 3px; font-size: 0.56rem; }
706
+ .hero-inspector .loop-stage-detail { min-height: 34px; font-size: 0.72rem; }
707
+ .mental-model { padding-top: 8px; }
708
  .actions .button { font-size: 0.78rem; }
709
  .menu-btn { padding-inline: 10px; }
710
  .nav-link { padding-inline: 10px; }
 
854
  </div>
855
  </div>
856
  <div class="hero-system">
857
+ <div class="scene-head" aria-hidden="true">
858
+ <strong>One governed pass</strong>
859
+ <span class="scene-flow"><span>Work</span><i>&rarr;</i><span>Agent</span><i>&rarr;</i><span>Evidence</span><i>&rarr;</i><span>State</span><i>&rarr;</i><span>Decision</span></span>
860
+ </div>
861
+ <div class="hero-scene" data-loop-scene aria-hidden="true">
862
+ <div class="scene-fallback">Work enters, an agent acts, evidence gates progress, state persists, and the system decides what happens next.</div>
863
+ </div>
864
+ <div class="scene-outcomes" aria-label="Possible loop outcomes">
865
+ <span class="scene-outcome retry">Retry with evidence</span>
866
+ <span class="scene-outcome escalate">Escalate to a human</span>
867
+ <span class="scene-outcome exit">Exit on a verified goal</span>
868
+ </div>
869
  <div class="hero-inspector">
870
  <div class="loop-stage-rail" role="group" aria-label="Inspect the loop lifecycle">
871
+ <button class="loop-stage" type="button" data-loop-stage="0" aria-pressed="true"><span class="loop-stage-number">01</span><span>Intake</span></button>
872
  <button class="loop-stage" type="button" data-loop-stage="1" aria-pressed="false"><span class="loop-stage-number">02</span><span>Delegate</span></button>
873
  <button class="loop-stage" type="button" data-loop-stage="2" aria-pressed="false"><span class="loop-stage-number">03</span><span>Act</span></button>
874
+ <button class="loop-stage" type="button" data-loop-stage="3" aria-pressed="false"><span class="loop-stage-number">04</span><span>Verify</span></button>
875
  <button class="loop-stage" type="button" data-loop-stage="4" aria-pressed="false"><span class="loop-stage-number">05</span><span>Persist</span></button>
876
  <button class="loop-stage" type="button" data-loop-stage="5" aria-pressed="false"><span class="loop-stage-number">06</span><span>Decide</span></button>
877
  </div>
878
+ <p class="loop-stage-detail" id="loop-stage-detail" aria-live="polite"><strong>Intake:</strong> turn a goal, event, or queue signal into a bounded work packet.</p>
879
  </div>
 
880
  </div>
881
  </div>
882
  </section>
 
1657
  });
1658
  });
1659
  </script>
1660
+ <script type="module" src="assets/loop-hero-scene.js?v=13"></script>
1661
  </body>
1662
  </html>