/* Editorial refinements shared by the index and the original article markup. */
:root {
  --blog-ink: #202b35;
  --blog-muted: #72808b;
  --blog-accent: #21736d;
  --blog-line: #e3e8e7;
  --blog-panel: #f4f7f4;
  --blog-surface: #fff;
  --blog-tag-bg: #edf4f1;
  --blog-tag-ink: #3c7069;
  --blog-tag-line: #dce9e3;
  --blog-tag-hover: #dcece4;
  --blog-code-bg: #eef4f1;
  --blog-code-ink: #304a43;
  --blog-code-line: #dce6df;
  --blog-code-accent: #75a995;
  --blog-input-border: #c9d5ce;
  --blog-warning: #a6342b;
  --bs-body-color: #46525c;
  --bs-body-bg: #fcfcfa;
  --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
}
body {
  font-family: var(--bs-font-sans-serif);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0;
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .navbar-brand, .navbar .nav-link {
  text-transform: none;
  letter-spacing: -.025em;
  color: var(--blog-ink);
}
h1, h2, h3 { font-weight: 650; line-height: 1.25; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { margin-top: 2.5rem; border-bottom-color: var(--blog-line); }
a { color: var(--blog-accent); text-underline-offset: .2em; }
a:hover { color: var(--blog-ink); }
::selection { background: #d8eae5; color: #153f3b; }
:focus-visible { outline: 2px solid var(--blog-accent); outline-offset: 4px; }
/* The shared navigation owns its styles; article layout still uses Quarto CSS. */
:root { --site-header-height: 68px; }
html { scroll-padding-top: calc(var(--site-header-height) + var(--site-toc-height, 0px) + 1rem); }
.sidebar.margin-sidebar, .sidebar.toc-left, .sidebar.sidebar-navigation, .headroom-target {
  top: var(--site-header-height);
  max-height: calc(100vh - var(--site-header-height));
}
/* Quarto sets an inline top from the padded sidebar when it becomes a menu. */
.quarto-sidebar-toggle.headroom-target { top: var(--site-header-height) !important; }
#quarto-content { padding-top: 2rem; }
div.quarto-post {
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom-color: var(--blog-line);
}
div.quarto-post .metadata {
  flex: 0 0 22%;
  font-size: .8rem;
  line-height: 1.65;
  letter-spacing: 0;
  color: var(--blog-muted);
  padding-top: .15rem;
}
div.quarto-post .metadata a { color: var(--blog-muted); }
div.quarto-post .listing-date { font-weight: 550; color: var(--blog-muted); }
div.quarto-post .listing-author { font-size: .75rem; }
div.quarto-post .body { flex: 1 1 0; min-width: 0; }
div.quarto-post .body h3.listing-title {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  color: var(--blog-ink);
  transition: color .15s;
}
div.quarto-post .body a:hover h3.listing-title { color: var(--blog-accent); }
div.quarto-post .body .listing-subtitle { font-size: .9rem; color: var(--blog-muted); margin-top: .4rem; margin-bottom: .8rem; }
div.quarto-post .listing-description { margin-top: .5rem; font-size: .95rem; line-height: 1.75; }
div.quarto-post .listing-description p { margin-bottom: 0; }
div.quarto-post .listing-categories { gap: .3rem; padding-bottom: 0; }
div.quarto-post .listing-categories .listing-category,
.post-categories .post-category {
  background: var(--blog-tag-bg);
  color: var(--blog-tag-ink);
  border: 1px solid var(--blog-tag-line);
  border-radius: 5px;
  padding: .15rem .45rem;
  margin: 0;
  font-size: .66rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  transition: background .15s;
}
div.quarto-post .listing-categories .listing-category:hover { background: var(--blog-tag-hover); }
#quarto-margin-sidebar .quarto-listing-category-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 650;
  color: var(--blog-muted);
  margin-bottom: .8rem;
}
#quarto-margin-sidebar .quarto-listing-category { font-size: .82rem; }
#quarto-margin-sidebar .category {
  padding: .3rem .6rem;
  margin: 0 0 .1rem -.6rem;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.5;
  transition: background .15s, color .15s;
}
#quarto-margin-sidebar .category:hover,
#quarto-margin-sidebar .category.active { color: var(--blog-accent); background: var(--blog-tag-bg); }
.quarto-category-count { color: var(--blog-muted); font-size: .9em; }
.quarto-title-banner { background: transparent; }
.quarto-title-meta-heading { letter-spacing: .08em; color: var(--blog-muted); }
pre.sourceCode, div.sourceCode { border-radius: 6px; }
blockquote { border-left: 3px solid var(--blog-tag-line); color: var(--blog-muted); }
@media (max-width: 767.98px) {
  body { font-size: 16px; }
  #quarto-content { padding-top: 1.25rem; }
  div.quarto-post { gap: 0; margin-bottom: 1.5rem; padding-bottom: 1.5rem; }
  div.quarto-post .metadata { flex-basis: auto; padding-block: .75rem 0; }
  div.quarto-post .metadata a { flex-direction: row; flex-wrap: wrap; gap: .6rem; align-items: baseline; }
  div.quarto-post .listing-description { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* Native MDX article content and accessible category controls. */
.quarto-post[hidden] { display: none !important; }
.quarto-listing-category button.category { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; }
.post-categories .post-category { display: inline-block; text-decoration: none; }
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .65rem; margin-top: 1rem; font-size: .85rem; color: var(--blog-muted); }
.post-meta a { color: inherit; }
.post-summary { margin-block: 1.4rem 2.5rem; padding-left: 1rem; border-left: 3px solid var(--blog-tag-line); font-size: .95rem; }
.post-content .astro-code { padding: 1rem 1.25rem; font-size: .8rem; line-height: 1.65; border: 1px solid var(--blog-line); }
/* Plain-text models use a light reading surface; override Shiki's inline theme. */
.post-content pre[data-language="text"],
.post-content pre[data-model] {
  background: var(--blog-code-bg) !important;
  color: var(--blog-code-ink) !important;
  border: 1px solid var(--blog-code-line);
  border-left: 3px solid var(--blog-code-accent);
  border-radius: 6px;
  padding: 1.1rem 1.35rem;
  margin-block: 1.25rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .82rem;
  line-height: 1.8;
  tab-size: 2;
  white-space: pre;
  overflow-x: auto;
}
.post-content pre[data-language="text"] > code {
  background: transparent;
  font: inherit;
  padding: 0;
}
.post-content pre[data-language="text"] > code,
.post-content pre[data-language="text"] > code span {
  /* Quarto applies a fixed dark blue to all code spans; use our palette instead. */
  color: var(--blog-code-ink) !important;
  background: transparent !important;
}
.post-content img { max-width: 100%; height: auto; }
.post-content a[id] { scroll-margin-top: 6rem; }

/* Theme palettes also cover the imported Quarto content. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --blog-ink: #edf3f4;
  --blog-muted: #a4b5bf;
  --blog-accent: #89d2ba;
  --blog-line: #34434c;
  --blog-panel: #1e2b33;
  --blog-surface: #1a252d;
  --blog-tag-bg: #243c37;
  --blog-tag-ink: #b0dfcf;
  --blog-tag-line: #3c5c50;
  --blog-tag-hover: #305247;
  --blog-code-bg: #1c2e2c;
  --blog-code-ink: #d7eee2;
  --blog-code-line: #314741;
  --blog-code-accent: #75a995;
  --blog-input-border: #40535c;
  --blog-warning: #ffafa5;
  --bs-body-bg: #151d24;
  --bs-body-color: #c5d0d7;
}
.theme-toggle {
  order: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: .75rem;
  padding: .5rem;
  border: 1px solid #53616c;
  border-radius: 50%;
  background: transparent;
  color: #e1eae8;
  cursor: pointer;
}
.theme-toggle:hover { background: #35444e; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] ::selection { background: #36574c; color: #eefbf3; }
:root[data-theme="dark"] .astro-code:not([data-language="text"]),
:root[data-theme="dark"] .astro-code:not([data-language="text"]) span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
}
:root[data-theme="dark"] div.quarto-post a { color: var(--bs-body-color); }
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .bg-light,
:root[data-theme="dark"] div.sourceCode,
:root[data-theme="dark"] pre.sourceCode {
  background-color: var(--blog-panel) !important;
  color: var(--bs-body-color);
  border-color: var(--blog-line);
}
:root[data-theme="dark"] code { color: #b5d9d0; }
:root[data-theme="dark"] .sourceCode .kw,
:root[data-theme="dark"] .sourceCode .cf,
:root[data-theme="dark"] .sourceCode .im { color: #e2b5df; }
:root[data-theme="dark"] .sourceCode .st,
:root[data-theme="dark"] .sourceCode .ch { color: #a9d6b4; }
:root[data-theme="dark"] .sourceCode .dv,
:root[data-theme="dark"] .sourceCode .fl { color: #efc292; }
:root[data-theme="dark"] .sourceCode .fu,
:root[data-theme="dark"] .sourceCode .dt { color: #a9d0f2; }
:root[data-theme="dark"] .sourceCode .co { color: #a4b5bf; }
:root[data-theme="dark"] table { color: var(--bs-body-color); border-color: var(--blog-line); }
:root[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: #1e2b33; color: var(--bs-body-color); }
:root[data-theme="dark"] .observablehq,
:root[data-theme="dark"] .observablehq--inspect { color: var(--bs-body-color); }
:root[data-theme="dark"] .cell input,
:root[data-theme="dark"] .cell select { color: var(--blog-ink); background-color: var(--blog-surface); border-color: var(--blog-input-border); }
/* Preserve readable plot labels inside the scientific chart canvases. */
:root[data-theme="dark"] .vega-embed { background: white; border-radius: 6px; padding: .5rem; color-scheme: light; }
.post-share { margin-block: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--blog-line); font-size: .85rem; color: var(--blog-muted); }
.post-share-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.post-share-actions a, .post-share-actions button { display: inline-flex; align-items: center; padding: .35rem .8rem; border: 1px solid var(--blog-tag-line); border-radius: 5px; background: var(--blog-tag-bg); color: var(--blog-tag-ink); font: inherit; text-decoration: none; cursor: pointer; }
.post-share-actions a:hover, .post-share-actions button:hover { background: var(--blog-tag-hover); }
.share-status { display: block; margin-top: .5rem; overflow-wrap: anywhere; }

/* Inline code should read naturally with prose in either palette. */
.content :not(pre) > code {
  color: var(--blog-code-ink) !important;
  background: var(--blog-code-bg);
  border: 1px solid var(--blog-code-line);
  border-radius: 4px;
  padding: .08em .32em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .86em;
  line-height: inherit;
  overflow-wrap: anywhere;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.content :not(pre) > code span { color: inherit; }

/* Long display equations scroll within the reading column on small screens. */
.content mjx-container[display="true"] {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: .25em;
}

/* Editorial views; the original scientific article styles remain intact. */
:root { --blog-muted:var(--identity-muted); }
h1,h2,h3,.site-brand { font-family:var(--identity-serif); font-weight:400; }
.editorial-page { width:min(52rem,calc(100% - 3rem)); margin:0 auto; }
.editorial-intro { padding:3.5rem 0 1.5rem; } .editorial-intro h1 { font-size:clamp(2.6rem,6vw,4rem); margin:.7rem 0 1.2rem; }
.editorial-lead { font:1.25rem/1.65 var(--identity-serif); max-width:55ch; } .editorial-meta { color:var(--identity-muted); font:.78rem/1.7 ui-monospace,monospace; }
.editorial-views { display:flex; flex-wrap:wrap; gap:.5rem 1.5rem; padding:1rem 0; margin-bottom:1.5rem; border-block:1px solid var(--identity-line); }
.editorial-views a { display:inline-flex; align-items:center; min-height:36px; text-decoration:none; } .editorial-views [aria-current] { text-decoration:underline; text-underline-offset:.35em; }
.editorial-label { font:1rem/1.5 system-ui,sans-serif; } .editorial-label span { color:var(--identity-muted); }
.editorial-post-list { list-style:none; padding:0; margin:0; } .editorial-post-list > li { padding:1.7rem 0; border-bottom:1px solid var(--identity-line); } .editorial-post-list h2 { border:0; margin:.5rem 0 .8rem; font-size:1.85rem; } .editorial-post-list h2 a { color:var(--identity-ink); text-decoration:none; } .editorial-post-list h2 a:hover { text-decoration:underline; }
.editorial-post-list p { margin:.6rem 0; } .editorial-subtitle { color:var(--identity-muted); } .editorial-tags { display:flex; flex-wrap:wrap; gap:.5rem 1rem; font:.78rem/1.7 ui-monospace,monospace; margin-top:.8rem; }
.editorial-series-list { padding-left:1.4rem; } .editorial-series-list li { padding:1rem 0; } .series-navigation { display:flex; flex-wrap:wrap; gap:1rem; justify-content:space-between; padding:1.5rem 0; border-top:1px solid var(--identity-line); }
.editorial-skip { position:absolute; left:1rem; top:-100px; padding:.75rem; background:var(--identity-paper); z-index:2000; } .editorial-skip:focus { top:1rem; }
.theme-toggle { color:var(--identity-ink); border-color:var(--identity-line); } .theme-toggle:hover { background:var(--blog-panel); }
@media(max-width:640px) { .editorial-intro { padding-top:2rem; } .editorial-post-list h2 { font-size:1.5rem; } }

/* Common reading width, typography and introductory spacing. */
.editorial-page { box-sizing:border-box; width:100%; max-width:var(--identity-content-width); padding-inline:var(--identity-gutter); }
.editorial-intro { padding:3.5rem 0 1.5rem; }
.editorial-intro h1 { font-size:clamp(2.6rem,6vw,4rem); margin:.7rem 0 1.2rem; }

@media(max-width:640px) { .editorial-intro { padding-top:2rem; } }
