-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfair.html
More file actions
6149 lines (5692 loc) · 360 KB
/
fair.html
File metadata and controls
6149 lines (5692 loc) · 360 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
<!DOCTYPE html>
<html lang="en" class="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SEO Meta Tags -->
<meta name="description"
content="Advanced FAIR Risk Analysis Tool. Quantitative Cyber Risk Quantification using Monte Carlo Simulation.">
<meta name="author" content="Kuro">
<title>FAIR Analysis - Kuro Risk Calculator</title>
<!-- Open Graph / Social Media Preview -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://aleriskcalc.kuronetwork.me/fair.html">
<meta property="og:title" content="FAIR Analysis - Kuro Risk Calculator">
<meta property="og:description"
content="Advanced FAIR Risk Analysis Tool. Quantitative Cyber Risk Quantification using Monte Carlo Simulation.">
<meta property="og:image" content="https://aleriskcalc.kuronetwork.me/icons/icon-cat.jpg">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://aleriskcalc.kuronetwork.me/fair.html">
<meta name="twitter:title" content="FAIR Analysis - Kuro Risk Calculator">
<meta name="twitter:description"
content="Advanced FAIR Risk Analysis Tool. Quantitative Cyber Risk Quantification using Monte Carlo Simulation.">
<meta name="twitter:image" content="https://aleriskcalc.kuronetwork.me/icons/icon-cat.jpg">
<!-- PWA Meta Tags -->
<meta name="application-name" content="FAIR Calc">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#3B82F6">
<!-- Icons -->
<link rel="manifest" href="./manifest.json">
<link rel="icon" type="image/svg+xml" href="./icons/icon.svg">
<!-- Fonts: JetBrains Mono for data, DM Sans for UI -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- Libraries -->
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<!-- FAIR Core Module -->
<script src="./fair-core.js"></script>
<!-- Tailwind Config -->
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['DM Sans', 'system-ui', 'sans-serif'],
mono: ['JetBrains Mono', 'monospace'],
},
colors: {
primary: '#3B82F6',
secondary: '#10B981',
accent: '#22D3EE',
darkbg: '#0B0F19',
darkcard: '#131825',
darksurface: '#1A1F2E',
}
}
}
}
</script>
<style>
/* Design System */
:root {
--color-bg: #F8FAFC;
--color-surface: #FFFFFF;
--color-border: #E2E8F0;
--color-text-primary: #0F172A;
--color-text-secondary: #475569;
--color-text-muted: #94A3B8;
--color-accent: #22D3EE;
}
.dark {
--color-bg: #0B0F19;
--color-surface: #131825;
--color-border: #1E293B;
--color-text-primary: #F1F5F9;
--color-text-secondary: #94A3B8;
--color-text-muted: #475569;
--color-accent: #22D3EE;
}
body {
font-family: 'DM Sans', system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.font-data {
font-family: 'JetBrains Mono', monospace;
font-variant-numeric: tabular-nums;
letter-spacing: -0.02em;
}
.dark body::before {
content: '';
position: fixed;
inset: 0;
z-index: -1;
opacity: 0.03;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
pointer-events: none;
}
.card {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 16px;
transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--color-accent); }
@keyframes fadeSlideUp {
from { opacity: 0; transform: translateY(16px); }
to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fadeSlideUp 0.5s ease-out both; }
.reveal-delay-1 { animation-delay: 0.08s; }
.reveal-delay-2 { animation-delay: 0.16s; }
.reveal-delay-3 { animation-delay: 0.24s; }
/* Settings panel */
.settings-panel { transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.settings-panel.open { transform: translateX(0); }
.settings-backdrop { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.settings-backdrop.open { opacity: 1; pointer-events: auto; }
/* Wizard Steps */
.wizard-step { display: none; animation: fadeSlideUp 0.35s ease-out both; }
.wizard-step.active { display: block; }
.step-indicator { display: flex; align-items: center; gap: 0; }
.step-dot {
width: 32px; height: 32px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 0.75rem; font-weight: 700;
font-family: 'JetBrains Mono', monospace;
border: 2px solid var(--color-border);
color: var(--color-text-muted);
background: var(--color-surface);
transition: all 0.3s ease; cursor: pointer; flex-shrink: 0;
}
.step-dot.active { border-color: var(--color-accent); color: var(--color-accent); box-shadow: 0 0 12px rgba(34,211,238,0.2); }
.step-dot.completed { border-color: #34D399; background: #34D399; color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--color-border); transition: background 0.3s ease; }
.step-line.completed { background: #34D399; }
/* Shared Styles */
.enhanced-input {
transition: all 0.2s ease;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.enhanced-input:focus {
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
}
/* Validation Error Styles */
.enhanced-input.input-error {
border-color: #EF4444 !important;
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
}
.enhanced-input.input-error:focus {
border-color: #EF4444 !important;
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Validation Warning Styles */
.enhanced-input.input-warning {
border-color: #F59E0B !important;
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
}
.enhanced-input.input-warning:focus {
border-color: #F59E0B !important;
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Validation Message Styles */
.validation-message {
display: none;
font-size: 0.75rem;
margin-top: 0.5rem;
padding: 0.5rem 0.75rem;
border-radius: 0.375rem;
align-items: flex-start;
gap: 0.5rem;
}
.validation-message.visible {
display: flex;
}
.validation-message.error {
background-color: #FEF2F2;
color: #991B1B;
border: 1px solid #FECACA;
}
.dark .validation-message.error {
background-color: rgba(127, 29, 29, 0.2);
color: #FCA5A5;
border-color: rgba(239, 68, 68, 0.3);
}
.validation-message.warning {
background-color: #FFFBEB;
color: #92400E;
border: 1px solid #FDE68A;
}
.dark .validation-message.warning {
background-color: rgba(120, 53, 15, 0.2);
color: #FCD34D;
border-color: rgba(245, 158, 11, 0.3);
}
.validation-message.info {
background-color: #EFF6FF;
color: #1E40AF;
border: 1px solid #BFDBFE;
}
.dark .validation-message.info {
background-color: rgba(30, 58, 138, 0.2);
color: #93C5FD;
border-color: rgba(59, 130, 246, 0.3);
}
.validation-message svg {
flex-shrink: 0;
width: 1rem;
height: 1rem;
margin-top: 0.125rem;
}
/* Auto-correction Toast Notification */
.toast-notification {
position: fixed;
bottom: 5rem;
right: 1rem;
z-index: 60;
max-width: 20rem;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
transform: translateX(120%);
transition: transform 0.3s ease-out;
display: flex;
align-items: flex-start;
gap: 0.75rem;
}
.toast-notification.visible {
transform: translateX(0);
}
.toast-notification.toast-warning {
background-color: #FFFBEB;
color: #92400E;
border: 1px solid #FDE68A;
}
.dark .toast-notification.toast-warning {
background-color: #1F2937;
color: #FCD34D;
border-color: rgba(245, 158, 11, 0.3);
}
.toast-notification.toast-info {
background-color: #EFF6FF;
color: #1E40AF;
border: 1px solid #BFDBFE;
}
.dark .toast-notification.toast-info {
background-color: #1F2937;
color: #93C5FD;
border-color: rgba(59, 130, 246, 0.3);
}
.toast-notification svg {
flex-shrink: 0;
width: 1.25rem;
height: 1.25rem;
}
.toast-close {
margin-left: auto;
cursor: pointer;
opacity: 0.6;
transition: opacity 0.2s;
}
.toast-close:hover {
opacity: 1;
}
/* Mobile Optimization for Input Groups */
@media (max-width: 768px) {
.pert-group {
flex-direction: column !important;
}
.pert-group>div {
width: 100% !important;
margin-bottom: 0.5rem;
}
}
/* Responsive Design - Mobile (320px-480px) */
@media (max-width: 480px) {
/* Stack all input groups vertically */
.pert-group {
flex-direction: column !important;
gap: 0.5rem;
}
.pert-group>input,
.pert-group>div {
width: 100% !important;
}
/* Reduce padding on cards */
.bg-white.p-6,
.dark\:bg-darkcard.p-6 {
padding: 1rem !important;
}
/* Stack header elements */
.flex.flex-col.sm\:flex-row {
flex-direction: column !important;
}
/* Full width buttons on mobile */
button.px-4 {
width: 100%;
justify-content: center;
}
/* Reduce font sizes */
h1.text-3xl {
font-size: 1.5rem !important;
}
h2.text-xl {
font-size: 1.125rem !important;
}
/* Stack metric cards */
.grid.grid-cols-2 {
grid-template-columns: 1fr !important;
}
/* Adjust toast position for mobile */
.toast-notification {
left: 1rem;
right: 1rem;
max-width: none;
}
/* Sticky footer adjustments */
.sticky-result-bar {
padding: 0.75rem !important;
}
.sticky-result-bar .text-xl {
font-size: 1rem !important;
}
}
/* Responsive Design - Tablet (481px-1024px) */
@media (min-width: 481px) and (max-width: 1024px) {
/* Two-column layout for PERT inputs */
.pert-group {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.pert-group>input {
flex: 1 1 30%;
min-width: 80px;
}
/* Adjust grid layouts */
.grid.grid-cols-1.lg\:grid-cols-2 {
grid-template-columns: 1fr !important;
}
/* Metric cards in 2 columns */
.grid.grid-cols-2.md\:grid-cols-4 {
grid-template-columns: repeat(2, 1fr) !important;
}
}
/* Responsive Design - Desktop (1025px+) */
@media (min-width: 1025px) {
/* Full multi-column layout */
.grid.grid-cols-1.lg\:grid-cols-2 {
grid-template-columns: repeat(2, 1fr);
}
/* PERT inputs in row */
.pert-group {
flex-direction: row;
gap: 0.5rem;
}
.pert-group>input {
flex: 1;
}
}
/* Responsive Chart Container */
.chart-container {
position: relative;
width: 100%;
min-height: 200px;
}
@media (max-width: 480px) {
.chart-container {
min-height: 180px;
}
}
@media (min-width: 481px) and (max-width: 1024px) {
.chart-container {
min-height: 250px;
}
}
@media (min-width: 1025px) {
.chart-container {
min-height: 300px;
}
}
/* Number Display Overflow Fix */
.enhanced-input[type="number"] {
/* Ensure number inputs don't overflow */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
}
/* Result card number overflow fix */
.result-value,
.metric-value,
[class*="font-bold"][class*="text-"] {
word-break: break-word;
overflow-wrap: break-word;
hyphens: auto;
max-width: 100%;
}
/* Large number display in result cards */
.result-card .text-xl,
.result-card .text-2xl,
.result-card .text-3xl {
font-size: clamp(0.875rem, 3vw, 1.5rem);
word-break: break-word;
overflow-wrap: break-word;
}
/* Sticky footer number display */
.sticky-result-bar .text-xl {
font-size: clamp(0.875rem, 4vw, 1.25rem);
word-break: break-word;
overflow-wrap: break-word;
}
/* Comparison table number cells */
#comparison-table td {
word-break: break-word;
overflow-wrap: break-word;
max-width: 150px;
}
/* Metric cards number display */
.metric-card p.text-lg,
.metric-card p.text-xl,
.metric-card p.text-2xl {
font-size: clamp(0.75rem, 2.5vw, 1.25rem);
word-break: break-word;
overflow-wrap: break-word;
}
/* Prevent number input spinner from being cut off */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
opacity: 1;
margin-left: 4px;
}
/* Ensure input content is visible */
input.enhanced-input {
padding-right: 0.75rem;
}
/* Summary section number display */
#comparison-summary p.text-lg {
font-size: clamp(0.875rem, 2.5vw, 1.125rem);
word-break: break-word;
overflow-wrap: break-word;
}
/* Sensitivity analysis number display */
.sensitivity-value {
font-size: clamp(0.75rem, 2vw, 1rem);
word-break: break-word;
overflow-wrap: break-word;
}
/* Convergence metrics number display */
.convergence-value {
font-size: clamp(0.75rem, 2vw, 0.875rem);
word-break: break-word;
overflow-wrap: break-word;
}
/* Chart Responsive Styles */
.chart-wrapper {
position: relative;
width: 100%;
overflow: hidden;
}
/* Chart canvas responsive sizing */
canvas {
max-width: 100% !important;
height: auto !important;
}
/* Chart legend responsive */
@media (max-width: 480px) {
/* Reduce chart height on mobile */
.chart-wrapper,
[style*="height: 300px"],
[style*="height: 350px"],
[style*="height: 400px"] {
height: 200px !important;
min-height: 180px !important;
}
/* Stack chart legends vertically on mobile */
.chart-legend {
flex-direction: column !important;
align-items: flex-start !important;
gap: 0.25rem !important;
}
.chart-legend>div {
font-size: 0.625rem !important;
}
}
@media (min-width: 481px) and (max-width: 1024px) {
/* Medium chart height on tablet */
.chart-wrapper,
[style*="height: 300px"],
[style*="height: 350px"],
[style*="height: 400px"] {
height: 280px !important;
min-height: 250px !important;
}
}
/* Tornado chart responsive */
#tornado-chart-container {
min-height: 200px;
}
@media (max-width: 480px) {
#tornado-chart-container {
min-height: 180px;
}
}
/* Comparison chart responsive */
#comparison-chart-container .relative {
min-height: 200px;
}
@media (max-width: 480px) {
#comparison-chart-container .relative {
min-height: 180px;
}
}
/* Chart interpretation text responsive */
.chart-interpretation {
font-size: clamp(0.625rem, 2vw, 0.75rem);
}
@media (max-width: 480px) {
.chart-interpretation li {
margin-bottom: 0.25rem;
}
}
/* Comparison Table Horizontal Scroll */
.comparison-table-wrapper {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
scrollbar-color: #9CA3AF #F3F4F6;
}
.dark .comparison-table-wrapper {
scrollbar-color: #4B5563 #1F2937;
}
.comparison-table-wrapper::-webkit-scrollbar {
height: 8px;
}
.comparison-table-wrapper::-webkit-scrollbar-track {
background: #F3F4F6;
border-radius: 4px;
}
.dark .comparison-table-wrapper::-webkit-scrollbar-track {
background: #1F2937;
}
.comparison-table-wrapper::-webkit-scrollbar-thumb {
background: #9CA3AF;
border-radius: 4px;
}
.dark .comparison-table-wrapper::-webkit-scrollbar-thumb {
background: #4B5563;
}
.comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
background: #6B7280;
}
.dark .comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
background: #6B7280;
}
/* Comparison table sticky first column */
#comparison-table {
min-width: 600px;
border-collapse: separate;
border-spacing: 0;
}
#comparison-table th:first-child,
#comparison-table td:first-child {
position: sticky;
left: 0;
z-index: 10;
background-color: inherit;
}
#comparison-table thead th:first-child {
background-color: #F9FAFB;
z-index: 11;
}
.dark #comparison-table thead th:first-child {
background-color: #1F2937;
}
#comparison-table tbody td:first-child {
background-color: #FFFFFF;
}
.dark #comparison-table tbody td:first-child {
background-color: #1F2937;
}
/* Add shadow to indicate scrollable content */
#comparison-table th:first-child::after,
#comparison-table td:first-child::after {
content: '';
position: absolute;
top: 0;
right: -8px;
bottom: 0;
width: 8px;
background: linear-gradient(to right, rgba(0, 0, 0, 0.05), transparent);
pointer-events: none;
}
.dark #comparison-table th:first-child::after,
.dark #comparison-table td:first-child::after {
background: linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent);
}
/* Mobile-specific table adjustments */
@media (max-width: 768px) {
#comparison-table {
font-size: 0.75rem;
}
#comparison-table th,
#comparison-table td {
padding: 0.5rem 0.75rem;
white-space: nowrap;
}
#comparison-table th:first-child,
#comparison-table td:first-child {
min-width: 120px;
max-width: 150px;
white-space: normal;
word-break: break-word;
}
/* Scroll indicator for mobile */
.scroll-indicator {
display: block;
text-align: center;
font-size: 0.625rem;
color: #9CA3AF;
padding: 0.25rem;
}
}
@media (min-width: 769px) {
.scroll-indicator {
display: none;
}
}
/* Level Badges */
.badge-l2 {
background-color: #DBEAFE;
color: #1E40AF;
border: 1px solid #93C5FD;
}
.dark .badge-l2 {
background-color: #1E3A8A;
color: #DBEAFE;
border-color: #2563EB;
}
.badge-l3 {
background-color: #F3F4F6;
color: #374151;
border: 1px solid #D1D5DB;
}
.dark .badge-l3 {
background-color: #374151;
color: #F3F4F6;
border-color: #4B5563;
}
/* Sticky Bottom Result Bar */
.sticky-result-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 50;
box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
transform: translateY(100%);
transition: transform 0.3s ease-out;
}
.sticky-result-bar.visible {
transform: translateY(0);
}
.shimmer {
animation: shimmer 2s infinite linear;
background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
background-size: 1000px 100%;
}
.dark .shimmer {
background: linear-gradient(to right, #1f2937 0%, #374151 20%, #1f2937 40%, #1f2937 100%);
}
@keyframes shimmer {
0% {
background-position: -1000px 0;
}
100% {
background-position: 1000px 0;
}
}
/* Footer Social Icons Hover Effect */
.social-icon {
transition: transform 0.2s ease, fill 0.2s ease;
}
.social-icon:hover {
transform: translateY(-3px);
}
</style>
</head>
<body
class="bg-gray-50 text-gray-800 dark:bg-darkbg dark:text-gray-200 min-h-screen flex flex-col font-sans transition-colors duration-300">
<!-- Navbar — Minimal -->
<nav class="bg-white/80 dark:bg-darkcard/80 backdrop-blur-xl border-b border-gray-200/50 dark:border-white/5 sticky top-0 z-40">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-14 items-center">
<div class="flex items-center gap-3">
<a href="./index.html"
class="flex items-center text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors group">
<svg class="w-4 h-4 mr-1.5 group-hover:-translate-x-0.5 transition-transform" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
</svg>
<span class="text-sm font-medium">Home</span>
</a>
<span class="text-gray-200 dark:text-gray-700">|</span>
<span class="text-lg font-bold tracking-tight text-gray-900 dark:text-white font-mono">FAIR</span>
<span class="text-sm font-medium text-gray-400 dark:text-gray-500 hidden sm:inline">Analysis</span>
</div>
<div class="flex items-center gap-2">
<!-- Info/Tutorial Button -->
<button id="btn-tutorial" class="p-2 rounded-lg text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</button>
<!-- Dark Mode Toggle -->
<button id="theme-toggle"
class="p-2 rounded-lg text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 focus:outline-none transition-colors">
<svg id="theme-icon" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
</svg>
</button>
<!-- Settings Gear -->
<button id="settings-toggle"
class="p-2 rounded-lg text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 focus:outline-none transition-colors"
aria-label="Settings" onclick="toggleSettings()">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
</button>
</div>
</div>
</div>
</nav>
<!-- Settings Side Panel -->
<div id="settings-backdrop" class="settings-backdrop fixed inset-0 z-50 bg-black/40" onclick="toggleSettings()"></div>
<div id="settings-panel" class="settings-panel fixed top-0 right-0 z-50 h-full w-80 bg-white dark:bg-darkcard border-l border-gray-200 dark:border-white/5 shadow-2xl overflow-y-auto">
<div class="p-6">
<div class="flex items-center justify-between mb-6">
<h2 class="text-lg font-bold text-gray-900 dark:text-white">Settings</h2>
<button onclick="toggleSettings()" class="p-1 rounded-lg text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-white/5">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
</button>
</div>
<!-- Language -->
<div class="mb-6">
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2">Language</label>
<select id="lang-select"
class="w-full bg-gray-50 dark:bg-darksurface border border-gray-200 dark:border-white/10 rounded-lg py-2.5 px-3 text-sm focus:ring-2 focus:ring-accent cursor-pointer text-gray-700 dark:text-gray-200">
<option value="en">🌐 English</option>
<option value="zh-TW">🌐 繁體中文</option>
<option value="ja">🌐 日本語</option>
<option value="es">🌐 Español</option>
<option value="de">🌐 Deutsch</option>
<option value="fr">🌐 Français</option>
<option value="pt">🌐 Português</option>
<option value="vi">🌐 Tiếng Việt</option>
</select>
</div>
<!-- Currency -->
<div class="mb-6">
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2">Currency</label>
<select id="currency-select"
class="w-full bg-gray-50 dark:bg-darksurface border border-gray-200 dark:border-white/10 rounded-lg py-2.5 px-3 text-sm focus:ring-2 focus:ring-accent cursor-pointer text-gray-700 dark:text-gray-200">
<option value="USD">USD ($)</option>
<option value="TWD">TWD (NT$)</option>
<option value="EUR">EUR (€)</option>
<option value="JPY">JPY (¥)</option>
<option value="CNY">CNY (¥)</option>
</select>
</div>
<div class="border-t border-gray-100 dark:border-white/5 my-6"></div>
<div class="mb-6">
<label class="block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-3">Mobile App</label>
<a href="https://apps.apple.com/tw/app/kuro-risk-calculator-%E8%B3%87%E5%AE%89%E9%A2%A8%E9%9A%AA%E8%A8%88%E7%AE%97%E8%A9%95%E4%BC%B0%E5%99%A8/id6757115315"
target="_blank" rel="noopener noreferrer" class="flex items-center justify-center transition-opacity hover:opacity-80">
<img src="https://developer.apple.com/assets/elements/icons/download-on-the-app-store/download-on-the-app-store.svg" alt="Download on App Store" class="h-10 w-auto">
</a>
</div>
<div class="border-t border-gray-100 dark:border-white/5 my-6"></div>
<button onclick="toggleSettings(); toggleModal('about-modal')"
class="w-full text-left px-3 py-2.5 rounded-lg text-sm font-medium text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors">
<span data-i18n="navAboutBtn">About Author</span>
</button>
</div>
</div>
<div class="flex-grow max-w-4xl mx-auto p-4 w-full pb-32">
<!-- Page Title -->
<div class="mb-6 reveal">
<p class="text-xs font-mono font-medium text-accent uppercase tracking-widest mb-3">OpenFAIR™ Quantitative Analysis</p>
<h1 class="text-3xl font-bold tracking-tight text-gray-900 dark:text-white" data-i18n="navTitle">FAIR Analysis</h1>
<p class="text-sm text-gray-500 dark:text-gray-400 mt-1" data-i18n="pageSubtitle">Factor Analysis of
Information Risk (OpenFAIR™)</p>
</div>
<!-- Wizard Step Indicator -->
<div class="step-indicator mb-4 reveal">
<div class="step-dot active" onclick="goToStep(1)" id="step-dot-1">1</div>
<div class="step-line" id="step-line-1"></div>
<div class="step-dot" onclick="goToStep(2)" id="step-dot-2">2</div>
<div class="step-line" id="step-line-2"></div>
<div class="step-dot" onclick="goToStep(3)" id="step-dot-3">3</div>
<div class="step-line" id="step-line-3"></div>
<div class="step-dot" onclick="goToStep(4)" id="step-dot-4">4</div>
</div>
<div class="flex justify-between mb-8 text-xs text-gray-400 dark:text-gray-500 reveal">
<span class="w-8 text-center">Scenario</span>
<span class="w-8 text-center">Frequency</span>
<span class="w-8 text-center">Loss</span>
<span class="w-8 text-center">Results</span>
</div>
<!-- STEP 1: Scenario Setup -->
<div class="wizard-step active" id="wizard-step-1">
<!-- Scenario Header -->
<header class="mb-6 card p-6">
<div class="flex flex-col sm:flex-row justify-between items-end gap-4">
<div>
<p class="text-xs text-gray-500 uppercase tracking-wide mb-1" data-i18n="labelScenario">Scenario</p>
</div>
<div class="w-full sm:w-auto flex-grow">
<div class="flex flex-col sm:flex-row gap-2 items-stretch sm:items-end">
<div class="sm:w-48">
<label class="block text-xs text-gray-500 mb-1" data-i18n="labelTemplate">Reference
Template</label>
<select id="scenario-template"
class="w-full px-3 py-2 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-sm focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
<option value="custom" data-i18n="templateCustom">Custom Scenario</option>
<option value="ransomware" data-i18n="templateRansomware">Ransomware Attack</option>
<option value="databreach" data-i18n="templateDataBreach">Data Breach</option>
<option value="ddos" data-i18n="templateDDoS">DDoS Attack</option>
<option value="bec" data-i18n="templateBEC">Business Email Compromise</option>
<option value="insider" data-i18n="templateInsider">Insider Threat</option>
</select>
</div>
<div class="flex-grow">
<input type="text" id="scenario-name" placeholder="e.g., Ransomware Attack on DB"
class="w-full bg-transparent border-0 border-b-2 border-gray-200 dark:border-gray-700 text-xl sm:text-2xl font-bold text-gray-800 dark:text-white focus:ring-0 focus:border-purple-500 placeholder-gray-300 dark:placeholder-gray-600 transition-colors py-2">
</div>
</div>
</div>
</div>
</header>
<!-- Template Notice (hidden by default) -->
<div id="template-notice"
class="hidden mb-6 p-4 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700 rounded-xl">
<div class="flex items-start gap-3">
<svg class="w-5 h-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5" fill="none"
stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<div class="flex-grow">
<p class="text-sm font-semibold text-amber-800 dark:text-amber-200" data-i18n="templateNoticeTitle">
Reference Data Loaded</p>
<p class="text-xs text-amber-700 dark:text-amber-300 mt-1" id="template-source"></p>
<p class="text-xs text-amber-600 dark:text-amber-400 mt-2" data-i18n="templateNoticeHint">Please
adjust values based on your organization's industry, size, and existing security controls.</p>
</div>
<button onclick="document.getElementById('template-notice').classList.add('hidden')"
class="text-amber-500 hover:text-amber-700">