Repository navigation
Expand file tree
/
Copy pathcv.html
More file actions
596 lines (549 loc) · 25.8 KB
/
Copy pathcv.html
File metadata and controls
596 lines (549 loc) · 25.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CV — Shabnam Hakimi</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<style>
/* ── PAGE HEADER ── */
.page-header {
padding: 8.8rem 2.5rem 3rem;
border-bottom: 1px solid var(--blue-G);
max-width: 900px;
}
.page-eyebrow.s-red { --hl-rgb: 255 119 146; --hl-a: 0.55; }
.page-title {
font-family: var(--sans); font-size: clamp(2rem,5vw,3.5rem); font-weight: 300;
color: var(--ink); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 0.6rem;
}
.page-meta { font-size: 0.7rem; color: var(--ink-dim); line-height: 1.8; }
.page-meta a { color: var(--ink-blue); text-decoration: none; }
.page-meta a:hover { text-decoration: underline; }
/* ── SECTION DIVIDER ── */
.cv-section-heading {
font-size: 0.78rem; letter-spacing: 0.35em; text-transform: uppercase;
color: var(--ink-blue); padding: 16px 0 8px;
margin-top: 48px;
border-top: 1.5px solid var(--ink-blue);
}
.cv-section-heading > .hl {
display: inline;
/* inline + clone, not inline-block: the band is one linear-gradient over
the element box, so on a label that wraps, inline-block stretched a
single gradient across BOTH lines and the colour landed in the gap
between them. Cloning the box decoration gives each line fragment its
own gradient, i.e. a highlighter stroke per line. */
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
padding: 0 6px;
margin-left: -6px;
background-image: linear-gradient(
transparent 22%,
rgb(var(--hl-rgb, 26 44 107) / var(--hl-a, 0)) 22%,
rgb(var(--hl-rgb, 26 44 107) / var(--hl-a, 0)) 92%,
transparent 92%
);
}
.cv-section-heading.s-slate { --hl-rgb: 119 119 255; --hl-a: 0.65; }
.cv-section-heading.s-helio { --hl-rgb: 201 119 255; --hl-a: 0.55; }
.cv-section-heading.s-violet { --hl-rgb: 255 119 228; --hl-a: 0.55; }
.cv-section-heading.s-red { --hl-rgb: 255 119 146; --hl-a: 0.55; }
.cv-section-heading.s-cheese { --hl-rgb: 255 174 119; --hl-a: 0.65; }
.cv-section-heading.s-yellow { --hl-rgb: 255 255 119; --hl-a: 0.75; }
.cv-section-heading.s-mint { --hl-rgb: 119 255 228; --hl-a: 0.65; }
/* ── SUBSECTION HEADING (inside Publications) ── */
/* Deliberately quieter than .cv-section-heading: smaller, dimmer, a hairline
rule instead of the 1.5px ink-blue one, and no highlighter band — the bands
mark top-level sections, so giving one to a subsection would flatten the
hierarchy the subsections exist to create. */
.cv-subsection-heading {
font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase;
color: var(--ink-dim); padding: 10px 0 6px;
margin-top: 26px;
border-top: 1px solid var(--blue-G);
}
/* Subsection lists sit closer together than standalone sections did — the
next subsection heading supplies the separation. */
.pub-list-sub { padding-bottom: 0.5rem; }
/* ── CV ENTRIES (education, positions) ── */
.cv-content { padding: 0 2.5rem 2rem; max-width: 900px; }
.cv-entry {
display: grid;
grid-template-columns: 80px 1fr;
gap: 1rem;
padding: 1rem 0;
border-bottom: 1px solid var(--blue-G);
opacity: 0; transform: translateY(12px);
transition: opacity 0.5s ease, transform 0.5s ease;
}
.cv-entry.visible { opacity: 1; transform: translateY(0); }
.cv-entry-year {
font-size: 0.7rem; letter-spacing: 0.12em; color: var(--ink-dim);
line-height: 1.3;
}
.cv-entry-title {
font-family: var(--sans); font-size: 0.88rem; font-weight: 400;
color: var(--ink); line-height: 1.3; margin-bottom: 0.2rem;
}
.cv-entry-sub { font-size: 0.7rem; color: var(--ink-dim); line-height: 1.6; }
/* ── PUBLICATION ENTRIES ── */
.pub-list { padding: 0 2.5rem 4rem; max-width: 900px; }
.pub-footnote { font-size: 0.68rem; color: var(--ink-dim); margin-top: 1.5rem; }
.pub-entry {
display: grid;
grid-template-columns: 1fr auto;
gap: 1rem;
padding: 1.4rem 0;
border-bottom: 1px solid var(--blue-G);
opacity: 0; transform: translateY(16px);
transition: opacity 0.5s ease, transform 0.5s ease;
}
.pub-entry.visible { opacity: 1; transform: translateY(0); }
.pub-main, .pub-aside {
display: grid;
grid-template-rows: auto auto auto;
row-gap: 0.35rem;
}
.pub-main {
grid-column: 1;
/* Row 3 is the venue line. Preprints suppress it — their venue field is the
literal word "Preprint", which the subsection heading already says —
so without a floor here those entries render two lines tall and the whole
section reads tighter than the two around it. Reserve one venue line's
worth of height (its font-size x its line-height) whether or not the row
has content; rows that do have content are already at least this tall, so
nothing else moves. */
grid-template-rows: auto auto minmax(calc(0.7rem * 1.7), auto);
}
.pub-aside { grid-column: 2; text-align: right; white-space: nowrap; }
.pub-title {
font-family: var(--sans); font-size: 0.88rem; font-weight: 400;
color: var(--ink); line-height: 1.35; grid-row: 1;
}
.pub-title a {
color: inherit; text-decoration: none;
border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.pub-title a:hover { border-color: var(--ink-dim); }
.pub-authors { font-size: 0.7rem; color: var(--ink-dim); line-height: 1.6; grid-row: 2; }
.pub-authors strong { color: var(--ink); font-weight: 400; }
.pub-venue { font-size: 0.7rem; color: var(--ink-dim); grid-row: 3; align-self: end; }
.pub-venue em { font-style: normal; color: var(--ink-blue); }
.pub-venue em.venue-journal { font-style: italic; }
.pub-year { font-size: 0.7rem; letter-spacing: 0.12em; color: var(--ink-dim); grid-row: 1; align-self: start; }
.pub-type {
font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
border: 1px solid var(--ink-faint); padding: 0.12rem 0.4rem;
color: var(--ink-dim); grid-row: 2; justify-self: end; align-self: start;
}
.pub-addendum {
font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
color: var(--h-red); grid-row: 3; align-self: end; justify-self: end;
}
/* ── FULL CV LINK ── */
/* The page's primary action, so it gets the filled treatment rather than an
outline. The outlined version used a 25%-alpha border, which computes to
1.62:1 against the paper — well under the 3:1 a UI boundary needs — so the
text read fine but the button shape was close to invisible.
Hover switches to ink on slate, not paper on slate: paper on slate is
3.20:1 and fails the 4.5:1 text minimum. */
.full-cv-link {
display: inline-flex; align-items: center; gap: 0.6rem;
font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
color: var(--paper); background: var(--ink-blue);
border: 1px solid var(--ink-blue); text-decoration: none;
padding: 0.7rem 1.4rem;
margin-top: 2rem; transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.full-cv-link:hover { background: var(--h-slate); border-color: var(--h-slate); color: var(--ink); }
/* ── FOOTER ── */
footer { position: relative; z-index: 10; }
@media (max-width: 700px) {
nav { padding: 1rem 1.5rem; }
.page-header, .cv-content, .pub-list { padding-left: 1.5rem; padding-right: 1.5rem; }
.pub-entry { grid-template-columns: 1fr; }
.pub-aside { flex-direction: row; align-items: center; }
.cv-entry { grid-template-columns: 1fr; gap: 0.3rem; }
body, a, button { cursor: auto; }
.cursor { display: none; }
}
</style>
</head>
<body>
<div class="cursor" id="cursor">+</div>
<nav>
<a href="index.html" class="nav-logo">
<span class="nav-logo-hl" id="nav-logo-hl"></span>
<span class="nav-logo-text">SH</span>
</a>
<ul class="nav-links" id="nav-links">
<li><a href="index.html#about">About</a></li>
<li><a href="index.html#research">Research</a>
<div class="nav-sub-links"><a href="graph.html">Graph</a><a href="projects.html">Projects</a><a href="cv.html" class="active">CV</a></div>
</li>
<li><a href="extracurriculars.html">Extracurriculars</a></li>
<li><a href="index.html#contact">Contact</a></li>
</ul>
<button class="nav-toggle" id="nav-toggle" aria-label="Toggle menu" aria-expanded="false" aria-controls="nav-links">
<span></span><span></span><span></span>
</button>
</nav>
<div class="page-header">
<p class="page-eyebrow s-red"><span class="hl">Research</span></p>
<h1 class="page-title">Curriculum Vitae</h1>
<p class="page-meta">
<a href="cv-viewer.html">View full CV (PDF) →</a>
</p>
</div>
<!-- ── Education & Positions ── -->
<div class="cv-content">
<div class="cv-section-heading s-slate"><span class="hl">Education</span></div>
<div class="cv-entry reveal">
<span class="cv-entry-year">2008–14</span>
<div>
<div class="cv-entry-title">PhD, Computation & Neural Systems</div>
<div class="cv-entry-sub">California Institute of Technology</div>
</div>
</div>
<div class="cv-entry reveal">
<span class="cv-entry-year">2002–06</span>
<div>
<div class="cv-entry-title">BA, Psychology</div>
<div class="cv-entry-sub">Stanford University</div>
</div>
</div>
<div class="cv-section-heading s-helio"><span class="hl">Positions</span></div>
<div class="cv-entry reveal">
<span class="cv-entry-year">2021–</span>
<div>
<div class="cv-entry-title">Senior Research Scientist</div>
<div class="cv-entry-sub">Toyota Research Institute, Human-Centered AI</div>
</div>
</div>
<div class="cv-entry reveal">
<span class="cv-entry-year">2016–21</span>
<div>
<div class="cv-entry-title">Postdoctoral Scholar, Center for Cognitive Neuroscience</div>
<div class="cv-entry-sub">Duke University</div>
</div>
</div>
<div class="cv-entry reveal">
<span class="cv-entry-year">2015–16</span>
<div>
<div class="cv-entry-title">Postdoctoral Research Associate, Institute of Cognitive Science</div>
<div class="cv-entry-sub">University of Colorado, Boulder</div>
</div>
</div>
<div class="cv-entry reveal">
<span class="cv-entry-year">2013–15</span>
<div>
<div class="cv-entry-title">Data Scientist & Director, CaféWell Behavioral Labs</div>
<div class="cv-entry-sub">Welltok, Inc.</div>
</div>
</div>
</div>
<!-- ── Selected Recent Publications (populated from publications.json) ── -->
<!-- One section with subsections, mirroring the LaTeX CV's \cvsection{Publications}
and its \cvsubsection headings. The website had collapsed journals, proceedings
and preprints into a single flat list, which is where it diverged. Subsection
order follows cv.tex. Any subsection with nothing in it hides itself, which
is why Reviews/Chapters/Commentaries and Science Communication are both
here but neither is currently visible — nothing in either is tagged
`selected` today. They stay so the mirror is complete and they light up on
their own if that changes.
Conference Presentations is the one cv.tex subsection NOT mirrored here:
talks and posters are left to the full CV (Shabnam's call, 2026-10-03).
Headings drop cv.tex's "Peer-Reviewed" qualifier on purpose. It was added
back when presentations were shown — abstracts are reviewed too, so
marking only journals and proceedings implied the talks were not. With
presentations gone, Preprints are still the sole unrefereed category and
that heading already says so; the qualifier would add nothing. Don't
reinstate it from cv.tex without re-reading this. -->
<div class="cv-content">
<div class="cv-section-heading s-violet"><span class="hl">Selected Recent Publications</span></div>
</div>
<div class="cv-content"><div class="cv-subsection-heading">Journals</div></div>
<div class="pub-list pub-list-sub" id="pub-list-journals"></div>
<div class="cv-content"><div class="cv-subsection-heading">Preprints & Working Papers</div></div>
<div class="pub-list pub-list-sub" id="pub-list-preprints"></div>
<div class="cv-content"><div class="cv-subsection-heading">Conference Proceedings</div></div>
<div class="pub-list pub-list-sub" id="pub-list-proceedings"></div>
<div class="cv-content"><div class="cv-subsection-heading">Reviews, Book Chapters & Commentaries</div></div>
<div class="pub-list pub-list-sub" id="pub-list-chapters"></div>
<div class="cv-content"><div class="cv-subsection-heading">Science Communication</div></div>
<div class="pub-list pub-list-sub" id="pub-list-scicomm"></div>
<div class="cv-content" style="padding-top:0;">
<a href="cv-viewer.html" class="full-cv-link">View full CV →</a>
</div>
<footer>
<p>Shabnam Hakimi, Ph.D. — Researcher & Synthesist</p>
<p><a href="about-this-site.html">Colophon</a> · MMXXVI</p>
</footer>
<script>
// ── LOAD PUBLICATIONS ────────────────────────────────────────────
(function() {
fetch('data/publications.json')
.then(r => r.json())
.then(pubs => {
const PRESENTATION_TYPES = ['talk', 'poster', 'symposium', 'invited-talk'];
const typeLabels = {
'journal': 'Journal',
'conf-full': 'Conference',
'conf-workshop': 'Workshop',
'preprint': 'Preprint',
'commentary': 'Commentary',
'book-chapter': 'Chapter',
'scicomm': 'Sci-comm',
'talk': 'Talk',
'poster': 'Poster',
'symposium': 'Symposium',
'invited-talk': 'Invited Talk',
};
function renderPubList(list, pubs) {
// The subsection heading already names the type, so a pill repeating it
// on every row is noise. Show the pill only where the subsection holds
// more than one type and it therefore still distinguishes something —
// Conference vs Workshop, Poster vs Talk vs Symposium.
const showType = new Set(pubs.map(p => p.pubType)).size > 1;
// No year dividers inside a subsection. Every entry already prints its
// year in the aside, so a divider repeated it; worse, the divider's
// highlighter band read louder than the subsection heading above it and
// inverted the hierarchy the subsections exist to establish. Entries
// stay sorted newest-first, so the years still read down the margin.
pubs.forEach(pub => {
const entry = document.createElement('div');
entry.className = 'pub-entry reveal';
// Format authors — bold Hakimi, keep each "Last, F." together on one line,
// join with commas and an ampersand + Oxford comma before the last author.
// Co-first authors (per coFirstLastNames) get a trailing asterisk.
const coFirst = pub.coFirstLastNames || [];
const isCoFirst = last => coFirst.some(n => n.toLowerCase() === last.toLowerCase());
const authorNames = pub.authors.map(a => {
if (/hakimi/i.test(a)) {
const star = isCoFirst('Hakimi') ? '<sup>*</sup>' : '';
return star + '<strong>Hakimi, S.</strong>';
}
const parts = a.split(',');
let last, initials;
if (parts.length === 2) {
last = parts[0].trim();
const first = parts[1].trim();
initials = first.split(/\s+/).map(w => w[0] + '.').join(' ');
} else {
// Already "First Last" format
const words = a.trim().split(/\s+/);
if (words.length >= 2) {
last = words[words.length - 1];
initials = words.slice(0, -1).map(w => w[0] + '.').join(' ');
}
}
if (last === undefined) return a;
const star = isCoFirst(last) ? '<sup>*</sup>' : '';
return star + last + ', ' + initials;
}).map(name => '<span style="white-space:nowrap">' + name + '</span>');
let authors;
if (authorNames.length === 1) {
authors = authorNames[0];
} else if (authorNames.length === 2) {
authors = authorNames[0] + ' & ' + authorNames[1];
} else {
authors = authorNames.slice(0, -1).join(', ') + ', & ' + authorNames[authorNames.length - 1];
}
// Format venue
const venue = pub.venue || '';
const typeLabel = typeLabels[pub.pubType] || pub.pubType;
// Link
const linkUrl = pub.url || (pub.doi ? 'https://doi.org/' + pub.doi : '') || (pub.arxivId ? 'https://arxiv.org/abs/' + pub.arxivId : '');
entry.innerHTML =
'<div class="pub-main">' +
'<div class="pub-title">' +
(linkUrl ? '<a href="' + linkUrl + '" target="_blank" rel="noopener">' + pub.title + '</a>' : pub.title) +
'</div>' +
'<div class="pub-authors">' + authors + '</div>' +
(venue.trim().toLowerCase() === typeLabel.toLowerCase() ? '' :
'<div class="pub-venue"><em' + (pub.pubType === 'journal' ? ' class="venue-journal"' : '') + '>' + venue + '</em></div>') +
'</div>' +
'<div class="pub-aside">' +
'<span class="pub-year">' + pub.year + '</span>' +
(showType ? '<span class="pub-type">' + typeLabel + '</span>' : '') +
(pub.addendum ? '<span class="pub-addendum">' + pub.addendum + '</span>' : '') +
'</div>';
list.appendChild(entry);
});
if (pubs.some(p => p.coFirstLastNames && p.coFirstLastNames.length)) {
const footnote = document.createElement('p');
footnote.className = 'pub-footnote';
footnote.textContent = '* Authors contributed equally.';
list.appendChild(footnote);
}
}
// Talks and posters are left off this page on purpose (Shabnam's call,
// 2026-10-03) — the same exclusion index.html's recent-pubs list makes.
// They stay in publications.json and in the full CV; this is the one
// place cv.html departs from cv.tex's subsection mirror. Filtering here,
// rather than just dropping their bucket, keeps the orphan warning below
// quiet: they're excluded, not unaccounted for.
const selected = pubs.filter(p => p.keywords && p.keywords.includes('selected')
&& !PRESENTATION_TYPES.includes(p.pubType));
selected.sort((a, b) => b.year - a.year || b.paperWeight - a.paperWeight);
// Buckets mirror the LaTeX CV's \cvsubsection headings under
// \cvsection{Publications}. Keep these in step with cv.tex: the website
// previously lumped journals, proceedings and preprints into one flat
// list, which is the divergence this restores.
// ── BUCKETS (start) ──
const BUCKETS = [
{ id: 'pub-list-journals', types: ['journal'] },
{ id: 'pub-list-preprints', types: ['preprint'] },
{ id: 'pub-list-proceedings', types: ['conf-full', 'conf-workshop'] },
{ id: 'pub-list-chapters', types: ['book-chapter', 'commentary'] },
{ id: 'pub-list-scicomm', types: ['scicomm'] },
];
// ── BUCKETS (end) ──
// ── PUB-TRIM (start) ──
// This page highlights selected *recent* work; the "View full CV" links
// carry the complete record. Two bounds, whichever binds first: nothing
// older than WINDOW_YEARS, and at most MAX_ENTRIES per subsection.
//
// Both are needed, and they do different jobs. The window alone left a
// decade-old poster tail when presentations were still shown here; the
// cap alone let the page grow without limit as new work accumulated.
// Today the cap binds Preprints and Proceedings; the window is what
// keeps Journals from collapsing to the single 2026 paper.
//
// The numbers are deliberate and load-bearing, not defaults. At 5/8 the
// 2024 Best Paper Award in Proceedings fell one slot outside the cap, so
// the page showed an Honorable Mention while hiding an outright win.
// Widening to 6 years also restores the two 2021 journal papers. Changing
// either number can silently evict a paper — data/test-pub-trim.mjs
// asserts the cases that matter, so run it if you touch these.
const WINDOW_YEARS = 6;
const MAX_ENTRIES = 9;
function trimForDisplay(entries) {
if (!entries.length) return entries;
// Anchor on the newest year present rather than strictly on the
// calendar year: forthcoming work is routinely dated ahead, and a
// January rollover shouldn't quietly drop a year's worth of entries
// before anything new has replaced them. Clamped to +2 so that a single
// mistyped year (2062) can't drag the cutoff with it and empty the
// subsection of everything else, while fillSection still shows the
// heading because the list isn't technically empty.
const thisYear = new Date().getFullYear();
const newest = Math.max(...entries.map(p => p.year));
const anchor = Math.max(thisYear, Math.min(newest, thisYear + 2));
const cutoff = anchor - WINDOW_YEARS + 1;
// `entries` is already sorted newest-first, so the slice keeps the
// most recent MAX_ENTRIES.
return entries.filter(p => p.year >= cutoff).slice(0, MAX_ENTRIES);
}
// ── PUB-TRIM (end) ──
// A section with nothing in it hides its own heading too.
function fillSection(listId, entries) {
const el = document.getElementById(listId);
if (entries.length) {
renderPubList(el, entries);
} else {
el.previousElementSibling.style.display = 'none';
el.style.display = 'none';
}
}
for (const b of BUCKETS) {
fillSection(b.id, trimForDisplay(selected.filter(p => b.types.includes(p.pubType))));
}
// Nothing should fall outside the buckets. If a new pubType appears in
// the bib it would otherwise vanish from the page silently, so say so.
const bucketed = new Set(BUCKETS.flatMap(b => b.types));
const orphans = selected.filter(p => !bucketed.has(p.pubType));
if (orphans.length) {
console.warn('cv.html: selected entries with no subsection:',
[...new Set(orphans.map(p => p.pubType))].join(', '));
}
// Reveal animation
const obs = new IntersectionObserver(
entries => entries.forEach(e => {
if (e.isIntersecting) { e.target.classList.add('visible'); obs.unobserve(e.target); }
}), { threshold: 0.06 }
);
document.querySelectorAll('.reveal').forEach(el => obs.observe(el));
})
.catch(err => {
console.error('Failed to load publications:', err);
const errEl = document.getElementById('pub-list-journals');
if (errEl) errEl.innerHTML =
'<p style="padding:2rem 2.5rem;color:var(--ink-dim);font-size:0.6rem;">Publications loading failed. Ensure data/publications.json is available.</p>';
});
})();
// ── CURSOR ────────────────────────────────────────────────────────
(function() {
const cursor = document.getElementById('cursor');
document.addEventListener('mousemove', e => {
cursor.style.left = e.clientX + 'px'; cursor.style.top = e.clientY + 'px';
});
document.addEventListener('mouseover', e => {
const link = e.target.closest('a, button');
if (link) { cursor.style.transform = 'translate(-50%,-50%) scale(1.9)'; cursor.style.color = 'var(--ink-blue)'; }
else { cursor.style.transform = 'translate(-50%,-50%) scale(1)'; cursor.style.color = 'var(--ink)'; }
});
})();
// ── LOGO HIGHLIGHT CYCLE ──────────────────────────────────────────
(function() {
const COLORS = ['#FFFF77','#7777FF','#C977FF','#FF77E4','#FF7792','#FFAE77'];
let idx = 0, hovered = false, lastSwap = 0;
const hl = document.getElementById('nav-logo-hl');
const logo = document.querySelector('.nav-logo');
if (!hl || !logo) return;
hl.style.backgroundColor = COLORS[0];
logo.addEventListener('mouseenter', () => hovered = true);
logo.addEventListener('mouseleave', () => hovered = false);
function tick(ts) {
if (ts - lastSwap > (hovered ? 600 : 3000)) {
idx = (idx + 1) % COLORS.length;
hl.style.backgroundColor = COLORS[idx];
lastSwap = ts;
}
requestAnimationFrame(tick);
}
requestAnimationFrame(tick);
})();
// ── GRID SNAP ────────────────────────────────────────────────────
(function() {
const CELL = 16;
function snap() {
document.querySelectorAll('.cv-section-heading, .page-header').forEach(el => {
el.style.paddingTop = '';
const absTop = el.getBoundingClientRect().top + window.scrollY;
const rem = absTop % CELL;
if (rem > 0.5) {
const nudge = CELL - rem;
const current = parseFloat(getComputedStyle(el).paddingTop) || 0;
el.style.paddingTop = (current + nudge) + 'px';
}
});
}
window.addEventListener('load', snap);
window.addEventListener('resize', snap);
if (document.fonts) document.fonts.ready.then(snap);
})();
</script>
<script>
(function(){
var nav = document.querySelector('nav');
var toggle = document.getElementById('nav-toggle');
if (!nav || !toggle) return;
toggle.addEventListener('click', function(){
var open = nav.classList.toggle('nav-open');
toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
});
nav.querySelectorAll('.nav-links a').forEach(function(a){
a.addEventListener('click', function(){
nav.classList.remove('nav-open');
toggle.setAttribute('aria-expanded', 'false');
});
});
})();
</script>
</body>
</html>