/* Shared type and color system. All assets are served locally. */
@font-face {
  font-family: Merriweather;
  src: url('font-0.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Merriweather;
  src: url('font-1.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: SourceSans;
  src: url('font-2.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: SourceSans;
  src: url('font-3.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --paper: #111614;
  --ink: #f1f0e9;
  --body: #cdd5cf;
  --muted: #9caaa1;
  --accent: #96d6b5;
  --line: #303c35;
  --soft: #19211c;
  --raised: #202b24;
  --ambient: #87c9a50a;
  --header-bg: #111614ed;
  --code-ink: #cdd5cf;
  --code-keyword: #a8d8f0;
  --code-string: #baddb0;
  --code-number: #e6c18c;
  --code-comment: #a1afa6;
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--body);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--soft);
  --bs-tertiary-bg: var(--soft);
  --bs-border-color: var(--line);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--ink);
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f6f4ef;
  --ink: #202a24;
  --body: #3c4840;
  --muted: #606e64;
  --accent: #256348;
  --line: #d8ded5;
  --soft: #eeeee7;
  --raised: #e5e9de;
  --ambient: #4e89500a;
  --header-bg: #f6f4efed;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: radial-gradient(ellipse 900px 650px at 90% 0, var(--ambient), transparent 75%), var(--paper);
  color: var(--body);
  font: 17px/1.6 SourceSans, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
::selection { background: var(--accent); color: var(--paper); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  color: var(--ink);
  font-family: Merriweather, Georgia, serif;
  font-weight: 400;
  line-height: 1.35;
}
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.8px; margin: 0 0 10px; }
h2 { font-size: 24px; margin: 0 0 22px; }
h3 { font: 600 19px/1.45 SourceSans, 'Segoe UI', sans-serif; margin: 0 0 12px; }
p { margin: 0 0 16px; }
figure { margin: 0; }
.wrap { width: min(1000px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; top: -100px; z-index: 2; }
.skip:focus { top: 12px; left: 12px; background: var(--paper); padding: 12px; }

/* Quiet navigation with a clear home link and language choice. */
.header { background: var(--header-bg); border-bottom: 1px solid var(--line); }
.header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
}
.brand { font: 600 15px/1.4 ui-monospace, 'SFMono-Regular', Consolas, monospace; white-space: nowrap; color: var(--ink); text-decoration: none; }
.brand::after { content: '.'; color: var(--accent); }
.nav { display: flex; align-items: center; font-size: 14px; margin-left: auto; flex-shrink: 0; }
.nav > a { color: var(--muted); padding-block: 8px; text-decoration: none; }
.nav > a + a { margin-left: 21px; }
.nav > a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.header-tools { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.theme-toggle { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; padding: 10px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--body); }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--raised); border-color: var(--accent); color: var(--ink); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-moon, [data-theme="light"] .theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: block; }
.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  margin-left: 0;
  flex-shrink: 0;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.lang a { color: var(--muted); min-width: 32px; padding: 5px; text-align: center; text-decoration: none; font-size: 13px; border-radius: 4px; }
.lang [aria-current] { color: var(--ink); font-weight: 600; background: var(--raised); }

