Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
2450 lines (2184 loc) · 131 KB
/
Copy pathindex.html
File metadata and controls
2450 lines (2184 loc) · 131 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="es" class="dark scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>Python & Encriptación — Exposición Oficial</title>
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google Fonts: Space Grotesk, Plus Jakarta Sans & JetBrains Mono -->
<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=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap" rel="stylesheet">
<!-- Font Awesome 6.5.1 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['"Plus Jakarta Sans"', 'system-ui', '-apple-system', 'sans-serif'],
display: ['"Space Grotesk"', 'sans-serif'],
mono: ['"JetBrains Mono"', 'monospace'],
},
colors: {
deep: {
950: '#000000',
900: '#030305',
850: '#07070b',
800: '#0e0e14',
700: '#161620',
}
}
}
}
}
</script>
<style>
:root {
color-scheme: dark;
}
html {
scroll-behavior: smooth;
background-color: #000000;
scroll-snap-type: y proximity;
scroll-padding-top: 10px;
}
body {
background-color: #000000;
color: #f1f5f9;
font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
overflow-x: hidden;
position: relative;
}
/* Cada sección ocupa la pantalla completa en el proyector */
.projector-section {
position: relative;
min-height: 100vh;
scroll-snap-align: start;
display: flex;
flex-direction: column;
justify-content: center;
padding-top: 3.5rem;
padding-bottom: 3.5rem;
}
/* Fondo negro OLED con dot-grid sutil para separar tarjetas en proyector */
.bg-deep-canvas {
background-color: #000000;
background-image: radial-gradient(rgba(255, 255, 255, 0.065) 1px, transparent 1px);
background-size: 28px 28px;
}
/* Halos ambientales sutiles por sección (identidad de color sin recargar) */
.section-glow::before {
content: '';
position: absolute;
inset: 8% -4%;
pointer-events: none;
z-index: -1;
border-radius: 9999px;
filter: blur(80px);
opacity: 0.45;
}
.glow-sky::before { background: radial-gradient(circle at 25% 40%, rgba(56, 189, 248, 0.14), transparent 60%); }
.glow-amber::before { background: radial-gradient(circle at 75% 45%, rgba(251, 191, 36, 0.12), transparent 60%); }
.glow-purple::before { background: radial-gradient(circle at 30% 50%, rgba(192, 132, 252, 0.13), transparent 60%); }
.glow-teal::before { background: radial-gradient(circle at 70% 45%, rgba(45, 212, 191, 0.12), transparent 60%); }
.glow-emerald::before { background: radial-gradient(circle at 50% 45%, rgba(16, 185, 129, 0.14), transparent 62%); }
.glow-gold::before { background: radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.10), transparent 60%); }
/* Conectores y animación de flujo en Funcionamiento */
@keyframes flowArrowPulse {
0%, 100% { opacity: 0.35; transform: translateX(0); }
50% { opacity: 0.95; transform: translateX(3px); }
}
.flow-arrow {
animation: flowArrowPulse 2.2s ease-in-out infinite;
}
.flow-step-card {
transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.flow-step-active {
border-color: rgba(52, 211, 153, 0.75) !important;
background: rgba(16, 185, 129, 0.12) !important;
box-shadow: 0 0 26px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
transform: translateY(-4px) scale(1.03) !important;
}
/* =========================================================
SISTEMA DE ANIMACIONES (SCROLL REVEAL & STAGGER)
========================================================== */
[data-motion="fade-up"] {
opacity: 0;
transform: translateY(32px);
transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity, transform;
}
[data-motion="fade-in"] {
opacity: 0;
transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity;
}
[data-motion="slide-left"] {
opacity: 0;
transform: translateX(-36px);
transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity, transform;
}
[data-motion="slide-right"] {
opacity: 0;
transform: translateX(36px);
transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity, transform;
}
[data-motion="scale-up"] {
opacity: 0;
transform: scale(0.94);
transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
will-change: opacity, transform;
}
/* Delays para cascada */
[data-delay="50"] { transition-delay: 0.05s !important; }
[data-delay="100"] { transition-delay: 0.08s !important; }
[data-delay="150"] { transition-delay: 0.12s !important; }
[data-delay="200"] { transition-delay: 0.18s !important; }
[data-delay="250"] { transition-delay: 0.22s !important; }
[data-delay="300"] { transition-delay: 0.28s !important; }
[data-delay="350"] { transition-delay: 0.32s !important; }
[data-delay="400"] { transition-delay: 0.38s !important; }
.in-view {
opacity: 1 !important;
transform: translateY(0) translateX(0) scale(1) !important;
}
/* Flotación suave para insignias */
@keyframes gentleFloat {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-6px); }
}
.motion-float {
animation: gentleFloat 5s ease-in-out infinite;
}
/* Canvas de partículas de fondo */
#cryptoCanvas {
position: fixed;
inset: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
z-index: 1;
}
/* Tarjetas de cristal negro con Spotlight Dinámico (Glow que sigue el cursor) */
.motion-card {
position: relative;
background: rgba(11, 11, 16, 0.90);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border: 1px solid rgba(255, 255, 255, 0.14);
box-shadow:
0 20px 45px -15px rgba(0, 0, 0, 0.98),
inset 0 1px 0 rgba(255, 255, 255, 0.14);
transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.35s ease;
overflow: hidden;
}
.motion-card::before {
content: '';
position: absolute;
inset: 0;
background: radial-gradient(380px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(255, 255, 255, 0.1), transparent 50%);
pointer-events: none;
border-radius: inherit;
z-index: 1;
opacity: 0;
transition: opacity 0.4s ease;
}
.motion-card:hover::before {
opacity: 1;
}
.motion-card:hover {
transform: translateY(-5px) scale(1.008);
border-color: rgba(255, 255, 255, 0.38);
box-shadow:
0 25px 50px -15px rgba(0, 0, 0, 1),
0 0 32px rgba(255, 255, 255, 0.08),
inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* Terminal de código */
.terminal-window {
background: #040407;
border: 1px solid rgba(255, 255, 255, 0.14);
box-shadow:
0 30px 60px -15px rgba(0, 0, 0, 0.98),
inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.py-kw { color: #c084fc; font-weight: 600; }
.py-fn { color: #38bdf8; font-weight: 500; }
.py-str { color: #34d399; }
.py-bytes { color: #fbbf24; }
.py-cm { color: #94a3b8; font-style: italic; }
.py-cls { color: #60a5fa; font-weight: 600; }
.py-num { color: #f87171; }
/* Scrollbars oscuros */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #000000; }
::-webkit-scrollbar-thumb { background: #1c1c24; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #2f2f3d; }
</style>
</head>
<body class="bg-deep-canvas min-h-screen flex flex-col selection:bg-white/25 selection:text-white relative">
<!-- Barra mínima de progreso de scroll (2px, sin texto ni controles) -->
<div id="scrollProgressBar" class="fixed top-0 left-0 h-[2px] w-0 z-50 pointer-events-none bg-gradient-to-r from-sky-400 via-emerald-400 to-amber-300 transition-[width] duration-150 ease-out"></div>
<!-- Canvas de partículas y constelación criptográfica de fondo interactivo -->
<canvas id="cryptoCanvas" aria-hidden="true"></canvas>
<!-- Notificación Toast -->
<div id="toast" class="fixed bottom-6 left-6 z-50 transform translate-y-12 opacity-0 pointer-events-none transition-all duration-300 bg-deep-850 border border-white/25 text-white px-4 py-2.5 rounded-xl shadow-2xl flex items-center gap-2.5 text-sm font-semibold">
<i class="fa-solid fa-check text-emerald-400"></i>
<span id="toastMessage">Acción completada</span>
</div>
<!-- =========================================================
CONTENIDO PRINCIPAL: SECCIÓN POR SECCIÓN (FULL HEIGHT)
========================================================== -->
<main class="relative z-10 flex-1 w-full max-w-6xl mx-auto px-5 sm:px-8 space-y-16">
<!-- =========================================================
00. HERO / PORTADA DE APERTURA PARA PROYECTOR
========================================================== -->
<section id="hero" class="projector-section section-glow glow-emerald text-center items-center">
<!-- Insignia de alta visibilidad -->
<div data-motion="fade-up" class="inline-flex items-center gap-2.5 px-4 py-2 rounded-full bg-white/[0.08] border border-white/20 text-slate-200 font-mono text-xs sm:text-sm mb-6 motion-float">
<span class="w-2.5 h-2.5 rounded-full bg-emerald-400 animate-pulse"></span>
<span class="tracking-wide uppercase font-semibold">Ciberseguridad Aplicada • Python 3.12</span>
</div>
<!-- Título de impacto visible a gran distancia -->
<h1 data-motion="fade-up" data-delay="100" class="font-display text-4xl sm:text-6xl md:text-7xl font-extrabold tracking-tight text-white max-w-4xl leading-[1.08]">
Python & <span class="text-transparent bg-clip-text bg-gradient-to-r from-white via-sky-200 to-emerald-300">Encriptación</span>
</h1>
<p data-motion="fade-up" data-delay="200" class="mt-4 text-base sm:text-xl md:text-2xl text-slate-200 max-w-3xl leading-relaxed font-normal">
Cómo transformar información legible en secuencias ininteligibles, proteger la privacidad y aplicar criptografía moderna con Python.
</p>
<!-- Terminal Interactiva Hero con fuente grande y legible -->
<div data-motion="scale-up" data-delay="300" class="w-full max-w-2xl mt-8 rounded-2xl terminal-window p-5 text-left text-slate-300 relative overflow-hidden">
<div class="flex items-center justify-between mb-3 text-xs sm:text-sm font-mono text-slate-300 border-b border-white/[0.1] pb-3">
<div class="flex items-center gap-2">
<span class="w-3.5 h-3.5 rounded-full bg-rose-500/80"></span>
<span class="w-3.5 h-3.5 rounded-full bg-amber-400/80"></span>
<span class="w-3.5 h-3.5 rounded-full bg-emerald-500/80"></span>
<span class="ml-2 text-white font-medium">terminal_cripto.py</span>
</div>
<button onclick="triggerHeroMorph()" class="px-3 py-1.5 rounded-lg bg-white/[0.1] hover:bg-white/[0.2] text-white transition text-xs font-mono font-semibold flex items-center gap-2 cursor-pointer">
<i class="fa-solid fa-rotate text-xs"></i>
<span>Alternar Cifrado</span>
</button>
</div>
<div class="font-mono text-xs sm:text-sm text-slate-400 mb-2">
<span class="text-emerald-400 font-semibold">py-sec@server</span>:<span class="text-sky-300">~/cryptography</span>$ python demo_cipher.py
</div>
<div id="heroCipherDisplay" class="font-mono font-bold text-xl sm:text-3xl text-amber-300 bg-black/80 px-5 py-4 rounded-xl border border-white/[0.15] min-h-[76px] flex items-center justify-between break-all select-all shadow-inner">
Mi clave del WiFi es 1234
</div>
<div class="flex items-center justify-between mt-3 text-xs sm:text-sm font-mono text-slate-300">
<span id="heroCipherState" class="text-emerald-400 flex items-center gap-2 font-semibold">
<i class="fa-solid fa-lock-open"></i> Texto Plano Original (Legible)
</span>
<span class="text-slate-400 font-mono">Fernet (AES-128-CBC + HMAC)</span>
</div>
</div>
<!-- Botón de inicio para el proyector -->
<div data-motion="fade-up" data-delay="350" class="mt-8 flex flex-wrap items-center justify-center gap-4">
<a href="#conceptos" class="px-7 py-3.5 rounded-xl bg-white text-black font-display font-bold text-base sm:text-lg hover:bg-slate-200 shadow-[0_0_25px_rgba(255,255,255,0.25)] transition flex items-center gap-3">
<span>Comenzar Exposición</span>
<i class="fa-solid fa-arrow-down text-sm"></i>
</a>
<button onclick="toggleFullscreen()" class="px-5 py-3.5 rounded-xl bg-white/[0.08] hover:bg-white/[0.16] border border-white/20 text-white font-display font-semibold text-base transition flex items-center gap-2 cursor-pointer">
<i id="fullscreenIcon" class="fa-solid fa-expand text-sm"></i>
<span>Pantalla Completa (F)</span>
</button>
</div>
</section>
<!-- =========================================================
01. CONCEPTOS
========================================================== -->
<section id="conceptos" class="projector-section section-glow glow-sky">
<div data-motion="fade-up" class="mb-7 text-center sm:text-left">
<span class="text-xs sm:text-sm font-mono uppercase tracking-wider text-sky-300 font-bold inline-flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-sky-400"></span> 01 • Fundamentos
</span>
<h2 class="font-display text-3xl sm:text-4xl md:text-5xl font-extrabold text-white mt-1">
Conceptos de <span class="text-transparent bg-clip-text bg-gradient-to-r from-sky-300 to-cyan-200">Criptografía</span>
</h2>
<p class="text-slate-200 text-sm sm:text-base md:text-lg mt-1 max-w-3xl">
Los 4 elementos esenciales del proceso criptográfico y las 3 grandes familias matemáticas.
</p>
</div>
<!-- 4 Términos Básicos -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
<div data-motion="fade-up" data-delay="100" class="motion-card p-4 sm:p-5 rounded-2xl">
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-mono px-2 py-0.5 rounded bg-white/[0.1] text-sky-300 font-bold border border-white/10">01. Entrada</span>
<i class="fa-solid fa-file-lines text-sky-400 text-lg"></i>
</div>
<h3 class="font-display font-bold text-white text-lg">Texto Plano</h3>
<p class="text-slate-200 text-sm mt-1.5 leading-relaxed">Información original legible por humanos antes del procesamiento criptográfico.</p>
</div>
<div data-motion="fade-up" data-delay="150" class="motion-card p-4 sm:p-5 rounded-2xl">
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-mono px-2 py-0.5 rounded bg-white/[0.1] text-purple-300 font-bold border border-white/10">02. Regla</span>
<i class="fa-solid fa-calculator text-purple-400 text-lg"></i>
</div>
<h3 class="font-display font-bold text-white text-lg">Algoritmo (Cifrador)</h3>
<p class="text-slate-200 text-sm mt-1.5 leading-relaxed">Fórmula matemática pública. Su seguridad nunca debe depender de mantenerlo oculto.</p>
</div>
<div data-motion="fade-up" data-delay="200" class="motion-card p-4 sm:p-5 rounded-2xl">
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-mono px-2 py-0.5 rounded bg-white/[0.1] text-amber-300 font-bold border border-white/10">03. Secreto</span>
<i class="fa-solid fa-key text-amber-400 text-lg"></i>
</div>
<h3 class="font-display font-bold text-white text-lg">Clave Criptográfica</h3>
<p class="text-slate-200 text-sm mt-1.5 leading-relaxed">El parámetro secreto que controla la transformación. Sin ella, el mensaje es ilegible.</p>
</div>
<div data-motion="fade-up" data-delay="250" class="motion-card p-4 sm:p-5 rounded-2xl">
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-mono px-2 py-0.5 rounded bg-white/[0.1] text-emerald-300 font-bold border border-white/10">04. Salida</span>
<i class="fa-solid fa-lock text-emerald-400 text-lg"></i>
</div>
<h3 class="font-display font-bold text-white text-lg">Texto Cifrado</h3>
<p class="text-slate-200 text-sm mt-1.5 leading-relaxed">Secuencia binaria que parece puramente aleatoria y protege los datos.</p>
</div>
</div>
<!-- Las 3 Familias Criptográficas -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-5">
<!-- Simétrico -->
<div data-motion="slide-left" data-delay="150" class="motion-card rounded-2xl p-5 sm:p-6 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-sky-400 text-lg">
<i class="fa-solid fa-key"></i>
</div>
<span class="text-xs font-mono px-2.5 py-1 rounded-full bg-white/[0.08] text-sky-300 font-bold border border-white/15">1 Sola Clave</span>
</div>
<h3 class="font-display text-xl sm:text-2xl font-bold text-white">Cifrado Simétrico</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
La <strong>misma clave</strong> cifra y descifra. Es ultra rápido, óptimo para bases de datos, discos y tráfico HTTPS.
</p>
<div class="mt-4 p-3.5 rounded-xl bg-black/70 border border-white/[0.1] font-mono text-xs sm:text-sm">
<div class="flex items-center justify-between text-slate-200">
<span>Texto Plano</span>
<span class="text-sky-300 font-bold"><i class="fa-solid fa-lock"></i> Clave K</span>
<span class="text-emerald-400 font-bold">Cifrado</span>
</div>
<div class="my-2 border-t border-dashed border-white/15"></div>
<div class="flex items-center justify-between text-slate-200">
<span class="text-emerald-400 font-bold">Cifrado</span>
<span class="text-sky-300 font-bold"><i class="fa-solid fa-lock-open"></i> Clave K</span>
<span>Texto Plano</span>
</div>
</div>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] flex items-center justify-between text-xs sm:text-sm">
<span class="text-slate-300">Ejemplo: <strong class="text-white font-mono">AES-256, Fernet</strong></span>
<span class="text-emerald-400 font-bold"><i class="fa-solid fa-bolt mr-1"></i>Ultra Rápido</span>
</div>
</div>
<!-- Asimétrico -->
<div data-motion="fade-up" data-delay="200" class="motion-card rounded-2xl p-5 sm:p-6 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-amber-300 text-lg">
<i class="fa-solid fa-lock-open"></i>
</div>
<span class="text-xs font-mono px-2.5 py-1 rounded-full bg-white/[0.08] text-amber-300 font-bold border border-white/15">Par de Claves</span>
</div>
<h3 class="font-display text-xl sm:text-2xl font-bold text-white">Cifrado Asimétrico</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Usa una clave <strong>Pública</strong> (para que cualquiera cifre) y una clave <strong>Privada</strong> (secreta para descifrar y firmar).
</p>
<div class="mt-4 p-3.5 rounded-xl bg-black/70 border border-white/[0.1] font-mono text-xs sm:text-sm">
<div class="flex items-center justify-between text-slate-200">
<span>Mensaje</span>
<span class="text-amber-300 font-bold"><i class="fa-solid fa-globe"></i> Pública</span>
<span class="text-emerald-400 font-bold">Token</span>
</div>
<div class="my-2 border-t border-dashed border-white/15"></div>
<div class="flex items-center justify-between text-slate-200">
<span class="text-emerald-400 font-bold">Token</span>
<span class="text-rose-400 font-bold"><i class="fa-solid fa-user-secret"></i> Privada</span>
<span>Mensaje</span>
</div>
</div>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] flex items-center justify-between text-xs sm:text-sm">
<span class="text-slate-300">Ejemplo: <strong class="text-white font-mono">RSA, ECC (Ed25519)</strong></span>
<span class="text-amber-300 font-bold"><i class="fa-solid fa-handshake mr-1"></i>Firmas</span>
</div>
</div>
<!-- Hashing -->
<div data-motion="slide-right" data-delay="250" class="motion-card rounded-2xl p-5 sm:p-6 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-emerald-400 text-lg">
<i class="fa-solid fa-fingerprint"></i>
</div>
<span class="text-xs font-mono px-2.5 py-1 rounded-full bg-white/[0.08] text-emerald-300 font-bold border border-white/15">Irreversible</span>
</div>
<h3 class="font-display text-xl sm:text-2xl font-bold text-white">Funciones Hash</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Genera una <strong>huella digital fija</strong> sin clave de descifrado. Sirve para verificar integridad y almacenar contraseñas.
</p>
<div class="mt-4 p-3.5 rounded-xl bg-black/70 border border-white/[0.1] font-mono text-xs sm:text-sm">
<div class="flex items-center justify-between text-slate-200">
<span>"Texto"</span>
<span class="text-emerald-400 font-bold"><i class="fa-solid fa-arrow-right"></i> SHA-256</span>
<span class="text-sky-300 font-bold">8c6976...</span>
</div>
<div class="my-2 border-t border-dashed border-white/15"></div>
<div class="flex items-center justify-between text-slate-300 text-xs sm:text-sm">
<span class="text-rose-400 font-bold"><i class="fa-solid fa-ban"></i> Sin retorno</span>
<span class="text-emerald-300 font-bold">Integridad Pura</span>
</div>
</div>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] flex items-center justify-between text-xs sm:text-sm">
<span class="text-slate-300">Ejemplo: <strong class="text-white font-mono">SHA-256, Argon2id</strong></span>
<span class="text-emerald-400 font-bold"><i class="fa-solid fa-check-double mr-1"></i>Integridad</span>
</div>
</div>
</div>
<!-- Diferencia fundamental -->
<div data-motion="fade-up" data-delay="300" class="mt-5 motion-card rounded-2xl p-4 flex flex-col sm:flex-row items-center justify-between gap-3 text-sm sm:text-base text-slate-200">
<div class="flex items-center gap-3">
<i class="fa-solid fa-circle-info text-white text-lg"></i>
<span><strong>Diferencia clave:</strong> <code class="text-amber-300 font-mono">Base64</code> es una <em>codificación</em> (0% seguridad). La <em>encriptación</em> requiere una clave matemática secreta.</span>
</div>
<div class="font-mono text-xs sm:text-sm text-white px-3 py-1 rounded-lg bg-white/[0.1] border border-white/20 whitespace-nowrap font-bold">
Base64 ≠ Cifrado ≠ Hash
</div>
</div>
</section>
<!-- =========================================================
02. FUNCIONAMIENTO (PEPEM)
========================================================== -->
<section id="funcionamiento" class="projector-section section-glow glow-amber">
<div data-motion="fade-up" class="mb-7 text-center sm:text-left">
<span class="text-xs sm:text-sm font-mono uppercase tracking-wider text-amber-300 font-bold inline-flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-amber-400"></span> 02 • Mecanismo Interno
</span>
<h2 class="font-display text-3xl sm:text-4xl md:text-5xl font-extrabold text-white mt-1">
Funcionamiento de la <span class="text-transparent bg-clip-text bg-gradient-to-r from-amber-300 to-emerald-300">Encriptación</span>
</h2>
<p class="text-slate-200 text-sm sm:text-base md:text-lg mt-1 max-w-3xl">
El proceso secuencial paso a paso explicado de forma clara y directa para cualquier audiencia.
</p>
</div>
<!-- Explicación Conceptual Destacada -->
<div data-motion="fade-up" data-delay="100" class="motion-card p-6 sm:p-8 rounded-2xl mb-6 border-white/20">
<div class="flex items-start gap-4">
<div class="w-11 h-11 rounded-xl bg-white/10 text-amber-300 flex items-center justify-center text-xl flex-shrink-0 border border-white/20 mt-1">
<i class="fa-solid fa-lightbulb"></i>
</div>
<div>
<h3 class="font-display font-bold text-white text-xl sm:text-2xl mb-2">¿Cómo Opera en Python?</h3>
<p class="text-slate-100 text-base sm:text-lg md:text-xl leading-relaxed">
En Python, el proceso funciona tomando el <strong>mensaje original</strong> y pasándolo a través de una <strong>librería de seguridad</strong> junto con una <strong>clave secreta</strong>, lo que transforma el texto normal en un <strong>resultado revuelto e ilegible</strong>.
</p>
<p class="text-slate-300 text-sm sm:text-base md:text-lg mt-3 leading-relaxed">
Esa librería se encarga de hacer todo el trabajo matemático por dentro para que no tengas que inventar nada complicado. Después, cuando alguien con permiso quiere leer el mensaje, vuelve a usar la misma clave para hacer el camino inverso y recuperar el texto original tal como estaba al principio.
</p>
</div>
</div>
</div>
<!-- Diagrama de Flujo Visual e Interactivo con Conectores -->
<div data-motion="fade-up" data-delay="150" class="flex flex-col lg:flex-row items-stretch lg:items-center gap-2.5 lg:gap-2 mb-6">
<div id="pepemStep1" class="flow-step-card motion-card flex-1 p-4 rounded-xl text-center">
<div class="w-8 h-8 rounded-full bg-sky-500/20 text-sky-300 mx-auto mb-2 text-xs flex items-center justify-center font-mono font-bold border border-sky-500/30">1</div>
<div class="font-bold text-sm sm:text-base text-white">Mensaje Original</div>
<div class="text-xs sm:text-sm font-mono text-sky-300 mt-1">"WiFi: 1234"</div>
</div>
<div class="hidden lg:flex items-center justify-center text-slate-400 px-0.5 flow-arrow">
<i class="fa-solid fa-arrow-right text-sm"></i>
</div>
<div id="pepemStep2" class="flow-step-card motion-card flex-1 p-4 rounded-xl text-center">
<div class="w-8 h-8 rounded-full bg-amber-500/20 text-amber-300 mx-auto mb-2 text-xs flex items-center justify-center font-mono font-bold border border-amber-500/30">2</div>
<div class="font-bold text-sm sm:text-base text-white">Clave Secreta</div>
<div class="text-xs sm:text-sm font-mono text-amber-300 mt-1">Fernet.generate()</div>
</div>
<div class="hidden lg:flex items-center justify-center text-slate-400 px-0.5 flow-arrow" style="animation-delay: 0.3s">
<i class="fa-solid fa-arrow-right text-sm"></i>
</div>
<div id="pepemStep3" class="flow-step-card motion-card flex-1 p-4 rounded-xl text-center border-white/30">
<div class="w-8 h-8 rounded-full bg-white text-black mx-auto mb-2 text-xs flex items-center justify-center font-mono font-bold">3</div>
<div class="font-bold text-sm sm:text-base text-white">Caja Fernet</div>
<div class="text-xs sm:text-sm font-mono text-slate-200 mt-1">caja.encrypt()</div>
</div>
<div class="hidden lg:flex items-center justify-center text-slate-400 px-0.5 flow-arrow" style="animation-delay: 0.6s">
<i class="fa-solid fa-arrow-right text-sm"></i>
</div>
<div id="pepemStep4" class="flow-step-card motion-card flex-1 p-4 rounded-xl text-center">
<div class="w-8 h-8 rounded-full bg-rose-500/20 text-rose-300 mx-auto mb-2 text-xs flex items-center justify-center font-mono font-bold border border-rose-500/30">4</div>
<div class="font-bold text-sm sm:text-base text-white">Texto Ilegible</div>
<div class="text-xs sm:text-sm font-mono text-rose-300 mt-1">gAAAAABm9xQ...</div>
</div>
<div class="hidden lg:flex items-center justify-center text-slate-400 px-0.5 flow-arrow" style="animation-delay: 0.9s">
<i class="fa-solid fa-arrow-right text-sm"></i>
</div>
<div id="pepemStep5" class="flow-step-card motion-card flex-1 p-4 rounded-xl text-center">
<div class="w-8 h-8 rounded-full bg-emerald-500/20 text-emerald-300 mx-auto mb-2 text-xs flex items-center justify-center font-mono font-bold border border-emerald-500/30">5</div>
<div class="font-bold text-sm sm:text-base text-white">Recuperación</div>
<div class="text-xs sm:text-sm font-mono text-emerald-300 mt-1">caja.decrypt()</div>
</div>
</div>
<!-- Consola Interactiva con el Código Exacto -->
<div data-motion="scale-up" data-delay="200" class="terminal-window rounded-2xl flex flex-col overflow-hidden">
<div class="px-5 py-3.5 bg-black border-b border-white/[0.1] flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-2">
<span class="w-3.5 h-3.5 rounded-full bg-rose-500/80"></span>
<span class="w-3.5 h-3.5 rounded-full bg-amber-400/80"></span>
<span class="w-3.5 h-3.5 rounded-full bg-emerald-500/80"></span>
<span class="ml-2 font-mono text-xs sm:text-sm text-white font-bold">ejemplo_pepem_wifi.py</span>
</div>
<div class="flex items-center gap-2">
<button onclick="runPepemDemoLive()" class="px-4 py-1.5 rounded-lg bg-emerald-500 hover:bg-emerald-400 text-black font-display font-bold text-xs sm:text-sm transition flex items-center gap-2 cursor-pointer shadow-[0_0_15px_rgba(16,185,129,0.3)]">
<i class="fa-solid fa-play text-xs"></i>
<span>Ejecutar Código en Vivo</span>
</button>
<button onclick="copyToClipboard(pepemCodeText, 'Código copiado')" class="px-3 py-1.5 rounded-lg bg-white/[0.1] hover:bg-white/[0.2] text-white font-mono text-xs transition cursor-pointer">
<i class="fa-regular fa-copy"></i>
</button>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 divide-y lg:divide-y-0 lg:divide-x divide-white/[0.1]">
<!-- Código Python Original -->
<pre class="p-5 sm:p-6 text-xs sm:text-sm md:text-base font-mono leading-relaxed overflow-x-auto text-slate-100"><code><span class="py-kw">from</span> cryptography.fernet <span class="py-kw">import</span> <span class="py-cls">Fernet</span>
<span class="py-cm"># 1. Generar la llave secreta</span>
llave = <span class="py-cls">Fernet</span>.<span class="py-fn">generate_key</span>()
caja = <span class="py-cls">Fernet</span>(llave)
<span class="py-cm"># 2. Cifrar el texto original (en bytes)</span>
secreto_oculto = caja.<span class="py-fn">encrypt</span>(<span class="py-bytes">b"Mi clave del WiFi es 1234"</span>)
<span class="py-fn">print</span>(<span class="py-str">"Asi se ve encriptado:"</span>, secreto_oculto)
<span class="py-cm"># 3. Descifrar y recuperar el original</span>
secreto_abierto = caja.<span class="py-fn">decrypt</span>(secreto_oculto)
<span class="py-fn">print</span>(<span class="py-str">"Asi vuelve a verse:"</span>, secreto_abierto.<span class="py-fn">decode</span>())</code></pre>
<!-- Consola de Salida en Vivo -->
<div class="p-5 sm:p-6 bg-black/90 font-mono text-xs sm:text-sm flex flex-col justify-between">
<div>
<div class="text-slate-400 mb-3 flex items-center justify-between pb-2 border-b border-white/[0.08]">
<span>Salida de Consola (Python 3.12)</span>
<span id="pepemExecBadge" class="text-emerald-400 font-bold flex items-center gap-1.5">
<span class="w-2 h-2 rounded-full bg-emerald-400"></span> Listo para ejecutar
</span>
</div>
<div id="pepemConsoleOutput" class="space-y-3">
<div class="text-slate-300">
<span class="text-sky-300">$</span> python ejemplo_pepem_wifi.py
</div>
<div class="text-slate-400 text-xs italic">
Presiona el botón verde "Ejecutar Código en Vivo" para ver la transformación criptográfica en tiempo real.
</div>
</div>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.08] text-xs text-slate-400">
<span class="text-white font-bold">Nota técnica:</span> Fernet genera un vector IV aleatorio en cada ejecución, por lo que el texto encriptado cambia siempre aunque el mensaje sea idéntico.
</div>
</div>
</div>
</div>
</section>
<!-- =========================================================
03. CARACTERÍSTICAS
========================================================== -->
<section id="caracteristicas" class="projector-section section-glow glow-purple">
<div data-motion="fade-up" class="mb-7 text-center sm:text-left">
<span class="text-xs sm:text-sm font-mono uppercase tracking-wider text-purple-300 font-bold inline-flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-purple-400"></span> 03 • Capacidades de Python
</span>
<h2 class="font-display text-3xl sm:text-4xl md:text-5xl font-extrabold text-white mt-1">
Características de la Encriptación en <span class="text-transparent bg-clip-text bg-gradient-to-r from-purple-300 to-sky-300">Python</span>
</h2>
<p class="text-slate-200 text-sm sm:text-base md:text-lg mt-1 max-w-3xl">
Los 7 pilares esenciales que definen la seguridad criptográfica en el ecosistema de Python.
</p>
</div>
<!-- Bento Grid Asimétrico (12 columnas) -->
<div class="grid grid-cols-1 md:grid-cols-6 lg:grid-cols-12 gap-4 sm:gap-5">
<!-- 1. Confidencialidad (destacado 5 cols) -->
<div data-motion="fade-up" data-delay="50" class="md:col-span-3 lg:col-span-5 motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-sky-500/15 border border-sky-500/30 flex items-center justify-center text-sky-400 text-lg">
<i class="fa-solid fa-user-lock"></i>
</div>
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-sky-500/10 text-sky-300 font-bold border border-sky-500/20">01. Acceso</span>
</div>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">1. Confidencialidad</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Protege la información para que solo personas autorizadas puedan acceder a ella.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-sky-300 font-semibold">
Principio: Privacidad Absoluta
</div>
</div>
<!-- 2. Algoritmos de cifrado (4 cols) -->
<div data-motion="fade-up" data-delay="100" class="md:col-span-3 lg:col-span-4 motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-purple-500/15 border border-purple-500/30 flex items-center justify-center text-purple-400 text-lg">
<i class="fa-solid fa-calculator"></i>
</div>
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-purple-500/10 text-purple-300 font-bold border border-purple-500/20">02. Motores</span>
</div>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">2. Algoritmos de Cifrado</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Utiliza métodos como AES y RSA para convertir datos en códigos ilegibles.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-purple-300 font-semibold">
Estándares: AES-256, RSA-2048
</div>
</div>
<!-- 3. Claves de seguridad (3 cols) -->
<div data-motion="fade-up" data-delay="150" class="md:col-span-3 lg:col-span-3 motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-amber-500/15 border border-amber-500/30 flex items-center justify-center text-amber-400 text-lg">
<i class="fa-solid fa-key"></i>
</div>
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-amber-500/10 text-amber-300 font-bold border border-amber-500/20">03. Control</span>
</div>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">3. Claves de Seguridad</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Utiliza claves para cifrar y descifrar mensajes de forma segura.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-amber-300 font-semibold">
Entropía: os.urandom
</div>
</div>
<!-- 4. Protección de datos (4 cols) -->
<div data-motion="fade-up" data-delay="200" class="md:col-span-3 lg:col-span-4 motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-emerald-500/15 border border-emerald-500/30 flex items-center justify-center text-emerald-400 text-lg">
<i class="fa-solid fa-shield-halved"></i>
</div>
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-emerald-500/10 text-emerald-300 font-bold border border-emerald-500/20">04. Cobertura</span>
</div>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">4. Protección de Datos</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Permite proteger contraseñas, archivos y mensajes privados.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-emerald-300 font-semibold">
Alcance: Reposo y Tránsito
</div>
</div>
<!-- 5. Cifrado y descifrado (4 cols) -->
<div data-motion="fade-up" data-delay="250" class="md:col-span-3 lg:col-span-4 motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-teal-500/15 border border-teal-500/30 flex items-center justify-center text-teal-400 text-lg">
<i class="fa-solid fa-arrows-rotate"></i>
</div>
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-teal-500/10 text-teal-300 font-bold border border-teal-500/20">05. Ciclo</span>
</div>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">5. Cifrado y Descifrado</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Transforma información legible en códigos y permite recuperar el mensaje original.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-teal-300 font-semibold">
Operación: Bidireccional reversible
</div>
</div>
<!-- 6. Integridad (4 cols) -->
<div data-motion="fade-up" data-delay="300" class="md:col-span-3 lg:col-span-4 motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-rose-500/15 border border-rose-500/30 flex items-center justify-center text-rose-400 text-lg">
<i class="fa-solid fa-check-double"></i>
</div>
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-rose-500/10 text-rose-300 font-bold border border-rose-500/20">06. Control</span>
</div>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">6. Integridad</h3>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Permite detectar modificaciones no autorizadas en la información mediante mecanismos criptográficos.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-rose-300 font-semibold">
Mecanismo: HMAC, Firmas, Hashes
</div>
</div>
<!-- 7. Librerías de Python (Bento Banner 12 cols con botón copiar) -->
<div data-motion="fade-up" data-delay="350" class="md:col-span-6 lg:col-span-12 motion-card p-5 sm:p-6 rounded-2xl flex flex-col md:flex-row items-start md:items-center justify-between gap-4 border-amber-400/25">
<div class="flex items-center gap-4">
<div class="w-12 h-12 rounded-xl bg-amber-400/15 border border-amber-400/30 flex items-center justify-center text-amber-300 text-2xl flex-shrink-0">
<i class="fa-brands fa-python"></i>
</div>
<div>
<div class="flex items-center gap-2.5 flex-wrap">
<span class="text-xs sm:text-sm font-mono px-2.5 py-0.5 rounded-full bg-amber-400/15 text-amber-300 font-bold border border-amber-400/25">07. Ecosistema</span>
<h3 class="font-display font-bold text-white text-lg sm:text-xl">7. Librerías de Python</h3>
</div>
<p class="text-slate-200 text-sm sm:text-base mt-1 leading-relaxed">
Utiliza herramientas como <span class="px-2 py-0.5 rounded bg-white/10 text-white font-mono text-sm font-semibold">Cryptography</span> y <span class="px-2 py-0.5 rounded bg-white/10 text-white font-mono text-sm font-semibold">PyCryptodome</span> para facilitar el cifrado.
</p>
</div>
</div>
<button type="button" onclick="copyToClipboard('pip install cryptography pycryptodome', 'Comando pip copiado')"
class="px-4 py-2.5 rounded-xl bg-black hover:bg-white/10 border border-white/20 text-emerald-400 font-mono text-xs sm:text-sm font-bold transition flex items-center gap-2.5 cursor-pointer whitespace-nowrap"
title="Copiar comando de instalación">
<span>pip install cryptography pycryptodome</span>
<i class="fa-regular fa-copy text-slate-300"></i>
</button>
</div>
</div>
</section>
<!-- =========================================================
04. APLICACIONES
========================================================== -->
<section id="aplicaciones" class="projector-section section-glow glow-teal">
<div data-motion="fade-up" class="mb-7 text-center sm:text-left">
<span class="text-xs sm:text-sm font-mono uppercase tracking-wider text-teal-300 font-bold inline-flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-teal-400"></span> 04 • Mundo Real
</span>
<h2 class="font-display text-3xl sm:text-4xl md:text-5xl font-extrabold text-white mt-1">
Aplicaciones en la <span class="text-transparent bg-clip-text bg-gradient-to-r from-teal-300 to-sky-300">Industria</span>
</h2>
<p class="text-slate-200 text-sm sm:text-base md:text-lg mt-1 max-w-3xl">
Cómo se implementa la criptografía en sistemas de producción reales con Python.
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
<div data-motion="fade-up" data-delay="100" class="motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-emerald-400 text-lg">
<i class="fa-solid fa-key"></i>
</div>
<span class="text-xs font-mono px-2.5 py-0.5 rounded-full bg-white/[0.08] text-emerald-300 font-bold">Argon2 / bcrypt</span>
</div>
<h4 class="font-display font-bold text-white text-lg sm:text-xl">Contraseñas en Backend</h4>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Django y FastAPI usan funciones de derivación lentas con sal individual por usuario para neutralizar ataques de fuerza bruta con GPU.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-slate-300">
Librería: <span class="text-emerald-300 font-bold">passlib / argon2-cffi</span>
</div>
</div>
<div data-motion="fade-up" data-delay="150" class="motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-sky-400 text-lg">
<i class="fa-solid fa-globe"></i>
</div>
<span class="text-xs font-mono px-2.5 py-0.5 rounded-full bg-white/[0.08] text-sky-300 font-bold">HTTPS / TLS 1.3</span>
</div>
<h4 class="font-display font-bold text-white text-lg sm:text-xl">Canales Seguros & APIs</h4>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Cifrado híbrido en microservicios: Handshake asimétrico (ECDH) para acordar una clave simétrica AES-GCM ultrarrápida.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-slate-300">
Librería: <span class="text-sky-300 font-bold">ssl / httpx / certifi</span>
</div>
</div>
<div data-motion="fade-up" data-delay="200" class="motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-amber-300 text-lg">
<i class="fa-solid fa-database"></i>
</div>
<span class="text-xs font-mono px-2.5 py-0.5 rounded-full bg-white/[0.08] text-amber-300 font-bold">Fernet / AES</span>
</div>
<h4 class="font-display font-bold text-white text-lg sm:text-xl">Backups en Cloud S3</h4>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Cifrado del lado del cliente antes de enviar copias de seguridad a AWS S3 o GCP. Cumplimiento normativo HIPAA y GDPR.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-slate-300">
Librería: <span class="text-amber-300 font-bold">cryptography + boto3</span>
</div>
</div>
<div data-motion="fade-up" data-delay="250" class="motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-purple-300 text-lg">
<i class="fa-solid fa-signature"></i>
</div>
<span class="text-xs font-mono px-2.5 py-0.5 rounded-full bg-white/[0.08] text-purple-300 font-bold">JWT / HMAC</span>
</div>
<h4 class="font-display font-bold text-white text-lg sm:text-xl">Tokens y Firmas Digitales</h4>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Autenticación stateless para microservicios. Las firmas criptográficas impiden que un cliente altere sus roles o permisos.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-slate-300">
Librería: <span class="text-purple-300 font-bold">PyJWT / authlib</span>
</div>
</div>
<div data-motion="fade-up" data-delay="300" class="motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-teal-300 text-lg">
<i class="fa-solid fa-comments"></i>
</div>
<span class="text-xs font-mono px-2.5 py-0.5 rounded-full bg-white/[0.08] text-teal-300 font-bold">End-to-End</span>
</div>
<h4 class="font-display font-bold text-white text-lg sm:text-xl">Mensajería Cifrada E2EE</h4>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Protocolos tipo Signal (Double Ratchet): ni los servidores intermediarios poseen la clave para inspeccionar el chat.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-slate-300">
Librería: <span class="text-teal-300 font-bold">PyNaCl / Curve25519</span>
</div>
</div>
<div data-motion="fade-up" data-delay="350" class="motion-card p-5 sm:p-6 rounded-2xl flex flex-col justify-between">
<div>
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-white/[0.1] border border-white/20 flex items-center justify-center text-rose-300 text-lg">
<i class="fa-solid fa-code-branch"></i>
</div>
<span class="text-xs font-mono px-2.5 py-0.5 rounded-full bg-white/[0.08] text-rose-300 font-bold">Merkle Trees</span>
</div>
<h4 class="font-display font-bold text-white text-lg sm:text-xl">Control de Versiones (Git)</h4>
<p class="text-slate-200 text-sm sm:text-base mt-2 leading-relaxed">
Cada commit de Git se identifica por el hash de su contenido. Modificar un solo carácter del pasado rompe toda la cadena.
</p>
</div>
<div class="mt-4 pt-3 border-t border-white/[0.1] text-xs sm:text-sm font-mono text-slate-300">
Librería: <span class="text-rose-300 font-bold">hashlib / sha256</span>
</div>
</div>
</div>
</section>
<!-- =========================================================
05. DEMO: LABORATORIO EN VIVO — ARGON2ID + AES-GCM (DEMO1.PY)
========================================================== -->
<section id="demo" class="projector-section section-glow glow-emerald">
<!-- ── ENCABEZADO + BARRA DE MÓDULOS ALINEADA ── -->
<div data-motion="fade-up" class="flex flex-col lg:flex-row lg:items-end justify-between gap-4 mb-6">
<div class="text-center lg:text-left">
<span class="text-xs sm:text-sm font-mono uppercase tracking-wider text-emerald-300 font-bold inline-flex items-center gap-2">
<span class="w-2 h-2 rounded-full bg-emerald-400 animate-pulse"></span> 05 • DEMO en Vivo
</span>
<h2 class="font-display text-3xl sm:text-4xl md:text-5xl font-extrabold text-white mt-1">
DEMO: <span class="text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 via-teal-300 to-sky-400">Argon2id + AES-GCM</span>
</h2>
<p class="text-slate-300 text-sm sm:text-base mt-1 max-w-2xl">
Ejecución interactiva de <code class="text-amber-300 font-mono font-semibold">DEMO1.PY</code>, código fuente completo y laboratorios de apoyo.
</p>
</div>
<!-- Selector de Módulo (Compacto y Uniforme) -->
<div class="flex justify-center lg:justify-end">
<div class="bg-white/[0.04] border border-white/15 p-1 rounded-xl inline-flex items-center gap-1 flex-wrap">
<button id="demoBtnOfficial" onclick="switchDemoModule('official')" class="px-3.5 py-2 rounded-lg text-xs sm:text-sm font-bold bg-white text-black transition cursor-pointer flex items-center gap-1.5">
<i class="fa-solid fa-terminal"></i><span>Simulador</span>
</button>
<button id="demoBtnCode" onclick="switchDemoModule('code')" class="px-3.5 py-2 rounded-lg text-xs sm:text-sm font-semibold text-slate-300 hover:text-white hover:bg-white/10 transition cursor-pointer flex items-center gap-1.5">
<i class="fa-brands fa-python text-amber-400"></i><span>Código DEMO1.PY</span>
</button>
<button id="demoBtnHash" onclick="switchDemoModule('hash')" class="px-3.5 py-2 rounded-lg text-xs sm:text-sm font-semibold text-slate-300 hover:text-white hover:bg-white/10 transition cursor-pointer flex items-center gap-1.5">
<i class="fa-solid fa-fingerprint text-sky-400"></i><span>SHA-256</span>
</button>
<button id="demoBtnCaesar" onclick="switchDemoModule('caesar')" class="px-3.5 py-2 rounded-lg text-xs sm:text-sm font-semibold text-slate-300 hover:text-white hover:bg-white/10 transition cursor-pointer flex items-center gap-1.5">
<i class="fa-solid fa-clock-rotate-left text-purple-400"></i><span>César</span>
</button>
</div>
</div>
</div>
<!-- ══════════════════════════════════════════════════════════════
MÓDULO 1: SIMULADOR OFICIAL DEMO1.PY
══════════════════════════════════════════════════════════════ -->
<div id="labModuleOfficial" class="grid grid-cols-1 lg:grid-cols-12 gap-6 items-stretch">
<!-- ── Panel Izquierdo: Control Compacto por Pestañas (Cifrar / Descifrar) ── -->
<div data-motion="slide-left" data-delay="100" class="lg:col-span-5 motion-card rounded-2xl p-5 sm:p-6 flex flex-col justify-between gap-5">
<!-- Cabecera del Panel + Selector Cifrar/Descifrar -->
<div class="space-y-4">
<div class="flex items-center justify-between gap-2">
<span class="text-xs font-mono uppercase tracking-wider text-slate-300 font-bold flex items-center gap-2">
<i class="fa-solid fa-sliders text-amber-300"></i> Consola DEMO1.PY
</span>
<span id="demo1SessionCountBadge" class="text-xs font-mono px-2.5 py-1 rounded-lg bg-emerald-500/10 text-emerald-300 border border-emerald-500/25 font-bold">
0 tokens en memoria
</span>
</div>
<!-- Sub-pestañas: 1. Cifrar vs 2. Descifrar -->
<div class="grid grid-cols-2 gap-1.5 p-1 rounded-xl bg-black/80 border border-white/15">
<button id="demo1TabEncrypt" type="button" onclick="switchDemo1ActionTab('encrypt')"