-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindustry.html
More file actions
1225 lines (1108 loc) · 83.6 KB
/
industry.html
File metadata and controls
1225 lines (1108 loc) · 83.6 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">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ML in Industry — LozanoLsa</title>
<link href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;0,9..144,900;1,9..144,300;1,9..144,500;1,9..144,800&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
--bg:#060A12;--surface:#0C1220;--surface2:#121A2E;--surface3:#19233A;
--blue:#38BEFF;--cyan:#00F5D4;--orange:#FF7A3D;--purple:#A78BFA;
--green:#34D399;--gold:#FBBF24;--rose:#FB7185;
--text:#D8E0F0;--muted:#5A6A8A;--dim:#2A3A5A;
--border:rgba(255,255,255,0.055);--border2:rgba(255,255,255,0.12);
}
html{scroll-behavior:smooth;scroll-padding-top:64px}
body{font-family:'DM Sans',sans-serif;background:var(--bg);color:var(--text);overflow-x:hidden}
body::before{content:'';position:fixed;inset:0;opacity:.028;pointer-events:none;z-index:0;
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");}
/* NAV */
nav{position:fixed;top:0;left:0;right:0;z-index:200;height:64px;padding:0 2.5rem;
display:flex;align-items:center;justify-content:space-between;
background:rgba(6,10,18,.85);backdrop-filter:blur(16px);border-bottom:1px solid var(--border);}
.nav-brand{font-family:'JetBrains Mono',monospace;font-size:.75rem;letter-spacing:.04em;}
.nav-brand strong{color:var(--blue)}.nav-brand span{color:var(--muted)}
.nav-right{display:flex;align-items:center;gap:1.2rem}
.nav-link{text-decoration:none;font-family:'JetBrains Mono',monospace;font-size:.65rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);transition:color .2s;}
.nav-link:hover{color:var(--text)}
.nav-gh{display:flex;align-items:center;gap:.5rem;text-decoration:none;font-family:'JetBrains Mono',monospace;font-size:.65rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border2);padding:.45rem 1rem;transition:all .2s;}
.nav-gh:hover{color:var(--text);border-color:var(--text)}
.nav-gh svg{width:14px;height:14px}
/* LAYOUT */
.container{max-width:1120px;margin:0 auto;padding:0 2.5rem}
.label-tag{font-family:'JetBrains Mono',monospace;font-size:.63rem;letter-spacing:.25em;text-transform:uppercase;color:var(--orange);}
.sec-title{font-family:'Fraunces',serif;font-size:clamp(1.8rem,3.5vw,2.6rem);font-weight:700;line-height:1.1;}
.rule{width:32px;height:2px;background:var(--orange);margin:1.2rem 0;}
/* PAGE HEADER */
#page-header{padding:8rem 0 4rem;border-bottom:1px solid var(--border);background:var(--surface)}
/* OPENING STATEMENT */
#opening{padding:5rem 0;border-bottom:1px solid var(--border)}
.opening-grid{display:grid;grid-template-columns:1fr 1fr;gap:6rem;align-items:center}
.opening-quote{font-family:'Fraunces',serif;font-size:clamp(2.2rem,4vw,3.4rem);font-weight:900;line-height:1.0;color:var(--text)}
.opening-quote em{font-style:italic;color:var(--orange)}
.opening-body{font-size:.92rem;color:var(--muted);line-height:1.9;font-weight:300}
.opening-body p+p{margin-top:1.2rem}
/* DEMO SECTION */
#maintenance-demo{padding:5rem 0;border-bottom:1px solid var(--border);background:var(--surface)}
.demo-tabs{display:flex;gap:0;margin-bottom:3rem;border:1px solid var(--border)}
.tab-btn{flex:1;padding:.85rem 1rem;background:transparent;border:none;border-right:1px solid var(--border);font-family:'JetBrains Mono',monospace;font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);cursor:pointer;transition:all .2s;}
.tab-btn:last-child{border-right:none}
.tab-btn:hover{color:var(--text);background:var(--surface2)}
.tab-btn.active{color:var(--bg);background:var(--orange);border-color:var(--orange)}
.tab-btn.active.blue{background:var(--blue);border-color:var(--blue)}
.tab-btn.active.green{background:var(--green);border-color:var(--green)}
.demo-layout{display:grid;grid-template-columns:1fr 1fr;gap:4rem;align-items:start}
.viz-box{background:var(--bg);border:1px solid var(--border);position:relative;overflow:hidden}
.viz-tag{position:absolute;top:.8rem;right:.85rem;font-family:'JetBrains Mono',monospace;font-size:.56rem;color:var(--dim);letter-spacing:.08em;text-transform:uppercase}
.viz-stats{display:flex;border-top:1px solid var(--border);background:var(--surface2)}
.vstat{flex:1;padding:.8rem 1rem;border-right:1px solid var(--border)}
.vstat:last-child{border-right:none}
.vstat-l{font-family:'JetBrains Mono',monospace;font-size:.54rem;color:var(--dim);letter-spacing:.1em;text-transform:uppercase;margin-bottom:.25rem}
.vstat-v{font-family:'JetBrains Mono',monospace;font-size:.88rem;font-weight:500}
/* THINK BOX */
.think-box{padding:1.2rem 1.6rem;background:var(--surface3);border-left:3px solid var(--orange);margin-bottom:2rem}
.think-box.blue{border-color:var(--blue)}
.think-box.green{border-color:var(--green)}
.think-label{font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.15em;text-transform:uppercase;color:var(--muted);margin-bottom:.35rem}
.think-text{font-size:.88rem;color:var(--text);line-height:1.65;font-style:italic}
.demo-ref{font-family:'JetBrains Mono',monospace;font-size:.6rem;letter-spacing:.15em;text-transform:uppercase;color:var(--dim);margin-bottom:.4rem}
.demo-title{font-family:'Fraunces',serif;font-size:clamp(1.5rem,3vw,2.2rem);font-weight:700;line-height:1.1;margin-bottom:.8rem}
.demo-desc{font-size:.84rem;color:var(--muted);line-height:1.88;font-weight:300;margin-bottom:1.8rem}
.demo-desc em{font-style:normal;font-weight:500}
.demo-desc em.o{color:var(--orange)}
.demo-desc em.b{color:var(--blue)}
.demo-desc em.g{color:var(--green)}
/* INSIGHT BOX */
.insight{margin-top:2rem;padding:1.4rem 1.6rem;border:1px solid var(--border);background:var(--surface2)}
.insight-label{font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:.8rem}
.insight-row{display:flex;justify-content:space-between;align-items:center;padding:.5rem 0;border-bottom:1px solid var(--border)}
.insight-row:last-child{border-bottom:none}
.insight-key{font-family:'JetBrains Mono',monospace;font-size:.68rem;color:var(--muted)}
.insight-val{font-family:'JetBrains Mono',monospace;font-size:.75rem;font-weight:500}
/* WHY ML SECTION */
#why-ml{padding:5rem 0;border-bottom:1px solid var(--border)}
.why-grid{display:grid;grid-template-columns:1fr 1fr;gap:5rem;align-items:start}
.why-quote{font-family:'Fraunces',serif;font-size:clamp(1.6rem,3vw,2.4rem);font-weight:300;font-style:italic;line-height:1.25;color:var(--dim)}
.why-quote strong{color:var(--text);font-style:normal;font-weight:700}
.why-quote em{color:var(--blue)}
.why-body p{font-size:.88rem;color:var(--muted);line-height:1.9;font-weight:300;margin-bottom:1.2rem}
.why-body p strong{color:var(--text);font-weight:600}
.why-body p em{color:var(--blue);font-style:normal}
/* PROJECT CALLOUT */
.project-callout{margin-top:2.5rem;padding:2rem;background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--green)}
.pc-tag{font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--green);margin-bottom:.6rem}
.pc-title{font-family:'Fraunces',serif;font-size:1.2rem;font-weight:700;margin-bottom:.6rem}
.pc-desc{font-size:.82rem;color:var(--muted);line-height:1.75;font-weight:300;margin-bottom:1.2rem}
.pc-link{display:inline-flex;align-items:center;gap:.5rem;text-decoration:none;font-family:'JetBrains Mono',monospace;font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border2);padding:.5rem 1.1rem;transition:all .2s}
.pc-link:hover{color:var(--text);border-color:var(--text)}
.pc-link svg{width:13px;height:13px;flex-shrink:0}
/* CTA */
#cta{padding:5rem 0;background:var(--surface);border-top:1px solid var(--border)}
.cta-inner{text-align:center;max-width:620px;margin:0 auto}
.cta-btns{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap;margin-top:2.5rem}
.btn-p{padding:.85rem 2.2rem;background:var(--blue);color:var(--bg);border:none;font-family:'DM Sans',sans-serif;font-size:.78rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;cursor:pointer;text-decoration:none;transition:background .2s}
.btn-p:hover{background:var(--cyan)}
.btn-s{padding:.85rem 2.2rem;background:transparent;color:var(--muted);border:1px solid var(--border2);font-family:'DM Sans',sans-serif;font-size:.78rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;cursor:pointer;text-decoration:none;transition:all .2s}
.btn-s:hover{color:var(--text);border-color:var(--text)}
/* COMING SOON */
.coming-soon-tag{display:inline-flex;align-items:center;gap:.4rem;font-family:'JetBrains Mono',monospace;font-size:.6rem;letter-spacing:.12em;text-transform:uppercase;color:var(--dim);border:1px solid var(--dim);padding:.3rem .75rem;margin-top:1rem}
footer{padding:1.8rem 2.5rem;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.foot-brand{font-family:'JetBrains Mono',monospace;font-size:.65rem;color:var(--dim);letter-spacing:.06em}
.foot-brand strong{color:var(--blue)}
.foot-gh{display:flex;align-items:center;gap:.5rem;text-decoration:none;color:var(--dim);font-family:'JetBrains Mono',monospace;font-size:.62rem;letter-spacing:.08em;text-transform:uppercase;transition:color .2s}
.foot-gh:hover{color:var(--muted)}
@media(max-width:900px){
.opening-grid,.demo-layout,.why-grid{grid-template-columns:1fr;gap:2.5rem}
nav{padding:0 1.2rem}
.nav-link{display:none}
}
</style>
</head>
<body>
<nav>
<div class="nav-brand"><strong>LozanoLsa</strong> <span>· Turning Operations into Predictive Systems</span></div>
<div class="nav-right">
<a href="index.html" class="nav-link">← Home</a>
<a href="models.html" class="nav-link">Models</a>
<a href="https://github.com/LozanoLsa" target="_blank" rel="noopener" class="nav-gh">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.745 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/></svg>
GitHub
</a>
</div>
</nav>
<!-- PAGE HEADER -->
<section id="page-header">
<div class="container">
<div class="label-tag" style="margin-bottom:.7rem">Industry · Maintenance</div>
<h1 class="sec-title" style="font-size:clamp(2rem,4vw,3rem)">ML in Manufacturing</h1>
<div class="rule"></div>
<p style="font-size:.95rem;color:var(--muted);font-weight:300;max-width:560px;line-height:1.8;margin-top:.5rem">Why does Machine Learning matter on the plant floor? It starts with a simple question about every machine you operate.</p>
</div>
</section>
<!-- OPENING STATEMENT -->
<section id="opening">
<div class="container">
<div class="opening-grid">
<div>
<div class="opening-quote">
Every device<br>has a point of<br><em>failure.</em>
</div>
</div>
<div class="opening-body">
<p>A new machine fresh from the manufacturer is healthy and problem-free. But due to wear and tear, its health slowly deteriorates — and eventually it fails. When that happens, you need to perform maintenance to get it back to a working condition.</p>
<p>The question isn't <em>if</em> it will fail. The question is <em>what you do about it before it does.</em> There are three approaches — and the difference between them is measured in production hours, maintenance costs, and competitive advantage.</p>
<p>The chart below shows real sensor data from an industrial motor. The signal isn't smooth — it drifts, spikes, and recovers. That's what real degradation looks like. Switch between the three maintenance strategies and watch how each one interacts with that reality.</p>
</div>
</div>
</div>
</section>
<!-- MAINTENANCE DEMO -->
<section id="maintenance-demo">
<div class="container">
<div class="demo-tabs" id="demo-tabs">
<button class="tab-btn active" onclick="setTab('reactive',this)">1 — Reactive</button>
<button class="tab-btn" onclick="setTab('preventive',this)">2 — Preventive</button>
<button class="tab-btn" onclick="setTab('predictive',this)">3 — Predictive ML</button>
</div>
<div class="demo-layout">
<!-- VIZ -->
<div>
<div class="viz-box">
<div class="viz-tag" id="viz-tag">Industrial Motor — Reactive</div>
<canvas id="pm-canvas" style="display:block;width:100%"></canvas>
<div class="viz-stats">
<div class="vstat"><div class="vstat-l">Equipment</div><div class="vstat-v" style="font-size:.75rem">Industrial Motor</div></div>
<div class="vstat"><div class="vstat-l">Y axis</div><div class="vstat-v" style="font-size:.75rem">Vibration mm/s</div></div>
<div class="vstat"><div class="vstat-l">Failure threshold</div><div class="vstat-v" id="stat-thresh">14.5 mm/s</div></div>
<div class="vstat"><div class="vstat-l">Life saved</div><div class="vstat-v" id="stat-saved" style="color:var(--muted)">0 days</div></div>
</div>
</div>
<!-- Insight panel -->
<div class="insight" id="insight-panel">
<div class="insight-label">Strategy comparison</div>
<div class="insight-row">
<span class="insight-key">Maintenance trigger</span>
<span class="insight-val" id="ins-trigger" style="color:var(--rose)">Device failure</span>
</div>
<div class="insight-row">
<span class="insight-key">Unplanned downtime</span>
<span class="insight-val" id="ins-downtime" style="color:var(--rose)">High risk</span>
</div>
<div class="insight-row">
<span class="insight-key">Useful life wasted</span>
<span class="insight-val" id="ins-waste">None</span>
</div>
<div class="insight-row">
<span class="insight-key">Data required</span>
<span class="insight-val" id="ins-data">None</span>
</div>
</div>
</div>
<!-- TEXT -->
<div id="demo-text-panel">
<!-- content injected by JS -->
</div>
</div>
</div>
</section>
<!-- WHAT COMES NEXT -->
<section id="whats-next" style="padding:5rem 0;border-bottom:1px solid var(--border)">
<div class="container">
<!-- Evolution line -->
<div style="margin-bottom:4rem">
<div class="label-tag" style="margin-bottom:1.2rem">The natural progression</div>
<div style="display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--border)">
<div style="padding:2rem 1.8rem;border-right:1px solid var(--border);position:relative">
<div style="position:absolute;top:0;left:0;right:0;height:2px;background:var(--rose)"></div>
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--rose);margin-bottom:.6rem;opacity:.7">01 — Reactive</div>
<div style="font-family:'Fraunces',serif;font-size:1.1rem;font-weight:700;margin-bottom:.6rem">React</div>
<div style="font-size:.78rem;color:var(--muted);line-height:1.7;font-weight:300">Something breaks. You fix it. No data needed — but every failure is a surprise.</div>
<div style="margin-top:1rem;font-family:'JetBrains Mono',monospace;font-size:.62rem;color:var(--dim)">Trigger: failure</div>
</div>
<div style="padding:2rem 1.8rem;border-right:1px solid var(--border);position:relative">
<div style="position:absolute;top:0;left:0;right:0;height:2px;background:var(--gold)"></div>
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--gold);margin-bottom:.6rem;opacity:.7">02 — Preventive</div>
<div style="font-family:'Fraunces',serif;font-size:1.1rem;font-weight:700;margin-bottom:.6rem">Plan</div>
<div style="font-size:.78rem;color:var(--muted);line-height:1.7;font-weight:300">You set a schedule. Downtime is controlled — but you pay for maintenance whether the machine needs it or not.</div>
<div style="margin-top:1rem;font-family:'JetBrains Mono',monospace;font-size:.62rem;color:var(--dim)">Trigger: calendar</div>
</div>
<div style="padding:2rem 1.8rem;border-right:1px solid var(--border);position:relative">
<div style="position:absolute;top:0;left:0;right:0;height:2px;background:var(--blue)"></div>
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--blue);margin-bottom:.6rem;opacity:.7">03 — Predictive</div>
<div style="font-family:'Fraunces',serif;font-size:1.1rem;font-weight:700;margin-bottom:.6rem">Predict</div>
<div style="font-size:.78rem;color:var(--muted);line-height:1.7;font-weight:300">The data tells you when. You intervene at exactly the right moment — maximum life, minimum downtime.</div>
<div style="margin-top:1rem;font-family:'JetBrains Mono',monospace;font-size:.62rem;color:var(--dim)">Trigger: data pattern</div>
</div>
<div style="padding:2rem 1.8rem;position:relative;background:var(--surface2)">
<div style="position:absolute;top:0;left:0;right:0;height:2px;background:var(--purple)"></div>
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--purple);margin-bottom:.6rem;opacity:.7">04 — Prescriptive</div>
<div style="font-family:'Fraunces',serif;font-size:1.1rem;font-weight:700;margin-bottom:.6rem">Act</div>
<div style="font-size:.78rem;color:var(--muted);line-height:1.7;font-weight:300">The model doesn't just predict — it tells you <em style="color:var(--purple);font-style:normal">what to do, who should do it, with what part, and when.</em></div>
<div style="margin-top:1rem;font-family:'JetBrains Mono',monospace;font-size:.62rem;color:var(--purple);opacity:.5">Trigger: connected systems</div>
</div>
</div>
</div>
<!-- Prescriptive explanation -->
<div style="display:grid;grid-template-columns:1fr 1fr;gap:5rem;align-items:start">
<div>
<div style="font-family:'Fraunces',serif;font-size:clamp(1.6rem,3vw,2.4rem);font-weight:300;font-style:italic;line-height:1.25;color:var(--dim)">
Predictive tells you<br>
<strong style="color:var(--text);font-style:normal;font-weight:700">the future.</strong><br>
Prescriptive tells you<br>
<em style="color:var(--purple)">what to do about it.</em>
</div>
</div>
<div>
<div class="label-tag" style="margin-bottom:.8rem;color:var(--purple)">Prescriptive maintenance</div>
<div style="font-size:.88rem;color:var(--muted);line-height:1.9;font-weight:300">
<p style="margin-bottom:1.1rem">Once you start making decisions based on data, something changes. You realize the data doesn't stop at the machine. It connects to your inventory. To your workforce schedule. To your production plan. To your supply chain.</p>
<p style="margin-bottom:1.1rem">Prescriptive maintenance is what happens when those connections exist. The model doesn't just say <em style="color:var(--blue);font-style:normal">"bearing will fail in 8 days"</em> — it says <em style="color:var(--purple);font-style:normal">"bearing 3B will fail in 8 days. Technician available Thursday. Part in stock at A7. Schedule the intervention at 2pm to minimize OEE impact."</em></p>
<p>That's not science fiction. That's the natural destination of every plant that starts asking the right questions about its data. Every dataset you build today is infrastructure for the decisions you'll make tomorrow.</p>
</div>
<!-- What's needed box -->
<div style="margin-top:2rem;padding:1.4rem 1.6rem;border:1px solid var(--border);background:var(--surface2)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:1rem">What prescriptive requires</div>
<div style="display:flex;flex-direction:column;gap:.6rem">
<div style="display:flex;align-items:center;gap:.75rem">
<div style="width:6px;height:6px;background:var(--purple);opacity:.6;flex-shrink:0"></div>
<span style="font-size:.8rem;color:var(--muted);font-weight:300">CMMS connected in real time — not just logged</span>
</div>
<div style="display:flex;align-items:center;gap:.75rem">
<div style="width:6px;height:6px;background:var(--purple);opacity:.6;flex-shrink:0"></div>
<span style="font-size:.8rem;color:var(--muted);font-weight:300">Live inventory and spare parts visibility</span>
</div>
<div style="display:flex;align-items:center;gap:.75rem">
<div style="width:6px;height:6px;background:var(--purple);opacity:.6;flex-shrink:0"></div>
<span style="font-size:.8rem;color:var(--muted);font-weight:300">Workforce availability as a live variable</span>
</div>
<div style="display:flex;align-items:center;gap:.75rem">
<div style="width:6px;height:6px;background:var(--purple);opacity:.6;flex-shrink:0"></div>
<span style="font-size:.8rem;color:var(--muted);font-weight:300">Production schedule optimization integrated</span>
</div>
<div style="margin-top:.4rem;padding:.8rem 1rem;background:var(--surface3);border-left:2px solid var(--purple)">
<span style="font-family:'JetBrains Mono',monospace;font-size:.68rem;color:var(--muted)">Most plants are still building this infrastructure. <em style="color:var(--blue);font-style:normal">Predictive is the foundation</em> — prescriptive is what comes next.</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- SENSOR DEMO -->
<section id="sensor-demo" style="padding:5rem 0;border-bottom:1px solid var(--border);background:var(--surface)">
<div class="container">
<div style="text-align:center;margin-bottom:3.5rem">
<div class="label-tag" style="margin-bottom:.7rem">How does the model actually read the sensors?</div>
<h2 class="sec-title">From sensor signal<br>to anomaly detected</h2>
<div class="rule" style="margin:1rem auto"></div>
<p style="font-size:.9rem;color:var(--muted);font-weight:300;max-width:540px;margin:0 auto;line-height:1.8">You don't need to be an engineer to understand this. The concept is basic — and once you see it, you can't unsee it.</p>
</div>
<div class="demo-layout">
<!-- LEFT: Motor + sensor feed + scatter -->
<div style="display:flex;flex-direction:column;gap:1.2rem">
<!-- Motor SVG — expanded with sensor split -->
<div style="background:var(--bg);border:1px solid var(--border);padding:1.4rem;position:relative">
<div style="position:absolute;top:.8rem;right:.85rem;font-family:'JetBrains Mono',monospace;font-size:.56rem;color:var(--dim);letter-spacing:.08em;text-transform:uppercase">Industrial Motor</div>
<svg id="motor-svg" viewBox="0 0 420 280" style="width:100%;display:block">
<!-- ── ENVIRONMENTAL SENSORS label ── -->
<text x="210" y="16" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="8" fill="#FBBF24" letter-spacing="0.15em">ENVIRONMENTAL SENSORS</text>
<line x1="20" y1="20" x2="390" y2="20" stroke="#FBBF24" stroke-width="0.5" opacity="0.3"/>
<!-- ENV: Cameras (top left) -->
<rect x="8" y="26" width="72" height="28" rx="2" fill="rgba(251,191,36,0.06)" stroke="#FBBF24" stroke-width="1" stroke-dasharray="3,2"/>
<text x="44" y="38" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#FBBF24">Cameras</text>
<text x="44" y="48" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#856A2A">normal / night vision</text>
<!-- ENV: Smoke & Gas (top center-left) -->
<rect x="90" y="26" width="70" height="28" rx="2" fill="rgba(251,191,36,0.06)" stroke="#FBBF24" stroke-width="1" stroke-dasharray="3,2"/>
<text x="125" y="38" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#FBBF24">Smoke & Gas</text>
<text x="125" y="48" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#856A2A">leak detection</text>
<!-- ENV: Humidity (top center) -->
<rect x="170" y="26" width="62" height="28" rx="2" fill="rgba(251,191,36,0.06)" stroke="#FBBF24" stroke-width="1" stroke-dasharray="3,2"/>
<text x="201" y="38" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#FBBF24">Humidity</text>
<text x="201" y="48" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#856A2A">ambient moisture</text>
<!-- ENV: Temperature (top center-right) -->
<rect x="242" y="26" width="72" height="28" rx="2" fill="rgba(251,191,36,0.06)" stroke="#FBBF24" stroke-width="1" stroke-dasharray="3,2"/>
<text x="278" y="38" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#FBBF24">Temperature</text>
<text x="278" y="48" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#856A2A">ambient air</text>
<!-- ENV: Radiation (top right) -->
<rect x="324" y="26" width="68" height="28" rx="2" fill="rgba(251,191,36,0.06)" stroke="#FBBF24" stroke-width="1" stroke-dasharray="3,2"/>
<text x="358" y="38" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#FBBF24">Radiation</text>
<text x="358" y="48" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#856A2A">nuclear / pharma</text>
<!-- ENV connector lines to motor area -->
<line x1="44" y1="54" x2="150" y2="80" stroke="#FBBF24" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<line x1="125" y1="54" x2="170" y2="80" stroke="#FBBF24" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<line x1="201" y1="54" x2="205" y2="80" stroke="#FBBF24" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<line x1="278" y1="54" x2="240" y2="80" stroke="#FBBF24" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<line x1="358" y1="54" x2="270" y2="80" stroke="#FBBF24" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<!-- ── MOTOR BODY ── -->
<rect x="100" y="80" width="220" height="130" rx="6" fill="none" stroke="#D8E0F0" stroke-width="2"/>
<!-- Shaft left -->
<rect x="72" y="132" width="30" height="18" rx="2" fill="none" stroke="#D8E0F0" stroke-width="1.8"/>
<!-- End cap right -->
<rect x="320" y="96" width="18" height="98" rx="3" fill="none" stroke="#D8E0F0" stroke-width="1.8"/>
<!-- Body lines -->
<line x1="118" y1="105" x2="315" y2="105" stroke="#2A3A5A" stroke-width="1.2"/>
<line x1="118" y1="122" x2="315" y2="122" stroke="#2A3A5A" stroke-width="1.2"/>
<line x1="118" y1="139" x2="315" y2="139" stroke="#2A3A5A" stroke-width="1.2"/>
<line x1="118" y1="156" x2="315" y2="156" stroke="#2A3A5A" stroke-width="1.2"/>
<line x1="118" y1="173" x2="315" y2="173" stroke="#2A3A5A" stroke-width="1.2"/>
<!-- Vibration waves left -->
<g id="wave-left" opacity="0.7">
<path d="M55,141 Q46,126 55,111 Q64,96 55,81" fill="none" stroke="#38BEFF" stroke-width="2.2" stroke-linecap="round"/>
<path d="M44,141 Q32,123 44,105 Q56,87 44,69" fill="none" stroke="#38BEFF" stroke-width="1.5" stroke-linecap="round" opacity="0.4"/>
</g>
<!-- Vibration waves right -->
<g id="wave-right" opacity="0.7">
<path d="M345,141 Q354,126 345,111 Q336,96 345,81" fill="none" stroke="#38BEFF" stroke-width="2.2" stroke-linecap="round"/>
<path d="M356,141 Q368,123 356,105 Q344,87 356,69" fill="none" stroke="#38BEFF" stroke-width="1.5" stroke-linecap="round" opacity="0.4"/>
</g>
<!-- ── MACHINE SENSORS label ── -->
<text x="210" y="226" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="8" fill="#38BEFF" letter-spacing="0.15em">MACHINE SENSORS</text>
<line x1="20" y1="230" x2="390" y2="230" stroke="#38BEFF" stroke-width="0.5" opacity="0.25"/>
<!-- MACH: Sensor A — Vibration (active, top of motor) -->
<rect id="sensor-a-box" x="152" y="60" width="66" height="22" rx="2" fill="#060A12" stroke="#38BEFF" stroke-width="2"/>
<line x1="185" y1="80" x2="185" y2="90" stroke="#38BEFF" stroke-width="1.5" stroke-dasharray="3,2"/>
<text x="185" y="72" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#38BEFF">Sensor A · Vibration</text>
<text id="sa-val" x="185" y="130" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="14" font-weight="bold" fill="#38BEFF" opacity="0">—</text>
<!-- MACH: Sensor B — Thermal (active, bottom of motor) -->
<rect id="sensor-b-box" x="152" y="208" width="66" height="22" rx="2" fill="#060A12" stroke="#00F5D4" stroke-width="2"/>
<line x1="185" y1="208" x2="185" y2="198" stroke="#00F5D4" stroke-width="1.5" stroke-dasharray="3,2"/>
<text x="185" y="220" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#00F5D4">Sensor B · Thermal</text>
<text id="sb-val" x="185" y="162" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="14" font-weight="bold" fill="#00F5D4" opacity="0">—</text>
<!-- MACH: Position (bottom left) -->
<rect x="8" y="236" width="68" height="26" rx="2" fill="rgba(56,190,255,0.06)" stroke="#38BEFF" stroke-width="1" stroke-dasharray="3,2"/>
<text x="42" y="248" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#38BEFF">Position</text>
<text x="42" y="257" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#2A5A6A">shaft alignment</text>
<line x1="42" y1="236" x2="100" y2="200" stroke="#38BEFF" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<!-- MACH: Pressure (bottom center-left) -->
<rect x="86" y="236" width="68" height="26" rx="2" fill="rgba(56,190,255,0.06)" stroke="#38BEFF" stroke-width="1" stroke-dasharray="3,2"/>
<text x="120" y="248" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#38BEFF">Pressure</text>
<text x="120" y="257" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#2A5A6A">internal / fluid</text>
<line x1="120" y1="236" x2="140" y2="210" stroke="#38BEFF" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<!-- MACH: Level (bottom center) -->
<rect x="164" y="236" width="62" height="26" rx="2" fill="rgba(56,190,255,0.06)" stroke="#38BEFF" stroke-width="1" stroke-dasharray="3,2"/>
<text x="195" y="248" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#38BEFF">Level</text>
<text x="195" y="257" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#2A5A6A">oil / coolant</text>
<line x1="195" y1="236" x2="195" y2="210" stroke="#38BEFF" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<!-- MACH: Strain (bottom center-right) -->
<rect x="236" y="236" width="62" height="26" rx="2" fill="rgba(56,190,255,0.06)" stroke="#38BEFF" stroke-width="1" stroke-dasharray="3,2"/>
<text x="267" y="248" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#38BEFF">Strain</text>
<text x="267" y="257" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#2A5A6A">mechanical stress</text>
<line x1="267" y1="236" x2="260" y2="210" stroke="#38BEFF" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<!-- MACH: Sound/Vibration (bottom right) -->
<rect x="308" y="236" width="80" height="26" rx="2" fill="rgba(56,190,255,0.06)" stroke="#38BEFF" stroke-width="1" stroke-dasharray="3,2"/>
<text x="348" y="248" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#38BEFF">Sound / Vibration</text>
<text x="348" y="257" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="5.5" fill="#2A5A6A">acoustic emission</text>
<line x1="320" y1="236" x2="310" y2="210" stroke="#38BEFF" stroke-width="0.7" stroke-dasharray="3,3" opacity="0.3"/>
<!-- Legend -->
<rect x="8" y="267" width="10" height="6" rx="1" fill="none" stroke="#FBBF24" stroke-width="1" stroke-dasharray="2,1"/>
<text x="22" y="274" font-family="JetBrains Mono,monospace" font-size="6" fill="#FBBF24">Environmental</text>
<rect x="100" y="267" width="10" height="6" rx="1" fill="none" stroke="#38BEFF" stroke-width="1" stroke-dasharray="2,1"/>
<text x="114" y="274" font-family="JetBrains Mono,monospace" font-size="6" fill="#38BEFF">Machine (attached)</text>
<rect x="220" y="267" width="10" height="6" rx="1" fill="#060A12" stroke="#38BEFF" stroke-width="2"/>
<text x="234" y="274" font-family="JetBrains Mono,monospace" font-size="6" fill="#38BEFF">Active in this demo</text>
</svg>
</div>
<!-- Status bar -->
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;border:1px solid var(--border)">
<div style="padding:.8rem 1rem;background:var(--surface2);border-right:1px solid var(--border)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.54rem;color:var(--dim);letter-spacing:.1em;text-transform:uppercase;margin-bottom:.25rem">Readings collected</div>
<div id="reading-count" style="font-family:'JetBrains Mono',monospace;font-size:.9rem;font-weight:500;color:var(--text)">0</div>
</div>
<div style="padding:.8rem 1rem;background:var(--surface2);border-right:1px solid var(--border)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.54rem;color:var(--dim);letter-spacing:.1em;text-transform:uppercase;margin-bottom:.25rem">Model status</div>
<div id="model-status" style="font-family:'JetBrains Mono',monospace;font-size:.75rem;font-weight:500;color:var(--muted)">Learning...</div>
</div>
<div style="padding:.8rem 1rem;background:var(--surface2)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.54rem;color:var(--dim);letter-spacing:.1em;text-transform:uppercase;margin-bottom:.25rem">Last reading</div>
<div id="last-reading" style="font-family:'JetBrains Mono',monospace;font-size:.75rem;font-weight:500;color:var(--muted)">—</div>
</div>
</div>
<!-- Scatter plot — fixed: size set explicitly to avoid offsetWidth=0 bug -->
<div style="background:var(--bg);border:1px solid var(--border);position:relative">
<div style="position:absolute;top:.8rem;right:.85rem;font-family:'JetBrains Mono',monospace;font-size:.56rem;color:var(--dim);letter-spacing:.08em;text-transform:uppercase;z-index:1" id="scatter-tag">Sensor A vs Sensor B</div>
<canvas id="scatter-canvas" style="display:block;width:100%"></canvas>
</div>
</div>
<!-- RIGHT: explanation -->
<div class="demo-info">
<div class="think-box" style="border-color:var(--cyan)">
<div class="think-label">Think of it like...</div>
<div class="think-text">Every time the motor runs normally, you write down what both sensors read. After enough readings, you know what "normal" looks like on a map. When a new reading falls far outside that map — the model flags it. No formulas. Just memory.</div>
</div>
<div class="demo-ref">Demo 02 — Sensor Anomaly Detection</div>
<h3 class="demo-title">How the model<br>learns what's normal</h3>
<div class="rule" style="background:var(--cyan)"></div>
<p class="demo-desc">
Two vibration sensors are installed on the motor — <em style="color:var(--blue)">Sensor A</em> on top, <em style="color:var(--cyan)">Sensor B</em> on the bottom. Each reading gives you two numbers. Plot them together and a pattern emerges: <em style="color:var(--blue)">normal operation always falls in the same zone.</em> When a reading falls outside that zone — the model already knows something is wrong.
</p>
<div style="display:flex;flex-direction:column;gap:1rem;margin-bottom:2rem">
<div id="phase-indicator" style="padding:1rem 1.2rem;background:var(--surface3);border-left:3px solid var(--cyan)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.15em;text-transform:uppercase;color:var(--muted);margin-bottom:.35rem" id="phase-label">Phase 1 — Collecting normal readings</div>
<div style="font-size:.84rem;color:var(--text);line-height:1.65" id="phase-text">The motor is running normally. Each reading is a data point. The model is learning what normal looks like — building its map.</div>
</div>
</div>
<!-- Manual test -->
<div id="manual-test" style="display:none">
<div style="font-family:'JetBrains Mono',monospace;font-size:.62rem;letter-spacing:.15em;text-transform:uppercase;color:var(--muted);margin-bottom:1rem">Test it yourself — place your own reading</div>
<div style="display:flex;flex-direction:column;gap:.9rem;margin-bottom:1.2rem">
<div>
<div style="font-family:'JetBrains Mono',monospace;font-size:.65rem;color:var(--muted);margin-bottom:.45rem;display:flex;justify-content:space-between">Sensor A <span id="slider-a-val" style="color:var(--blue);background:var(--surface3);padding:.1rem .4rem">5</span></div>
<input type="range" id="slider-a" min="1" max="10" value="5" step="1" style="accent-color:var(--blue)">
</div>
<div>
<div style="font-family:'JetBrains Mono',monospace;font-size:.65rem;color:var(--muted);margin-bottom:.45rem;display:flex;justify-content:space-between">Sensor B <span id="slider-b-val" style="color:var(--cyan);background:var(--surface3);padding:.1rem .4rem">5</span></div>
<input type="range" id="slider-b" min="1" max="10" value="5" step="1" style="accent-color:var(--cyan)">
</div>
</div>
<!-- Result indicator -->
<div id="test-result" style="padding:1rem 1.2rem;background:var(--surface3);border-left:3px solid var(--muted);transition:all .3s">
<div style="font-family:'JetBrains Mono',monospace;font-size:.62rem;letter-spacing:.15em;text-transform:uppercase;color:var(--muted);margin-bottom:.3rem">Reading assessment</div>
<div id="result-text" style="font-size:.88rem;font-weight:600;color:var(--muted)">Move the sliders to test</div>
</div>
</div>
<!-- KNN connection -->
<div style="margin-top:2rem;padding:1rem 1.2rem;background:var(--surface2);border:1px solid var(--border)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.15em;text-transform:uppercase;color:var(--blue);margin-bottom:.5rem">The connection to KNN</div>
<div style="font-size:.8rem;color:var(--muted);line-height:1.75;font-weight:300">This is exactly how K-Nearest Neighbors works — it measures the distance from a new point to what it already knows. If the nearest neighbors are all "normal", the reading is normal. If not — it's an anomaly.</div>
<a href="models.html#block1" style="display:inline-flex;align-items:center;gap:.4rem;margin-top:.8rem;text-decoration:none;font-family:'JetBrains Mono',monospace;font-size:.6rem;letter-spacing:.08em;text-transform:uppercase;color:var(--blue);border-bottom:1px solid var(--blue);padding-bottom:.1rem">→ See KNN demo in Models</a>
</div>
</div>
</div>
</div>
</section>
<!-- WHY ML -->
<section id="why-ml">
<div class="container">
<div class="why-grid">
<div>
<div class="why-quote">
Not a calendar.<br>Not a rule.<br>
<strong>A pattern</strong> the data<br>
<em>already knows.</em>
</div>
</div>
<div class="why-body">
<div class="label-tag" style="margin-bottom:.8rem">How predictive ML works</div>
<p>How do we predict when a device fails? Using <strong>data collected from similar devices in the past.</strong> With industrial motors, there are already thousands of similar machines installed across plants worldwide — each one generating vibration, temperature, and current data throughout its lifecycle.</p>
<p>By analyzing patterns from motors that already failed, a model learns what the degradation curve looks like before breakdown. When it sees those same patterns in a new motor, it can estimate <em>how much life is left.</em></p>
<p>The fancy term we currently use — or maybe overuse — is <strong>AI.</strong> But the basic principle is simpler: analyze historic data, recognize patterns, make better decisions about the future. That's it.</p>
<p>We're still in the early phases of this transition in industry. Preventive maintenance has decades of trust behind it. Predictive maintenance is still earning that trust — one dataset at a time.</p>
<div class="project-callout">
<div class="pc-tag">Real project — Motor Failures Prediction</div>
<div class="pc-title">KNN applied to industrial motor failure</div>
<div class="pc-desc">This is exactly what the Motor Failures Prediction project does: KNN finds the K most similar motors that already failed — by vibration profile, temperature, and load — and predicts when yours will reach the same point. Real dataset. Open code.</div>
<a href="https://github.com/LozanoLsa/Motor_Failures_Prediction" target="_blank" rel="noopener" class="pc-link">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.745 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/></svg>
Full Repository
</a>
</div>
</div>
</div>
</div>
</section>
<!-- ECOSYSTEM DEMO -->
<section id="ecosystem" style="padding:5rem 0;border-bottom:1px solid var(--border);background:var(--surface)">
<div class="container">
<div style="text-align:center;margin-bottom:3.5rem">
<div class="label-tag" style="margin-bottom:.7rem">The complete picture</div>
<h2 class="sec-title">From sensor to work order —<br>the full ecosystem</h2>
<div class="rule" style="margin:1rem auto"></div>
<p style="font-size:.9rem;color:var(--muted);font-weight:300;max-width:580px;margin:0 auto;line-height:1.8">This is what predictive — and eventually prescriptive — maintenance looks like in practice. Click any block to learn what it does.</p>
</div>
<!-- Ecosystem diagram -->
<div style="background:var(--bg);border:1px solid var(--border);padding:2.5rem;margin-bottom:2rem">
<svg id="eco-svg" viewBox="0 0 900 340" style="width:100%;display:block">
<!-- ── MACHINE + SENSORS (left) ── -->
<!-- Machine box -->
<rect x="10" y="100" width="130" height="140" rx="4" fill="#0C1220" stroke="#2A3A5A" stroke-width="1.2"/>
<!-- Motor icon simplified -->
<rect x="30" y="125" width="90" height="60" rx="3" fill="none" stroke="#5A6A8A" stroke-width="1.5"/>
<rect x="22" y="148" width="10" height="14" rx="1" fill="none" stroke="#5A6A8A" stroke-width="1.2"/>
<rect x="120" y="138" width="10" height="34" rx="1" fill="none" stroke="#5A6A8A" stroke-width="1.2"/>
<line x1="38" y1="140" x2="112" y2="140" stroke="#2A3A5A" stroke-width="1"/>
<line x1="38" y1="152" x2="112" y2="152" stroke="#2A3A5A" stroke-width="1"/>
<line x1="38" y1="164" x2="112" y2="164" stroke="#2A3A5A" stroke-width="1"/>
<!-- Sensor A top -->
<rect id="eco-sa" x="45" y="108" width="40" height="18" rx="2" fill="#0C1220" stroke="#38BEFF" stroke-width="1.5" style="cursor:pointer"/>
<text x="65" y="121" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#38BEFF">Sensor A</text>
<!-- Sensor B bottom -->
<rect id="eco-sb" x="45" y="212" width="40" height="18" rx="2" fill="#0C1220" stroke="#00F5D4" stroke-width="1.5" style="cursor:pointer"/>
<text x="65" y="225" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#00F5D4">Sensor B</text>
<!-- Label -->
<text x="75" y="258" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="8" fill="#5A6A8A">MACHINE</text>
<!-- Environmental sensors top -->
<text x="75" y="92" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#2A3A5A">Vibration · Thermal · Pressure</text>
<!-- ── FLOW ARROW 1: Machine → Sensor Data ── -->
<g id="arrow1">
<line x1="142" y1="170" x2="195" y2="170" stroke="#38BEFF" stroke-width="1.5" stroke-dasharray="5,3" opacity="0.4"/>
<polygon points="195,166 203,170 195,174" fill="#38BEFF" opacity="0.4"/>
</g>
<!-- ── SENSOR DATA ── -->
<rect id="eco-sd" x="205" y="130" width="100" height="80" rx="4" fill="#0C1220" stroke="#38BEFF" stroke-width="1.5" style="cursor:pointer"/>
<!-- Cylinder look -->
<ellipse cx="255" cy="142" rx="40" ry="10" fill="#121A2E" stroke="#38BEFF" stroke-width="1.2"/>
<rect x="215" y="142" width="80" height="50" fill="#121A2E" stroke="#38BEFF" stroke-width="0"/>
<line x1="215" y1="142" x2="215" y2="192" stroke="#38BEFF" stroke-width="1.2"/>
<line x1="295" y1="142" x2="295" y2="192" stroke="#38BEFF" stroke-width="1.2"/>
<ellipse cx="255" cy="192" rx="40" ry="10" fill="#0C1220" stroke="#38BEFF" stroke-width="1.2"/>
<text x="255" y="165" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="8" fill="#38BEFF" font-weight="bold">Sensor</text>
<text x="255" y="177" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="8" fill="#38BEFF" font-weight="bold">Data</text>
<text x="255" y="218" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Real-time readings</text>
<!-- Knowledge base (below sensor data) -->
<rect id="eco-kb" x="205" y="240" width="100" height="55" rx="4" fill="#0C1220" stroke="#2A3A5A" stroke-width="1.2" style="cursor:pointer"/>
<ellipse cx="255" cy="250" rx="38" ry="8" fill="#121A2E" stroke="#2A3A5A" stroke-width="1"/>
<rect x="217" y="250" width="76" height="35" fill="#121A2E"/>
<line x1="217" y1="250" x2="217" y2="285" stroke="#2A3A5A" stroke-width="1"/>
<line x1="293" y1="250" x2="293" y2="285" stroke="#2A3A5A" stroke-width="1"/>
<ellipse cx="255" cy="285" rx="38" ry="8" fill="#0C1220" stroke="#2A3A5A" stroke-width="1"/>
<text x="255" y="265" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Knowledge</text>
<text x="255" y="276" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Base</text>
<text x="255" y="306" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#2A3A5A">Manuals · History</text>
<!-- Flow arrow KB → ML -->
<line x1="305" y1="262" x2="348" y2="220" stroke="#2A3A5A" stroke-width="1" stroke-dasharray="4,3" opacity="0.5"/>
<!-- ── FLOW ARROW 2: Sensor Data → ML ── -->
<g id="arrow2">
<line x1="305" y1="170" x2="348" y2="170" stroke="#38BEFF" stroke-width="1.5" stroke-dasharray="5,3" opacity="0.4"/>
<polygon points="348,166 356,170 348,174" fill="#38BEFF" opacity="0.4"/>
</g>
<!-- ── ML BLOCK ── -->
<rect id="eco-ml" x="358" y="130" width="90" height="80" rx="4" fill="#0C1220" stroke="#A78BFA" stroke-width="2" style="cursor:pointer"/>
<text x="403" y="162" text-anchor="middle" font-family="Fraunces,serif" font-size="24" fill="#A78BFA" font-weight="bold">ML</text>
<text x="403" y="182" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#A78BFA">Pattern</text>
<text x="403" y="193" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#A78BFA">Recognition</text>
<text x="403" y="226" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">KNN · Random Forest</text>
<text x="403" y="237" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Logistic · SVM</text>
<!-- ── FLOW ARROW 3: ML → CMMS ── -->
<g id="arrow3">
<line x1="448" y1="170" x2="495" y2="170" stroke="#A78BFA" stroke-width="1.5" stroke-dasharray="5,3" opacity="0.4"/>
<polygon points="495,166 503,170 495,174" fill="#A78BFA" opacity="0.4"/>
</g>
<!-- ERP top (feeds into CMMS) -->
<rect id="eco-erp" x="505" y="30" width="110" height="60" rx="4" fill="#185FA5" stroke="#38BEFF" stroke-width="1.5" style="cursor:pointer"/>
<text x="560" y="57" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="9" fill="white" font-weight="bold">ERP</text>
<text x="560" y="70" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#B5D4F4">Operations</text>
<text x="560" y="106" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#5A6A8A">Production schedule</text>
<!-- Arrow ERP → CMMS -->
<line x1="560" y1="90" x2="560" y2="128" stroke="#38BEFF" stroke-width="1.2" stroke-dasharray="4,3" opacity="0.5"/>
<polygon points="556,128 560,136 564,128" fill="#38BEFF" opacity="0.4"/>
<!-- ── CMMS ── -->
<rect id="eco-cmms" x="505" y="118" width="110" height="110" rx="4" fill="#185FA5" stroke="#38BEFF" stroke-width="2" style="cursor:pointer"/>
<text x="560" y="150" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="12" fill="white" font-weight="bold">CMMS</text>
<text x="560" y="167" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#B5D4F4">Work orders</text>
<text x="560" y="178" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#B5D4F4">Alerts</text>
<text x="560" y="189" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#B5D4F4">Notifications</text>
<text x="560" y="200" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="6.5" fill="#B5D4F4">Prescriptions</text>
<text x="560" y="218" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#FBBF24">SAP PM · Maximo</text>
<!-- Inventory + Asset data (right of CMMS) -->
<rect id="eco-inv" x="640" y="100" width="90" height="55" rx="4" fill="#0C1220" stroke="#2A3A5A" stroke-width="1.2" style="cursor:pointer"/>
<text x="685" y="125" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Inventory</text>
<text x="685" y="136" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Asset Data</text>
<line x1="640" y1="127" x2="617" y2="155" stroke="#2A3A5A" stroke-width="1" stroke-dasharray="3,3" opacity="0.5"/>
<!-- Maintenance history -->
<rect id="eco-mh" x="640" y="175" width="90" height="55" rx="4" fill="#0C1220" stroke="#2A3A5A" stroke-width="1.2" style="cursor:pointer"/>
<text x="685" y="200" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Maintenance</text>
<text x="685" y="211" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">History</text>
<line x1="640" y1="202" x2="617" y2="193" stroke="#2A3A5A" stroke-width="1" stroke-dasharray="3,3" opacity="0.5"/>
<!-- ── FLOW ARROW 4: CMMS → App ── -->
<g id="arrow4">
<line x1="560" y1="228" x2="560" y2="270" stroke="#34D399" stroke-width="1.5" stroke-dasharray="5,3" opacity="0.4"/>
<polygon points="556,270 560,278 564,270" fill="#34D399" opacity="0.4"/>
</g>
<!-- ── APP / TECHNICIAN ── -->
<rect id="eco-app" x="495" y="280" width="130" height="50" rx="4" fill="#0C1220" stroke="#34D399" stroke-width="1.8" style="cursor:pointer"/>
<text x="560" y="301" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="8" fill="#34D399" font-weight="bold">Technician App</text>
<text x="560" y="315" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#5A6A8A">Work order · Instructions · AR</text>
<!-- ── ANIMATED DATA PARTICLES ── -->
<circle id="p1" cx="0" cy="170" r="3.5" fill="#38BEFF" opacity="0"/>
<circle id="p2" cx="0" cy="170" r="3.5" fill="#A78BFA" opacity="0"/>
<circle id="p3" cx="0" cy="170" r="3.5" fill="#34D399" opacity="0"/>
<!-- Step labels -->
<text x="75" y="320" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#2A3A5A">① Detect</text>
<text x="255" y="320" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#2A3A5A">② Collect</text>
<text x="403" y="320" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#2A3A5A">③ Predict</text>
<text x="560" y="320" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#2A3A5A">④ Decide</text>
<text x="685" y="320" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="7" fill="#2A3A5A">⑤ Context</text>
</svg>
</div>
<!-- Info panel -->
<div id="eco-info" style="display:grid;grid-template-columns:1fr 2fr;gap:0;border:1px solid var(--border);min-height:120px">
<div style="padding:1.4rem 1.6rem;background:var(--surface2);border-right:1px solid var(--border)">
<div style="font-family:'JetBrains Mono',monospace;font-size:.58rem;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:.5rem">Selected block</div>
<div id="eco-block-name" style="font-family:'Fraunces',serif;font-size:1.1rem;font-weight:700;color:var(--text)">Click any block</div>
<div id="eco-block-tag" style="font-family:'JetBrains Mono',monospace;font-size:.65rem;color:var(--muted);margin-top:.3rem">to learn what it does</div>
</div>
<div style="padding:1.4rem 1.8rem">
<div id="eco-block-desc" style="font-size:.85rem;color:var(--muted);line-height:1.85;font-weight:300">Each block in this diagram plays a specific role in turning raw sensor data into a maintenance action. Click any block to understand its role in the ecosystem.</div>
</div>
</div>
</div>
</section>
<!-- CTA -->
<section id="cta">
<div class="container">
<div class="cta-inner">
<div class="label-tag" style="margin-bottom:.8rem">What's next</div>
<h2 class="sec-title">See the models behind the prediction</h2>
<div class="rule" style="margin:1rem auto"></div>
<p style="font-size:.9rem;color:var(--muted);line-height:1.85;font-weight:300">KNN, Logistic Regression, Decision Trees, SVM — 11 supervised learning models explained through interactive visualizations. Understand the math, the geometry, and when to use each one.</p>
<div class="cta-btns">
<a href="models.html" class="btn-p">Explore the models</a>
<a href="https://github.com/LozanoLsa" target="_blank" rel="noopener" class="btn-s">View on GitHub</a>
</div>
<div>
<span class="coming-soon-tag">Quality · Operations · SCM — coming soon</span>
</div>
</div>
</div>
</section>
<footer>
<div style="display:flex;align-items:center;gap:1.5rem">
<a href="index.html" style="text-decoration:none;font-family:'JetBrains Mono',monospace;font-size:.62rem;color:var(--dim);letter-spacing:.06em;text-transform:uppercase;transition:color .2s" onmouseover="this.style.color='var(--muted)'" onmouseout="this.style.color='var(--dim)'">← Home</a>
<div class="foot-brand"><strong>LozanoLsa</strong> · Turning Operations into Predictive Systems · 2025</div>
</div>
<a href="https://github.com/LozanoLsa" target="_blank" rel="noopener" class="foot-gh">
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor"><path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.745 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/></svg>
github.com/LozanoLsa
</a>
</footer>
<script>
// ── DATA ──
const DAYS=120,FAIL_THRESH=14.5,MAINT_PREV=70,MAINT_PRED=98;
function randn(){let u=0,v=0;while(!u)u=Math.random();while(!v)v=Math.random();return Math.sqrt(-2*Math.log(u))*Math.cos(2*Math.PI*v);}
function genVib(seed){
function rng(i){let x=Math.sin(seed*1000+i*7.3)*43758.5453;return x-Math.floor(x);}
const pts=[];
for(let d=0;d<DAYS;d++){
const deg=0.082*d+0.00035*d*d;
const noise=(rng(d)-.5)*1.9+Math.sin(d*.42)*.65;
const spike=rng(d+100)>.93?rng(d+200)*3.2:0;
pts.push(Math.max(1.5,2.4+deg+noise+spike));
}
return pts;
}
const vibData=genVib(42);
let failDay=DAYS;
for(let d=0;d<DAYS;d++){if(vibData[d]>=FAIL_THRESH){failDay=d;break;}}
// ── CANVAS ──
let currentMode='reactive',animFrame=null,currentDay=0;
function drawFrame(dayLimit){
const canvas=document.getElementById('pm-canvas');
if(!canvas)return;
const W=canvas.offsetWidth,H=240;
canvas.width=W*devicePixelRatio;canvas.height=H*devicePixelRatio;
canvas.style.height=H+'px';
const ctx=canvas.getContext('2d');
ctx.scale(devicePixelRatio,devicePixelRatio);
const P={t:18,r:18,b:32,l:52},pw=W-P.l-P.r,ph=H-P.t-P.b;
const YMAX=18,YMIN=0;
const xS=d=>P.l+(d/DAYS)*pw;
const yS=v=>P.t+(1-(v-YMIN)/(YMAX-YMIN))*ph;
ctx.clearRect(0,0,W,H);
// Grid
[0,3,6,9,12,15,18].forEach(v=>{
const y=yS(v);
ctx.beginPath();ctx.moveTo(P.l,y);ctx.lineTo(P.l+pw,y);
ctx.strokeStyle='rgba(255,255,255,0.04)';ctx.lineWidth=.5;ctx.stroke();
ctx.fillStyle='#2A3A5A';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='right';
ctx.fillText(v,P.l-5,y+3);
});
[0,20,40,60,80,100,120].forEach(d=>{
const x=xS(d);
ctx.beginPath();ctx.moveTo(x,P.t);ctx.lineTo(x,P.t+ph);
ctx.strokeStyle='rgba(255,255,255,0.04)';ctx.lineWidth=.5;ctx.stroke();
ctx.fillStyle='#2A3A5A';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='center';
ctx.fillText('d'+d,x,P.t+ph+14);
});
// Axis label
ctx.save();ctx.translate(12,P.t+ph/2);ctx.rotate(-Math.PI/2);
ctx.fillStyle='#5A6A8A';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='center';
ctx.fillText('vibration mm/s',0,0);ctx.restore();
// Threshold
const ty=yS(FAIL_THRESH);
ctx.beginPath();ctx.moveTo(P.l,ty);ctx.lineTo(P.l+pw,ty);
ctx.strokeStyle='rgba(251,113,133,.55)';ctx.lineWidth=1.2;ctx.setLineDash([5,4]);ctx.stroke();ctx.setLineDash([]);
ctx.fillStyle='rgba(251,113,133,.6)';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='left';
ctx.fillText('failure threshold ('+FAIL_THRESH+' mm/s)',P.l+4,ty-4);
// Zones
if(currentMode==='reactive'&&dayLimit>=failDay){
ctx.fillStyle='rgba(251,113,133,0.07)';
ctx.fillRect(xS(failDay),P.t,Math.min(pw*.15,P.l+pw-xS(failDay)),ph);
ctx.fillStyle='rgba(251,113,133,.45)';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='left';
ctx.fillText('unplanned downtime',xS(failDay)+4,P.t+ph-8);
}
if(currentMode==='preventive'&&dayLimit>=MAINT_PREV){
ctx.fillStyle='rgba(251,191,36,0.07)';
ctx.fillRect(xS(MAINT_PREV),P.t,xS(failDay)-xS(MAINT_PREV),ph);
ctx.fillStyle='rgba(251,191,36,.5)';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='center';
ctx.fillText('usable life wasted',xS((MAINT_PREV+failDay)/2),P.t+ph-8);
}
if(currentMode==='predictive'&&dayLimit>=MAINT_PRED){
ctx.fillStyle='rgba(52,211,153,0.07)';
ctx.fillRect(xS(MAINT_PRED),P.t,xS(failDay)-xS(MAINT_PRED),ph);
}
// Maintenance lines
if(currentMode==='preventive'&&dayLimit>=MAINT_PREV){
const mx=xS(MAINT_PREV);
ctx.beginPath();ctx.moveTo(mx,P.t);ctx.lineTo(mx,P.t+ph);
ctx.strokeStyle='rgba(251,191,36,.7)';ctx.lineWidth=1.8;ctx.setLineDash([4,3]);ctx.stroke();ctx.setLineDash([]);
ctx.fillStyle='rgba(251,191,36,.7)';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='left';
ctx.fillText('scheduled maint. d'+MAINT_PREV,mx+4,P.t+14);
}
if(currentMode==='predictive'&&dayLimit>=MAINT_PRED){
const px2=xS(MAINT_PRED);
ctx.beginPath();ctx.moveTo(px2,P.t);ctx.lineTo(px2,P.t+ph);
ctx.strokeStyle='rgba(52,211,153,.8)';ctx.lineWidth=2;ctx.setLineDash([4,3]);ctx.stroke();ctx.setLineDash([]);
ctx.fillStyle='rgba(52,211,153,.8)';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='left';
ctx.fillText('ML alert: maint. in '+(failDay-MAINT_PRED)+'d',px2+4,P.t+14);
}
// Failure marker
if(currentMode==='reactive'&&dayLimit>=failDay){
const fx=xS(failDay);
ctx.beginPath();ctx.moveTo(fx,P.t);ctx.lineTo(fx,P.t+ph);
ctx.strokeStyle='#FB7185';ctx.lineWidth=2;ctx.stroke();
ctx.fillStyle='#FB7185';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='left';
ctx.fillText('FAILURE d'+failDay,fx+4,yS(FAIL_THRESH)-6);
}
// ML prediction line
if(currentMode==='predictive'&&dayLimit>=MAINT_PRED){
ctx.beginPath();
for(let d=MAINT_PRED;d<DAYS;d++){
const slope=(FAIL_THRESH-vibData[MAINT_PRED])/(failDay-MAINT_PRED);
const pred=vibData[MAINT_PRED]+slope*(d-MAINT_PRED);
const x=xS(d),y=yS(pred);
d===MAINT_PRED?ctx.moveTo(x,y):ctx.lineTo(x,y);
}
ctx.strokeStyle='rgba(52,211,153,.7)';ctx.lineWidth=1.5;ctx.setLineDash([6,4]);ctx.stroke();ctx.setLineDash([]);
ctx.fillStyle='rgba(52,211,153,.6)';ctx.font='9px JetBrains Mono,monospace';ctx.textAlign='right';
ctx.fillText('ML forecast',P.l+pw-4,yS(FAIL_THRESH)+12);
}
// Signal
const limit=Math.min(dayLimit,DAYS-1);
ctx.beginPath();
for(let d=0;d<=limit;d++){
const x=xS(d),y=yS(vibData[d]);
d===0?ctx.moveTo(x,y):ctx.lineTo(x,y);
}
ctx.strokeStyle='#38BEFF';ctx.lineWidth=1.8;ctx.stroke();
// Dot
ctx.beginPath();ctx.arc(xS(limit),yS(vibData[limit]),4,0,Math.PI*2);
ctx.fillStyle='#38BEFF';ctx.fill();
}
function animate(target){
if(animFrame)cancelAnimationFrame(animFrame);
currentDay=0;
const step=()=>{
currentDay=Math.min(currentDay+2,target);
drawFrame(currentDay);
if(currentDay<target)animFrame=requestAnimationFrame(step);
else updateStats();
};
step();
}
function updateStats(){
const el=document.getElementById('stat-saved');
const ins_t=document.getElementById('ins-trigger');
const ins_d=document.getElementById('ins-downtime');
const ins_w=document.getElementById('ins-waste');
const ins_data=document.getElementById('ins-data');
if(currentMode==='reactive'){
el.textContent='0 days';el.style.color='var(--muted)';
ins_t.textContent='Device failure';ins_t.style.color='var(--rose)';
ins_d.textContent='High — unplanned';ins_d.style.color='var(--rose)';
ins_w.textContent='None';ins_w.style.color='var(--muted)';
ins_data.textContent='None required';ins_data.style.color='var(--muted)';
document.getElementById('viz-tag').textContent='Industrial Motor — Reactive';
} else if(currentMode==='preventive'){
el.textContent='0 days (wasted '+(failDay-MAINT_PREV)+'d)';el.style.color='var(--gold)';
ins_t.textContent='Calendar (day '+MAINT_PREV+')';ins_t.style.color='var(--gold)';
ins_d.textContent='Low — scheduled';ins_d.style.color='var(--green)';
ins_w.textContent=(failDay-MAINT_PREV)+' days lost';ins_w.style.color='var(--gold)';
ins_data.textContent='None — time-based';ins_data.style.color='var(--muted)';
document.getElementById('viz-tag').textContent='Industrial Motor — Preventive';
} else {
el.textContent='+'+(failDay-MAINT_PRED)+' days maximized';el.style.color='var(--green)';
ins_t.textContent='ML model (vibration pattern)';ins_t.style.color='var(--green)';
ins_d.textContent='Minimal — data-driven';ins_d.style.color='var(--green)';
ins_w.textContent='~'+(failDay-MAINT_PRED)+' days used fully';ins_w.style.color='var(--green)';
ins_data.textContent='Sensor history required';ins_data.style.color='var(--cyan)';
document.getElementById('viz-tag').textContent='Industrial Motor — Predictive ML';
}
}
const MODES={
reactive:{
target:Math.min(failDay+8,DAYS),
think:'A microwave breaking at home is an inconvenience. A pressure transmitter failing in an oil refinery is a financial catastrophe. Every minute of unplanned downtime in a manufacturing line can cost hundreds of thousands of dollars.',
ref:'Mode 01 — Reactive Maintenance',
title:'Wait and react.',
color:'var(--rose)',
desc:`The motor runs until vibration crosses <em class="o">14.5 mm/s</em> — the failure threshold. You react after the breakdown. Notice the real sensor noise: the signal drifts, spikes, and recovers. This isn't a simulation artifact — this is what degradation actually looks like on the floor.<br><br>Reactive maintenance works fine for a microwave at home. In an industrial plant, it means <em class="o">unplanned downtime, emergency crews, cascading failures,</em> and production losses that compound by the hour.`
},
preventive:{
target:DAYS,
think:'Preventive maintenance is time-based — not usage-based. That\'s the core problem. You could schedule maintenance on a brand-new machine simply because the calendar says so. The machine has zero wear. You\'re paying to maintain something that doesn\'t need it yet.',
ref:'Mode 02 — Preventive Maintenance',
title:'Scheduled. Safe. But costly.',
color:'var(--gold)',
desc:`Maintenance is scheduled at day <em class="o">70</em> — before the motor reaches failure. The downtime problem is solved. But look at the shaded zone: that\'s usable life you gave up. The motor was still healthy at day 70, but the calendar said maintain.<br><br><em class="o">Preventive is time-based. Predictive is usage-based.</em> That single difference explains why predictive maintenance can recover dozens of operational days per equipment cycle — not because it does more maintenance, but because it does it at exactly the right moment.`
},
predictive:{
target:DAYS,
think:'It\'s like you\'re cheating. You know when the device might fail, you wait and play it cool — and then right before it fails, you perform maintenance. You\'ve used the machine to its maximum and avoided the breakdown. That\'s what the data makes possible.',
ref:'Mode 03 — Predictive ML',
title:'The data knew first.',
color:'var(--green)',
desc:`The ML model analyzes historical vibration patterns from similar motors and predicts failure day. At day <em class="g">98</em> it issues an alert — <em class="g">${failDay-MAINT_PRED} days before actual failure.</em> The dashed green line is the model\'s forecast.<br><br>Maximum usable life. Near-zero unplanned downtime. The model doesn\'t guess — it recognizes the degradation pattern it has seen hundreds of times before, in motors just like this one. That\'s the difference between a calendar decision and a data decision.`
}
};
function setTab(mode,btn){
currentMode=mode;
document.querySelectorAll('.tab-btn').forEach(b=>b.classList.remove('active','blue','green'));
btn.classList.add('active');
if(mode==='preventive')btn.classList.add('blue');
if(mode==='predictive')btn.classList.add('green');
// update text panel
const m=MODES[mode];
const colorClass=mode==='reactive'?'':'mode==="preventive"?"blue":"green"';
const tbClass=mode==='reactive'?'':mode==='preventive'?'blue':'green';
document.getElementById('demo-text-panel').innerHTML=`
<div>
<div class="think-box ${tbClass}">
<div class="think-label">Think of it like...</div>
<div class="think-text">${m.think}</div>
</div>
<div class="demo-ref">${m.ref}</div>
<h3 class="demo-title">${m.title}</h3>
<div style="width:32px;height:2px;background:${m.color};margin:1rem 0"></div>
<p class="demo-desc">${m.desc}</p>
</div>
`;
animate(m.target);
}
// Init
window.addEventListener('load',()=>{
setTab('reactive',document.querySelector('.tab-btn'));
});
window.addEventListener('resize',()=>drawFrame(currentDay));
// ════════════════════════════════════════════
// ECOSYSTEM DIAGRAM — animated flow
// ════════════════════════════════════════════
const ECO_INFO = {
'eco-sa': {name:'Sensor A (Vibration)', tag:'Environmental sensing', desc:'Installed on top of the motor. Measures vibration in real time — every millisecond. Normal vibration looks like a steady, low signal. As the motor degrades, the signal drifts upward and becomes irregular. This is the raw input that feeds the entire predictive system.'},
'eco-sb': {name:'Sensor B (Thermal)', tag:'Environmental sensing', desc:'Installed on the bottom of the motor. Measures temperature — a critical indicator of bearing wear, lubrication failure, and electrical faults. Combined with Sensor A, two data points per reading give the model much richer context than a single sensor alone.'},
'eco-sd': {name:'Sensor Data', tag:'Data layer', desc:'The database where all sensor readings are stored continuously. Every reading from every sensor lands here — timestamped, labeled with the equipment ID, and ready for the ML model to consume. Without clean, continuous sensor data, there is no predictive maintenance.'},
'eco-kb': {name:'Knowledge Base', tag:'Support data', desc:'The accumulated intelligence about the equipment: manuals, schematics, historical failure records, spare parts specs, and maintenance procedures. The ML model uses this to understand context — not just what the sensor reads, but what that reading means for this specific machine.'},
'eco-ml': {name:'ML Model', tag:'The brain', desc:'This is where the magic happens — and it\'s simpler than it sounds. The model has learned from thousands of motors that already failed. It recognizes the vibration and temperature patterns that precede a breakdown. When it sees those same patterns in your motor, it predicts: "failure in approximately 8 days." KNN, Random Forest, SVM — all can play this role.'},
'eco-erp': {name:'ERP — Operations', tag:'Enterprise system', desc:'The company\'s production planning system (SAP, Oracle, etc.). The CMMS needs to know: when can we take this machine offline without disrupting the production schedule? The ERP provides the factory floor schedule and master production plan so maintenance can be scheduled in the least disruptive window.'},
'eco-cmms': {name:'CMMS', tag:'Computerized Maintenance Management System', desc:'The brain of maintenance operations. It receives the ML\'s prediction and automatically generates: a work order for the right technician, a parts request to inventory, a notification to the supervisor, and a job plan with step-by-step instructions. Examples: SAP PM, IBM Maximo, eMaint. This is the bridge between prediction and action.'},
'eco-inv': {name:'Inventory & Asset Data', tag:'Support systems', desc:'Real-time visibility of spare parts in stock. When the CMMS creates a work order, it immediately checks: is the required bearing available? If not, it triggers a purchase order automatically. Asset data provides the full history of this specific machine — previous repairs, warranty status, replacement cost — to help prioritize the intervention.'},