-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresearch.html
More file actions
513 lines (463 loc) · 22.9 KB
/
Copy pathresearch.html
File metadata and controls
513 lines (463 loc) · 22.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dr. Marcus Lower | Astrophysicist</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=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--sidebar-bg: #0b0f1e;
--sidebar-border: #1e2740;
--sidebar-text: #cbd5e1;
--sidebar-muted: #64748b;
--sidebar-accent: #f0a83a;
--sidebar-link: #7eb8f7;
--page-bg: #f8f9fc;
--content-bg: #ffffff;
--text-primary: #1e293b;
--text-secondary: #475569;
--text-muted: #94a3b8;
--border: #e2e8f0;
--accent: #2563eb;
--accent-light: #eff6ff;
--accent-gold: #d97706;
--accent-gold-light: #fffbeb;
--nav-active: #1e293b;
--tag-bg: #f1f5f9;
--nav-bg: #ffffff;
--sidebar-width: 265px;
--transition-theme: background 0.0s, color 0.0s, border-color 0.0s;
}
html.dark {
--page-bg: #0b0f1e;
--content-bg: #111827;
--nav-bg: #0b0f1e;
--text-primary: #e2e8f0;
--text-secondary: #94a3b8;
--text-muted: #4e5a6e;
--border: #252b3b;
--accent: #5b9cf6;
--accent-light: #1a2540;
--accent-gold: #f0a83a;
--accent-gold-light: #1e1708;
--nav-active: #e2e8f0;
--tag-bg: #1e2435;
--sidebar-bg: #080b14;
--sidebar-border: #161c30;
--sidebar-muted: #4e5a6e;
}
html { font-family: 'Inter', system-ui, sans-serif; font-size: 15px; }
body { display: flex; flex-direction: column; min-height: 100vh; background: var(--page-bg); color: var(--text-primary); transition: var(--transition-theme); }
/* ── TOP NAV ── */
nav {
position: sticky; top: 0; z-index: 100;
background: var(--nav-bg);
border-bottom: 1px solid var(--border);
display: flex; align-items: center; justify-content: space-between;
padding: 0 1.25rem;
height: 52px;
transition: var(--transition-theme);
}
.nav-brand { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; color: var(--text-primary); text-decoration: none; letter-spacing: -0.01em; }
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-links { display: flex; gap: 0; }
.nav-links a {
font-size: 14px; font-weight: 500; color: var(--text-secondary);
text-decoration: none; padding: 0 14px; height: 52px;
display: flex; align-items: center;
border-bottom: 2px solid transparent;
transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent); border-bottom-color: var(--accent); }
/* ── LAYOUT ── */
.wrapper {
display: flex;
flex: 1;
max-width: 1100px;
margin: 0 auto;
width: 100%;
}
/* ── SIDEBAR ── */
aside {
width: var(--sidebar-width);
min-width: var(--sidebar-width);
background: var(--sidebar-bg);
color: var(--sidebar-text);
position: sticky;
top: 15px;
height: calc(120vh - 52px);
overflow-y: auto;
overflow-x: hidden;
padding: 28px 20px 32px;
display: flex;
flex-direction: column;
gap: 0;
}
#stars-canvas {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
pointer-events: none; z-index: 0;
}
.sidebar-inner { position: relative; z-index: 1; }
.avatar-wrap { text-align: center; margin-bottom: 20px; }
.avatar-img {
width: 180px; height: 180px; border-radius: 50%;
border: 2px solid var(--sidebar-border);
object-fit: cover; display: block;
margin: 0 auto 12px;
}
.sidebar-name {
font-family: 'Space Grotesk', sans-serif;
font-size: 17px; font-weight: 600; color: #e2e8f0;
line-height: 1.25;
}
.sidebar-title { font-size: 12.5px; color: var(--sidebar-muted); margin-top: 4px; line-height: 1.4; }
.sidebar-inst { font-size: 12.5px; color: var(--sidebar-accent); margin-top: 3px; font-weight: 500; }
.sidebar-divider { border: none; border-top: 1px solid var(--sidebar-border); margin: 16px 0; }
.sidebar-section { margin-bottom: 18px; }
.sidebar-section-label {
font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
color: var(--sidebar-muted); margin-bottom: 10px; font-weight: 600;
}
.sidebar-info { display: flex; flex-direction: column; gap: 8px; }
.sidebar-info a, .sidebar-info span {
display: flex; align-items: center; gap: 8px;
font-size: 12.5px; color: var(--sidebar-text);
text-decoration: none; transition: color 0.15s;
}
.sidebar-info a:hover { color: var(--sidebar-link); }
.icon-wrap {
width: 18px; height: 18px; min-width: 18px;
display: flex; align-items: center; justify-content: center;
}
.icon-wrap svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-wrap img { width: 15px; height: 15px; display: block; object-fit: contain; }
.expertise-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.etag {
font-size: 11px; padding: 3px 8px; border-radius: 20px;
background: rgba(255,255,255,0.06);
border: 1px solid rgba(255,255,255,0.1);
color: #94a3b8;
}
/* ── MAIN ── */
main {
flex: 1;
padding: 36px 40px;
max-width: 800px;
}
.section { margin-bottom: 44px; }
.section-heading {
font-family: 'Space Grotesk', sans-serif;
font-size: 22px; font-weight: 600; color: var(--text-primary);
letter-spacing: -0.02em; margin-bottom: 18px;
padding-bottom: 10px;
border-bottom: 2px solid var(--border);
}
/* ── BIO ── */
.bio-text { font-size: 15px; line-height: 1.75; color: var(--text-secondary); }
.bio-text p + p { margin-top: 14px; }
.bio-text a { color: var(--accent); text-decoration: none; }
.bio-text a:hover { text-decoration: underline; }
/* ── PAGE TABS ── */
.page-content { display: none; }
.page-content.active { display: block; }
/* ── FOOTER ── */
footer {
background: #0b0f1e; color: #475569;
text-align: center; padding: 18px;
font-size: 12.5px; border-top: 1px solid #1e2740;
}
footer a { color: #7eb8f7; text-decoration: none; }
html.dark footer { background: #080b14; border-top-color: #161c30; }
/* ── THEME TOGGLE ── */
.theme-toggle {
display: flex; align-items: center; justify-content: center;
width: 34px; height: 34px; border-radius: 8px;
background: none; border: 1px solid var(--border);
cursor: pointer; color: var(--text-secondary);
transition: background 0.15s, border-color 0.15s, color 0.15s;
flex-shrink: 0;
}
.theme-toggle:hover { background: var(--tag-bg); color: var(--text-primary); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* ── HAMBURGER ── */
.hamburger {
display: none;
flex-direction: column; justify-content: center; align-items: center;
gap: 5px; width: 34px; height: 34px; border-radius: 8px;
background: none; border: 1px solid var(--border);
cursor: pointer; padding: 0; flex-shrink: 0;
transition: background 0.15s;
}
.hamburger:hover { background: var(--tag-bg); }
.hamburger span {
display: block; width: 16px; height: 1.5px;
background: var(--text-secondary); border-radius: 2px;
transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-dropdown {
display: none;
position: absolute; top: 52px; left: 0; right: 0;
background: var(--nav-bg);
border-bottom: 1px solid var(--border);
flex-direction: column;
z-index: 99;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nav-dropdown.open { display: flex; }
.nav-dropdown a {
font-size: 14px; font-weight: 500; color: var(--text-secondary);
text-decoration: none; padding: 13px 20px;
border-bottom: 1px solid var(--border);
transition: background 0.12s, color 0.12s;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: var(--tag-bg); color: var(--text-primary); }
.nav-dropdown a.active { color: var(--accent); background: var(--accent-light); }
/* ── RESPONSIVE ── */
@media (max-width: 820px) {
.wrapper { flex-direction: column; }
aside { position: static; width: 100%; min-width: unset; height: auto; padding: 20px; }
main { padding: 20px; }
nav { position: relative; } /* ← new: anchors the dropdown */
.nav-links{ display: none; } /* ← new: hides desktop tabs */
.hamburger{ display: flex; } /* ← new: shows burger button */
.contact-grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<!-- TOP NAV -->
<nav>
<a href="index.html" class="nav-brand">Marcus Lower</a>
<div class="nav-right">
<div class="nav-links">
<a href="index.html" onclick="return showPage('about',this)">About</a>
<a href="research.html" class="active" onclick="return showPage('research',this)">My Research</a>
<a href="collaborations.html" onclick="return showPage('collaborations',this)">Collaborations</a>
<a href="publications.html" onclick="return showPage('publications',this)">Publications</a>
<a href="software.html" onclick="return showPage('software',this)">Software</a>
<a href="talks.html" onclick="return showPage('talks',this)">Talks</a>
<a href="group.html" onclick="return showPage('group',this)">Group</a>
<a href="cv.html" onclick="return showPage('cv',this)">CV</a>
<!-- <a href="#" onclick="return showPage('contact',this)">Contact</a> -->
</div>
<button class="theme-toggle" id="theme-btn" aria-label="Toggle dark mode" onclick="toggleTheme()">
<svg id="icon-sun" viewBox="0 0 24 24" style="display:none"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
<svg id="icon-moon" viewBox="0 0 24 24"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
</button>
<button class="hamburger" id="hamburger" aria-label="Open menu" onclick="toggleMenu()">
<span></span><span></span><span></span>
</button>
</div>
</nav>
<!-- MOBILE DROPDOWN -->
<div class="nav-dropdown" id="nav-dropdown">
<a href="index.html" onclick="return mobileNav('about',this)">About</a>
<a href="research.html" class="active" onclick="return mobileNav('research',this)">My Research</a>
<a href="collaborations.html" onclick="return mobileNav('collaborations',this)">Collaborations</a>
<a href="publications.html" onclick="return mobileNav('publications',this)">Publications</a>
<a href="software.html" onclick="return mobileNav('software',this)">Software</a>
<a href="talks.html" onclick="return mobileNav('talks',this)">Talks</a>
<a href="group.html" onclick="return mobileNav('group',this)">Group</a>
<a href="cv.html" onclick="return mobileNav('cv',this)">CV</a>
</div>
<div class="wrapper">
<!-- SIDEBAR -->
<aside style="position:relative;">
<canvas id="stars-canvas"></canvas>
<div class="sidebar-inner">
<div class="avatar-wrap">
<img src="Photos/bio.jpg" alt="Dr. Marcus Lower" class="avatar-img" />
<div class="sidebar-name">Dr. Marcus Lower</div>
<div class="sidebar-title">ARC DECRA Fellow | Astrophysicist</div>
<div class="sidebar-inst"><a href="https://www.swinburne.edu.au/" style="color: #f0a83a;">Swinburne University of Technology</a></div>
</div>
<hr class="sidebar-divider">
<div class="sidebar-section">
<div class="sidebar-section-label">Contact</div>
<div class="sidebar-info">
<a href="mailto:mlower@swin.edu.au">
<span class="icon-wrap"><svg viewBox="0 0 24 24"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="m2 7 10 7 10-7"/></svg></span>
mlower@swin.edu.au
</a>
<a href="https://www.github.com/mlower">
<span class="icon-wrap"><svg viewBox="0 0 24 24"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg></span>
github.com/mlower
</a>
<a href="https://www.linkedin.com/in/marcus-lower-864a40272/">
<span class="icon-wrap"><svg viewBox="0 0 24 24"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect x="2" y="9" width="4" height="12"/><circle cx="4" cy="4" r="2"/></svg></span>
LinkedIn
</a>
<a href="https://bsky.app/profile/astromelow.bsky.social" target="_blank" rel="noopener">
<span class="icon-wrap">
<img src="https://upload.wikimedia.org/wikipedia/commons/7/7a/Bluesky_Logo.svg" alt="Bluesky" />
</span>
Bluesky
</a>
</div>
</div>
<hr class="sidebar-divider">
<div class="sidebar-section">
<div class="sidebar-section-label">Location</div>
<div class="sidebar-info">
<span>
<span class="icon-wrap"><svg viewBox="0 0 24 24"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z"/><circle cx="12" cy="9" r="2.5"/></svg></span>
<a href="https://en.wikipedia.org/wiki/Melbourne">Melbourne, VIC, Australia</a>
</span>
</div>
</div>
<hr class="sidebar-divider">
<div class="sidebar-section">
<div class="sidebar-section-label">Research Interests</div>
<div class="expertise-tags">
<span class="etag">Pulsars</span>
<span class="etag">Magnetars</span>
<span class="etag">Polarimetry</span>
<span class="etag">Fast radio bursts</span>
<span class="etag">Relativity</span>
<span class="etag">Gravitational waves</span>
</div>
</div>
<hr class="sidebar-divider">
<div class="sidebar-section">
<div class="sidebar-section-label">Metrics</div>
<div class="sidebar-info" style="gap:6px;">
<span style="justify-content:space-between;"><span>Publications</span><span style="color:#f0a83a;font-weight:600;">92</span></span>
<span style="justify-content:space-between;"><span>Citations</span><span style="color:#f0a83a;font-weight:600;">17,231</span></span>
<span style="justify-content:space-between;"><span>h-index</span><span style="color:#f0a83a;font-weight:600;">45</span></span>
<a href="https://ui.adsabs.harvard.edu/search/filter_property_fq_property=AND&filter_property_fq_property=property%3A%22refereed%22&fq=%7B!type%3Daqp%20v%3D%24fq_property%7D&fq_property=(property%3A%22refereed%22)&p_=0&q=%20author%3A%22Lower%2C%20Marcus%20E%22&sort=date%20desc%2C%20bibcode%20desc" style="color:var(--sidebar-link);font-size:11.5px;justify-content:flex-start;">NASA/ADS ↗</a>
</div>
</div>
</div>
</aside>
<!-- MAIN CONTENT -->
<main>
<!-- MY RESEARCH -->
<div id="page-research" class="page-content active">
<div class="section">
<h1 class="section-heading">My research</h1>
<div class="bio-text">
<figure>
<img src="./Photos/parkes_photo.jpg" alt="" width="100%" />
<figcaption style="font-size: 10px;">Visiting Murriyang, the Parkes Radio Telescope, in October 2019. Photo credit: Laura Sizer.</figcaption>
</figure>
<br>
<h2 style="font-size:18px;color:var(--accent);margin-bottom:12px;">Neutron stars and pulsar timing</h2>
<p>Stars with that have masses greater than about 8 times that of our Sun will end their lives in core-collapse supernovae. One of the potential remnants of these explosions is a neutron star, incredibly dense and compact objects host to extremely strong magnetic and gravitational fields. Some spinning neutron stars have be observed to emit beams of electromagnetic radiation from along their magnetic poles which we observe as periodic flashes of light. These neutron stars are referred to as pulsars
<p>By precisely measuring the arrival time of these light pulses we can learn a swath of information about the properties of pulsars, attempt to detect gravitational waves originating from supermassive black holes, and undertake the some of the most precise tests of General Relativity.</p>
<p>Some pulsars have been observed to undergo sudden spin-up events, resulting in deviations in their measured pulse arrival times. These "glitches" in the pulsar spin are thought to arise either from a star-quake in the neutron star crust, or from coupling between the crust and superfluid interior of the star. Measurements of these glitches allow us to probe how matter behaves at the ultra-high densities that exist inside neutron stars.</p>
<p>In order to understand the global, population-level properties of pulsars, we must observe large samples of them. This is where the 'Parkes Young Pulsar Array' (P574) project comes in. By monitoring 270 pulsars over many years (some even back to the 1990s!), we have been able to learn a swathe of information about how their spin evolves with time, and even use them as tools to study the ionised gas that permeates the Galaxy. I am also involved in the 'Thousand Pulsar Array' project that operates on the MeerKAT telescope.</p>
<br>
<h2 style="font-size:18px;color:var(--accent);margin-bottom:12px;">Magnetars</h2>
<p>Magnetars are a class of slowly rotating neutron stars which posses the most powerful magnetic fields in the known universe. Many of these objects have been observed to emit extremely energetic x-ray and gamma-ray bursts. Of the 24 known magentars (see: <a href="http://www.physics.mcgill.ca/~pulsar/magnetar/main.html" target="_blank">the McGill magnetar catalogue</a>), we have only ever observed 5 that emit pulsed radio emission similar to pulsars. These "radio loud" magnetars display large variations in their brightness and rotational stability over times, in addition to emitting remarkable millisecond-in-width spikes in their single-pulses.</p>
<p>Four such radio-loud magnetars are actively the careful watch of the Parkes Magnetar Monitoring Programme (P885). By studiously tracking their rotational and emissive properties, this project has uncovered several new and surprising behaviours in these extreme objects. This includes rare propagation effects in their magnetic fields, and sudden suppression of their radio emission.</p>
<br>
<h2 style="font-size:18px;color:var(--accent);margin-bottom:12px;">Galactic fast radio burst analogues</h2>
<p>Fast radio bursts (or "FRBs" for short) are brief, millisecond-duration flashes of radio waves that have been detected from distant galaxies. Despite first being identified in 2007, exactly how and where FRBs are produced remains a cosmic mystery. However, recent advances in the 2020s suggest that a significant fraction of FRBs are caused by magnetic explosions around magnetars. Several repeating sourcs of FRBs have also displayed some unusual behaviours that could indicate their progenitor objects reside in orbit around a star of some kind.</p>
<p>Determining exactly how FRBs are produced, and what sort of objects/systems they come from is challenging. The distances to them makes imaging the individual objects that cause FRBs extremely difficult, even those that come from nearby galaxies. However, there are several objects within our own Galaxy that we can use as proxies to better understand the astrophysics of FRBs. These include radio-emitting magnetars, for which one has been seen to emit extremely luminous radio bursts similar to geneuine FRBs, and pulsars that orbit main-sequence stars.</p>
</div>
</div>
</div>
</main>
</div>
<footer>
<p>Dr. Marcus Lower · Centre for Astrophysics and Supercomputing, Swinburne University of Technology · Last updated June 2026 · Built with <a href="https://academicpages.github.io/">Academicpages</a></p>
</footer>
<script>
function toggleMenu() {
var btn = document.getElementById('hamburger');
var dropdown = document.getElementById('nav-dropdown');
btn.classList.toggle('open');
dropdown.classList.toggle('open');
}
function mobileNav(id, el) {
showPage(id, null);
document.querySelectorAll('.nav-links a').forEach(function(a) { a.classList.remove('active'); });
document.querySelectorAll('.nav-dropdown a').forEach(function(a) { a.classList.remove('active'); });
if (el) el.classList.add('active');
document.getElementById('hamburger').classList.remove('open');
document.getElementById('nav-dropdown').classList.remove('open');
return false;
}
function showPage(id, el) {
document.querySelectorAll('.page-content').forEach(function(p) { p.classList.remove('active'); });
document.getElementById('page-' + id).classList.add('active');
document.querySelectorAll('.nav-links a').forEach(function(a) { a.classList.remove('active'); });
if (el) el.classList.add('active');
return false;
}
function applyTheme(dark) {
document.documentElement.classList.toggle('dark', dark);
var sun = document.getElementById('icon-sun');
var moon = document.getElementById('icon-moon');
if (sun && moon) {
sun.style.display = dark ? 'block' : 'none';
moon.style.display = dark ? 'none' : 'block';
}
}
function toggleTheme() {
var isDark = document.documentElement.classList.contains('dark');
var next = !isDark;
applyTheme(next);
try { localStorage.setItem('theme', next ? 'dark' : 'light'); } catch(e) {}
}
(function() {
var saved;
try { saved = localStorage.getItem('theme'); } catch(e) {}
var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
applyTheme(saved === 'dark' || (!saved && prefersDark));
})();
// Animated star field on sidebar canvas
(function() {
var canvas = document.getElementById('stars-canvas');
if (!canvas) return;
var ctx = canvas.getContext('2d');
var stars = [], W, H, raf;
function resize() {
W = canvas.width = canvas.offsetWidth;
H = canvas.height = canvas.offsetHeight;
}
function initStars(n) {
stars = [];
for (var i = 0; i < n; i++) {
stars.push({
x: Math.random() * W,
y: Math.random() * H,
r: Math.random() * 1.2 + 0.2,
alpha: Math.random() * 0.7 + 0.1,
speed: Math.random() * 0.0000017 + 0.0000005,
phase: Math.random() * Math.PI * 2
});
}
}
function draw(t) {
ctx.clearRect(0, 0, W, H);
stars.forEach(function(s) {
var a = s.alpha * (0.5 + 0.5 * Math.sin(t * s.speed * 1000 + s.phase));
ctx.beginPath();
ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(200, 220, 255, ' + a + ')';
ctx.fill();
});
raf = requestAnimationFrame(draw);
}
function start() {
resize();
initStars(120);
if (raf) cancelAnimationFrame(raf);
requestAnimationFrame(draw);
}
start();
window.addEventListener('resize', function() { start(); });
})();
</script>
</body>
</html>