:root {
  --background: #fafafa;
  --surface: #fff;
  --text: #2c2c2c;
  --muted: #555;
  --accent: #176b91;
  --border: #e0e0e0;
  --subtle: #f0f0f0;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 100px; scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--background); color: var(--text); font: 16px/1.7 var(--font); }
/* Telescope photograph with a light veil for readable content on every page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgb(250 250 250 / 74%), rgb(250 250 250 / 82%)),
    url('assets/telescope-background.jpg') center center / cover no-repeat;
}
body { isolation: isolate; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 2.6rem; font-weight: 500; line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 1.65rem; font-weight: 450; line-height: 1.35; letter-spacing: -.025em; }
h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.5; }
strong { font-weight: 600; }
.muted, .date-label { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 8px 16px; background: var(--text); color: white; }
.skip-link:focus { top: 8px; }

/* Shared navigation: real page links and a persistent current-page indicator. */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); box-shadow: 0 2px 6px #0000000c; border-bottom: 1px solid #e9e9e9; }
.header-inner { width: min(1240px, calc(100% - 80px)); min-height: 74px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.site-name { color: var(--text); font-size: 1.5rem; font-weight: 700; letter-spacing: -.035em; white-space: nowrap; }
.site-name:hover { text-decoration: none; }
#navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 26px; }
#navigation a { color: #3e4c59; font-size: .9375rem; padding: 24px 0 21px; border-bottom: 3px solid transparent; }
#navigation a:hover { color: var(--accent); text-decoration: none; }
#navigation a[aria-current=page] { color: var(--accent); border-bottom-color: var(--accent); }
.menu-toggle { display: none; align-items: center; gap: 9px; color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; font-size: .875rem; }
.site-footer { width: min(960px, calc(100% - 48px)); margin: auto auto 0; padding: 24px 0; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: .8125rem; }
.site-footer>div { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.inner-page .site-footer { border-top: 1px solid var(--border); }

/* Quiet, compact profile homepage, inspired by the supplied Hafner reference. */
.home-page { background: #f5f5f5; }
.home-main { width: min(760px, calc(100% - 48px)); margin: auto; padding: 70px 0 76px; }
.profile-photo { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; margin-bottom: 23px; }
.profile h1 { font-size: 2.55rem; font-weight: 700; letter-spacing: -.04em; }
.profile-role { color: var(--muted); margin: 7px 0 21px; font-size: .9375rem; }
.profile-intro { font-size: 1rem; line-height: 1.75; }
.profile-intro p+p { margin-top: 13px; }
.profile-intro a { color: var(--text); text-decoration: underline; text-decoration-color: #a8a8a8; }
.profile-intro a:hover { color: var(--accent); }
.profile-socials { display: flex; gap: 15px; margin: 20px 0 23px; }
.profile-socials a { display: grid; place-items: center; width: 30px; height: 32px; color: var(--text); }
.profile-socials a:hover { color: var(--accent); text-decoration: none; }
.profile-socials svg { width: 26px; height: 26px; stroke-width: 1.8; }
.orcid-icon { display: grid; place-items: center; width: 25px; height: 25px; background: currentColor; border-radius: 50%; font-size: 0; }
.orcid-icon::after { content: 'iD'; font-size: 15px; line-height: 1; font-weight: 600; color: var(--background); }
.profile-links { display: flex; flex-wrap: wrap; gap: 12px; }
.profile-links a { color: var(--text); background: #e7e7e7; border: 1px solid #dedede; border-radius: 5px; padding: 5px 14px; font-size: .9375rem; transition: background .15s; }
.profile-links a:hover { background: #dcdcdc; text-decoration: none; }
.home-page .site-footer { width: min(760px, calc(100% - 48px)); }

/* Shared academic page layout. */
.page-content { width: min(960px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 72px; flex: 1; }
.page-heading { margin-bottom: 36px; }
.page-heading h1 { margin-bottom: 10px; }
.page-heading p { color: var(--muted); }
.heading-with-action { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.prose { max-width: 780px; }
.prose p+p { margin-top: 18px; }
.prose .inline-link { display: inline-block; margin-top: 16px; }
.content-section { margin: 46px 0 34px; }
.content-section>h2 { margin-bottom: 22px; }
.section-intro { color: var(--muted); margin: -7px 0 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; border: 1px solid #b9c7ce; border-radius: 4px; background: transparent; color: var(--accent); padding: 9px 16px; font-size: .875rem; white-space: nowrap; }
.button:hover { background: #edf3f6; text-decoration: none; }
.inline-link { font-size: .9375rem; }
.bio-layout { display: grid; grid-template-columns: 1fr 220px; gap: 52px; }
.bio-aside img { width: 220px; border-radius: 4px; }
.bio-aside p { font-size: .8125rem; color: var(--muted); margin-top: 13px; }
.timeline-row { display: grid; grid-template-columns: 155px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--border); }
.date-label { font-size: .875rem; }
.timeline-row h3 { margin-bottom: 5px; }
.timeline-row .muted { margin-top: 5px; font-size: .875rem; }
.research-topic { display: grid; grid-template-columns: 45px 1fr; gap: 20px; padding: 32px 0; border-bottom: 1px solid var(--border); }
.research-topic:first-of-type { margin-top: 18px; }
.topic-number { padding-top: 6px; color: #8a8a8a; font-size: .875rem; }
.research-topic h2 { margin-bottom: 15px; font-size: 1.4rem; }
.research-topic p { max-width: 800px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags span { font-size: .8125rem; color: var(--muted); padding: 2px 9px; border: 1px solid var(--border); border-radius: 4px; }
.instrument-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 25px; }
.instrument-grid article { padding-left: 18px; border-left: 2px solid var(--border); }
.instrument-grid h3 { margin-bottom: 4px; }
.instrument-grid .muted { margin-top: 10px; font-size: .875rem; }

/* Searchable, fully pre-rendered publication records. */
.publication-overview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin: 0 0 22px; font-size: .875rem; }
.publication-overview p { color: var(--muted); }
.publication-overview strong { color: var(--text); }
.publication-overview p>span { margin: 0 10px; }
.publication-controls { display: flex; gap: 14px; }
.search-field { display: flex; flex: 1; min-width: 0; align-items: center; gap: 12px; padding: 0 15px; border: 1px solid #ccc; border-radius: 4px; background: var(--surface); }
.search-field svg { color: var(--muted); }
.search-field input { min-width: 0; width: 100%; padding: 12px 0; background: transparent; color: var(--text); border: 0; font-size: 1rem; }
.search-field input:focus { outline: none; }
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.year-filter select { height: 100%; min-height: 50px; border: 1px solid #ccc; border-radius: 4px; padding: 0 15px; background: var(--surface); color: var(--text); font-size: .9375rem; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0 8px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-buttons button { color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 6px 10px; font-size: .875rem; }
.filter-buttons button:hover { background: var(--subtle); }
.filter-buttons button[aria-pressed=true] { background: #e8eef2; color: #155d7c; }
#publication-count { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.publication { display: grid; grid-template-columns: 65px minmax(0,1fr); gap: 25px; padding: 27px 0; border-bottom: 1px solid var(--border); }
.publication-year { color: #828282; font-size: 1.125rem; line-height: 1.5; }
.publication h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; line-height: 1.5; margin-bottom: 7px; }
.publication h2 a { color: var(--text); }
.publication h2 a:hover { color: var(--accent); }
.publication-authors { color: var(--muted); font-size: .875rem; margin-bottom: 4px; }
.publication-authors strong { color: var(--text); }
.publication-venue { font-size: .875rem; font-style: italic; color: var(--muted); }
.publication-meta { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.publication-badge { font-size: .75rem; color: #52666c; background: #edf1f2; padding: 1px 7px; border: 1px solid #dfe6e8; border-radius: 3px; }
.publication-badge.progress { background: #f6f0e4; border-color: #e8ddc7; color: #756134; }
.paper-link { font-size: .8125rem; }
.paper-link span { margin-left: 4px; }
.publication-note, .notice { color: var(--muted); font-size: .8125rem; margin-top: 25px; }
.empty-state { text-align: center; padding: 55px 20px; }
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { color: var(--muted); margin: 10px 0 20px; }

/* Media and repository pages take their restrained card layout from al-folio. */
.media-card { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 30px; padding: 30px 0; border-top: 1px solid var(--border); }
.media-card time { color: var(--muted); font-size: .875rem; padding-top: 2px; }
.media-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; color: var(--muted); font-size: .8125rem; margin-bottom: 12px; }
.media-meta>span:first-child { border: 1px solid var(--border); border-radius: 3px; padding: 1px 7px; }
.media-card h3 { font-size: 1.5rem; margin-bottom: 16px; }
.media-card p { margin-bottom: 18px; }
.github-profile { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 21px; border: 1px solid var(--border); border-radius: 5px; color: var(--text); background: var(--surface); }
.github-profile:hover { border-color: #b5c2c8; text-decoration: none; }
.github-profile img { width: 64px; height: 64px; border-radius: 50%; }
.github-profile strong { display: block; font-size: 1.125rem; }
.github-profile div>span { display: block; color: var(--muted); font-size: .875rem; }
.profile-link-label { font-size: .875rem; color: var(--accent); margin-left: auto; white-space: nowrap; }
.repository-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.repository-card { padding: 23px; background: var(--surface); border: 1px solid #d2d2d2; border-radius: 5px; display: flex; flex-direction: column; }
.repo-heading { display: flex; align-items: flex-start; gap: 10px; }
.repo-heading svg { margin-top: 3px; color: var(--muted); }
.repo-heading h3 { font-size: 1rem; overflow-wrap: anywhere; }
.repository-card>p { font-size: .875rem; color: var(--muted); line-height: 1.7; margin: 15px 0 25px; }
.repo-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: .75rem; margin-top: auto; }
.repo-meta>span:last-child { margin-left: auto; }
.language-dot { width: 10px; height: 10px; border-radius: 50%; }
.python { background: #3572a5; }
.notebook { background: #da5b0b; }

/* CV and contact. */
.cv-section { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 35px; padding: 28px 0; border-top: 1px solid var(--border); }
.cv-section>h2 { font-size: 1.15rem; font-weight: 500; }
.cv-section h3 { margin-bottom: 4px; }
.cv-section p { font-size: .9375rem; }
.cv-section p.muted { font-size: .875rem; margin-top: 5px; }
.cv-entry+.cv-entry { margin-top: 24px; }
.cv-entry .date-label { display: block; margin-bottom: 5px; font-size: .8125rem; }
.skill-list>div+div { margin-top: 22px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px 60px; border-top: 1px solid var(--border); padding-top: 32px; }
.contact-grid h2 { font-size: 1.3rem; margin-bottom: 17px; }
.contact-email { font-size: 1.25rem; overflow-wrap: anywhere; }
.contact-grid .muted { font-size: .875rem; margin-top: 8px; }
address { font-style: normal; line-height: 1.9; }
.contact-links { list-style: none; margin: 0; padding: 0; }
.contact-links li+li { margin-top: 12px; }
.contact-links a { display: inline-flex; gap: 20px; flex-wrap: wrap; }
.contact-links span { font-size: .875rem; color: var(--muted); }

@media (max-width: 1100px) {
  .header-inner { width: calc(100% - 48px); gap: 25px; }
  #navigation { gap: 19px; }
  #navigation a { font-size: .875rem; }
}
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; min-height: 70px; padding: 14px 0; gap: 12px; }
  .js .menu-toggle { display: inline-flex; }
  #navigation { width: 100%; gap: 3px 20px; }
  #navigation a { padding: 9px 0; }
  .js #navigation { display: none; }
  .js #navigation.is-open { display: flex; }
  .site-name { font-size: 1.4rem; }
  .home-main { padding-block: 55px; }
  .bio-layout { grid-template-columns: minmax(0,1fr) 180px; gap: 30px; }
  .filter-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .github-profile { flex-wrap: wrap; }
  .profile-link-label { margin-left: 0; }
}
@media (max-width: 600px) {
  .header-inner, .page-content, .home-main, .site-footer, .home-page .site-footer { width: calc(100% - 40px); }
  h1 { font-size: 2.15rem; }
  h2 { font-size: 1.45rem; }
  .home-main { padding: 45px 0 60px; }
  .profile-photo { width: 150px; height: 150px; margin-bottom: 23px; }
  .profile h1 { font-size: 2.2rem; }
  .profile-role { font-size: .875rem; margin-bottom: 18px; }
  .profile-intro { font-size: .9375rem; line-height: 1.8; }
  .profile-links { gap: 9px; }
  .profile-links a { padding: 6px 11px; font-size: .875rem; }
  .page-content { padding-block: 37px 52px; }
  .page-heading { margin-bottom: 28px; }
  .page-heading p { font-size: .9375rem; }
  .site-footer { flex-direction: column; gap: 9px; padding: 20px 0; font-size: .75rem; }
  .site-footer>div { gap: 15px; }
  .footer-location { margin-left: auto; }
  .bio-layout { grid-template-columns: minmax(0,1fr); }
  .bio-aside { display: flex; gap: 18px; align-items: center; }
  .bio-aside img { width: 100px; border-radius: 50%; }
  .bio-aside p { margin: 0; }
  .content-section { margin-block: 35px 28px; }
  .timeline-row { grid-template-columns: 1fr; gap: 6px; }
  .research-topic { grid-template-columns: 25px minmax(0,1fr); gap: 13px; padding-block: 26px; }
  .research-topic h2 { font-size: 1.25rem; }
  .research-topic p { overflow-wrap: anywhere; font-size: .9375rem; }
  .instrument-grid { grid-template-columns: 1fr; gap: 25px; }
  .publication-overview { font-size: .8125rem; gap: 8px; }
  .publication-overview p>span { margin-inline: 5px; }
  .publication-controls { gap: 9px; }
  .search-field { padding-inline: 10px; gap: 8px; }
  .year-filter select { width: 107px; padding-inline: 8px; font-size: .875rem; }
  .filter-buttons { gap: 4px; }
  .filter-buttons button { padding: 7px 8px; }
  .publication { grid-template-columns: 1fr; gap: 8px; padding-block: 24px; }
  .publication-year { font-size: .875rem; }
  .publication h2 { font-size: 1rem; overflow-wrap: anywhere; }
  .publication-authors, .publication-venue { font-size: .875rem; }
  .media-card { grid-template-columns: 1fr; gap: 14px; padding-block: 24px; }
  .media-card h3 { font-size: 1.35rem; }
  .github-profile { padding: 17px; gap: 12px; }
  .github-profile img { width: 50px; height: 50px; }
  .github-profile>div { flex: 1; min-width: 0; }
  .github-profile div>span { font-size: .8125rem; }
  .profile-link-label { flex-basis: 100%; }
  .repository-grid { grid-template-columns: 1fr; }
  .repository-card { padding: 20px; }
  .heading-with-action { align-items: flex-start; flex-direction: column; gap: 20px; }
  .cv-section { grid-template-columns: 1fr; gap: 19px; }
  .cv-section>h2 { color: var(--accent); }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .skip-link, .profile-socials, .profile-links, .publication-controls, .filter-row, .button, .paper-link { display: none !important; }
  body::before { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  .page-content, .home-main { width: 100%; padding: 0; }
  .publication[hidden] { display: grid !important; }
  .empty-state { display: none !important; }
  .publication, .repository-card, .cv-entry { break-inside: avoid; }
  a { color: black; }
  h1 { font-size: 24pt; }
}

/* Combined media coverage and outreach. */
.media-section + .media-section { margin-top: 38px; }
.media-section > h2 { margin-bottom: 22px; }
.media-card h3 { font-weight: 500; line-height: 1.4; }
.media-detail { display: flex; gap: 24px; align-items: flex-start; }
.media-card > div { min-width: 0; }
.media-detail > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.video-preview { display: block; position: relative; flex: 0 0 260px; width: 260px; max-width: 100%; overflow: hidden; border-radius: 4px; border: 1px solid var(--border); background: #222; }
.video-preview img { display: block; width: 100%; height: 200px; object-fit: contain; background: #fff; }
.video-preview > span:not(.media-image-frame) { display: block; padding: 7px 10px; color: white; background: #222; text-align: center; font-size: .8125rem; }
.video-preview:hover { text-decoration: none; outline: 2px solid var(--accent); }
@media (max-width: 700px) {
  .media-detail { flex-direction: column; }
  .video-preview { flex: auto; width: 260px; max-width: 100%; }
}

.research-figure { flex: 0 0 260px; width: 260px; max-width: 100%; min-width: 0; margin: 0; }
.research-figure > a { display: block; }
.research-figure img { display: block; box-sizing: border-box; width: 100%; height: 200px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 4px; }
.research-figure figcaption { margin-top: 8px; font-size: .75rem; line-height: 1.5; color: var(--muted); }
@media (max-width: 700px) {
  .research-figure { flex: auto; width: 260px; max-width: 100%; }
}

/* One fixed viewport shared by research figures and video thumbnails. */
.media-image-frame {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 260px;
  max-width: 100%;
  height: 200px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.media-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
}
