-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathos.html
More file actions
7328 lines (6745 loc) · 375 KB
/
Copy pathos.html
File metadata and controls
7328 lines (6745 loc) · 375 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html lang="en"><head>
<script src="sovereign_shamir.js"></script>
<script src="sovereign_security.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- CSP NOTE: script-src uses 'unsafe-inline' only because all JS is inline in this single-file app.
In a deployed context, extract scripts to separate .js files and use nonces or hashes instead.
All other directives are tightened: no eval, no external scripts, minimal connect surface. -->
<meta http-equiv="Content-Security-Policy" content="
default-src 'none';
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline';
font-src 'self';
connect-src 'self' http://localhost:11434 ws: wss: https:;
img-src 'self' data: blob:;
worker-src blob:;
object-src 'none';
base-uri 'none';
form-action 'none';
upgrade-insecure-requests;
">
<title>SOVEREIGN OS v7 — Identity-Local Authority Stack</title>
<!-- Fonts: fully offline — no external dependency -->
<style>
:root {
--bg: #060d06;
--bg2: #0b160b;
--bg3: #101e10;
--border: rgba(80, 230, 130, 0.18);
--border2: rgba(80, 230, 130, 0.32);
--green: #4eff91;
--cyan: #00ffd5;
--purple: #d97dff;
--yellow: #fbbf24;
--red: #ff6eb4;
--orange: #ff6b35;
--text: #f4fff0;
--text2: #b8f5a0;
--text3: #72c97a;
--mono: 'Courier New', Courier, monospace;
--ui: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
--glow-g: 0 0 20px rgba(0,255,136,0.3);
--glow-c: 0 0 20px rgba(0,212,255,0.3);
--glow-p: 0 0 20px rgba(168,85,247,0.3);
--glow-r: 0 0 20px rgba(255,51,102,0.3);
}
*{margin:0;padding:0;box-sizing:border-box;}
html{height:100%;}
body{
background:var(--bg);color:var(--text);
font-family:var(--ui);min-height:100vh;
overflow-x:hidden;
background-image:
radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0,212,255,0.03), transparent),
radial-gradient(ellipse 60% 80% at 80% 80%, rgba(168,85,247,0.03), transparent),
repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.005) 40px, rgba(255,255,255,0.005) 41px),
repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.005) 40px, rgba(255,255,255,0.005) 41px);
}
/* ── TOP NAV ── */
#topnav{
position:fixed;top:0;left:0;right:0;height:52px;z-index:200;
background:rgba(6,6,8,0.92);backdrop-filter:blur(12px);
border-bottom:1px solid var(--border2);
display:flex;align-items:center;padding:0 20px;gap:0;
}
.nav-logo{
font-family:var(--mono);font-size: 16px;font-weight:700;
color:var(--cyan);letter-spacing:2px;margin-right:24px;
white-space:nowrap;text-shadow:var(--glow-c);
}
.nav-tabs{display:flex;gap:0;flex:1;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none;}.nav-tabs::-webkit-scrollbar{display:none;}
.nav-tab{
padding:8px 10px;font-size: 14px;font-weight:600;
letter-spacing:.3px;text-transform:uppercase;cursor:pointer;
color:var(--text2);border-bottom:2px solid transparent;
transition:all .2s;border:none;background:none;font-family:var(--ui);
white-space:nowrap;flex-shrink:0;
}
.nav-tab:hover{color:var(--text2);}
.nav-tab.active{color:var(--cyan);border-bottom-color:var(--cyan);}
.nav-identity{
margin-left:auto;display:flex;align-items:center;gap:10px;
font-family:var(--mono);font-size: 14px;
}
.id-chip{
padding:4px 10px;border:1px solid var(--border2);border-radius:3px;
color:var(--text2);cursor:pointer;transition:.2s;
}
.id-chip.live{border-color:var(--green);color:var(--green);box-shadow:var(--glow-g);}
.status-dot{width:6px;height:6px;border-radius:50%;background:var(--text3);}
.status-dot.live{background:var(--green);box-shadow:0 0 8px rgba(0,255,136,0.6);animation:pulse 2s infinite;}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
/* ── LAYOUT ── */
.app-wrap{padding-top:52px;min-height:100vh;}
.tab-content{display:none;padding:24px 20px 60px;}
.tab-content.active{display:block;}
/* ── PANELS ── */
.panel{
background:var(--bg2);border:1px solid var(--border);
border-radius:10px;padding:20px;margin-bottom:16px;
position:relative;overflow:hidden;
}
.panel::before{
content:'';position:absolute;top:0;left:0;
width:3px;height:100%;
background:linear-gradient(180deg,var(--c,var(--border2)),transparent);
}
.panel.c{--c:var(--cyan);}
.panel.g{--c:var(--green);}
.panel.p{--c:var(--purple);}
.panel.y{--c:var(--yellow);}
.panel.r{--c:var(--red);}
.panel.o{--c:var(--orange);}
.panel-title{
font-size: 15px;font-weight:600;letter-spacing:1px;
text-transform:uppercase;color:var(--c,var(--text2));
margin-bottom:14px;display:flex;align-items:center;gap:8px;
}
.panel-sub{font-size: 16px;color:var(--text2);font-weight: 600;text-transform:none;letter-spacing:0;}
/* ── GRID LAYOUTS ── */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;}
.grid-auto{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;}
@media(max-width:768px){.grid-2,.grid-3{grid-template-columns:1fr;}}
/* ── FORMS ── */
input,textarea,select{
background:var(--bg);border:1px solid var(--border2);color:var(--text);
font-family:var(--mono);font-size: 15px;padding:8px 12px;
border-radius:4px;width:100%;outline:none;transition:border-color .2s;
}
input:focus,textarea:focus,select:focus{border-color:var(--cyan);box-shadow:0 0 0 2px rgba(0,212,255,0.1);}
label{font-size: 16px;color:var(--text2);display:block;margin-bottom:4px;text-transform:uppercase;letter-spacing:.8px;}
.field-heading{font-size: 16px;color:var(--text2);display:block;margin-bottom:4px;text-transform:uppercase;letter-spacing:.8px;}
.field{margin-bottom:12px;}
.row{display:flex;gap:10px;flex-wrap:wrap;}
.row .field{flex:1;min-width:180px;}
/* ── BUTTONS ── */
.btn{
font-family:var(--ui);font-size: 15px;font-weight:600;
padding:8px 16px;border-radius:4px;border:1px solid var(--border2);
background:transparent;color:var(--text);cursor:pointer;transition:all .2s;
letter-spacing:.5px;text-transform:uppercase;
}
.btn:hover{background:rgba(255,255,255,0.04);}
.btn.c{border-color:var(--cyan);color:var(--cyan);}
.btn.c:hover{background:rgba(0,212,255,0.08);box-shadow:var(--glow-c);}
.btn.g{border-color:var(--green);color:var(--green);}
.btn.g:hover{background:rgba(0,255,136,0.08);box-shadow:var(--glow-g);}
.btn.p{border-color:var(--purple);color:var(--purple);}
.btn.p:hover{background:rgba(168,85,247,0.08);box-shadow:var(--glow-p);}
.btn.r{border-color:var(--red);color:var(--red);}
.btn.r:hover{background:rgba(255,51,102,0.08);box-shadow:var(--glow-r);}
.btn.big{padding:12px 28px;font-size: 15px;width:100%;}
.btn:disabled{opacity:.35;cursor:not-allowed;}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;}
/* ── ENTROPY RING ── */
.entropy-ring{
width:180px;height:180px;border-radius:50%;
border:2px solid var(--border2);position:relative;
margin:0 auto 20px;display:flex;align-items:center;
justify-content:center;flex-direction:column;
background:radial-gradient(circle,rgba(0,212,255,0.04),transparent 70%);
}
.entropy-ring::after{
content:'';position:absolute;inset:-3px;border-radius:50%;
background:conic-gradient(var(--cyan) var(--ep,0%), var(--border) var(--ep,0%));
mask:radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
transition:--ep .3s;
}
.entropy-val{font-family:var(--mono);font-size: 16px;color:var(--cyan);}
.entropy-lbl{font-size: 16px;color:var(--text2);text-transform:uppercase;letter-spacing:1px;margin-top:2px;}
/* ── SPONGE GRID ── */
.sponge-grid{
display:grid;grid-template-columns:repeat(25,1fr);gap:1px;
padding:10px;background:var(--bg3);border-radius:6px;
border:1px solid var(--border2);
}
.sc{width:100%;aspect-ratio:1;border-radius:1px;transition:background .1s;}
/* ── STEP INDICATOR ── */
.steps{display:flex;justify-content:center;gap:0;margin-bottom:28px;flex-wrap:wrap;}
.step{
padding:6px 16px;font-size: 16px;font-weight:600;
letter-spacing:.8px;text-transform:uppercase;
border:1px solid var(--border2);color:var(--text2);transition:.2s;
}
.step:first-child{border-radius:4px 0 0 4px;}
.step:last-child{border-radius:0 4px 4px 0;}
.step:not(:first-child){border-left:none;}
.step.active{border-color:var(--purple);color:var(--purple);background:rgba(168,85,247,0.07);}
.step.done{border-color:var(--green);color:var(--green);background:rgba(0,255,136,0.05);}
/* ── DID CARD ── */
.did-card{
background:linear-gradient(135deg,rgba(0,212,255,0.04),rgba(168,85,247,0.04));
border:1px solid rgba(168,85,247,0.25);border-radius:10px;padding:20px;
text-align:center;margin-bottom:16px;position:relative;overflow:hidden;
}
.did-card::before{
content:'⬡';position:absolute;right:16px;top:50%;transform:translateY(-50%);
font-size:60px;opacity:.04;color:var(--cyan);pointer-events:none;
}
.did-username{font-size:22px;font-weight:800;color:var(--purple);margin-bottom:4px;}
.did-str{font-family:var(--mono);font-size: 14px;color:var(--cyan);word-break:break-all;}
.did-meta{font-size: 16px;color:var(--green);margin-top:6px;}
/* ── SHARE GRID ── */
.share-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;}
.share-card{
background:var(--bg);border:1px solid var(--border2);border-radius:6px;
padding:10px;text-align:center;cursor:pointer;transition:.2s;
}
.share-card:hover{border-color:var(--cyan);}
.share-card.copied{border-color:var(--green);}
.share-num{font-size: 16px;color:var(--text2);margin-bottom:4px;text-transform:uppercase;letter-spacing:.5px;}
.share-hex{font-family:var(--mono);font-size: 15px;color:var(--cyan);word-break:break-all;line-height:1.6;}
/* ── LOG ── */
.log{
height:100px;overflow-y:auto;font-family:var(--mono);font-size: 16px;
line-height:1.7;background:var(--bg);border:1px solid var(--border);
border-radius:4px;padding:8px;
}
.ll{padding:1px 0;}
.ll.ok{color:var(--green);}
.ll.info{color:var(--cyan);}
.ll.warn{color:var(--yellow);}
.ll.err{color:var(--red);}
.ll.dim{color:var(--text2);}
/* ── PEER CHIPS ── */
.peer-chip{
font-family:var(--mono);font-size: 16px;padding:3px 8px;
border:1px solid var(--border2);border-radius:3px;color:var(--text2);transition:.2s;
}
.peer-chip.live{border-color:var(--green);color:var(--green);}
/* ── AI BUBBLE ── */
.ai-bubble{
background:rgba(168,85,247,0.05);border:1px solid rgba(168,85,247,0.2);
border-radius:8px;padding:14px;font-size: 15px;line-height:1.75;
color:var(--text2);white-space:pre-wrap;min-height:80px;font-family:var(--mono);
}
.ai-thinking{color:var(--text2);font-style:italic;animation:pulse 1.2s infinite;}
/* ── ASSET / ATTACK STYLES ── */
.metric-card{
background:var(--bg3);border:1px solid var(--border2);border-radius:8px;
padding:16px;text-align:center;position:relative;overflow:hidden;
}
.metric-card::after{
content:'';position:absolute;bottom:0;left:0;right:0;height:2px;
background:linear-gradient(90deg,transparent,var(--mc,var(--border2)),transparent);
}
.metric-card.c{--mc:var(--cyan);}
.metric-card.g{--mc:var(--green);}
.metric-card.y{--mc:var(--yellow);}
.metric-card.r{--mc:var(--red);}
.metric-val{font-family:var(--mono);font-size:22px;font-weight:700;color:var(--text);}
.metric-lbl{font-size: 16px;color:var(--text2);text-transform:uppercase;letter-spacing:.8px;margin-top:4px;}
.metric-sub{font-size: 14px;color:var(--text2);margin-top:2px;}
/* ── HASH / MONO TEXT ── */
.hash{font-family:var(--mono);font-size: 16px;color:var(--text2);word-break:break-all;}
.mono{font-family:var(--mono);}
/* ── CARD ── */
.card{background:rgba(255,255,255,0.02);border:1px solid var(--border2);border-radius:6px;padding:12px;margin-bottom:8px;}
/* ── BADGE ── */
.badge{
display:inline-block;padding:2px 8px;border-radius:3px;
font-size: 16px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;
}
.badge.g{background:rgba(0,255,136,0.1);color:var(--green);border:1px solid rgba(0,255,136,0.2);}
.badge.c{background:rgba(0,212,255,0.1);color:var(--cyan);border:1px solid rgba(0,212,255,0.2);}
.badge.y{background:rgba(251,191,36,0.1);color:var(--yellow);border:1px solid rgba(251,191,36,0.2);}
.badge.r{background:rgba(255,51,102,0.1);color:var(--red);border:1px solid rgba(255,51,102,0.2);}
/* ── PROGRESS BAR ── */
.pbar{height:3px;background:var(--border2);border-radius:2px;overflow:hidden;margin-bottom:12px;}
.pfill{height:100%;background:var(--cyan);border-radius:2px;transition:width .3s;}
/* ── SECTION (within birth tab) ── */
.sec{display:none;}
.sec.active{display:block;}
/* ── GOVERNANCE TIMELINE ── */
.timeline-entry{
padding:10px 14px;border-left:2px solid var(--border2);margin-left:8px;
position:relative;margin-bottom:8px;
}
.timeline-entry::before{
content:'';position:absolute;left:-5px;top:14px;
width:8px;height:8px;border-radius:50%;background:var(--border2);
}
.timeline-entry.ok::before{background:var(--green);}
.timeline-entry.warn::before{background:var(--yellow);}
/* ── MODAL ── */
.modal-bg{
position:fixed;inset:0;background:rgba(0,0,0,.8);
display:none;align-items:center;justify-content:center;z-index:300;
backdrop-filter:blur(4px);
}
.modal-bg.open{display:flex;}
.modal{
background:var(--bg2);border:1px solid var(--border2);
border-radius:10px;padding:28px;max-width:480px;width:90%;
}
/* ── SCROLLBARS ── */
::-webkit-scrollbar{width:4px;height:4px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px;}
::-webkit-scrollbar-thumb:hover{background:var(--text3);}
/* ── HEADER GLYPH ── */
.sys-header{
text-align:center;padding:32px 0 24px;
}
.sys-glyph{
font-size:40px;margin-bottom:8px;
text-shadow:0 0 30px rgba(0,212,255,0.5);
}
.sys-title{font-size:26px;font-weight:800;color:var(--cyan);letter-spacing:2px;}
.sys-sub{font-size: 15px;color:var(--text2);margin-top:4px;font-family:var(--mono);}
</style>
<!-- Gap 3 fix: FSM kernel — must be first script loaded to enforce invariants -->
<script src="sovereign_fsm.js"></script>
<!-- Gap 4 fix: transport.js — DHT, Double Ratchet, KDF, sovereignSend -->
<script src="transport.js"></script>
</head>
<body>
<!-- TOP NAV -->
<nav id="topnav">
<a class="nav-logo" href="index.html" style="text-decoration:none;cursor:pointer;" title="Back to Genesis Node">⬡ SOVEREIGN OS v7</a>
<div class="nav-tabs">
<button class="nav-tab" onclick="switchTab('birth')">Birth Certificate</button>
<button class="nav-tab" onclick="switchTab('stack')">⬡ Stack</button>
<button class="nav-tab" onclick="switchTab('runtime')">⬡ Event Runtime</button>
<button class="nav-tab" onclick="switchTab('trustgraph')">⬡ Trust Graph</button>
<button class="nav-tab" onclick="switchTab('identity')">Identity Vault</button>
<button class="nav-tab" onclick="switchTab('governance')">Governance</button>
<button class="nav-tab" onclick="switchTab('assets')">Asset Valuation</button>
<button class="nav-tab" onclick="switchTab('network')">Peer Network</button>
<button class="nav-tab active" onclick="switchTab('witness')">AI Witness</button>
<button class="nav-tab" onclick="switchTab('feed')" id="nav-feed">Feed / Mailbox <span id="inbox-badge" style="display:none;background:var(--red);color:#fff;border-radius:3px;padding:1px 5px;font-size:8px;margin-left:4px;"></span></button>
<button class="nav-tab" onclick="switchTab('memory')">⬡ Memory</button>
<button class="nav-tab" onclick="switchTab('parser')">⬡ Parser</button>
<button class="nav-tab" onclick="switchTab('tokens')">⬡ Tokens</button>
<button class="nav-tab" onclick="switchTab('attacks')">⬡ Attacks</button>
<button class="nav-tab" onclick="switchTab('search')">⬡ Search</button>
<button class="nav-tab" onclick="switchTab('invariants')">⬡ Invariants</button>
<button class="nav-tab" onclick="switchTab('devtools')">⬡ Dev Tools</button>
</div>
<div class="nav-identity">
<a href="index.html" style="padding:4px 10px;border:1px solid var(--border2);border-radius:3px;color:var(--text3);font-family:var(--mono);font-size:11px;text-decoration:none;transition:.2s;" title="Genesis Node">⟵ Home</a>
<div class="status-dot live" id="nav-dot"></div>
<div class="id-chip live" id="nav-id-chip">arcane-mind-7811</div>
</div>
</nav>
<div class="app-wrap">
<!-- ═══════════════════════════════════════════════════════
TAB: STACK ARCHITECTURE (NEW v7)
═══════════════════════════════════════════════════════ -->
<div class="tab-content" id="tab-stack">
<div class="sys-header">
<div class="sys-glyph">⬡</div>
<div class="sys-title">SOVEREIGN STACK v7</div>
<div class="sys-sub">Identity-Local Authority · 7-Layer Architecture · No Global Consensus Required</div>
</div>
<!-- INVARIANT BANNER -->
<div style="background:linear-gradient(135deg,rgba(0,212,255,0.06),rgba(168,85,247,0.06));border:1px solid rgba(0,212,255,0.2);border-radius:10px;padding:20px 24px;margin-bottom:20px;text-align:center;">
<div style="font-size:10px;color:var(--text3);text-transform:uppercase;letter-spacing:2px;margin-bottom:8px;">Core Invariant</div>
<div style="font-family:var(--mono);font-size:14px;color:var(--cyan);line-height:1.8;">A sovereign identity can deterministically justify its own state transitions to any other identity.</div>
<div style="font-size:10px;color:var(--text2);margin-top:10px;font-style:italic;">"Does this require global agreement, or can it be justified locally?"</div>
</div>
<!-- LAYER STACK -->
<div style="display:flex;flex-direction:column;gap:12px;max-width:900px;margin:0 auto;">
<!-- L0 -->
<div class="panel c" style="position:relative;" id="layer-0">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L0</div>
<div class="panel-title">⬡ Layer 0 — Entropy Identity Kernel
<span class="panel-sub">Brutally small · frozen early · no network dependency · no upgrade logic</span>
</div>
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:14px;">
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:10px;text-align:center;">
<div style="font-size:20px;margin-bottom:4px;">🔵</div>
<div style="font-size:9px;color:var(--cyan);font-weight:700;text-transform:uppercase;letter-spacing:.8px;">Input</div>
<div style="font-size:10px;color:var(--text2);margin-top:4px;">Local Entropy Only</div>
</div>
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:10px;text-align:center;">
<div style="font-size:20px;margin-bottom:4px;">⚙️</div>
<div style="font-size:9px;color:var(--cyan);font-weight:700;text-transform:uppercase;letter-spacing:.8px;">Process</div>
<div style="font-size:10px;color:var(--text2);margin-top:4px;">Keccak Sponge Permute</div>
</div>
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:10px;text-align:center;">
<div style="font-size:20px;margin-bottom:4px;">🔑</div>
<div style="font-size:9px;color:var(--cyan);font-weight:700;text-transform:uppercase;letter-spacing:.8px;">Output</div>
<div style="font-size:10px;color:var(--text2);margin-top:4px;">DID + Ed25519 Keys</div>
</div>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;margin-bottom:10px;">Identity is a <strong style="color:var(--cyan);">capability issuer</strong>, not just a signer. The DID mints capabilities that higher layers consume. No external registries. No clock dependency.</div>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<span class="badge g">✓ Network-Free</span>
<span class="badge c">✓ Frozen After Genesis</span>
<span class="badge g">✓ Capability Issuer</span>
<span class="badge c">✓ No Oracle</span>
</div>
<div style="margin-top:12px;">
<div id="stack-l0-status" style="font-family:var(--mono);font-size:9px;color:var(--green);">● Active · arcane-mind-7811 · did:sovereign:02b08ed9f4d4…</div>
</div>
</div>
<!-- Arrow -->
<div style="text-align:center;color:var(--border2);font-size:20px;">▼</div>
<!-- L1 -->
<div class="panel g" style="position:relative;" id="layer-1">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L1</div>
<div class="panel-title" style="color:var(--green);">⬡ Layer 1 — Deterministic Event Runtime
<span class="panel-sub">The real core · every mutation is a signed event · state = pure fold(events)</span>
</div>
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:12px;margin-bottom:12px;font-family:var(--mono);font-size:9px;color:var(--cyan);line-height:2;">
<div style="color:var(--text3);margin-bottom:4px;">// Event Model</div>
<div>State = <span style="color:var(--green);">fold</span>(events, genesis)</div>
<div>Event = { type, payload, signer, sig, timestamp_hint }</div>
<div>Verify: <span style="color:var(--cyan);">Ed25519.verify(sig, hash(event), pubKey)</span></div>
<div>Project: <span style="color:var(--purple);">S_n = F(S_{n-1}, E_n)</span> — pure function, no IO</div>
</div>
<div style="display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px;">
<span class="badge g">✓ Append-Only</span>
<span class="badge c">✓ Pure Fold</span>
<span class="badge g">✓ No Hidden Clocks</span>
<span class="badge c">✓ WASM Target</span>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;">This layer <strong style="color:var(--green);">replaces "the chain."</strong> Canonical execution targets WASM for portability across browser, headless node, and embedded. Deterministic test vectors make it auditable and credibly neutral.</div>
<div style="margin-top:10px;">
<button class="btn g" onclick="switchTab('runtime')" style="font-size:10px;padding:6px 14px;">Open Event Runtime →</button>
</div>
</div>
<div style="text-align:center;color:var(--border2);font-size:20px;">▼</div>
<!-- L2 -->
<div class="panel p" style="position:relative;" id="layer-2">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L2</div>
<div class="panel-title" style="color:var(--purple);">⬡ Layer 2 — Authority & Governance Semantics
<span class="panel-sub">Not voting — authority resolution · pluggable policies · version-signed</span>
</div>
<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px;margin-bottom:12px;">
<div style="background:var(--bg);border:1px solid rgba(168,85,247,0.2);border-radius:6px;padding:8px;text-align:center;font-size:9px;color:var(--text2);">
<div style="color:var(--purple);font-weight:700;margin-bottom:2px;">1-ID-1-Vote</div>Direct authority
</div>
<div style="background:var(--bg);border:1px solid rgba(168,85,247,0.2);border-radius:6px;padding:8px;text-align:center;font-size:9px;color:var(--text2);">
<div style="color:var(--purple);font-weight:700;margin-bottom:2px;">Reputation-Weighted</div>Stake-adjusted
</div>
<div style="background:var(--bg);border:1px solid rgba(168,85,247,0.2);border-radius:6px;padding:8px;text-align:center;font-size:9px;color:var(--text2);">
<div style="color:var(--purple);font-weight:700;margin-bottom:2px;">Capability Threshold</div>Role-gated
</div>
<div style="background:var(--bg);border:1px solid rgba(168,85,247,0.2);border-radius:6px;padding:8px;text-align:center;font-size:9px;color:var(--text2);">
<div style="color:var(--purple);font-weight:700;margin-bottom:2px;">Delegated Graph</div>Transitive
</div>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;">Governance policies are <strong style="color:var(--purple);">versioned, signed, and state-local</strong>. Two communities can use incompatible governance rules and still interoperate at lower layers. Sybil resistance lives at L3, not here.</div>
<div style="margin-top:10px;">
<button class="btn p" onclick="switchTab('governance')" style="font-size:10px;padding:6px 14px;">Open Governance →</button>
</div>
</div>
<div style="text-align:center;color:var(--border2);font-size:20px;">▼</div>
<!-- L3 -->
<div class="panel y" style="position:relative;" id="layer-3">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L3</div>
<div class="panel-title" style="color:var(--yellow);">⬡ Layer 3 — Trust Graph & Sybil Mitigation
<span class="panel-sub">Contextual sufficiency · not universal · graph primitives portable</span>
</div>
<div style="background:var(--bg);border:1px solid rgba(251,191,36,0.15);border-radius:6px;padding:12px;margin-bottom:12px;font-family:var(--mono);font-size:9px;color:var(--text2);line-height:1.9;">
<div><span style="color:var(--yellow);">Nodes:</span> Identity assertions · endorsements · revocations</div>
<div><span style="color:var(--yellow);">Edges:</span> Contextual trust scopes · expiry · weight</div>
<div><span style="color:var(--yellow);">Query:</span> "What confidence level is required for THIS action?"</div>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;">Goal: <strong style="color:var(--yellow);">contextual sufficiency</strong>, not universal Sybil resistance. Each community chooses its trust heuristics, but graph primitives are standardized so trust data is portable and inspectable.</div>
<div style="margin-top:10px;">
<button class="btn" style="border-color:var(--yellow);color:var(--yellow);font-size:10px;padding:6px 14px;" onclick="switchTab('trustgraph')">Open Trust Graph →</button>
</div>
</div>
<div style="text-align:center;color:var(--border2);font-size:20px;">▼</div>
<!-- L4 -->
<div class="panel c" style="position:relative;" id="layer-4">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L4</div>
<div class="panel-title">⬡ Layer 4 — Mesh State Exchange Protocol
<span class="panel-sub">Replaces blockchain consensus · state is local by default · sync is voluntary</span>
</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px;">
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:10px;">
<div style="font-size:9px;color:var(--cyan);font-weight:700;margin-bottom:6px;text-transform:uppercase;letter-spacing:.8px;">Protocol Primitives</div>
<div style="font-size:9px;color:var(--text2);line-height:2;font-family:var(--mono);">
• Signed state roots<br>
• Event ranges<br>
• Merkle inclusion proofs (opt.)<br>
• Quorum attestations
</div>
</div>
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:10px;">
<div style="font-size:9px;color:var(--cyan);font-weight:700;margin-bottom:6px;text-transform:uppercase;letter-spacing:.8px;">Principles</div>
<div style="font-size:9px;color:var(--text2);line-height:2;">
• State is local by default<br>
• Sync is voluntary<br>
• Proofs are demand-driven<br>
• Disagreement is allowed
</div>
</div>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;"><strong style="color:var(--cyan);">Convergence is a negotiation, not an obligation.</strong> Nodes choose whose signatures they care about. This is the clear differentiator from Substrate, Ethereum, and all global-consensus chains.</div>
<div style="margin-top:10px;">
<button class="btn c" onclick="switchTab('network')" style="font-size:10px;padding:6px 14px;">Open Peer Network →</button>
</div>
</div>
<div style="text-align:center;color:var(--border2);font-size:20px;">▼</div>
<!-- L5 -->
<div class="panel" style="position:relative;border-color:var(--orange);" id="layer-5">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L5</div>
<div class="panel-title" style="color:var(--orange);">⬡ Layer 5 — Optional Anchoring & Witnessing
<span class="panel-sub">Never required for correctness · adds timestamping · public auditability</span>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;margin-bottom:12px;">Anchoring must never be required for correctness. Anchors only add: timestamping, public auditability, external dispute evidence. Chains, IPFS, timestamp authorities, even paper notarization all fit here. <strong style="color:var(--orange);">Anchors consume state roots, never events.</strong> This keeps anchoring cheap and decoupled.</div>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<span class="badge" style="background:rgba(255,107,53,0.1);color:var(--orange);border-color:rgba(255,107,53,0.2);">Optional</span>
<span class="badge" style="background:rgba(255,107,53,0.1);color:var(--orange);border-color:rgba(255,107,53,0.2);">State Roots Only</span>
<span class="badge" style="background:rgba(255,107,53,0.1);color:var(--orange);border-color:rgba(255,107,53,0.2);">Chain-Agnostic</span>
<span class="badge" style="background:rgba(255,107,53,0.1);color:var(--orange);border-color:rgba(255,107,53,0.2);">IPFS / Notary / BTC</span>
</div>
</div>
<div style="text-align:center;color:var(--border2);font-size:20px;">▼</div>
<!-- L6 -->
<div class="panel p" style="position:relative;" id="layer-6">
<div style="position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:48px;opacity:.07;font-family:var(--mono);">L6</div>
<div class="panel-title" style="color:var(--purple);">⬡ Layer 6 — Machine Witnesses (AI as Observer, Not Oracle)
<span class="panel-sub">Advisory artifacts only · signed · inspectable · never executable authority</span>
</div>
<div style="background:rgba(168,85,247,0.04);border:1px solid rgba(168,85,247,0.15);border-radius:6px;padding:12px;margin-bottom:12px;">
<div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;font-size:9px;color:var(--text2);line-height:1.9;">
<div>
<div style="color:var(--green);margin-bottom:4px;">✓ AI MAY:</div>
Detect inconsistencies<br>
Flag anomalous patterns<br>
Simulate governance outcomes<br>
Assist human arbitration
</div>
<div>
<div style="color:var(--red);margin-bottom:4px;">✗ AI MAY NOT:</div>
Decide truth<br>
Execute authority<br>
Override signed events<br>
Bypass human review
</div>
</div>
</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;">AI outputs are always <strong style="color:var(--purple);">advisory artifacts — signed and inspectable, never executable authority.</strong></div>
<div style="margin-top:10px;">
<button class="btn p" onclick="switchTab('witness')" style="font-size:10px;padding:6px 14px;">Open AI Witness →</button>
</div>
</div>
</div>
<!-- WHY THIS WINS -->
<div class="panel g" style="margin-top:20px;max-width:900px;margin-left:auto;margin-right:auto;">
<div class="panel-title" style="color:var(--green);">⬡ Asymmetric Advantage — Why This Stack Wins</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:20px;">
<div>
<div style="font-size:10px;font-weight:700;color:var(--green);margin-bottom:10px;text-transform:uppercase;letter-spacing:.8px;">Sovereign OS Owns</div>
<div style="font-size:10px;color:var(--text2);line-height:2;">
✓ Local-first determinism<br>
✓ Identity-scoped authority<br>
✓ Voluntary coordination<br>
✓ Composable trust<br>
✓ Can move UP into chains
</div>
</div>
<div>
<div style="font-size:10px;font-weight:700;color:var(--red);margin-bottom:10px;text-transform:uppercase;letter-spacing:.8px;">Blockchains Cannot</div>
<div style="font-size:10px;color:var(--text2);line-height:2;">
✗ Move down without breaking economics<br>
✗ Break security assumptions easily<br>
✗ Operate without global consensus<br>
✗ Function identity-local by default<br>
✗ Be truly sovereign
</div>
</div>
</div>
</div>
</div><!-- /tab-stack -->
<!-- ═══════════════════════════════════════════════════════
TAB: EVENT RUNTIME (NEW v7)
═══════════════════════════════════════════════════════ -->
<div class="tab-content" id="tab-runtime">
<div class="sys-header">
<div class="sys-glyph">⬡</div>
<div class="sys-title">EVENT RUNTIME</div>
<div class="sys-sub">Layer 1 · Deterministic · Append-Only · State = fold(events) · Pure Function</div>
</div>
<!-- METRICS -->
<div class="grid-3" style="margin-bottom:16px;">
<div class="metric-card g">
<div class="metric-val" id="rt-event-count">0</div>
<div class="metric-lbl">Total Events</div>
</div>
<div class="metric-card c">
<div class="metric-val" id="rt-state-hash">—</div>
<div class="metric-lbl">State Root</div>
<div class="metric-sub" style="font-family:var(--mono);font-size:8px;" id="rt-state-full">—</div>
</div>
<div class="metric-card y">
<div class="metric-val" id="rt-replay-status">IDLE</div>
<div class="metric-lbl">Replay Status</div>
</div>
</div>
<div class="grid-2">
<!-- LEFT: EMIT EVENT -->
<div>
<div class="panel g">
<div class="panel-title" style="color:var(--green);">⬡ Emit Signed Event</div>
<div class="field">
<label for="rt-event-type">Event Type</label>
<select id="rt-event-type">
<option>IDENTITY_ASSERTED</option>
<option>CAPABILITY_MINTED</option>
<option>CAPABILITY_REVOKED</option>
<option>ENDORSEMENT_GIVEN</option>
<option>ENDORSEMENT_REVOKED</option>
<option>GOVERNANCE_PROPOSED</option>
<option>GOVERNANCE_VOTED</option>
<option>ASSET_REGISTERED</option>
<option>ASSET_TRANSFERRED</option>
<option>STATE_ANCHORED</option>
<option>TRUST_GRANTED</option>
<option>TRUST_REVOKED</option>
<option>CUSTOM</option>
</select>
</div>
<div class="field">
<label for="rt-event-payload">Payload (JSON)</label>
<textarea id="rt-event-payload" rows="4" placeholder='{"key": "value", "note": "any data"}'></textarea>
</div>
<div class="btn-row">
<button class="btn g" onclick="EventRuntime.emit()">Emit Event →</button>
<button class="btn c" onclick="EventRuntime.replay()">Replay All</button>
<button class="btn" onclick="EventRuntime.exportLog()">Export Log</button>
</div>
<div class="log" id="rt-emit-log" style="height:80px;margin-top:10px;"></div>
</div>
<!-- STATE PROJECTOR -->
<div class="panel c">
<div class="panel-title">⬡ State Projector — Current State</div>
<div style="background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:12px;font-family:var(--mono);font-size:9px;color:var(--cyan);line-height:1.9;margin-bottom:10px;max-height:200px;overflow-y:auto;" id="rt-state-view">
<div style="color:var(--text3);">// Awaiting events…</div>
</div>
<div style="display:flex;gap:8px;flex-wrap:wrap;">
<button class="btn c" onclick="EventRuntime.computeRoot()" style="font-size:10px;padding:6px 12px;">Compute Root</button>
<button class="btn" onclick="EventRuntime.verifyAll()" style="font-size:10px;padding:6px 12px;">Verify All Sigs</button>
<button class="btn r" onclick="EventRuntime.clearLog()" style="font-size:10px;padding:6px 12px;">Clear</button>
</div>
</div>
</div>
<!-- RIGHT: EVENT LOG -->
<div>
<div class="panel" style="border-color:var(--green);">
<div class="panel-title" style="color:var(--green);">⬡ Append-Only Event Log
<span class="panel-sub">Signed · deterministic · tamper-evident</span>
</div>
<div id="rt-event-log" style="max-height:480px;overflow-y:auto;display:flex;flex-direction:column;gap:6px;">
<div style="color:var(--text2);font-size:11px;padding:10px 0;">No events emitted yet. The ledger is empty.</div>
</div>
</div>
</div>
</div>
<!-- DETERMINISM PROBE -->
<div class="panel o" style="margin-top:16px;">
<div class="panel-title" style="color:var(--orange);">⬡ Determinism Probe — Verify Pure Function F: S × E → S
<span class="panel-sub">Run two identical replays · outputs must match · proves no hidden state</span>
</div>
<div style="font-size:10px;color:var(--text2);margin-bottom:12px;line-height:1.8;">
Takes the current event log, replays it twice from genesis, and compares state roots. Any divergence indicates non-determinism (hidden clock, RNG, or IO). <strong style="color:var(--orange);">This is the L1 invariant check.</strong>
</div>
<div class="btn-row" style="margin-bottom:10px;">
<button class="btn o" onclick="EventRuntime.probeDeteminism()">Run Determinism Probe</button>
</div>
<div id="rt-det-result" style="font-family:var(--mono);font-size:9px;color:var(--text3);">— not yet run —</div>
</div>
</div><!-- /tab-runtime -->
<!-- ═══════════════════════════════════════════════════════
TAB: TRUST GRAPH (NEW v7)
═══════════════════════════════════════════════════════ -->
<div class="tab-content" id="tab-trustgraph">
<div class="sys-header">
<div class="sys-glyph">⬡</div>
<div class="sys-title">TRUST GRAPH</div>
<div class="sys-sub">Layer 3 · Contextual Sybil Resistance · Endorsements · Revocations · Trust Scopes</div>
</div>
<div class="grid-2">
<!-- LEFT: ADD TRUST ASSERTION -->
<div>
<div class="panel y">
<div class="panel-title" style="color:var(--yellow);">⬡ Issue Trust Assertion</div>
<div class="field">
<label for="tg-target">Target DID or Node ID</label>
<input id="tg-target" placeholder="did:sovereign:… or peer-id">
</div>
<div class="field">
<label for="tg-scope">Trust Scope</label>
<select id="tg-scope">
<option>IDENTITY_ENDORSEMENT</option>
<option>GOVERNANCE_DELEGATE</option>
<option>DATA_WITNESS</option>
<option>ASSET_CUSTODIAN</option>
<option>CAPABILITY_RELAY</option>
<option>FULL_TRUST</option>
</select>
</div>
<div class="field">
<label for="tg-weight">Weight (0.0 – 1.0)</label>
<input id="tg-weight" type="number" min="0" max="1" step="0.1" value="0.8">
</div>
<div class="field">
<label for="tg-expiry">Expiry (days, 0 = permanent)</label>
<input id="tg-expiry" type="number" value="0" min="0">
</div>
<div class="btn-row">
<button class="btn y" onclick="TrustGraph.assert()">Issue Assertion</button>
<button class="btn r" onclick="TrustGraph.revoke()">Revoke</button>
</div>
</div>
<div class="panel c">
<div class="panel-title">⬡ Trust Query</div>
<div style="font-size:10px;color:var(--text2);margin-bottom:10px;line-height:1.8;">Ask: "What confidence level does this identity have for this action?"</div>
<div class="field">
<label for="tg-query-did">Query DID</label>
<input id="tg-query-did" placeholder="did:sovereign:…">
</div>
<div class="field">
<label for="tg-query-scope">Required Scope</label>
<select id="tg-query-scope">
<option>IDENTITY_ENDORSEMENT</option>
<option>GOVERNANCE_DELEGATE</option>
<option>DATA_WITNESS</option>
<option>ASSET_CUSTODIAN</option>
<option>CAPABILITY_RELAY</option>
<option>FULL_TRUST</option>
</select>
</div>
<button class="btn c" onclick="TrustGraph.query()">Query Trust</button>
<div id="tg-query-result" style="margin-top:10px;font-family:var(--mono);font-size:9px;color:var(--text3);">— query not run —</div>
</div>
</div>
<!-- RIGHT: TRUST GRAPH VISUALIZATION -->
<div>
<div class="panel" style="border-color:var(--yellow);">
<div class="panel-title" style="color:var(--yellow);">⬡ Trust Graph — Active Assertions</div>
<!-- Canvas for visual graph -->
<canvas id="tg-canvas" width="440" height="300" style="width:100%;border:1px solid var(--border2);border-radius:6px;background:var(--bg);margin-bottom:10px;"></canvas>
<div id="tg-assertion-list" style="max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:4px;">
<div style="font-size:10px;color:var(--text2);">No trust assertions yet.</div>
</div>
</div>
<div class="panel g">
<div class="panel-title" style="color:var(--green);">⬡ Sybil Threshold Config
<span class="panel-sub">Set required confidence levels per action class</span>
</div>
<div style="display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;font-size:9px;color:var(--text2);line-height:2.4;">
<span>Emit event</span><span style="color:var(--green);font-family:var(--mono);">≥ 0.0 (self-authority)</span>
<span>Governance vote</span><span style="color:var(--cyan);font-family:var(--mono);">≥ 0.5 endorsement</span>
<span>Asset transfer</span><span style="color:var(--yellow);font-family:var(--mono);">≥ 0.7 custody trust</span>
<span>Protocol upgrade</span><span style="color:var(--red);font-family:var(--mono);">≥ 0.9 full trust</span>
</div>
</div>
</div>
</div>
<!-- TRUST LOG -->
<div class="panel">
<div class="panel-title">⬡ Trust Operation Log</div>
<div class="log" id="tg-log" style="height:100px;"></div>
</div>
</div><!-- /tab-trustgraph -->
<div class="tab-content" id="tab-birth">
<!-- ── QUICK-START GUIDE (dismissible) ── -->
<div id="qs-guide" style="background:rgba(0,212,255,0.05);border:1px solid rgba(0,212,255,0.2);border-radius:8px;padding:14px 18px;margin-bottom:16px;display:flex;gap:14px;align-items:flex-start;">
<div style="font-size:22px;flex-shrink:0;">⬡</div>
<div style="flex:1;">
<div style="font-size:12px;font-weight:700;color:var(--cyan);margin-bottom:6px;letter-spacing:.5px;">QUICK START — 3 STEPS</div>
<div style="font-size:10px;color:var(--text2);line-height:1.8;">
<span style="color:var(--green);font-weight:600;">Step 1:</span> Type something meaningful in the <strong>Intent</strong> box below, then click <strong style="color:var(--cyan);">Collect Entropy</strong>.<br>
<span style="color:var(--green);font-weight:600;">Step 2:</span> Click <strong style="color:var(--cyan);">Generate Identity</strong> when the ring reaches 100%.<br>
<span style="color:var(--green);font-weight:600;">Step 3:</span> Click <strong style="color:var(--cyan);">Create Recovery Shares →</strong>, copy all 5 shares to safe places, then <strong style="color:var(--cyan);">Confirm & Finalize</strong>.<br>
<span style="color:var(--yellow);">💡 No account, no cloud, no blockchain. Everything stays on your device.</span>
</div>
</div>
<button onclick="document.getElementById('qs-guide').style.display='none'" style="background:none;border:none;color:var(--text2);cursor:pointer;font-size:16px;padding:0;flex-shrink:0;" title="Dismiss">✕</button>
</div>
<div class="sys-header">
<div class="sys-glyph">⬡</div>
<div class="sys-title">SOVEREIGN IDENTITY</div>
<div class="sys-sub">Birth Certificate Engine · Keccak Entropy · Shamir 3-of-5 · No Oracle · v7 Stack L0</div>
</div>
<div class="steps">
<div class="step active" id="s-0">Entropy</div>
<div class="step" id="s-1">Identity</div>
<div class="step" id="s-2">Recovery</div>
<div class="step" id="s-3">Confirm</div>
</div>
<!-- SEC 0: ENTROPY -->
<div class="sec active" id="sec-0">
<div class="panel c">
<div class="panel-title">⬡ KeccakBlackBox Engine
<span class="panel-sub">Absorb → Permute → Squeeze · sovereign entropy · no oracle</span>
</div>
<div class="entropy-ring" id="ering" style="--ep: 0%;">
<div class="entropy-val" id="epct">0%</div>
<div class="entropy-lbl">Entropy</div>
</div>
<div class="field" style="margin-bottom:10px;">
<div class="field-heading" role="group" aria-label="Active Sources"><span>Active Sources</span></div>
<div style="display:flex;gap:12px;font-size:10px;flex-wrap:wrap;">
<span><span class="status-dot live" id="d-hw" style="display:inline-block;margin-right:4px;"></span>Hardware CSPRNG</span>
<span><span class="status-dot live" id="d-tm" style="display:inline-block;margin-right:4px;"></span>Timing</span>
<span><span class="status-dot live" id="d-ms" style="display:inline-block;margin-right:4px;"></span>Mouse</span>
<span><span class="status-dot live" id="d-in" style="display:inline-block;margin-right:4px;"></span>Intent</span>
</div>
</div>
<div class="field">
<label for="intent">Intent — seeds the sponge with meaning</label>
<input id="intent" type="text" placeholder="a word, phrase, or symbol that is yours…" maxlength="200">
</div>
<div style="background:rgba(168,85,247,0.05);border:1px solid rgba(168,85,247,0.2);border-radius:6px;padding:14px;margin-bottom:12px;">
<div class="panel-title" style="margin-bottom:10px;color:var(--purple);">⬡ Personal Keys — Session Only
<span class="panel-sub" style="color:var(--text2);">Not stored or persisted · mixed into sponge during entropy · leave blank to skip</span>
</div>
<div class="row">
<div class="field"><label for="pkey-1">Personal Key 1</label><input id="pkey-1" type="password" placeholder="passphrase, secret word…" maxlength="256" autocomplete="off"></div>
<div class="field"><label for="pkey-2">Personal Key 2</label><input id="pkey-2" type="password" placeholder="name, date, memory…" maxlength="256" autocomplete="off"></div>
</div>
<div class="row">
<div class="field"><label for="pkey-3">Personal Key 3</label><input id="pkey-3" type="password" placeholder="number, symbol, place…" maxlength="256" autocomplete="off"></div>
<div class="field"><label for="pkey-4">Personal Key 4</label><input id="pkey-4" type="password" placeholder="anything meaningful…" maxlength="256" autocomplete="off"></div>
</div>
<div style="font-size:9px;color:var(--text3);line-height:1.6;">Keys are hashed into the Keccak sponge before generation and immediately discarded. They never leave this page and are not written to IDB or memory.</div>
</div>
<div style="margin-bottom:12px;">
<div class="field-heading"><span>Keccak Sponge State — 200 bytes, live</span></div>
<div class="sponge-grid" id="sponge"></div>
</div>
<div class="pbar"><div class="pfill" id="ebar" style="width: 100%;"></div></div>
<div class="log" id="elog" style="margin-bottom:12px;"></div>
<div class="btn-row">
<button class="btn c" onclick="KeccakEngine.startCollection()">Collect Entropy</button>
<button class="btn g big" id="btn-gen" onclick="doGenerateIdentity()">Generate Identity →</button>
</div>
</div>
</div>
<!-- SEC 1: IDENTITY -->
<div class="sec" id="sec-1">
<div class="panel g">
<div class="panel-title">⬡ Birth Certificate
<span class="panel-sub">Self-sovereign · no gatekeeper · no chain · no permission</span>
</div>
<div id="cert-display">
<div class="did-card">
<div style="font-size:8px;color:var(--text2);margin-bottom:4px;text-transform:uppercase;letter-spacing:1px;">Sovereign Identity · Birth Certificate</div>
<div class="did-username">arcane-mind-7811</div>
<div class="did-str">did:sovereign:02b08ed9f4d4f64a7089812a</div>
<div class="did-meta">⬡ Born 2026-02-19T11:03:42.083Z · 3 sponge steps · d6ee60ebed4bafd4</div>
</div>
<div class="row">
<div class="field"><label for="dyn-did">DID</label><input id="dyn-did" readonly="" value="did:sovereign:02b08ed9f4d4f64a7089812a"></div>
<div class="field"><label for="dyn-username">Username</label><input id="dyn-username" readonly="" value="arcane-mind-7811"></div>
</div>
<div class="field"><label for="dyn-pubkey">Public Key (Ed25519 SPKI Hex)</label><input id="dyn-pubkey" readonly="" value="302a300506032b65700321009a89001deff375a2644492a7c3a88fdba969c943…"></div>
<div class="card">
<div style="font-size:9px;color:var(--cyan);">KeccakBlackBox · 3 absorb steps</div>
<div class="hash" style="margin-top:3px;">State: d6ee60ebed4bafd4</div>
</div>
</div>
</div>
<div class="panel y">
<div class="panel-title">⚠ Key is in Memory — Not Yet Saved</div>
<div style="font-size:11px;color:var(--text2);line-height:1.75;margin-bottom:14px;">
Your Ed25519 private key exists only in memory. If you close this tab before
completing Recovery, it is gone forever. The next step splits your key into
5 shares — any 3 reconstruct you. No single point of failure.
</div>
<div class="btn-row">
<button class="btn" onclick="birthStep(0)">← Redo Entropy</button>
<button class="btn g" onclick="doRecoverySetup()">Create Recovery Shares →</button>
</div>
</div>
</div>
<!-- SEC 2: SHAMIR RECOVERY -->
<div class="sec" id="sec-2">
<div class="panel p">
<div class="panel-title">⬡ Shamir Secret Sharing — 3 of 5
<span class="panel-sub">GF(256) · any 3 of 5 shares reconstruct your key · self-hosted</span>
</div>
<div style="font-size:11px;color:var(--text2);margin-bottom:14px;line-height:1.75;">
Your key has been split into 5 shares over GF(2⁸). Give each to a different trusted
location or person. Any 3 reconstruct your identity. No share reveals anything alone.
</div>
<div class="share-grid" id="share-display"></div>
<div class="btn-row" style="margin-top:10px;margin-bottom:14px;">
<button class="btn p" onclick="copyAllShares()" title="Copy all 5 shares as a single JSON bundle to clipboard">⬡ Copy All Shares (JSON)</button>
<button class="btn y" onclick="downloadSharesFile()" title="Download all 5 shares as a .txt file">⬇ Download Shares as File</button>
</div>
<div style="margin-top:14px;padding:12px;background:rgba(0,0,0,.3);border-radius:6px;">
<div class="field" style="margin-bottom:8px;">
<label for="rec-input">Test Recovery — paste any 3 share hexes, comma-separated</label>
<textarea id="rec-input" rows="4" placeholder="Paste 3 full share hexes — comma or newline separated e.g.: 01a3f8... 03b2c1... 05d4e7..."></textarea>
</div>
<div class="btn-row">
<button class="btn p" onclick="ShamirRecovery.test()">Test Recovery</button>
<div id="rec-result" style="font-size:10px;padding:8px;line-height:1.6;"></div>
</div>
</div>
<div class="log" id="slog" style="margin-top:10px;"></div>
</div>
<div class="btn-row">
<button class="btn" onclick="birthStep(1)">← Back</button>
<button class="btn g" id="btn-confirm" onclick="doConfirm()">Confirm & Finalize →</button>
</div>
</div>
<!-- SEC 3: CONFIRM -->
<div class="sec" id="sec-3">
<div class="panel g" id="final-cert-panel" style="display: block;">
<div class="panel-title">⬡ Sovereign Identity — Established</div>
<div id="final-cert-content">
<div class="did-card" style="margin-bottom:12px;">
<div style="font-size:8px;color:var(--text2);margin-bottom:4px;">SOVEREIGN IDENTITY — ESTABLISHED</div>
<div class="did-username">arcane-mind-7811</div>
<div class="did-str">did:sovereign:02b08ed9f4d4f64a7089812a</div>
<div class="did-meta">⬡ 2026-02-19T11:03:42.083Z</div>
</div>
<div class="card">
<div style="display:grid;grid-template-columns:1fr 1fr;gap:8px;font-size:10px;">
<div><span class="status-dot live" style="display:inline-block;margin-right:5px;"></span>Keccak entropy collected</div>
<div><span class="status-dot live" style="display:inline-block;margin-right:5px;"></span>Ed25519 keypair generated</div>
<div><span class="status-dot live" style="display:inline-block;margin-right:5px;"></span>DID anchored locally</div>
<div><span class="status-dot live" style="display:inline-block;margin-right:5px;"></span>Shamir 3-of-5 shares created</div>
<div><span class="status-dot live" style="display:inline-block;margin-right:5px;"></span>Key encrypted to IDB</div>
<div><span class="status-dot live" style="display:inline-block;margin-right:5px;"></span>Birth certificate complete</div>
</div>
</div>
</div>
<div class="btn-row" style="margin-top:14px;">
<button class="btn g" onclick="exportCert()">Export Certificate JSON</button>
<button class="btn c" onclick="switchTab('identity')">→ Open Identity Vault</button>
<button class="btn p" onclick="switchTab('witness')">→ Register AI Witness</button>
<button class="btn r" onclick="newIdentity()">⬡ New Identity</button>
<button class="btn y" onclick="document.getElementById('import-file').click()">⬡ Import Identity</button>