-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1026 lines (969 loc) · 87.9 KB
/
index.html
File metadata and controls
1026 lines (969 loc) · 87.9 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>
<!--
Copyright © Ripon Chandra Malo
Version: V2.0.0
Licensed under the MIT License.
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Academic Portfolio — Acadpro V2.0.0</title>
<meta name="author" content="Ripon Chandra Malo">
<meta name="version" content="V2.0.0">
<meta name="copyright" content="© Ripon Chandra Malo. Licensed under the MIT License.">
<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=Playfair+Display:wght@400;600;700&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap" rel="stylesheet">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect width='24' height='24' rx='6' fill='%231a1a2e'/%3E%3Ctext x='50%25' y='58%25' font-size='11' text-anchor='middle' fill='%23e0c097' font-family='Georgia,serif' font-weight='bold'%3EAR%3C/text%3E%3C/svg%3E">
<style>
:root{--bg:#faf9f7;--surface:#f0eeea;--text:#1a1a2e;--muted:#6b6b7b;--accent:#2d5a7b;--accent-warm:#c8956c;--accent-sage:#5a7a6a;--card:#fff;--card-border:rgba(0,0,0,0.06);--glass:rgba(250,249,247,0.88);--radius:14px;--shadow:0 2px 20px rgba(26,26,46,0.06);--shadow-hover:0 14px 44px rgba(26,26,46,0.11);--container:1080px;--serif:'Playfair Display',Georgia,serif;--sans:'Source Sans 3',system-ui,sans-serif;--transition:0.3s cubic-bezier(0.4,0,0.2,1)}
[data-theme="dark"]{--bg:#0d0d18;--surface:#14142a;--text:#e8e6e1;--muted:#9a99a8;--accent:#7badc8;--accent-warm:#d4a574;--accent-sage:#7dab95;--card:#1a1a2e;--card-border:rgba(255,255,255,0.07);--glass:rgba(13,13,24,0.9);--shadow:0 2px 20px rgba(0,0,0,0.35);--shadow-hover:0 14px 44px rgba(0,0,0,0.45)}
[data-theme="blue"]{--bg:#ffffff;--surface:#ffffff;--text:#333333;--muted:#657b91;--accent:#0078d4;--accent-warm:#0078d4;--accent-sage:#0078d4;--card:#ffffff;--card-border:rgba(0,120,212,0.15);--glass:rgba(255,255,255,0.95);--shadow:0 0px 0px transparent;--shadow-hover:0 6px 16px rgba(0,120,212,0.12);--serif:var(--sans)}
[data-theme="blue"] h1, [data-theme="blue"] h2, [data-theme="blue"] h3, [data-theme="blue"] h4 { color: var(--accent); }
[data-theme="blue"] nav a:hover { background: rgba(0,120,212,0.08); color: var(--accent); }
[data-theme="blue"] .btn-primary { background: var(--accent); color: #fff; }
[data-theme="blue"] .btn-outline { color: var(--accent); border-color: var(--accent); }
[data-theme="blue"] .otw-banner { background: var(--accent); color: #ffffff; }
[data-theme="blue"] .otw-banner h3, [data-theme="blue"] .otw-banner p, [data-theme="blue"] .otw-banner .otw-cta { color: #ffffff; }
[data-theme="blue"] .skill-tag { border-color: rgba(0,120,212,0.3); color: var(--accent); }
[data-theme="blue"] .header { border-bottom: 1px solid rgba(0,120,212,0.15); }
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--sans);color:var(--text);background:var(--bg);line-height:1.6;-webkit-font-smoothing:antialiased;font-size:15px}
body::before{content:'';position:fixed;inset:0;pointer-events:none;z-index:9999;opacity:0.02;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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:128px}
a{color:inherit}img{display:block;max-width:100%}
.wrap{max-width:var(--container);margin:0 auto;padding:0 1.5rem}
.header{position:sticky;top:0;z-index:60;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);background:var(--glass);border-bottom:1px solid var(--card-border)}
.header-inner{display:flex;align-items:center;gap:1rem;padding:0.75rem 0}
.brand{display:flex;align-items:center;gap:0.7rem;text-decoration:none;color:inherit}
.logo{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;background:var(--accent);color:#fff;font-family:var(--sans);font-weight:700;font-size:16px;letter-spacing:-0.5px;flex-shrink:0}
.brand-text .name{font-family:var(--serif);font-size:1.05rem}
.brand-text .tagline{font-size:0.76rem;color:var(--muted);font-weight:500}
nav{margin-left:auto;display:flex;gap:0.1rem;align-items:center;flex-wrap:wrap}
nav a{color:var(--muted);text-decoration:none;padding:0.4rem 0.55rem;border-radius:8px;font-size:0.84rem;font-weight:600;transition:all var(--transition)}
nav a:hover{color:var(--text);background:var(--surface)}
.theme-btn{background:var(--surface);border:1px solid var(--card-border);width:36px;height:36px;border-radius:10px;cursor:pointer;display:grid;place-items:center;transition:all var(--transition);margin-left:0.2rem;color:var(--muted)}
.theme-btn:hover{border-color:var(--accent);color:var(--accent)}
.theme-btn svg{width:18px;height:18px}
.hero{display:grid;grid-template-columns:1fr;gap:2rem;align-items:center;padding:3rem 0 2rem}
@media(min-width:860px){.hero{grid-template-columns:1fr 400px}}
.hero-text .kicker{font-size:0.76rem;text-transform:uppercase;letter-spacing:0.14em;color:var(--accent-warm);font-weight:700;margin-bottom:0.5rem}
.hero-text h1{font-family:var(--serif);font-size:clamp(2rem,4vw,2.7rem);line-height:1.15;margin-bottom:1rem}
.hero-text .lead{color:var(--muted);max-width:52ch;margin-bottom:1.3rem;font-size:0.95rem}
.hero-text .lead strong{color:var(--text);font-weight:600}
.hero-actions{display:flex;gap:0.6rem;flex-wrap:wrap;align-items:center}
.hero-role{margin-top:0.8rem;font-size:0.82rem;color:var(--muted);display:flex;align-items:center;gap:0.4rem}
.hero-role svg{width:14px;height:14px;opacity:0.5}
.btn-primary{display:inline-flex;align-items:center;gap:0.4rem;padding:0.6rem 1.2rem;border-radius:10px;background:var(--text);color:var(--bg);text-decoration:none;font-weight:600;font-size:0.88rem;transition:all var(--transition);border:none;cursor:pointer;font-family:var(--sans)}
.btn-primary:hover{opacity:0.85;transform:translateY(-1px)}
.btn-outline{display:inline-flex;align-items:center;gap:0.4rem;padding:0.6rem 1.2rem;border-radius:10px;background:transparent;border:1.5px solid var(--card-border);color:var(--text);text-decoration:none;font-weight:600;font-size:0.88rem;transition:all var(--transition)}
.btn-outline:hover{border-color:var(--accent);color:var(--accent)}
.featured-card{background:var(--card);border:1px solid var(--card-border);border-radius:16px;padding:0.7rem;box-shadow:var(--shadow)}
.photo-carousel{position:relative;overflow:hidden;border-radius:12px;height:320px;background:var(--surface)}
.photo-track{display:flex;height:100%;transition:transform 700ms cubic-bezier(0.22,0.9,0.3,1)}
.photo-slide{min-width:100%;height:100%;position:relative;overflow:hidden}
.photo-slide img{width:100%;height:100%;object-fit:cover;transition:transform 8s ease}
.photo-slide.active img{transform:scale(1.06)}
.photo-slide::after{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at center,transparent 50%,rgba(0,0,0,0.12) 100%);pointer-events:none}
.photo-dots{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;gap:6px;z-index:5}
.photo-dot{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,0.45);border:none;cursor:pointer;transition:all var(--transition);padding:0}
.photo-dot.active{background:#fff;width:22px;border-radius:4px}
.carousel-nav{display:flex;justify-content:flex-end;gap:0.3rem;padding:0.5rem 0.1rem 0}
.car-btn{width:32px;height:32px;border-radius:8px;border:1px solid var(--card-border);background:var(--bg);color:var(--muted);cursor:pointer;display:grid;place-items:center;transition:all var(--transition)}
.car-btn:hover{border-color:var(--accent);color:var(--accent)}
.car-btn svg{width:14px;height:14px}
.otw-banner{position:relative;margin:2rem 0;padding:1.8rem 2rem;border-radius:18px;overflow:hidden;background:linear-gradient(135deg,var(--accent) 0%,#1e63b7 42%,#2c7cc8 72%,#3a83cf 100%);color:#fff;box-shadow:0 22px 45px rgba(32,97,173,0.18)}
.otw-banner::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 18% 50%,rgba(255,255,255,0.08) 0%,transparent 38%),radial-gradient(circle at 86% 18%,rgba(255,255,255,0.08) 0%,transparent 22%),linear-gradient(120deg,rgba(255,255,255,0.03) 0%,transparent 44%,rgba(255,255,255,0.04) 66%,transparent 100%);pointer-events:none}
.otw-banner::after{content:'';position:absolute;top:-60px;right:-40px;width:220px;height:220px;border-radius:50%;background:rgba(255,255,255,0.04);pointer-events:none}
.otw-inner{position:relative;z-index:2;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1.4rem;align-items:center}
.otw-banner .otw-orbit{position:absolute;right:120px;top:50%;width:180px;height:180px;transform:translateY(-50%);pointer-events:none;opacity:0.4}
.otw-banner .otw-orbit::before{content:'';position:absolute;inset:18px;border-radius:50%;border:1px solid rgba(255,255,255,0.12)}
.otw-banner .otw-orbit::after{content:'';position:absolute;left:50%;top:50%;width:12px;height:12px;margin:-6px;border-radius:50%;background:rgba(255,255,255,0.82);box-shadow:0 0 0 6px rgba(255,255,255,0.08);animation:otw-orbit 8s linear infinite}
@keyframes otw-orbit{0%{transform:rotate(0deg) translateX(72px) rotate(0deg)}100%{transform:rotate(360deg) translateX(72px) rotate(-360deg)}}
.otw-content{min-width:240px;max-width:760px}
.otw-pulse{width:54px;height:54px;border-radius:50%;background:rgba(255,255,255,0.12);display:grid;place-items:center;flex-shrink:0;position:relative}
.otw-pulse::before{content:'';position:absolute;inset:-6px;border-radius:50%;border:2px solid rgba(255,255,255,0.15);animation:otw-ring 2.5s ease-out infinite}
@keyframes otw-ring{0%{transform:scale(0.9);opacity:1}100%{transform:scale(1.5);opacity:0}}
.otw-pulse svg{width:26px;height:26px;color:#fff}
.otw-content h3{font-family:var(--serif);font-size:1.3rem;margin-bottom:0.4rem}
.otw-content p{opacity:0.85;font-size:0.92rem;line-height:1.6;max-width:60ch}
.otw-actions{display:flex;align-items:center;justify-content:flex-end;min-width:170px}
.otw-cta{display:inline-flex;align-items:center;gap:0.4rem;margin-top:0.7rem;padding:0.7rem 1.2rem;border-radius:12px;background:rgba(255,255,255,0.16);backdrop-filter:blur(6px);color:#fff;font-weight:700;font-size:0.9rem;text-decoration:none;border:1px solid rgba(255,255,255,0.24);transition:all var(--transition);box-shadow:0 12px 24px rgba(15,23,42,0.12)}
.otw-actions .otw-cta{margin-top:0}
.otw-cta:hover{background:rgba(255,255,255,0.25);transform:translateY(-2px)}
.otw-cta svg{width:15px;height:15px}
.section{padding:2.5rem 0 0}
.section-header{margin-bottom:1.5rem}
.section-header h2{font-family:var(--serif);font-size:1.6rem;margin-bottom:0.3rem}
.section-header p{color:var(--muted);font-size:0.9rem}
.grid{display:grid;gap:1rem}
@media(min-width:700px){.g2{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:repeat(3,1fr)}.g4{grid-template-columns:repeat(4,1fr)}}
.expertise-cloud{display:flex;flex-wrap:wrap;gap:0.5rem;justify-content:center;padding:1rem 0}
.skill-tag{padding:0.45rem 1rem;border-radius:50px;font-size:0.84rem;font-weight:600;border:1.5px solid var(--card-border);background:var(--card);color:var(--muted);transition:all 0.4s cubic-bezier(0.34,1.56,0.64,1);cursor:default;position:relative;box-shadow:var(--shadow);opacity:0;transform:translateY(10px) scale(0.95)}
.skill-tag.vis{opacity:1;transform:translateY(0) scale(1)}
.skill-tag:hover{transform:translateY(-4px) scale(1.05);border-color:var(--accent);color:var(--accent);box-shadow:var(--shadow-hover)}
.skill-tag[data-level="expert"]{border-color:var(--accent);color:var(--accent);font-size:1rem;padding:0.55rem 1.3rem}
.skill-tag[data-level="advanced"]{font-size:0.92rem;padding:0.5rem 1.1rem}
.skill-tag::after{content:attr(data-level);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%) scale(0.8);padding:0.2rem 0.5rem;border-radius:6px;background:var(--text);color:var(--bg);font-size:0.7rem;white-space:nowrap;opacity:0;pointer-events:none;transition:all var(--transition)}
.skill-tag:hover::after{opacity:1;transform:translateX(-50%) scale(1)}
.tabs-container{background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.tabs-header{display:flex;border-bottom:1px solid var(--card-border);background:var(--surface)}
.tab-btn{flex:1;padding:0.85rem 1rem;border:none;background:transparent;font-family:var(--sans);font-size:0.9rem;font-weight:600;color:var(--muted);cursor:pointer;position:relative;transition:color var(--transition)}
.tab-btn.active{color:var(--text)}
.tab-btn::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2.5px;background:var(--accent);transform:scaleX(0);transition:transform var(--transition)}
.tab-btn.active::after{transform:scaleX(1)}
.tab-btn:hover{color:var(--text)}
.tab-panel{display:none;padding:1.2rem 1.4rem}
.tab-panel.active{display:block}
.timeline-item{display:flex;gap:1rem;padding:1.1rem 0;border-bottom:1px solid var(--card-border)}
.timeline-item:last-child{border-bottom:none}
.tl-logo{width:48px;height:48px;border-radius:12px;background:var(--surface);display:grid;place-items:center;flex-shrink:0;overflow:hidden;border:1px solid var(--card-border)}
.tl-logo img{width:100%;height:100%;object-fit:contain;padding:4px}
.tl-logo svg{width:24px;height:24px;color:var(--accent)}
.tl-content{flex:1}
.tl-content h4{font-size:0.95rem;font-weight:600;margin-bottom:0.1rem}
.tl-content .tl-org{font-size:0.85rem;color:var(--accent);font-weight:600}
.tl-content .tl-desc{font-size:0.84rem;color:var(--muted);margin-top:0.25rem}
.tl-year{font-size:0.78rem;font-weight:700;color:var(--muted);white-space:nowrap;padding-top:0.1rem}
.card{background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:0.5rem;transition:all var(--transition)}
.card:hover{box-shadow:var(--shadow-hover);transform:translateY(-3px)}
.card-top{display:flex;justify-content:space-between;align-items:flex-start}
.card-top h3{font-family:var(--serif);font-size:1.05rem;line-height:1.25}
.card-top .sub{font-size:0.82rem;color:var(--muted);margin-top:0.15rem}
.tag{font-size:0.72rem;font-weight:700;padding:0.2rem 0.55rem;border-radius:6px;background:var(--surface);color:var(--accent);white-space:nowrap;flex-shrink:0}
.card-media{border-radius:10px;overflow:hidden;height:130px;background:var(--surface)}
.card-media svg,.card-media img{width:100%;height:100%;display:block;object-fit:cover}
.card-desc{font-size:0.88rem;color:var(--muted);flex:1}
.card-actions{display:flex;gap:0.4rem;margin-top:auto;align-items:center;flex-wrap:wrap}
.action-btn{display:inline-flex;align-items:center;gap:0.35rem;padding:0.4rem 0.65rem;border-radius:8px;border:1px solid var(--card-border);background:transparent;color:var(--muted);font-size:0.8rem;font-weight:600;text-decoration:none;cursor:pointer;transition:all var(--transition);font-family:var(--sans)}
.action-btn:hover{border-color:var(--accent);color:var(--accent)}
.action-btn svg{width:15px;height:15px}
.share-wrap{position:relative;display:inline-flex}
.share-dropdown{position:absolute;bottom:calc(100% + 8px);right:0;min-width:180px;background:var(--card);border:1px solid var(--card-border);border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,0.15);padding:0.4rem;opacity:0;pointer-events:none;transform:translateY(6px);transition:all 0.25s ease;z-index:50}
.share-wrap.open .share-dropdown{opacity:1;pointer-events:auto;transform:translateY(0)}
.share-option{display:flex;align-items:center;gap:0.6rem;padding:0.55rem 0.7rem;border-radius:8px;border:none;background:transparent;color:var(--text);font-size:0.84rem;font-weight:500;cursor:pointer;width:100%;text-align:left;transition:background var(--transition);text-decoration:none;font-family:var(--sans)}
.share-option:hover{background:var(--surface)}
.share-option svg{width:16px;height:16px;flex-shrink:0}
.share-option.copy-done{color:var(--accent-sage)}
.compact-card{background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);padding:1rem 1.1rem;box-shadow:var(--shadow);display:flex;gap:0.8rem;align-items:flex-start;transition:all var(--transition);text-decoration:none;color:inherit}
a.compact-card:hover{box-shadow:var(--shadow-hover);transform:translateY(-3px);border-color:var(--accent)}
a.compact-card:hover .ext-arrow{opacity:1;transform:translateX(0)}
.compact-icon{width:40px;height:40px;border-radius:10px;background:var(--surface);display:grid;place-items:center;flex-shrink:0;color:var(--accent-warm)}
.compact-icon svg{width:20px;height:20px}
.compact-body{flex:1}
.compact-card h3{font-size:0.93rem;font-weight:600}
.compact-card .sub{font-size:0.82rem;color:var(--muted)}
.ext-arrow{color:var(--accent);opacity:0;transform:translateX(-4px);transition:all var(--transition);flex-shrink:0;margin-top:0.2rem}
.ext-arrow svg{width:16px;height:16px}
.video-card{background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:all var(--transition);cursor:pointer}
.video-card:hover{box-shadow:var(--shadow-hover);transform:translateY(-3px)}
.video-thumb{height:140px;background:var(--surface);display:grid;place-items:center;position:relative}
.video-thumb svg.bg-art{position:absolute;inset:0;width:100%;height:100%}
.play-circle{width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,0.92);display:grid;place-items:center;position:relative;z-index:2;box-shadow:0 4px 16px rgba(0,0,0,0.15);transition:transform var(--transition)}
.video-card:hover .play-circle{transform:scale(1.08)}
.play-circle svg{width:18px;height:18px;color:var(--text);margin-left:2px}
.video-info{padding:0.8rem 1rem}
.video-info h4{font-size:0.9rem;font-weight:600;margin-bottom:0.15rem}
.video-info p{font-size:0.8rem;color:var(--muted)}
.contact-grid{display:grid;gap:1rem}
@media(min-width:860px){.contact-grid{grid-template-columns:1fr 340px}}
.map-wrap{border-radius:var(--radius);overflow:hidden;border:1px solid var(--card-border);min-height:260px;box-shadow:var(--shadow)}
.map-wrap iframe{width:100%;height:100%;min-height:260px;border:0;display:block}
.contact-stack{display:grid;gap:1rem;max-width:760px;margin:0 auto}
.contact-banner{background:transparent;border:none;border-radius:0;padding:0;box-shadow:none}
.contact-banner.centered{text-align:center}
.contact-banner h3{font-family:var(--serif);font-size:1.3rem;margin-bottom:1.2rem;color:var(--accent)}
.contact-banner p{color:var(--muted);line-height:1.7}
.contact-top-list{list-style:none;display:grid;gap:0.95rem;justify-items:center}
.contact-top-item{display:flex;align-items:center;gap:0.8rem;justify-content:center;text-align:left;max-width:420px;width:100%}
.contact-top-item .ci-icon{width:42px;height:42px}
.contact-top-item .contact-value{font-size:0.98rem}
.contact-detail-actions{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(220px,0.65fr);gap:1.2rem;align-items:stretch;max-width:860px;margin:0 auto;padding:1.15rem 1.25rem;border:1px solid var(--card-border);border-radius:16px;background:var(--surface)}
.contact-detail-actions .contact-top-list{justify-items:start}
.contact-detail-actions .contact-top-item{justify-content:flex-start;max-width:none}
.contact-action-column{display:flex;flex-direction:column;gap:0.8rem;align-items:stretch;justify-content:center;border-left:1px solid var(--card-border);padding-left:1.2rem}
.contact-action-column .btn-primary,
.contact-action-column .btn-outline{min-width:120px;justify-content:center}
.contact-divider{height:1px;background:var(--card-border);margin:1.1rem 0}
.contact-lead{max-width:620px;margin:0 auto 1.2rem}
.contact-info{background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);padding:1.4rem;box-shadow:var(--shadow)}
.contact-info h3{font-family:var(--serif);font-size:1.15rem;margin-bottom:1rem}
.contact-list{list-style:none;display:flex;flex-direction:column;gap:0.7rem}
.contact-item{display:flex;align-items:center;gap:0.7rem;font-size:0.9rem}
.ci-icon{width:36px;height:36px;border-radius:9px;background:var(--surface);display:grid;place-items:center;flex-shrink:0;color:var(--accent)}
.ci-icon svg{width:16px;height:16px}
.contact-item a{color:var(--accent);text-decoration:none}
.contact-item a:hover{text-decoration:underline}
.ci-label{font-size:0.73rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:0.06em}
.contact-actions{display:flex;gap:0.6rem;flex-wrap:wrap;margin-top:1.1rem}
.contact-profiles{margin-top:1.2rem;padding-top:1rem;border-top:1px solid var(--card-border);text-align:center}
.contact-profiles .ci-label{display:block;margin-bottom:0.7rem}
.contact-profiles .socials{justify-content:center;margin-top:0;padding-top:0;border-top:none}
.contact-profiles-buttons{display:flex;justify-content:center;gap:0.8rem;flex-wrap:wrap}
.contact-profiles-buttons .action-btn{padding:0.7rem 1rem;border-radius:12px;font-size:0.88rem}
.contact-section-divider{height:1px;background:var(--card-border);max-width:640px;margin:1.35rem auto 1rem}
.opps-pills{display:flex;gap:0.45rem;flex-wrap:wrap;margin-top:0.9rem}
.opps-pill{display:inline-flex;align-items:center;padding:0.38rem 0.8rem;border-radius:999px;background:rgba(255,255,255,0.14);border:1px solid rgba(255,255,255,0.18);font-size:0.8rem;font-weight:600}
.research-intro{font-size:0.92rem;color:var(--muted);line-height:1.7}
.research-highlight-group+.research-highlight-group{margin-top:1.1rem;padding-top:1.1rem;border-top:1px solid var(--card-border)}
.research-highlight-group h4{font-size:1rem;font-family:var(--serif);margin-bottom:0.35rem}
.research-highlight-group p{font-size:0.85rem;color:var(--muted);margin-bottom:0.55rem}
.research-highlight-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.75rem}
.research-highlight-card{padding:0.9rem 1rem;border-radius:14px;background:var(--surface);border:1px solid var(--card-border);box-shadow:0 8px 24px rgba(15,23,42,0.04);min-height:100%}
.research-highlight-card.simple{display:flex;align-items:flex-start}
.research-highlight-card.simple span{font-size:0.9rem;line-height:1.55;color:var(--text)}
.research-skill-card{display:flex;gap:0.85rem;align-items:flex-start}
.research-skill-icon{width:42px;height:42px;border-radius:12px;background:var(--card);border:1px solid var(--card-border);display:grid;place-items:center;color:var(--accent);flex-shrink:0}
.research-skill-icon svg{width:20px;height:20px}
.research-skill-content{flex:1;min-width:0}
.research-skill-head{display:flex;justify-content:space-between;gap:0.75rem;align-items:flex-start}
.research-skill-head strong{font-size:0.92rem;line-height:1.35}
.research-skill-level{display:inline-flex;align-items:center;padding:0.25rem 0.55rem;border-radius:999px;font-size:0.72rem;font-weight:700;white-space:nowrap;border:1px solid var(--card-border);background:var(--card);color:var(--muted);text-transform:capitalize}
.research-skill-level[data-level="expert"]{border-color:rgba(15,118,110,0.2);background:rgba(15,118,110,0.08);color:#0f766e}
.research-skill-level[data-level="advanced"]{border-color:rgba(37,99,235,0.2);background:rgba(37,99,235,0.08);color:#2563eb}
.research-skill-level[data-level="intermediate"]{border-color:rgba(180,83,9,0.2);background:rgba(180,83,9,0.08);color:#b45309}
.research-skill-level[data-level="learning"]{border-color:rgba(124,58,237,0.2);background:rgba(124,58,237,0.08);color:#7c3aed}
.research-skill-note{font-size:0.82rem;color:var(--muted);margin-top:0.35rem;line-height:1.55}
.socials{display:flex;gap:0.4rem;margin-top:1.2rem;padding-top:1rem;border-top:1px solid var(--card-border)}
.social-btn{width:38px;height:38px;border-radius:10px;border:1px solid var(--card-border);background:transparent;display:grid;place-items:center;color:var(--muted);text-decoration:none;transition:all var(--transition)}
.social-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--surface)}
.social-btn svg{width:17px;height:17px}
.footer{padding:2rem 0;text-align:center;color:var(--muted);font-size:0.82rem;border-top:1px solid var(--card-border);margin-top:3rem}
.reveal{opacity:0;transform:translateY(16px);transition:opacity 0.6s ease,transform 0.6s ease}
.reveal.vis{opacity:1;transform:none}
.reveal:nth-child(2){transition-delay:0.07s}.reveal:nth-child(3){transition-delay:0.14s}.reveal:nth-child(4){transition-delay:0.21s}.reveal:nth-child(5){transition-delay:0.28s}.reveal:nth-child(6){transition-delay:0.35s}
.modal-overlay{position:fixed;inset:0;z-index:200;display:none;align-items:center;justify-content:center;padding:1rem}
.modal-overlay.open{display:flex}
.modal-bg{position:absolute;inset:0;background:rgba(0,0,0,0.55);backdrop-filter:blur(4px)}
.modal-box{position:relative;max-width:860px;width:100%;background:var(--card);border-radius:14px;overflow:hidden;box-shadow:0 24px 80px rgba(0,0,0,0.3)}
.modal-body{padding:0}
.modal-close{position:absolute;top:0.6rem;right:0.6rem;z-index:10;width:34px;height:34px;border-radius:8px;border:none;background:rgba(255,255,255,0.9);cursor:pointer;display:grid;place-items:center}
.modal-close svg{width:16px;height:16px}
.award-modal{padding:1.4rem}
.award-modal-hero{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:1.2rem;align-items:start}
.award-modal h3{font-family:var(--serif);font-size:1.5rem;margin-bottom:0.35rem}
.award-modal-sub{color:var(--accent);font-weight:700;margin-bottom:0.8rem}
.award-modal-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.75rem;margin:1rem 0}
.award-modal-meta-item{padding:0.85rem 0.95rem;border:1px solid var(--card-border);border-radius:12px;background:var(--surface)}
.award-modal-meta-item .ci-label{display:block;margin-bottom:0.25rem}
.award-modal-desc{color:var(--muted);line-height:1.7}
.award-modal-media{border:1px solid var(--card-border);border-radius:14px;overflow:hidden;background:var(--surface);min-height:180px}
.award-modal-media img{width:100%;height:100%;object-fit:cover;display:block}
.award-modal-actions{display:flex;gap:0.6rem;flex-wrap:wrap;margin-top:1.1rem}
.project-open{background:none;border:none;padding:0;text-align:left;color:inherit;cursor:pointer}
.project-open h3{transition:color var(--transition)}
.project-open:hover h3{color:var(--accent)}
.project-modal{padding:1.25rem}
.project-modal-head{display:grid;grid-template-columns:120px minmax(0,1fr);gap:1rem;align-items:start}
.project-modal-thumb{border:1px solid var(--card-border);border-radius:14px;overflow:hidden;background:var(--surface);height:120px}
.project-modal-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.project-modal-kicker{font-size:0.76rem;text-transform:uppercase;letter-spacing:0.08em;color:var(--accent);font-weight:700;margin-bottom:0.35rem}
.project-modal h3{font-family:var(--serif);font-size:1.35rem;line-height:1.2;margin-bottom:0.25rem}
.project-modal-sub{color:var(--muted);margin-bottom:0.55rem}
.project-modal-summary{color:var(--muted);line-height:1.65;font-size:0.92rem}
.project-modal-meta{display:flex;gap:0.5rem;flex-wrap:wrap;margin-top:0.75rem}
.project-modal-meta-item{padding:0.4rem 0.7rem;background:var(--surface);border:1px solid var(--card-border);border-radius:999px;font-size:0.8rem}
.project-tabs{margin-top:1rem;border:1px solid var(--card-border);border-radius:16px;overflow:hidden;background:var(--card)}
.project-tabs-header{display:flex;background:var(--surface);border-bottom:1px solid var(--card-border)}
.project-tab-btn{flex:1;padding:0.8rem 0.9rem;border:none;background:transparent;font-family:var(--sans);font-size:0.86rem;font-weight:700;color:var(--muted);cursor:pointer;position:relative}
.project-tab-btn.active{color:var(--text)}
.project-tab-btn::after{content:'';position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--accent);transform:scaleX(0);transition:transform var(--transition)}
.project-tab-btn.active::after{transform:scaleX(1)}
.project-tab-panel{display:none;padding:1rem 1.05rem}
.project-tab-panel.active{display:block}
.project-tab-panel p{color:var(--muted);line-height:1.7}
.project-modal-list{list-style:none;display:grid;gap:0.55rem}
.project-modal-list li{padding:0.7rem 0.8rem;border-radius:10px;background:var(--card);border:1px solid var(--card-border)}
.project-results-grid{display:grid;gap:0.75rem}
.project-modal-figures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.85rem}
.project-figure{border:1px solid var(--card-border);border-radius:14px;overflow:hidden;background:var(--card)}
.project-figure img{width:100%;height:180px;object-fit:cover;display:block}
.project-figure figcaption{padding:0.75rem 0.85rem;font-size:0.84rem;color:var(--muted)}
.project-media-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.9rem}
.project-media-card{position:relative;border:1px solid var(--card-border);border-radius:16px;overflow:hidden;background:var(--surface);cursor:pointer;text-align:left;padding:0}
.project-media-card img{width:100%;height:190px;object-fit:cover;display:block}
.project-media-card.video .project-media-thumb{position:relative;height:190px;background:#111}
.project-media-card.video .project-media-thumb img{height:100%}
.project-media-thumb::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,0.05),rgba(0,0,0,0.28))}
.project-media-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:58px;height:58px;border-radius:50%;background:rgba(255,255,255,0.92);display:grid;place-items:center;z-index:2;box-shadow:0 10px 26px rgba(0,0,0,0.18)}
.project-media-play svg{width:24px;height:24px;color:var(--accent);margin-left:2px}
.project-media-badge{position:absolute;left:12px;top:12px;z-index:2;padding:0.35rem 0.6rem;border-radius:999px;background:rgba(255,255,255,0.92);font-size:0.74rem;font-weight:700;color:var(--text)}
.project-media-caption{padding:0.8rem 0.9rem;color:var(--muted);font-size:0.86rem;line-height:1.55}
.project-screenshots-wrap{margin-top:0.95rem}
.project-lightbox-image{width:100%;display:block;max-height:78vh;object-fit:contain;background:#111}
.project-lightbox-caption{padding:1rem 1.1rem;color:var(--muted);font-size:0.9rem}
.project-gallery-title{font-family:var(--serif);font-size:1rem;margin-bottom:0.7rem}
@media(max-width:760px){.award-modal-hero,.project-modal-head{grid-template-columns:1fr}.award-modal-meta,.project-modal-figures,.project-media-grid{grid-template-columns:1fr}.project-tabs-header{flex-direction:column}}
@media(max-width:760px){.award-modal-hero{grid-template-columns:1fr}.award-modal-meta{grid-template-columns:1fr}}
@media(max-width:760px){.research-highlight-grid{grid-template-columns:1fr}.research-skill-head{flex-direction:column;align-items:flex-start}}
@media(max-width:699px){nav a{font-size:0.78rem;padding:0.35rem 0.4rem}.photo-carousel{height:260px}.video-thumb{height:110px}.hero{padding:2rem 0}.otw-banner{padding:1.35rem 1.2rem}.otw-inner{grid-template-columns:1fr;gap:1rem}.otw-actions{justify-content:flex-start}.otw-content p{text-wrap:balance}.otw-banner .otw-orbit{right:-10px;top:auto;bottom:-32px;transform:none;width:120px;height:120px;opacity:0.28}}
@media print{.header,.theme-btn,.action-btn,.car-btn,.modal-overlay,.otw-banner{display:none!important}body{background:#fff}.card,.compact-card{box-shadow:none;border:1px solid #ddd}}
.pub-alt-note{font-size:0.82rem;color:var(--muted);font-style:italic;margin-bottom:1rem}
.pub-filter-bar{display:flex;gap:0.4rem;flex-wrap:wrap;margin-bottom:1.2rem;align-items:center}
.pub-filter-btn{padding:0.45rem 1.1rem;border-radius:50px;border:1.5px solid var(--card-border);background:var(--card);color:var(--muted);font-size:0.84rem;font-weight:600;cursor:pointer;transition:all var(--transition);font-family:var(--sans)}
.pub-filter-btn:hover{border-color:var(--accent);color:var(--accent)}
.pub-filter-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.pub-sort-label{margin-left:auto;font-size:0.78rem;color:var(--muted);font-weight:600;display:flex;align-items:center;gap:0.3rem}
.pub-sort-label svg{width:14px;height:14px}
.pub-list{display:flex;flex-direction:column;gap:0.6rem}
.pub-row{display:flex;gap:1rem;padding:1.1rem;background:var(--card);border:1px solid var(--card-border);border-radius:var(--radius);box-shadow:var(--shadow);transition:all var(--transition);align-items:flex-start}
.pub-row:hover{box-shadow:var(--shadow-hover);transform:translateY(-2px)}
.pub-row-num{font-family:var(--serif);font-size:1.1rem;font-weight:700;color:var(--accent);min-width:22px;padding-top:0.15rem;opacity:0.5}
.pub-row-thumb{width:90px;height:90px;border-radius:10px;overflow:hidden;background:var(--surface);flex-shrink:0;border:1px solid var(--card-border)}
.pub-row-thumb img,.pub-row-thumb svg{width:100%;height:100%;object-fit:cover;display:block}
.pub-row-body{flex:1;min-width:0}
.pub-row-head{display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem;margin-bottom:0.25rem}
.pub-row-title{font-family:var(--serif);font-size:1rem;font-weight:600;line-height:1.3}
.pub-row-year{font-size:0.72rem;font-weight:700;padding:0.18rem 0.5rem;border-radius:6px;background:var(--surface);color:var(--accent);white-space:nowrap;flex-shrink:0}
.pub-row-authors{font-size:0.84rem;color:var(--muted);margin-bottom:0.15rem}
.pub-row-authors strong{color:var(--accent);font-weight:600}
.pub-row-venue{font-size:0.82rem;color:var(--accent-warm);font-weight:500;font-style:italic;margin-bottom:0.25rem}
.pub-row-desc{font-size:0.84rem;color:var(--muted);line-height:1.5;margin-bottom:0.5rem}
.pub-row-actions{display:flex;gap:0.35rem;flex-wrap:wrap;align-items:center}
.demo-switcher{position:fixed;right:18px;top:50%;transform:translateY(-50%);z-index:140;background:var(--card);border:1px solid var(--card-border);border-radius:16px;box-shadow:var(--shadow-hover);padding:0.8rem;display:flex;flex-direction:column;gap:0.55rem;min-width:180px}
.demo-switcher .demo-label{font-size:0.72rem;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:0.08em}
.demo-switcher .demo-current{font-family:var(--serif);font-size:1rem;color:var(--accent)}
.demo-switcher .action-btn{justify-content:center}
@media(max-width:699px){.pub-row{flex-direction:column}.pub-row-thumb{width:100%;height:140px}.pub-row-head{flex-wrap:wrap}}
@media(max-width:860px){.demo-switcher{right:12px;top:auto;bottom:14px;transform:none;min-width:160px}}
@media(max-width:760px){.contact-detail-actions{grid-template-columns:1fr;padding:1rem}.contact-detail-actions .contact-top-list{justify-items:center}.contact-detail-actions .contact-top-item{justify-content:center}.contact-action-column{align-items:center;border-left:none;border-top:1px solid var(--card-border);padding-left:0;padding-top:1rem}}
</style>
</head>
<body data-theme="light">
<header class="header"><div class="wrap header-inner">
<a class="brand" href="#top" id="brandLink"><div class="logo" id="brandInitials"></div><div class="brand-text"><div class="name" id="brandName"></div><div class="tagline" id="brandTagline"></div></div></a>
<nav><a href="#research">Research</a><a href="#publications">Publications</a><a href="#projects">Projects</a><a href="#teaching">Teaching</a><a href="#experience">Experience</a><a href="#contact">Contact</a>
<button class="theme-btn" id="themeToggle" aria-label="Toggle theme"><svg id="themeIcon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg></button></nav>
</div></header>
<main class="wrap" id="top">
<!-- All sections rendered by JS -->
<div id="heroSection"></div>
<div id="hiringSection"></div>
<section class="section" id="research" style="padding-top: 2rem;">
<div id="researchContent"></div>
</section>
<section class="section" id="publications"><div class="section-header"><h2>Publications</h2><p>Selected publications with BibTeX, PDF download, and sharing.</p></div><div id="pubContent"></div></section>
<section class="section" id="projects"><div class="section-header"><h2>Projects</h2><p>Selected projects with demos, source code, and documentation.</p></div><div class="grid g3" id="projectsGrid"></div></section>
<section class="section" id="teaching"><div class="section-header"><h2>Teaching — Sample Lectures</h2><p>Click any tile to watch in a modal.</p></div><div class="grid g4" id="teachingGrid"></div></section>
<section class="section" id="experience"><div class="section-header"><h2>Experience & Education</h2></div><div id="expTabsContainer"></div></section>
<section class="section" id="awards"><div class="section-header"><h2>Awards & Certifications</h2></div><div class="grid g3" id="awardsGrid"></div></section>
<section class="section" id="contact"><div class="section-header"><h2>Contact Me</h2></div><div id="contactContent"></div></section>
<footer class="footer" id="footerContent"></footer>
</main>
<div class="modal-overlay" id="modal"><div class="modal-bg" id="modalBg"></div><div class="modal-box"><button class="modal-close" id="modalClose"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button><div class="modal-body" id="modalContent"></div></div></div>
<div id="demoSwitcherMount"></div>
<script>
// ============================================================
// SVG ICON LIBRARY
// ============================================================
const ICONS={
github:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 .297a12 12 0 00-3.79 23.39c.6.11.82-.26.82-.58v-2.17c-3.34.73-4.04-1.61-4.04-1.61-.55-1.41-1.34-1.79-1.34-1.79-1.1-.75.08-.74.08-.74 1.22.08 1.86 1.26 1.86 1.26 1.08 1.85 2.83 1.32 3.52 1.01.11-.78.42-1.33.76-1.64-2.66-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.12-.3-.54-1.52.12-3.17 0 0 1.01-.32 3.3 1.23a11.4 11.4 0 016 0c2.28-1.55 3.29-1.23 3.29-1.23.66 1.65.24 2.87.12 3.17.77.84 1.24 1.91 1.24 3.22 0 4.61-2.82 5.62-5.5 5.92.43.37.81 1.1.81 2.22v3.29c0 .32.21.7.82.58A12 12 0 0012 .297z"/></svg>',
share:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>',
pdf:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',
bib:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',
copy:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>',
fb:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>',
li:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>',
x:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>',
scholar:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M5.242 13.769L0 9.5 12 0l12 9.5-5.242 4.269C17.548 11.249 14.978 9.5 12 9.5c-2.977 0-5.548 1.748-6.758 4.269zM12 10a7 7 0 100 14 7 7 0 000-14z"/></svg>',
play:'<svg viewBox="0 0 24 24" fill="currentColor"><polygon points="5 3 19 12 5 21"/></svg>',
extArrow:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="7" y1="17" x2="17" y2="7"/><polyline points="7 7 17 7 17 17"/></svg>',
mail:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>',
user:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',
phone:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6A19.79 19.79 0 012.12 4.18 2 2 0 014.11 2h3a2 2 0 012 1.72c.13.81.36 1.6.68 2.34a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.74.32 1.53.55 2.34.68A2 2 0 0122 16.92z"/></svg>',
pin:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg>',
cited:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M3 12h18"/><path d="M3 18h18"/></svg>',
sort:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 3 18 9"/><polyline points="6 15 12 21 18 15"/></svg>',
grid:'<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg>',
userPlus:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="8.5" cy="7" r="4"/><line x1="20" y1="8" x2="20" y2="14"/><line x1="23" y1="11" x2="17" y2="11"/></svg>',
award:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="7"/><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"/></svg>',
star:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>',
cap:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 10v6M2 10l10-5 10 5-10 5z"/><path d="M6 12v5c0 2 3 3 6 3s6-1 6-3v-5"/></svg>',
monitor:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>',
shield:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
code:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',
globe:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"/></svg>',
pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.12 2.12 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>',
orcid:'<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM7.369 4.378c.525 0 .947.431.947.947s-.422.947-.947.947a.95.95 0 01-.947-.947c0-.525.422-.947.947-.947zm-.722 3.038h1.444v10.041H6.647V7.416zm3.562 0h3.9c3.712 0 5.344 2.653 5.344 5.025 0 2.578-2.016 5.025-5.325 5.025h-3.919V7.416zm1.444 1.303v7.444h2.297c3.272 0 4.05-2.381 4.05-3.722 0-2.016-1.303-3.722-3.978-3.722h-2.369z"/></svg>',
researchgate:'<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="11" fill="currentColor" opacity=".16"/><text x="12" y="15.2" text-anchor="middle" font-size="9.8" font-weight="700" font-family="Arial, sans-serif" fill="currentColor">RG</text></svg>',
kaggle:'<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="11" fill="currentColor" opacity=".16"/><text x="12" y="15.3" text-anchor="middle" font-size="11" font-weight="700" font-family="Arial, sans-serif" fill="currentColor">K</text></svg>'
};
const ICON_COLORS={warm:'var(--accent-warm)',accent:'var(--accent)',sage:'var(--accent-sage)'};
// ============================================================
// HELPER FUNCTIONS
// ============================================================
function esc(s){const d=document.createElement('div');d.textContent=s;return d.innerHTML;}
function highlightAuthor(authors,name){return authors.replace(name,'<strong>'+name+'</strong>');}
function shareDropdownHTML(title,url){
return '<div class="share-wrap"><button class="action-btn share-toggle" data-title="'+esc(title)+'" data-url="'+esc(url)+'">'+ICONS.share+'Share</button><div class="share-dropdown"></div></div>';
}
function getTemplateMeta(template){
const t=(template||'phd').toLowerCase();
if(t==='professor' || t==='teacher') return { template:'professor', label:'Professor' };
return { template:'phd', label:'PhD Student' };
}
function getEffectiveSettings(data){
const base=Object.assign({}, data.settings||{});
const stored=localStorage.getItem('demoTemplateMode');
const template=getTemplateMeta(stored || base.template).template;
const meta=getTemplateMeta(template);
base.template=meta.template;
if(!base.templateLabel || stored) base.templateLabel=meta.label;
return base;
}
function renderDemoSwitcher(settings){
const enabled = settings && settings.demoTemplateSwitcher !== false;
if(!enabled){document.getElementById('demoSwitcherMount').innerHTML='';return;}
const meta=getTemplateMeta(settings.template);
const next=meta.template==='professor' ? { template:'phd', label:'Student', href:'index.html' } : { template:'professor', label:'Professor', href:'professor.html' };
document.getElementById('demoSwitcherMount').innerHTML=
'<aside class="demo-switcher">'+
'<div class="demo-label">Demo View</div>'+
'<div class="demo-current">'+esc(meta.label)+'</div>'+
'<a class="action-btn" id="demoSwitchBtn" href="'+next.href+'">'+ICONS.grid+' Open '+esc(next.label)+' Page</a>'+
'</aside>';
}
// ============================================================
// RENDER FUNCTIONS
// ============================================================
function renderHero(p, projects, hero, settings){
const manual = (p.photos || []).map(ph => ({ src: ph.src, alt: ph.alt, title: '' }));
const proj = (projects || []).filter(pr => pr.image).map(pr => ({ src: pr.image, alt: pr.title, title: pr.title }));
const allPhotos = [...manual, ...proj];
if(allPhotos.length === 0) allPhotos.push({ src: '', alt: 'No image', title: '' });
const kicker = (hero && hero.welcomeTitle) || 'Welcome';
const roleLabel = (settings && settings.templateLabel) || p.role;
const slides=allPhotos.map((ph,i)=>{
let caption = ph.title ? '<div class="slide-caption" style="position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,0.65);color:#fff;padding:0.75rem 1rem;font-size:0.85rem;font-weight:600;font-family:var(--sans);backdrop-filter:blur(4px);">'+esc(ph.title)+'</div>' : '';
return '<div class="photo-slide'+(i===0?' active':'')+'" style="position:relative;"><img src="'+ph.src+'" alt="'+esc(ph.alt)+'" loading="'+(i===0?'eager':'lazy')+'">'+caption+'</div>';
}).join('');
const dots=allPhotos.map((ph,i)=>'<button class="photo-dot'+(i===0?' active':'')+'" data-i="'+i+'"></button>').join('');
document.getElementById('heroSection').innerHTML=
'<section class="hero"><div class="hero-text reveal"><div class="kicker">'+esc(kicker)+'</div><h1>'+p.headline+'</h1><p class="lead">'+p.bio+'</p><div class="hero-actions"><a class="btn-primary" href="#publications">'+ICONS.grid+'Publications</a><a class="btn-outline" href="#projects">Projects</a></div><div class="hero-role">'+ICONS.user+' '+esc(roleLabel)+' · '+esc(p.affiliation)+'</div></div><div class="featured-card reveal"><div class="photo-carousel" id="photoCarousel"><div class="photo-track" id="photoTrack">'+slides+'</div><div class="photo-dots" id="photoDots">'+dots+'</div></div><div class="carousel-nav"><button class="car-btn" id="photoPrev" aria-label="Previous"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg></button><button class="car-btn" id="photoNext" aria-label="Next"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg></button></div></div></section>';
document.getElementById('brandInitials').textContent=p.initials;
document.getElementById('brandName').textContent=p.name;
document.getElementById('brandTagline').textContent=p.tagline;
}
function renderHiring(h, opportunities){
const positions = opportunities && opportunities.positions && opportunities.positions.length ? opportunities.positions : [];
const title = (opportunities && opportunities.title) || (h && h.title) || 'Open to Collaborate';
const description = (opportunities && opportunities.summary) || (h && h.description) || '';
if((!h || !h.enabled) && !title && !description && !positions.length){document.getElementById('hiringSection').innerHTML='';return;}
document.getElementById('hiringSection').innerHTML=
'<section class="otw-banner reveal" id="hiring"><div class="otw-orbit"></div><div class="otw-inner"><div class="otw-content"><h3>'+esc(title)+'</h3><p>'+esc(description)+'</p>'+(positions.length?'<div class="opps-pills">'+positions.map(item=>'<span class="opps-pill">'+esc(item)+'</span>').join('')+'</div>':'')+'</div><div class="otw-actions"><a class="otw-cta" href="#contact">'+ICONS.mail+'Contact Me</a></div></div></section>';
}
function renderProjects(projects){
window._projects = projects || [];
document.getElementById('projectsGrid').innerHTML=projects.map(p=>
'<article class="card reveal"><div class="card-top"><div><button class="project-open project-detail-btn" type="button" data-project="'+window._projects.indexOf(p)+'"><h3>'+esc(p.title)+'</h3></button><div class="sub">'+esc(p.subtitle)+'</div></div><span class="tag">'+esc(p.year)+'</span></div><button class="project-open project-detail-btn" type="button" data-project="'+window._projects.indexOf(p)+'"><div class="card-media"><img src="'+p.image+'" alt="'+esc(p.title)+'" loading="lazy"></div></button><div class="card-desc">'+esc(p.description)+'</div><div class="card-actions"><a class="action-btn" href="'+p.github+'" target="_blank">'+ICONS.github+'GitHub</a>'+shareDropdownHTML(p.title,p.url)+'</div></article>'
).join('');
}
function initProjectDetails(){
document.querySelectorAll('.project-detail-btn').forEach(btn=>{btn.addEventListener('click',()=>{
const project=(window._projects||[])[Number(btn.dataset.project)];
if(!project) return;
const figures = project.figures || [];
const bullets = project.highlights || [];
const metrics = project.meta || [];
const demoUrl = project.demoUrl || project.url;
const projectId = 'project-' + Number(btn.dataset.project);
const media = project.media || {};
const featuredVideo = media.featuredVideo || project.videoUrl || '';
const featuredVideoTitle = media.featuredVideoTitle || 'Project video';
const featuredImage = media.featuredImage || '';
const featuredImageCaption = media.featuredImageCaption || '';
const screenshots = media.screenshots || figures || [];
const modalHTML = `
<div class="project-modal">
<div class="project-modal-head">
<div>
<div class="project-modal-thumb">${project.image ? `<img src="${project.image}" alt="${esc(project.title || 'Project image')}">` : ''}</div>
</div>
<div>
<div class="project-modal-kicker">${esc(project.year || 'Project')}</div>
<h3>${esc(project.title || '')}</h3>
<div class="project-modal-sub">${esc(project.subtitle || '')}</div>
<p class="project-modal-summary">${esc(project.description || '')}</p>
<div class="project-modal-meta">
${metrics.length ? metrics.map(item=>`<span class="project-modal-meta-item">${esc(item.label || 'Info')}: ${esc(item.value || '')}</span>`).join('') : `
<span class="project-modal-meta-item">${esc(project.subtitle || 'Research project')}</span>
<span class="project-modal-meta-item">${esc(project.year || '')}</span>
`}
</div>
</div>
</div>
<div class="project-tabs">
<div class="project-tabs-header">
<button class="project-tab-btn active" type="button" data-project-tab="${projectId}-details">Details & Objective</button>
<button class="project-tab-btn" type="button" data-project-tab="${projectId}-results">Results</button>
<button class="project-tab-btn" type="button" data-project-tab="${projectId}-media">Video / Screenshots</button>
</div>
<div class="project-tab-panel active" id="${projectId}-details">
<p>${esc(project.longDescription || project.description || '')}</p>
${bullets.length ? `<ul class="project-modal-list" style="margin-top:0.9rem">${bullets.map(item=>`<li>${esc(item)}</li>`).join('')}</ul>` : ''}
</div>
<div class="project-tab-panel" id="${projectId}-results">
<div class="project-results-grid">
${metrics.length ? metrics.map(item=>`<div class="project-modal-meta-item">${esc(item.label || 'Info')}: ${esc(item.value || '')}</div>`).join('') : '<p>No additional result metrics provided.</p>'}
</div>
</div>
<div class="project-tab-panel" id="${projectId}-media">
${(featuredVideo || featuredImage) ? `<div class="project-media-grid">
${featuredVideo ? `<button class="project-media-card video project-video-open" type="button" data-video-src="${featuredVideo}" data-video-title="${esc(featuredVideoTitle || project.title || 'Project video')}"><div class="project-media-thumb"><img src="https://img.youtube.com/vi/${featuredVideo.split('/embed/')[1].split('?')[0]}/hqdefault.jpg" alt="${esc(featuredVideoTitle || project.title || 'Project video')}"><span class="project-media-badge">Video</span><span class="project-media-play">${ICONS.play}</span></div><div class="project-media-caption">${esc(featuredVideoTitle || 'Project demonstration')}</div></button>` : ''}
${featuredImage ? `<button class="project-media-card project-image-open" type="button" data-image-src="${featuredImage}" data-image-caption="${esc(featuredImageCaption || '')}"><img src="${featuredImage}" alt="${esc(featuredImageCaption || project.title || 'Featured image')}"><div class="project-media-caption">${esc(featuredImageCaption || 'Featured figure')}</div></button>` : ''}
</div>` : ''}
${screenshots.length ? `<div class="project-screenshots-wrap"><div class="project-gallery-title">Screenshots & Figures</div><div class="project-modal-figures">${screenshots.map(item=>`<button class="project-figure project-image-open" type="button" data-image-src="${item.image}" data-image-caption="${esc(item.caption || '')}" style="padding:0;text-align:left;cursor:pointer"><img src="${item.image}" alt="${esc(item.caption || project.title || 'Screenshot')}"><figcaption>${esc(item.caption || '')}</figcaption></button>`).join('')}</div></div>` : (!featuredVideo && !featuredImage ? '<p>No media added for this project.</p>' : '')}
</div>
</div>
<div class="award-modal-actions">
${demoUrl ? `<a class="btn-primary" href="${demoUrl}" target="_blank" rel="noopener">${ICONS.extArrow} Demo</a>` : ''}
${project.github ? `<a class="btn-outline" href="${project.github}" target="_blank" rel="noopener">${ICONS.github} Repository</a>` : ''}
</div>
</div>
`;
openModal(modalHTML);
bindProjectModalInteractions();
})});
}
function bindProjectModalInteractions(){
document.querySelectorAll('.project-tab-btn').forEach(tabBtn=>{
tabBtn.addEventListener('click',()=>{
const target=tabBtn.dataset.projectTab;
document.querySelectorAll('.project-tab-btn').forEach(b=>b.classList.remove('active'));
document.querySelectorAll('.project-tab-panel').forEach(p=>p.classList.remove('active'));
tabBtn.classList.add('active');
const panel=document.getElementById(target);
if(panel) panel.classList.add('active');
});
});
document.querySelectorAll('.project-video-open').forEach(videoBtn=>{
videoBtn.addEventListener('click',()=>{
const src=videoBtn.dataset.videoSrc;
const title=videoBtn.dataset.videoTitle || 'Project video';
openVideoLightbox(src, title);
});
});
document.querySelectorAll('.project-image-open').forEach(imageBtn=>{
imageBtn.addEventListener('click',()=>{
const src=imageBtn.dataset.imageSrc;
const caption=imageBtn.dataset.imageCaption || '';
openModal('<div><img class="project-lightbox-image" src="'+src+'" alt="'+caption+'">'+(caption?'<div class="project-lightbox-caption">'+caption+'</div>':'')+'</div>');
});
});
}
function renderPublications(pubs,style){
window._allPubs = [...pubs]; // store for dynamic filtering
window._pubState = { filter: 'all', sort: 'year', limit: 6 };
const types=[...new Set(pubs.map(p=>p.type))];
const publicationTypeLabels={journal:'Journal',conference:'Conference',workshop:'Workshop',poster:'Poster',thesis:'Thesis / Dissertation'};
let html='';
if(style==='card'||style==='both'){
const sortedCard=[...pubs].sort((a,b)=>b.year-a.year);
html+='<div class="grid g3">'+sortedCard.slice(0,3).map(p=>{
const tag=(publicationTypeLabels[p.type] || (p.type ? p.type.charAt(0).toUpperCase()+p.type.slice(1) : 'Publication'))+' · '+p.year;
return '<article class="card reveal"><div class="card-top"><div><h3>'+esc(p.title)+'</h3><div class="sub">'+highlightAuthor(esc(p.authors),p.highlightAuthor)+'</div></div><span class="tag">'+tag+'</span></div><div class="card-media"><img src="'+p.image+'" alt="'+esc(p.title)+'" loading="lazy"></div><div class="card-desc"><em>'+esc(p.venue)+'</em> — '+esc(p.description)+'</div><div class="card-actions"><button class="action-btn bib-btn" data-bib="'+esc(p.bibtex)+'">'+ICONS.bib+'BibTeX</button><a class="action-btn" href="'+p.pdfUrl+'">'+ICONS.pdf+'PDF</a>'+shareDropdownHTML(p.title,p.url)+'</div></article>';
}).join('')+'</div>';
}
if(style==='alt'||style==='both'){
if(style==='both')html+='</div><section class="section" id="publications-alt"><div class="section-header"><h2>Publications (Alt Style)</h2><p>Tabbed list view — sorted by year.</p></div>';
html+='<div class="pub-filter-bar"><button class="pub-filter-btn pub-cat-btn active" data-filter="all">All</button>';
types.forEach(t=>html+='<button class="pub-filter-btn pub-cat-btn" data-filter="'+t+'">'+(publicationTypeLabels[t] || (t ? t.charAt(0).toUpperCase()+t.slice(1) : 'Publication'))+'</button>');
// Sort controls
html+=`<div class="pub-sort-controls" style="margin-left:auto; display:flex; gap:0.5rem; align-items:center;">
<span style="font-size:0.75rem; color:var(--muted); font-weight:600;">SORT BY</span>
<button class="pub-filter-btn pub-sort-btn active" data-sort="year" style="padding:0.25rem 0.75rem; font-size:0.78rem;">Year</button>
<button class="pub-filter-btn pub-sort-btn" data-sort="citations" style="padding:0.25rem 0.75rem; font-size:0.78rem;">Citations</button>
</div></div>`;
html+='<div class="pub-list" id="pubList"></div>';
html+='<div id="pubLoadMoreWrap" style="text-align:center; margin-top:1.5rem;"><button id="pubLoadMoreBtn" class="btn-outline">Load More</button></div>';
if(style==='both')html+='</section>';
}
document.getElementById('pubContent').innerHTML=html;
}
function updatePubListDisplay() {
const container = document.getElementById('pubList');
if(!container) return;
let filtered = window._allPubs;
if (window._pubState.filter !== 'all') {
filtered = filtered.filter(p => p.type === window._pubState.filter);
}
if (window._pubState.sort === 'citations') {
filtered.sort((a,b) => (b.citations || 0) - (a.citations || 0));
} else {
filtered.sort((a,b) => (b.year || 0) - (a.year || 0));
}
const visible = filtered.slice(0, window._pubState.limit);
const isComplete = window._pubState.limit >= filtered.length;
container.innerHTML = visible.map((p,i)=>
'<div class="pub-row reveal vis" data-type="'+p.type+'" data-year="'+p.year+'"><span class="pub-row-num">'+(i+1)+'.</span><div class="pub-row-thumb"><img src="'+p.thumbnail+'" alt="'+esc(p.title)+'" loading="lazy"></div><div class="pub-row-body"><div class="pub-row-head"><span class="pub-row-title">'+esc(p.title)+'</span><span class="pub-row-year">'+p.year+'</span></div><div class="pub-row-authors">'+highlightAuthor(esc(p.authors),p.highlightAuthor)+'</div><div class="pub-row-venue">'+esc(p.venue)+'</div><div class="pub-row-desc">'+esc(p.description)+'</div><div class="pub-row-actions"><a class="action-btn" href="'+p.pdfUrl+'">'+ICONS.pdf+'PDF</a><button class="action-btn bib-btn" data-bib="'+esc(p.bibtex)+'">'+ICONS.bib+'BibTeX</button>'+shareDropdownHTML(p.title,p.url)+'<span class="action-btn" style="cursor:default;opacity:0.6">'+ICONS.cited+'Cited: '+(p.citations||0)+'</span></div></div></div>'
).join('');
initBibTeX(); // re-bind click events for new nodes
initShareDropdowns();
const wrap = document.getElementById('pubLoadMoreWrap');
if(wrap) wrap.style.display = isComplete ? 'none' : 'block';
}
function renderResearch(research, profile, expertise, lab) {
const details = research || {};
const summary = details.summary || (lab && lab.description) || '';
const title = details.title || 'Research Highlights & Interests';
const highlights = details.highlights || [];
const interests = (details.interests && details.interests.length ? details.interests : (expertise || []).map(item=>item.name));
const interestCards = (details.interestCards && details.interestCards.length ? details.interestCards : (expertise && expertise.length ? expertise : interests));
const metrics = details.metrics || [];
const overviewStats = metrics.length ? '<div class="hero-actions" style="margin-top:1rem">'+metrics.map(item=>'<span class="tag">'+esc(item.label)+': '+esc(item.value)+'</span>').join('')+'</div>' : '';
const renderHighlightItem=item=>{
if(item && typeof item === 'object' && !Array.isArray(item)){
const icon = ICONS[item.icon] || ICONS.code;
const level = (item.level || 'learning').toLowerCase();
return '<div class="research-highlight-card"><div class="research-skill-card"><div class="research-skill-icon">'+icon+'</div><div class="research-skill-content"><div class="research-skill-head"><strong>'+esc(item.name || item.title || 'Skill')+'</strong><span class="research-skill-level" data-level="'+esc(level)+'">'+esc(level)+'</span></div>'+(item.note ? '<div class="research-skill-note">'+esc(item.note)+'</div>' : '')+'</div></div></div>';
}
return '<div class="research-highlight-card simple"><span>'+esc(item || '')+'</span></div>';
};
const renderHighlightGroup=group=>{
const items = group.items || [];
return '<div class="research-highlight-group"><h4>'+esc(group.title || 'Highlight')+'</h4>'+(group.description?'<p>'+esc(group.description)+'</p>':'')+'<div class="research-highlight-grid">'+items.map(renderHighlightItem).join('')+'</div></div>';
};
const renderInterestItem=item=>{
if(item && typeof item === 'object' && !Array.isArray(item)){
const icon = ICONS[item.icon] || ICONS.star;
const level = (item.level || 'learning').toLowerCase();
return '<div class="research-highlight-card"><div class="research-skill-card"><div class="research-skill-icon">'+icon+'</div><div class="research-skill-content"><div class="research-skill-head"><strong>'+esc(item.name || item.title || 'Interest')+'</strong><span class="research-skill-level" data-level="'+esc(level)+'">'+esc(level)+'</span></div>'+(item.note ? '<div class="research-skill-note">'+esc(item.note)+'</div>' : '')+'</div></div></div>';
}
return '<div class="research-highlight-card simple"><span>'+esc(item || '')+'</span></div>';
};
document.getElementById('researchContent').innerHTML=
'<div class="section-header"><h2>'+esc(title)+'</h2><p>'+(summary ? esc(summary) : 'Research focus, highlights, and areas of expertise in the same visual theme.')+'</p></div>'+
'<div class="tabs-container reveal">'+
'<div class="tabs-header">'+
'<button class="tab-btn active" data-tab="research-overview">Overview</button>'+
'<button class="tab-btn" data-tab="research-highlights">Highlights</button>'+
'<button class="tab-btn" data-tab="research-interests">Interests</button>'+
'</div>'+
'<div class="tab-panel active" id="tab-research-overview"><div class="research-intro">'+profile.bio+(summary?'<div style="margin-top:1rem">'+esc(summary)+'</div>':'')+overviewStats+'</div></div>'+
'<div class="tab-panel" id="tab-research-highlights">'+
(highlights.length ? highlights.map(renderHighlightGroup).join('') : '<div class="research-intro">Add items to <code>researchProfile.highlights</code> in <code>data.json</code> to show your current research highlights here.</div>')+
'</div>'+
'<div class="tab-panel" id="tab-research-interests"><div class="research-highlight-grid">'+interestCards.map(renderInterestItem).join('')+'</div></div>'+
'</div>';
}
function renderTeaching(lectures){
document.getElementById('teachingGrid').innerHTML=lectures.map(l=>
'<div class="video-card reveal" data-video="'+l.videoUrl+'"><div class="video-thumb"><svg class="bg-art" viewBox="0 0 400 280" preserveAspectRatio="xMidYMid slice"><rect width="400" height="280" fill="'+l.bgColor+'"/><circle cx="200" cy="140" r="80" fill="#fff" opacity=".05"/></svg><div class="play-circle">'+ICONS.play+'</div></div><div class="video-info"><h4>'+esc(l.title)+'</h4><p>'+esc(l.subtitle)+'</p></div></div>'
).join('');
}
function renderExperience(exp,edu){
const expHTML=exp.map(e=>'<div class="timeline-item"><div class="tl-logo">'+(ICONS[e.icon]||ICONS.monitor)+'</div><div class="tl-content"><h4>'+esc(e.title)+'</h4><div class="tl-org">'+esc(e.organization)+'</div><div class="tl-desc">'+esc(e.description)+'</div></div><div class="tl-year">'+esc(e.years)+'</div></div>').join('');
const eduHTML=edu.map(e=>'<div class="timeline-item"><div class="tl-logo">'+(e.logo?'<img src="'+e.logo+'" alt="'+esc(e.organization)+'">':ICONS.cap)+'</div><div class="tl-content"><h4>'+esc(e.title)+'</h4><div class="tl-org">'+esc(e.organization)+'</div><div class="tl-desc">'+esc(e.description)+'</div></div><div class="tl-year">'+esc(e.years)+'</div></div>').join('');
document.getElementById('expTabsContainer').innerHTML=
'<div class="tabs-container reveal"><div class="tabs-header"><button class="tab-btn active" data-tab="exp">Experience</button><button class="tab-btn" data-tab="edu">Education</button></div><div class="tab-panel active" id="tab-exp">'+expHTML+'</div><div class="tab-panel" id="tab-edu">'+eduHTML+'</div></div>';
}
function renderAwards(awards){
window._awards = awards || [];
document.getElementById('awardsGrid').innerHTML=awards.map(a=>{
const iconSVG=ICONS[a.icon]||ICONS.award;
const color=ICON_COLORS[a.iconColor]||'var(--accent-warm)';
const canOpen = !!(a.details || a.organizer || a.date || a.location || a.certificateImage || a.certificateUrl);
if(canOpen){
return '<button class="compact-card reveal award-detail-btn" type="button" data-award="'+window._awards.indexOf(a)+'" style="width:100%;text-align:left;cursor:pointer;font-family:var(--sans)"><div class="compact-icon" style="color:'+color+'">'+iconSVG+'</div><div class="compact-body"><h3>'+esc(a.title)+'</h3><div class="sub">'+esc(a.subtitle)+'</div></div><div class="ext-arrow" style="opacity:1;transform:none">'+ICONS.extArrow+'</div></button>';
}
return '<a class="compact-card reveal" href="'+a.url+'" target="_blank" rel="noopener"><div class="compact-icon" style="color:'+color+'">'+iconSVG+'</div><div class="compact-body"><h3>'+esc(a.title)+'</h3><div class="sub">'+esc(a.subtitle)+'</div></div><div class="ext-arrow">'+ICONS.extArrow+'</div></a>';
}).join('');
}
function initAwardDetails(){
document.querySelectorAll('.award-detail-btn').forEach(btn=>{btn.addEventListener('click',()=>{
const award = (window._awards||[])[Number(btn.dataset.award)];
if(!award) return;
const modalHTML = `
<div class="award-modal">
<div class="award-modal-hero">
<div>
<div class="award-modal-sub">${esc(award.subtitle || 'Award & Certificate')}</div>
<h3>${esc(award.title || '')}</h3>
<p class="award-modal-desc">${esc(award.details || 'Award and certificate details are available here.')}</p>
<div class="award-modal-meta">
${award.organizer ? `<div class="award-modal-meta-item"><span class="ci-label">Organizer</span><strong>${esc(award.organizer)}</strong></div>` : ''}
${award.location ? `<div class="award-modal-meta-item"><span class="ci-label">Location</span><strong>${esc(award.location)}</strong></div>` : ''}
${award.date ? `<div class="award-modal-meta-item"><span class="ci-label">Date</span><strong>${esc(award.date)}</strong></div>` : ''}
${award.certificateName ? `<div class="award-modal-meta-item"><span class="ci-label">Certificate</span><strong>${esc(award.certificateName)}</strong></div>` : ''}
</div>
<div class="award-modal-actions">
${award.certificateUrl ? `<a class="btn-primary" href="${award.certificateUrl}" target="_blank" rel="noopener">${ICONS.pdf} View Certificate</a>` : ''}
${award.url ? `<a class="btn-outline" href="${award.url}" target="_blank" rel="noopener">${ICONS.extArrow} Official Link</a>` : ''}
</div>
</div>
<div class="award-modal-media">
${award.certificateImage ? `<img src="${award.certificateImage}" alt="${esc(award.title || 'Certificate image')}">` : '<div style="min-height:180px;display:grid;place-items:center;color:var(--muted)">'+ICONS.award+'</div>'}
</div>
</div>
</div>
`;
openModal(modalHTML);
})});
}
function renderContact(c,name,cv,settings){
const socialIcons={'google-scholar':ICONS.scholar,github:ICONS.github,linkedin:ICONS.li,orcid:ICONS.orcid,twitter:ICONS.x,researchgate:ICONS.researchgate,kaggle:ICONS.kaggle};
const profileButtons=(c.socials||[]).map(s=>'<a class="action-btn" href="'+s.url+'" target="_blank" rel="noopener">'+(socialIcons[s.platform]||ICONS.globe)+esc(s.platform)+'</a>').join('');
const cvUrl = (cv && cv.url) || c.cvUrl || '#';
const template=((settings&&settings.template)||'').toLowerCase();
const showMap=template==='professor' || template==='teacher';
if(showMap){
const socialsHTML=(c.socials||[]).map(s=>'<a class="social-btn" href="'+s.url+'" target="_blank" aria-label="'+s.platform+'">'+(socialIcons[s.platform]||ICONS.globe)+'</a>').join('');
document.getElementById('contactContent').innerHTML=
'<div class="contact-grid"><div class="map-wrap"><iframe src="'+c.mapEmbed+'" loading="lazy" referrerpolicy="no-referrer-when-downgrade" title="Map"></iframe></div><aside class="contact-info"><h3>Contact Me</h3><ul class="contact-list"><li class="contact-item"><div class="ci-icon">'+ICONS.user+'</div><div><div class="ci-label">Name</div>'+esc(name)+'</div></li><li class="contact-item"><div class="ci-icon">'+ICONS.mail+'</div><div><div class="ci-label">Email</div><a href="mailto:'+c.email+'">'+esc(c.email)+'</a></div></li><li class="contact-item"><div class="ci-icon">'+ICONS.phone+'</div><div><div class="ci-label">Phone</div><a href="tel:'+c.phone+'">'+esc(c.phone)+'</a></div></li><li class="contact-item"><div class="ci-icon">'+ICONS.pin+'</div><div><div class="ci-label">Office</div>'+esc(c.office)+'</div></li></ul><div class="contact-actions"><a class="btn-primary" href="mailto:'+c.email+'">'+ICONS.mail+'Mail</a><a class="btn-outline" href="'+cvUrl+'" target="_blank" rel="noopener">'+ICONS.pdf+'CV</a></div><div class="contact-profiles"><span class="ci-label">Academic Profiles</span><div class="socials">'+socialsHTML+'</div></div></aside></div>';
return;
}
document.getElementById('contactContent').innerHTML=
'<div class="contact-stack">'+
'<section class="contact-banner centered reveal">'+
'<h3>Research Collaboration & Opportunities</h3>'+
'<p class="contact-lead">I welcome research collaboration, student supervision discussions, interdisciplinary academic partnerships, and opportunities to work on impactful projects in geotechnical engineering, soil improvement, and experimental research. If you would like to discuss a position, a joint study, or a potential collaboration, feel free to reach out.</p>'+
'<div class="contact-detail-actions">'+
'<ul class="contact-top-list">'+
'<li class="contact-top-item"><div class="ci-icon">'+ICONS.user+'</div><div><div class="ci-label">Name</div><div class="contact-value">'+esc(name)+'</div></div></li>'+
'<li class="contact-top-item"><div class="ci-icon">'+ICONS.mail+'</div><div><div class="ci-label">Email</div><div class="contact-value"><a href="mailto:'+c.email+'">'+esc(c.email)+'</a></div></div></li>'+
'<li class="contact-top-item"><div class="ci-icon">'+ICONS.phone+'</div><div><div class="ci-label">Phone</div><div class="contact-value"><a href="tel:'+c.phone+'">'+esc(c.phone)+'</a></div></div></li>'+
'</ul>'+
'<div class="contact-action-column"><a class="btn-primary" href="mailto:'+c.email+'">'+ICONS.mail+'Mail</a><a class="btn-outline" href="'+cvUrl+'" target="_blank" rel="noopener">'+ICONS.pdf+'CV</a></div>'+
'</div>'+
'<div class="contact-section-divider"></div>'+
'<div class="ci-label" style="margin-bottom:0.85rem">Academic Profiles</div>'+
'<div class="contact-profiles-buttons">'+profileButtons+'</div>'+
'</section>'+
'</div>';
}
function renderFooter(f){
document.getElementById('footerContent').innerHTML=
'© '+new Date().getFullYear()+' '+esc(f.copyright)+' — Academic Portfolio<div style="margin-top:0.6rem;font-size:0.75rem;opacity:0.7;display:flex;justify-content:center;gap:1.5rem;flex-wrap:wrap"><span>Designed by <a href="https://github.com/riponcm" target="_blank" rel="noopener" style="color:var(--accent);text-decoration:none"><strong>'+esc(f.designedBy)+'</strong></a></span><span>'+esc(f.version)+'</span><span><a href="'+f.repoUrl+'" target="_blank" rel="noopener" style="color:var(--accent);text-decoration:none">Acadpro '+esc(f.version)+'</a></span></div>';
}
// ============================================================
// INTERACTIVE FEATURES (initialized after render)
// ============================================================
function initCarousel(){
const track=document.getElementById('photoTrack');if(!track)return;
const slides=track.children,dots=document.querySelectorAll('.photo-dot');
let idx=0,auto=true;
function show(i){idx=((i%slides.length)+slides.length)%slides.length;track.style.transform='translateX('+-idx*100+'%)';[...slides].forEach((s,j)=>s.classList.toggle('active',j===idx));dots.forEach((d,j)=>d.classList.toggle('active',j===idx));}
document.getElementById('photoNext').addEventListener('click',()=>{auto=false;show(idx+1)});
document.getElementById('photoPrev').addEventListener('click',()=>{auto=false;show(idx-1)});
dots.forEach(d=>d.addEventListener('click',()=>{auto=false;show(+d.dataset.i)}));
document.getElementById('photoCarousel').addEventListener('mouseenter',()=>auto=false);
document.getElementById('photoCarousel').addEventListener('mouseleave',()=>auto=true);
setInterval(()=>{if(auto)show(idx+1)},4500);
}
function initTabs(){
document.querySelectorAll('.tab-btn').forEach(btn=>{btn.addEventListener('click',()=>{
const t=btn.dataset.tab;const c=btn.closest('.tabs-container');
c.querySelectorAll('.tab-btn').forEach(b=>b.classList.remove('active'));
c.querySelectorAll('.tab-panel').forEach(p=>p.classList.remove('active'));
btn.classList.add('active');document.getElementById('tab-'+t).classList.add('active');
})});
}
function initShareDropdowns(){
document.querySelectorAll('.share-toggle').forEach(btn=>{
const wrap=btn.closest('.share-wrap'),dd=wrap.querySelector('.share-dropdown'),title=btn.dataset.title||'',url=btn.dataset.url||'';
dd.innerHTML='<button class="share-option copy-link" data-url="'+url+'">'+ICONS.copy+' Copy link</button><a class="share-option" href="https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(url)+'" target="_blank" rel="noopener">'+ICONS.fb+' Facebook</a><a class="share-option" href="https://www.linkedin.com/sharing/share-offsite/?url='+encodeURIComponent(url)+'" target="_blank" rel="noopener">'+ICONS.li+' LinkedIn</a><a class="share-option" href="https://twitter.com/intent/tweet?text='+encodeURIComponent(title)+'&url='+encodeURIComponent(url)+'" target="_blank" rel="noopener">'+ICONS.x+' X (Twitter)</a>';
btn.addEventListener('click',e=>{e.stopPropagation();document.querySelectorAll('.share-wrap.open').forEach(w=>{if(w!==wrap)w.classList.remove('open')});wrap.classList.toggle('open')});
dd.querySelector('.copy-link').addEventListener('click',e=>{e.stopPropagation();navigator.clipboard.writeText(url).then(()=>{const el=dd.querySelector('.copy-link');el.classList.add('copy-done');el.innerHTML=ICONS.copy+' Copied!';setTimeout(()=>{el.classList.remove('copy-done');el.innerHTML=ICONS.copy+' Copy link'},2000)})});
});
document.addEventListener('click',()=>document.querySelectorAll('.share-wrap.open').forEach(w=>w.classList.remove('open')));
}
function initBibTeX(){
document.querySelectorAll('.bib-btn').forEach(btn=>{btn.addEventListener('click',()=>{
const b=btn.dataset.bib;if(!b)return;
const modalHTML = `
<div style="padding: 1.5rem; background: var(--card); border-radius: 12px;">
<h3 style="margin-bottom: 1rem; font-family: var(--serif); color: var(--text);">BibTeX Citation</h3>
<pre id="bibTexCode" style="background: var(--surface); padding: 1rem; border-radius: 8px; font-size: 0.85rem; overflow-x: auto; color: var(--muted); border: 1px solid var(--card-border); font-family: monospace; white-space: pre-wrap;">${esc(b)}</pre>
<div style="display: flex; justify-content: flex-end; margin-top: 1rem;">
<button id="copyBibBtn" class="action-btn" style="background: var(--accent); color: #fff; border: none;">${ICONS.copy} Copy to Clipboard</button>
</div>
</div>
`;
window.openModal(modalHTML);
setTimeout(() => {
document.getElementById('copyBibBtn').addEventListener('click', (e) => {
navigator.clipboard.writeText(b).then(() => {
e.target.innerHTML = ICONS.copy + ' Copied!';
e.target.style.background = 'var(--accent-sage)';
setTimeout(() => {
e.target.innerHTML = ICONS.copy + ' Copy to Clipboard';
e.target.style.background = 'var(--accent)';
}, 2000);
});
});
}, 50);
})});
}
function initPubFilter(){
updatePubListDisplay(); // initial render
const catBtns=document.querySelectorAll('.pub-cat-btn');
catBtns.forEach(btn=>{btn.addEventListener('click',()=>{
catBtns.forEach(b=>b.classList.remove('active'));btn.classList.add('active');
window._pubState.filter = btn.dataset.filter;
window._pubState.limit = 6; // reset limit on filter change
updatePubListDisplay();
})});
const sortBtns=document.querySelectorAll('.pub-sort-btn');
sortBtns.forEach(btn=>{btn.addEventListener('click',()=>{
sortBtns.forEach(b=>b.classList.remove('active'));btn.classList.add('active');
window._pubState.sort = btn.dataset.sort;
window._pubState.limit = 6; // reset limit on sort change
updatePubListDisplay();
})});
const loadBtn = document.getElementById('pubLoadMoreBtn');
if(loadBtn) {
loadBtn.addEventListener('click', () => {
window._pubState.limit += 6;
updatePubListDisplay();
});
}
}
function extractYouTubeVideoId(url){
if(!url) return '';
if(url.includes('/embed/')){
return url.split('/embed/')[1].split(/[?&]/)[0];
}
if(url.includes('youtu.be/')){
return url.split('youtu.be/')[1].split(/[?&]/)[0];
}
try{
const parsed = new URL(url);
const v = parsed.searchParams.get('v');
return v || '';
}catch(e){
return '';
}
}
function openVideoLightbox(src,title){
const vid = extractYouTubeVideoId(src);
if(!vid) return;
const safeTitle = esc(title || 'Video');
openModal('<div id="ytPlayerWrap" style="position:relative;padding-top:56.25%;background:#000"><div id="ytPlayerDiv" style="position:absolute;inset:0"></div></div>');
setTimeout(()=>{
const playerWrap=document.getElementById('ytPlayerWrap');
if(!playerWrap) return;
if(window._ytReady && window.YT){
if(window._ytPlayer && window._ytPlayer.destroy) try{window._ytPlayer.destroy()}catch(e){}
window._ytPlayer=new YT.Player('ytPlayerDiv',{
width:'100%',
height:'100%',
videoId:vid,
playerVars:{autoplay:1,rel:0,modestbranding:1,playsinline:1},
events:{
onError:function(){
playerWrap.innerHTML='<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;position:absolute;inset:0;color:#fff;gap:1rem;padding:1.5rem;text-align:center"><p>Unable to play "'+safeTitle+'" inline.</p><a href="https://www.youtube.com/watch?v='+vid+'" target="_blank" rel="noopener" style="padding:0.6rem 1.2rem;border-radius:10px;background:#ff0000;color:#fff;text-decoration:none;font-weight:700">Watch on YouTube</a></div>';
}
}
});
return;
}
playerWrap.innerHTML='<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;position:absolute;inset:0;color:#fff;gap:1rem;padding:1.5rem;text-align:center"><p>Loading video...</p><a href="https://www.youtube.com/watch?v='+vid+'" target="_blank" rel="noopener" style="padding:0.6rem 1.2rem;border-radius:10px;background:#ff0000;color:#fff;text-decoration:none;font-weight:700">Watch on YouTube</a></div>';
},300);
}
function initVideo(){
window._ytReady=false;
var tag=document.createElement('script');tag.src='https://www.youtube.com/iframe_api';document.head.appendChild(tag);
window.onYouTubeIframeAPIReady=function(){window._ytReady=true};
document.querySelectorAll('.video-card').forEach(c=>{c.addEventListener('click',()=>{
openVideoLightbox(c.dataset.video,'Teaching video');
})});
}
function initReveal(){
const o=new IntersectionObserver(e=>{e.forEach(x=>{if(x.isIntersecting)x.target.classList.add('vis')})},{threshold:0.08});
document.querySelectorAll('.reveal').forEach(el=>o.observe(el));
const tags=document.querySelectorAll('.skill-tag');
const o2=new IntersectionObserver(e=>{e.forEach(x=>{if(x.isIntersecting){const i=[...tags].indexOf(x.target);setTimeout(()=>x.target.classList.add('vis'),i*55)}})},{threshold:0.1});
tags.forEach(t=>o2.observe(t));
}
function initModal(){
window._modalStack=[];
window.openModal=function(h){
var m=document.getElementById('modal');
var content=document.getElementById('modalContent');
if(m.classList.contains('open') && content.innerHTML.trim()){
window._modalStack.push(content.innerHTML);
}
content.innerHTML=h;
m.classList.add('open');
};
window.closeModal=function(){
if(window._ytPlayer&&window._ytPlayer.destroy)try{window._ytPlayer.destroy()}catch(e){}
window._ytPlayer=null;
var content=document.getElementById('modalContent');
var modal=document.getElementById('modal');
if(window._modalStack && window._modalStack.length){
content.innerHTML=window._modalStack.pop();
bindProjectModalInteractions();
return;
}
content.innerHTML='';
modal.classList.remove('open');
};
document.getElementById('modalBg').addEventListener('click',closeModal);
document.getElementById('modalClose').addEventListener('click',closeModal);
document.addEventListener('keydown',e=>{if(e.key==='Escape')closeModal()});
}
// ============================================================
// THEME
// ============================================================
(function(){const b=document.body,btn=document.getElementById('themeToggle'),icon=document.getElementById('themeIcon');
let s=localStorage.getItem('themeOverride');
if(!s) s=b.getAttribute('data-theme')||'light';
b.setAttribute('data-theme',s);ui(s);
btn.addEventListener('click',()=>{
let current = b.getAttribute('data-theme');
let defaultTheme = window._defaultTheme || 'light';
const n = (current === 'dark') ? defaultTheme : 'dark';
b.setAttribute('data-theme',n);
localStorage.setItem('themeOverride', n === defaultTheme ? 'null' : 'dark'); // only remember if they explicitly want dark
ui(n);
});
function ui(t){icon.innerHTML=t==='dark'?'<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>':'<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/>';}
})();
// ============================================================
// LOAD DATA & RENDER
// ============================================================
function renderSite(D){
const settings=getEffectiveSettings(D);
const pubStyle=settings.publicationStyle||'alt';
let theme=settings.theme||'BH';
if(theme==='BH')theme='light'; // Map BH to light mode CSS
window._defaultTheme = theme;
if(localStorage.getItem('themeOverride') !== 'dark'){
document.body.setAttribute('data-theme',theme);
const icon=document.getElementById('themeIcon');
icon.innerHTML='<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/>';
}
renderHero(D.profile, D.projects, D.hero, settings);
renderHiring(D.hiring, D.opportunities);
renderResearch(D.researchProfile, D.profile, D.expertise, D.lab);
renderProjects(D.projects);
renderPublications(D.publications,pubStyle);
renderTeaching(D.teaching);
renderExperience(D.experience,D.education);
renderAwards(D.awards);