:root {
  --site-accent: #0d904f;
  --site-link: #35752b;
  --site-link-hover: #285921;
  --site-heading: #000;
  --site-border: #dce7dc;
  --bs-body-color: #000;
  --bs-link-color: var(--site-link);
  --bs-link-color-rgb: 53, 117, 43;
  --bs-link-hover-color: var(--site-link-hover);
  --bs-link-hover-color-rgb: 40, 89, 33;
  --bs-primary: var(--site-accent);
  --bs-primary-rgb: 13, 144, 79;
  --bs-body-bg: #fbfbf9;
}

body.quarto-dark {
  color-scheme: dark;
  --site-accent: #69cf96;
  --site-link: #8cdb9b;
  --site-link-hover: #b4edbe;
  --site-heading: #fff;
  --site-border: #35483b;
  --bs-body-color: #fff;
  --bs-body-bg: #171e1a;
  --bs-link-color: var(--site-link);
  --bs-link-color-rgb: 140, 219, 155;
  --bs-link-hover-color: var(--site-link-hover);
  --bs-link-hover-color-rgb: 180, 237, 190;
  --bs-primary: var(--site-accent);
  --bs-primary-rgb: 105, 207, 150;
}

/* Keep Quarto's persistent theme control beside search at every width. */
.navbar .quarto-navbar-tools { margin-left: auto; }
.navbar #quarto-search { margin-left: .25rem; }
@media (max-width: 991.98px) {
  .navbar .navbar-brand-container {
    min-width: 0;
    max-width: calc(100% - 9rem);
  }
  .navbar-brand-container .navbar-brand:not(.navbar-brand-logo) {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.navbar .quarto-color-scheme-toggle {
  display: inline-grid;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--bs-body-color);
  text-decoration: none;
}
.navbar .quarto-color-scheme-toggle:hover { color: var(--site-link); }
.navbar .quarto-color-scheme-toggle svg { grid-area: 1 / 1; }
.navbar .quarto-color-scheme-toggle .theme-icon-sun { opacity: 0; }
body.quarto-dark .navbar .quarto-color-scheme-toggle .theme-icon-moon { opacity: 0; }
body.quarto-dark .navbar .quarto-color-scheme-toggle .theme-icon-sun { opacity: 1; }
body.quarto-dark .home-hero-gif { mix-blend-mode: normal; border-radius: .5rem; }
body.quarto-dark .cv-download { background: #167344; border-color: #69cf96; }
body.quarto-dark .cv-download:hover { background: #1d8853; }
body.quarto-dark .activity-map-caption { color: #fff; }

/* Animate theme colors in both directions, including the navbar and borders. */
@media (prefers-reduced-motion: no-preference) {
  body, .navbar, .navbar-brand, .nav-link, .nav-footer,
  h1, h2, h3, h4, h5, h6, h2::after, a, summary,
  .activities-archive, .activity-map-caption, .listing-item,
  input, select, textarea, pre, code, .cv-download {
    transition: color .3s ease, background-color .3s ease,
      border-color .3s ease, box-shadow .3s ease;
  }
  .navbar .quarto-color-scheme-toggle svg { transition: opacity .3s ease; }
}

body { line-height: 1.65; }
.navbar {
  border-top: 3px solid var(--site-accent);
  border-bottom: 1px solid var(--site-border);
  --bs-navbar-hover-color: var(--site-link);
  --bs-navbar-active-color: var(--site-link);
}
.navbar-brand { font-weight: 600; letter-spacing: .01em; }
.navbar-brand img { height: 2rem; width: 2rem; object-fit: contain; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--site-link); }
.navbar .nav-link.active { box-shadow: inset 0 -2px var(--site-accent); }
main.content { max-width: 840px; }
body.blog-post main.content p { text-align: justify; }
main.content:has(> .home-hero) > #title-block-header { display: none; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 290px);
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.home-hero h1 { margin-top: 0; }
.home-hero-copy > p:last-child { margin-bottom: 0; }
.home-subtitle { font-size: 1.15rem; font-weight: 300; margin-bottom: 1.5rem; }
.home-hero-actions { margin-top: 1.5rem; }
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.15rem;
  border: 1px solid var(--site-accent);
  border-radius: .4rem;
  background: var(--site-accent);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  box-shadow: 0 2px 5px rgb(32 60 40 / 10%);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.cv-download:hover {
  background: #0a743f;
  border-color: #0a743f;
  color: #fff;
  box-shadow: 0 3px 8px rgb(32 60 40 / 16%);
}
.cv-download:focus-visible { outline-offset: 4px; }
.cv-download svg { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  .cv-download { transition: none; }
}
.home-hero-gif { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
h1, h2, h3 { color: var(--site-heading); }
h1 { letter-spacing: -.025em; }
h2 { margin-top: 2.1rem; border-bottom: 1px solid var(--site-border); padding-bottom: .25rem; }
h2::after { content: ""; display: block; width: 2.5rem; height: 3px; margin-top: .35rem; background: var(--site-accent); }
a { color: var(--site-link); text-underline-offset: .15em; }
a:hover { color: var(--site-link-hover); }
a:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 2px; }
.publication-list li, .activity-list li { margin-bottom: .65rem; }
.activities-archive { margin-top: 2.1rem; border-top: 1px solid var(--site-border); padding-top: .75rem; }
.activities-archive summary { cursor: pointer; color: var(--site-heading); font-size: 1.05rem; font-weight: 600; }
.activities-archive summary::marker { color: var(--site-accent); }
.activities-archive[open] summary { margin-bottom: 1rem; }
.quarto-listing-default .listing-item { padding-block: .8rem; }
.math-macros { display: none; }
/* Label unnumbered examples; Quarto supplies labels for numbered exm- blocks. */
.theorem.example:not([id^="exm-"]) > p:first-child::before {
  content: "Example. ";
  font-weight: bold;
  font-style: normal;
}
#refs .csl-entry:has(> .csl-left-margin) {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: .75em;
}
#refs .csl-left-margin,
#refs .csl-right-inline {
  float: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 600px) {
  main.content { padding-inline: .45rem; }
  h1 { font-size: 2rem; }
  .home-hero { grid-template-columns: 1fr; gap: .5rem; }
  .home-hero-gif { max-width: 320px; justify-self: center; }
}

/* Theorem-like environments in blog posts: left bar + faint tint */
.blog-post .theorem,
.blog-post .lemma,
.blog-post .corollary,
.blog-post .proposition,
.blog-post .conjecture,
.blog-post .definition,
.blog-post .example,
.blog-post .remark,
.blog-post .exercise {
  margin: 1.25rem 0;
  padding: .6rem 1rem;
  border-left: 4px solid var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 6%, transparent);
  border-radius: 0 .35rem .35rem 0;
}
.blog-post .definition {
  border-left-color: var(--bs-success);
  background: color-mix(in srgb, var(--bs-success) 6%, transparent);
}
.blog-post .remark,
.blog-post .example {
  border-left-color: var(--bs-secondary);
  background: none;
}
/* Proofs: plain text, italic "Proof." label (from Quarto), QED square at the end. */
.blog-post .proof:not(.remark):not(.solution) > :last-child::after {
  content: "\25A1";
  float: right;
  margin-left: 1em;
}
/* Make the Remark label match the Example label (bold, upright). */
.blog-post .remark .proof-title,
.blog-post .remark .proof-title em {
  font-weight: bold;
  font-style: normal;
}

/* Black-on-transparent SVG diagrams: invert for the dark theme. */
.diagram { display: block; max-width: 100%; height: auto; margin: 1.5rem auto; }
body.quarto-dark .diagram { filter: invert(1); }