/* Profile: preserve the introduction, give it more room to breathe. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px;
  align-items: center;
  gap: 64px;
  padding: 64px 0 58px;
}
.hero h1 { font-size: clamp(32px, 3.2vw, 42px); line-height: 1.3; margin-bottom: 14px; letter-spacing: -1.1px; }
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}
.location { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.hero .intro { font-size: 18px; line-height: 1.65; max-width: 650px; margin-bottom: 19px; }
.hero .email-line { font-size: 15px; margin: 0 0 9px; overflow-wrap: anywhere; }
.portrait-frame { width: 174px; margin-top: 0; padding: 7px; border: 1px solid var(--line); border-radius: 50%; }
.portrait { width: 158px; height: 158px; object-fit: cover; border-radius: 50%; }
.social { display: flex; flex-wrap: wrap; gap: 5px 19px; font-size: 14px; }
.profile-links { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 17px; font-size: 15px; }
.profile-links a { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); text-decoration: none; background: var(--soft); }
.profile-links a:first-child { color: var(--paper); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.profile-links a:hover { border-color: var(--accent); text-decoration: underline; }
.text-link { display: inline-block; }
.text-link span { margin-left: 5px; }

/* Original project evidence, circular crops and editorial rows. */
.section { padding: 36px 0; }
#projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; border-top: 1px solid var(--line); padding-top: 38px; padding-bottom: 28px; }
#projects > .section-head, #projects > .institution { grid-column: 1 / -1; }
.section-head h2 { margin-bottom: 14px; }
#projects .section-head h2 { margin-bottom: 0; }
.institution { max-width: 760px; font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0 0 23px; }
#projects .institution { margin: -5px 0 5px; }
.institution a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); }
.project {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin: 0;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  transition: border-color 160ms ease, transform 160ms ease;
}
.project:hover, .project:focus-within { border-color: var(--accent); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .project:hover { transform: translateY(-2px); } }
.project-media { position: relative; }
.project-thumb {
  position: relative;
  display: block;
  width: 94px;
  height: 94px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
}
.project-thumb:hover { border-color: var(--accent); }
.project-thumb:focus-visible { outline-offset: 4px; }
.project-thumb img { position: absolute; max-width: none; height: auto; }
.project-thumb.gorgona-thumb img { width: 360%; left: -180%; top: -44%; }
.project-thumb.incor-thumb img { width: 400%; left: -155%; top: -142%; }
.project-thumb.rpms-thumb img { width: 260%; left: -80%; top: -34%; }
.project-thumb.physionet-thumb img { width: 165%; left: -24%; top: -5%; }
.project-thumb.hle-thumb img { width: 100%; height: 100%; left: 0; top: 0; padding: 8px; object-fit: contain; }
.project-info { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.project h3 { font-size: 20px; margin-bottom: 8px; }
.project h3 a { color: var(--ink); text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.project .desc { max-width: 660px; margin-bottom: 17px; font-size: 16px; line-height: 1.65; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 14px; margin: 0; }

/* Case studies and CV use the same type and spacing. */
.detail-top { max-width: 800px; padding: 50px 0 30px; }
.back { display: inline-block; margin-bottom: 26px; font-size: 14px; }
.detail-top .eyebrow { margin-bottom: 14px; }
.detail-top h1 { font-size: 34px; margin-bottom: 15px; }
.detail-top .subtitle { font-size: 20px; line-height: 1.6; max-width: 760px; margin: 0 0 20px; }
.article-section { padding: 25px 0; }
.article-section h2 { font-size: 23px; margin-bottom: 17px; }
.article-section h3 { font-size: 18px; margin: 24px 0 12px; }
.article-section > p, .lead { max-width: 810px; }
.article-section figure { margin: 25px 0; }
.article-section figure img { width: 100%; max-height: 560px; object-fit: contain; }
figcaption, .note { font-size: 13px; line-height: 1.55; color: var(--muted); }
.article-section figcaption { margin-top: 10px; }
.image-link { display: block; cursor: zoom-in; }
.article-section .image-link, .gorgona-flow .flow-window { background: white; border-radius: 8px; overflow: hidden; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.split h3 { margin-top: 0; }
.two-images { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: center; }
.two-images img { max-height: 250px !important; }
.case-ecgs figure { margin: 28px 0 36px; }
.case-ecgs figure img { max-height: none; height: auto; }
.metrics { display: flex; flex-wrap: wrap; gap: 22px 40px; padding: 21px 0; border-block: 1px solid var(--line); margin-bottom: 14px; }
.metric strong { display: block; color: var(--ink); font-size: 26px; font-weight: 600; }
.metric span { font-size: 14px; color: var(--muted); }
.contents { display: flex; flex-wrap: wrap; gap: 12px 22px; font-size: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.table-scroll { overflow: auto; margin: 22px 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
td, th { text-align: left; border-bottom: 1px solid var(--line); padding: 12px; vertical-align: top; }
th { font-weight: 600; }
thead th { background: var(--soft); color: var(--ink); border-bottom-color: var(--line); }
tbody th { font-weight: 400; }
.refs { padding-left: 20px; }
.refs li { font-size: 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.refs small { color: var(--muted); }
.gorgona-flow { max-width: 590px; margin: 28px auto; }
.flow-window { position: relative; aspect-ratio: 1.123; overflow: hidden; }
.flow-window img { position: absolute; width: 200%; max-width: none; height: auto; left: -100%; top: 0; }
.gorgona-flow figcaption { margin-top: 10px; }
.incor-figure .figure-window { aspect-ratio: 1.674; overflow: hidden; }
.incor-figure img { width: 100%; height: auto; max-height: none !important; }
.biomarker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 36px; }
.biomarker-grid h3 { margin: 12px 0 9px; }
.biomarker-grid p { margin: 0 0 7px; }
.biomarker-grid a { font-size: 14px; }
.rpms-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.rpms-gallery img { height: 240px; object-fit: contain; object-position: top; }
.technical { font-size: 15px; padding: 18px 0; margin: 20px 0; border-block: 1px solid var(--line); }
.technical summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.technical[open] summary { margin-bottom: 16px; }
.technical img { max-width: 420px; margin: 20px auto; }
.education { list-style: none; margin: 0; padding: 0; }
.education li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 24px; padding: 17px 0; border-top: 1px solid var(--line); }
.education time { font-size: 13px; color: var(--muted); }
.education strong { font-size: 17px; font-weight: 600; }
.education small { display: block; font-size: 14px; color: var(--muted); }
.pub-list { padding: 0; list-style: none; }
.pub-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 18px; margin: 0 0 26px; }
.pub-list time { font-size: 14px; color: var(--muted); }
.pub-list h3 { font: 18px/1.5 SourceSans, sans-serif; margin: 0 0 5px; }
.pub-list p { font-size: 14px; color: var(--muted); }
.cv-job { max-width: 810px; padding: 20px 0 10px; border-top: 1px solid var(--line); }
.cv-job h3 { margin: 0 0 10px; }
.job-meta { font-size: 15px; color: var(--muted); }
.cv-job ul, .cv-awards { padding-left: 20px; }
.cv-job li { margin-bottom: 10px; }
.cv-awards li { margin-bottom: 16px; }

/* Research details and original award images. */
.challenge-story { max-width: 800px; }
.award-photo { max-width: 700px; margin: 12px 0 30px; }
.award-photo img { width: 100%; height: auto; }
.award-photo figcaption { margin-top: 12px; }
.certificate-photo { max-width: 700px; }
.news-list { list-style: none; padding: 0 !important; margin: 20px 0; }
.news-list li { margin-bottom: 20px; }
.news-list p { margin: 4px 0 0; }
.news-date { color: var(--muted); font-size: 15px; }
.challenge-story .contents { align-items: flex-start; }
.challenge-story ul { padding-left: 23px; }
.challenge-story li { margin-bottom: 10px; }
.challenge-tasks { margin: 22px 0; }
.challenge-tasks > div { padding: 13px 0; border-top: 1px solid var(--line); }
.challenge-tasks dt { font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.challenge-tasks dd { margin: 0; }
.training-stages { padding-left: 25px; margin: 24px 0; }
.training-stages li { padding-left: 8px; margin-bottom: 20px; }
.training-stages strong { color: var(--ink); }
.training-stages p { margin: 5px 0 0; }
.method-figure { max-width: 740px; }
.article-section .method-figure img { height: auto; max-height: none; }
.challenge-story #results tbody tr:first-child { font-weight: 600; }
.challenge-story #results tbody tr:first-child th { font-weight: 600; }
.challenge-sources { font-size: 15px; }

/* Plain contact information. */
.contact { border-top: 1px solid var(--line); margin-top: 24px; padding: 32px 0 20px; }
.contact h2 { font-size: 20px; margin-bottom: 13px; }
.contact-email { font-size: 16px; margin-bottom: 10px; overflow-wrap: anywhere; }
.contact .social { margin-bottom: 13px; }
.contact-download { font-size: 14px; margin: 0; }
.current-reading { border-block: 1px solid var(--line); padding: 24px 0; }
.reading-item { display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; color: var(--body); text-decoration: none; }
.reading-cover { width: 36px; height: 54px; object-fit: cover; border-radius: 1px; flex: 0 0 36px; }
.reading-copy { display: block; min-width: 0; }
.reading-label { display: block; font-size: 11px; line-height: 1.35; color: var(--muted); margin-bottom: 3px; }
.reading-title { display: block; font-size: 15px; line-height: 1.4; color: var(--accent); font-weight: 500; }
.reading-author { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 3px; }
.reading-item:hover .reading-title { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 420px) {
  .reading-title { font-size: 14px; }
}
.footer { padding: 18px 0 30px; color: var(--muted); font-size: 12px; }
.footer a { color: var(--muted); }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.only-print { display: none; }

/* Tablet: retain the circular evidence while widening the text column. */
@media (max-width: 760px) {
  .wrap { width: calc(100% - 48px); }
  .header .wrap { flex-wrap: wrap; gap: 8px 16px; padding: 20px 0 14px; }
  .brand { order: 0; flex: 1; }
  .nav { order: 2; flex-basis: 100%; justify-content: flex-start; width: 100%; margin-left: 0; }
  .nav > a { padding-block: 7px; }
  .nav > a + a { margin-left: 24px; }
  .header-tools { order: 1; margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr) 124px; gap: 30px; padding: 42px 0 38px; }
  .hero h1 { font-size: 30px; letter-spacing: -.5px; }
  .hero .intro { font-size: 18px; }
  .portrait-frame { width: 124px; }
  .portrait { width: 108px; height: 108px; }
  #projects { grid-template-columns: 1fr; }
  .project { grid-template-columns: 120px minmax(0, 1fr); gap: 27px; }
  .project-thumb { width: 116px; height: 116px; }
  .project h3 { font-size: 21px; }
  .split { grid-template-columns: 1fr; gap: 20px; }
  .rpms-gallery { gap: 20px; }
}

/* Phone: show the portrait and give each project description the full width. */
@media (max-width: 540px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 40px); }
  .header .wrap { padding: 18px 0 12px; }
  .brand { font-size: 14px; }
  .nav { flex-wrap: wrap; justify-content: flex-start; row-gap: 3px; font-size: 13px; }
  .nav > a { min-height: 40px; display: inline-flex; align-items: center; }
  .nav > a + a { margin-left: 16px; }
  .header-tools { gap: 9px; }
  .lang { gap: 1px; }
  .lang a { min-width: 30px; padding: 7px 5px; }
  .hero { display: flex; flex-direction: column; gap: 23px; padding: 32px 0 36px; }
  .hero-copy { order: 1; width: 100%; }
  .portrait-frame { order: 0; align-self: flex-start; flex-shrink: 0; width: 104px; margin: 0; }
  .portrait { width: 88px; height: 88px; }
  .hero h1 { font-size: 27px; letter-spacing: -.5px; margin-bottom: 8px; }
  .location { margin-bottom: 18px; }
  .hero .intro { font-size: 17px; line-height: 1.65; }
  .hero .email-line { font-size: 14px; }
  .social { font-size: 13px; gap: 6px 17px; }
  .profile-links { gap: 12px 21px; margin-top: 17px; font-size: 14px; }
  .profile-links a { min-height: 42px; }
  .section { padding-top: 28px; }
  h2 { font-size: 23px; }
  .institution { font-size: 12px; line-height: 1.6; }
  .project { grid-template-columns: 1fr; gap: 21px; padding: 24px; }
  .project-media { width: 116px; }
  .project-thumb { width: 116px; height: 116px; }
  .project h3 { font-size: 20px; }
  .project .desc { line-height: 1.65; }
  .project-links { gap: 12px 27px; }
  .project-links a { min-height: 36px; display: inline-flex; align-items: center; }
  .detail-top { padding-top: 30px; }
  .detail-top h1 { font-size: 29px; letter-spacing: -.7px; }
  .detail-top .subtitle { font-size: 18px; }
  .article-section { padding: 22px 0; }
  .article-section h2 { font-size: 22px; }
  .two-images, .biomarker-grid, .rpms-gallery { grid-template-columns: 1fr; }
  .rpms-gallery img { height: auto; max-height: 330px; }
  .rpms-gallery figure { margin: 12px 0; }
  .metrics { gap: 18px; }
  .metric { flex: 1; min-width: 85px; }
  .metric strong { font-size: 23px; }
  .metric span { display: block; font-size: 12px; }
  .education li { grid-template-columns: 1fr; gap: 5px; }
  td, th { font-size: 13px; padding: 10px 8px; }
  .contact h2 { font-size: 20px; }
  .contact-email { font-size: 16px; }
  .contact a { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}


/* Blog preview shares the portfolio's quiet, editorial layout. */
.reading-list { list-style: none; margin: 0; padding: 0; max-width: 740px; }
.reading-recommendation { border-top: 1px solid var(--line); padding: 28px 0; }
.reading-recommendation h2 { font: 600 clamp(21px, 2.6vw, 26px)/1.4 SourceSans, 'Segoe UI', sans-serif; margin: 0 0 9px; overflow-wrap: anywhere; }
.reading-recommendation h2 a { color: var(--ink); text-decoration-color: var(--accent); }
.reading-meta { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.reading-note { margin: 0; max-width: 660px; }
.blog-feature { padding-bottom: 28px; }
.blog-feature > p { max-width: 700px; }
.blog-preview { border-top: 1px solid var(--line); margin-top: 20px; padding: 25px 0 10px; }
.blog-preview .blog-date { font-size: 13px; color: var(--muted); margin: 0 0 9px; }
.blog-preview h3 { font-size: clamp(20px, 2.2vw, 25px); line-height: 1.35; margin: 0 0 12px; }
.blog-preview h3 a { color: var(--ink); text-decoration: none; }
.blog-preview h3 a:hover, .blog-preview h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.blog-preview > p:not(.blog-date):not(.project-links) { max-width: 680px; }

/* Shared navigation and accessible search, including Quarto pages. */
button, input { font: inherit; }
button { cursor: pointer; }
.search-toggle { margin-left: 20px; border: 0; border-radius: 0; background: none; color: var(--accent); padding: 8px 0; font-size: inherit; }
.search-toggle:hover { text-decoration: underline; text-underline-offset: 4px; }
:where(button,input,[tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.nav [aria-current="page"] { color: var(--ink); font-weight: 600; }
#main:focus { outline: none; }
#site-search { width: min(680px, calc(100% - 32px)); max-height: 85dvh; padding: 26px; border: 1px solid var(--line); border-radius: 12px; color: var(--body); background: var(--paper); box-shadow: 0 12px 60px #0005; }
#site-search::backdrop { background: #070d0bb3; }
.search-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.search-dialog-head h2 { margin: 0; font-size: 24px; }
[data-search-close] { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 4px; font-size: 26px; }
#site-search label, .blog-index label { display: block; font-size: 15px; margin-bottom: 8px; }
#search-query, #blog-query { width: 100%; border: 1px solid var(--muted); background: var(--soft); border-radius: 6px; padding: 12px; color: var(--ink); font-size: 17px; }
#search-status, #blog-status { min-height: 24px; color: var(--muted); font-size: 14px; margin: 12px 0; }
#search-results { list-style: none; padding: 0; margin: 0; }
#search-results li { border-top: 1px solid var(--line); padding: 16px 0; }
#search-results li > a { font-size: 18px; font-weight: 600; }
#search-results li p { font-size: 15px; margin: 6px 0 0; }
.blog-preview[hidden] { display: none; }
.blog-index .blog-preview h2 { font: 600 25px/1.4 SourceSans, sans-serif; margin: 0 0 12px; }
.blog-preview h2 a { color: var(--ink); text-decoration: none; }

/* Blog reading keeps original figures and article text. */
body.blog-page { padding-top: 0 !important; }
.blog-page .header .nav { padding: 0; }
.blog-page .header a { text-decoration: none; }
.blog-page .header .wrap { min-height: 80px; }
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 44px; align-items: start; }
.blog-layout:has(.blog-index) { display: block; }
.blog-main { display: block; min-width: 0; width: 100%; padding: 30px 0 50px; grid-area: auto; }
.blog-main > header { margin: 0 0 30px; }
.blog-main h1 { font-size: clamp(27px, 3.1vw, 36px); font-weight: 700; letter-spacing: -.6px; }
.blog-main h2 { margin: 38px 0 18px; padding: 0; border: 0; font-size: 24px; }
.blog-main h3 { margin: 28px 0 14px; }
.blog-main p { line-height: 1.75; }
.blog-main a { color: var(--accent); }
.blog-main .description { color: var(--muted); font-size: 18px; margin: 18px 0; }
.blog-main .quarto-title-meta { font-size: 14px; }
.blog-main .quarto-title-meta-heading { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.blog-main .quarto-category { color: var(--muted); border-color: var(--line); }
.blog-main .column-screen-inset, .blog-main .column-body-outset { width: 100%; margin-inline: 0; }
.blog-main pre { max-width: 100%; overflow: auto; border: 1px solid var(--line); padding: 14px; background: var(--soft); font-size: 13px; }
.blog-main div.sourceCode { background: var(--soft); border-color: var(--line); }
.blog-main :not(pre) > code { color: var(--accent); background: var(--soft); padding: .1em .25em; border-radius: 3px; }
:root:not([data-theme="light"]) .blog-main pre code, :root:not([data-theme="light"]) .blog-main pre code span { color: var(--code-ink); }
:root:not([data-theme="light"]) .blog-main pre code span:is(.kw,.cf,.im,.bu,.dt) { color: var(--code-keyword); }
:root:not([data-theme="light"]) .blog-main pre code span:is(.st,.ss,.vs,.ch) { color: var(--code-string); }
:root:not([data-theme="light"]) .blog-main pre code span:is(.dv,.bn,.fl,.cn) { color: var(--code-number); }
:root:not([data-theme="light"]) .blog-main pre code span:is(.co,.cv,.an) { color: var(--code-comment); }
.blog-main blockquote { color: var(--body); border-left-color: var(--accent); }
.blog-main .callout { color: var(--body); background: var(--soft); border-color: var(--line); }
.blog-main .callout .callout-header { background: var(--raised); color: var(--ink); }
.blog-main .code-copy-button { color: var(--muted); background: var(--soft); }
.blog-main details { margin-block: 18px; }
.blog-main summary { cursor: pointer; padding-block: 10px; }
.blog-main .post-citation { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--line); }
.blog-main .post-citation h2 { margin: 0 0 16px; font-size: 22px; }
.blog-main .post-citation pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.citation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-block: 16px; }
.citation-actions button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--accent); }
.citation-actions button:hover { background: var(--raised); }
.blog-main .citation-usage, .blog-main .citation-status { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.citation-status:empty { display: none; }
.blog-main img { max-width: 100%; height: auto; }
.blog-main figure, .blog-main .quarto-figure { margin-block: 24px; }
.blog-main .table-scroll { max-width: 100%; }
.blog-main table { margin: 0; }
.blog-main td, .blog-main th { color: var(--body); background: transparent; border-color: var(--line); }
.blog-main thead th { color: var(--ink); background: var(--soft); }
.blog-toc { position: sticky; top: 24px; padding-top: 38px; font-size: 13px; max-height: calc(100dvh - 48px); overflow: auto; }
.blog-toc #TOC { position: static; padding: 0; }
.blog-toc h2 { font: 600 14px/1.4 SourceSans, sans-serif; margin: 0 0 14px; }
.blog-toc ul { padding-left: 14px; list-style: none; }
.blog-toc li { margin: 10px 0; }
.blog-toc a { color: var(--muted); }
.figure-original { display: block; position: relative; cursor: zoom-in; }
.figure-original img { background: white; border-radius: 6px; }
.figure-original::after { content: 'Open original ↗'; display: inline-block; font-size: 13px; margin: 6px 0 10px; }
.figure-scroll { max-width: 100%; }
.figure-scroll::before { content: 'Scroll to explore the figure · Click to open the original'; display: block; width: fit-content; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.blog-page .footer { margin-top: 0; }
/* Less aggressive crops keep the original research assets recognizable. */
.project-thumb.incor-thumb img { width: 230%; left: -67%; top: -62%; }
.project-thumb.rpms-thumb img { width: 160%; left: -30%; top: -4%; }
@media (max-width: 900px) {
 .header .wrap { flex-wrap: wrap; gap: 8px 18px; }
 .header .nav { order: 3; width: 100%; margin: 0; flex-wrap: wrap; gap: 0 20px; }
 .header .nav > a + a, .header .search-toggle { margin-left: 0; }
 .header .header-tools { margin-left: auto; }
 .blog-layout { display: flex; flex-direction: column; gap: 0; }
 .blog-toc { position: static; order: -1; width: 100%; max-height: none; padding-top: 22px; border-bottom: 1px solid var(--line); }
 .blog-toc ul { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; }
 .blog-toc ul ul { display: none; }
 .blog-toc li { margin: 0 0 12px; }
 .blog-toc h2 { margin-bottom: 12px; }
 .blog-main { padding-top: 28px; }
}
@media (max-width: 540px) {
 .header .nav { gap: 0 16px; }
 .header .nav > a, .header .search-toggle { min-height: 44px; }
 .header .lang a { min-width: 32px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
 .blog-main .quarto-title-meta { display: block; }
 .blog-main .quarto-title-meta > div { margin-bottom: 12px; }
 .blog-main .quarto-title-meta p { margin-bottom: 0; }
 .blog-main table { min-width: 520px; }
 #site-search { padding: 18px; }
}

.article-language { font-size: 13px; color: var(--muted); margin-top: 20px; margin-bottom: 0; }

/* Quarto assigns named grid columns to every aside. Reset them in shared layout. */
.blog-toc { grid-area: auto; min-width: 0; }
.blog-main { margin: 0; }

.blog-toc summary { font: 600 14px/1.4 SourceSans, sans-serif; cursor: pointer; padding: 8px 0; min-height: 36px; }
.blog-toc details[open] summary { margin-bottom: 12px; }

@media print {
  :root, :root[data-theme="light"], :root[data-theme="dark"] {
    color-scheme: light;
    --paper: white;
    --ink: #202a24;
    --body: #303b33;
    --muted: #58655c;
    --accent: #256348;
    --line: #d8ded5;
    --soft: #f2f3ee;
    --raised: #e5e9de;
    --code-ink: #303b33;
    --code-keyword: #244c9f;
    --code-string: #256348;
    --code-number: #80501d;
    --code-comment: #58655c;
  }
  body { background: white; }
  .header, .skip, .blog-toc, .article-language, #site-search { display: none; }
  .wrap { width: 100%; }
  .blog-layout { display: block; }
  .project { break-inside: avoid; }
}


.reading-kind { margin: 0 0 7px; color: var(--muted); font: 600 12px/1.4 SourceSans, 'Segoe UI', sans-serif; letter-spacing: .02em; }

