/* Shared additions to the original Wowchemy theme. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/roboto-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/roboto-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --site-ink: #28313b;
  --site-muted: #596470;
  --site-border: #dfe4e8;
  --site-surface: #fff;
  --site-accent: #1565c0;
}
body.dark {
  --site-ink: #e4e7ed;
  --site-muted: #b4bbc7;
  --site-border: #414553;
  --site-surface: #282a36;
  --site-accent: #bbdefb;
  color-scheme: dark;
}
html { font-size: 16px; scroll-padding-top: 84px; }
body { color: var(--site-ink); overflow-x: visible; }
@media (min-width: 992px) { html { font-size: 18px; } }
a { text-underline-offset: .15em; }
a:hover { text-decoration: underline; }
/* Icon-only and button links have their own shape, so the hover underline just
   draws a rule under the glyph. */
.network-icon a:hover,
.btn:hover,
.nav-link:hover,
.navbar-brand:hover,
.theme-control:hover { text-decoration: none; }
.article-style p a:not(.btn), .pub-list-item > a:not(.btn), .section-more, .back-link { text-decoration: underline; }
.text-muted, .dark .text-muted { color: var(--site-muted) !important; }
.article-metadata, .dark .article-metadata { color: var(--site-muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 4px; }
.navbar-toggler:focus-visible { outline: 2px solid var(--site-accent) !important; outline-offset: 2px; }
#content:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Keep the original header compact, with real keyboard/touch controls. */
.navbar { box-shadow: none; border-bottom: 1px solid var(--site-border); font-size: 15px; }
.dark .navbar { box-shadow: none; }
.navbar-brand { font-size: 20px; }
#navbar-main .nav-link { min-height: 44px; display: flex; align-items: center; }
.theme-control { display: flex; align-items: center; gap: .4rem; margin: 0; }
.theme-control svg { width: 18px; height: 18px; flex: none; }
#theme-select {
  max-width: 7.5rem;
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--site-ink);
  font: inherit;
  font-size: 13px;
  padding: 6px 2px;
  cursor: pointer;
}
#theme-select option { background: var(--site-surface); color: var(--site-ink); }
.no-js .theme-control, .no-js .navbar-toggler, .no-js .publication-filters { display: none; }
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  padding: 10px 16px;
  background: var(--site-surface);
  color: var(--site-accent);
  font-weight: 700;
  transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }
/* Top-aligned: an SVG has no text baseline, so a baseline-aligned link would
   leave a descender gap under the row. */
.network-icon li a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 40px; vertical-align: top; }
/* Icons are inline SVG outlines taken from the Font Awesome 5 / Academicons
   glyphs the site used to load as fonts. Each viewBox is the glyph's em box, so
   these sizes reproduce the old font rendering. */
.network-icon .big-icon { display: block; width: 2rem; height: 2rem; fill: currentColor; }
.toggler-icon { width: .875em; height: 1em; vertical-align: -.125em; fill: currentColor; }
ul.ul-edu { margin-left: 2.5em; padding-left: 0; }
/* The theme sizes .pub-icon as a font glyph; padding sits outside the glyph. */
svg.pub-icon { box-sizing: content-box; width: .75em; height: 1em; vertical-align: -.125em; fill: currentColor; }
/* The theme draws the note banner's info icon with the icon font; draw the same
   glyph as a mask in the box that glyph occupied. The font must be reset too:
   asking for the now-missing icon font makes Chrome scan every system font,
   which blocked the main thread for ~0.8s on phones. */
div.alert > div:first-child::before { content: ''; font-family: inherit; height: 1lh; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M80.5 80.5Q153 8 256 8Q359 8 431.5 80.5Q504 153 504 256Q504 359 431.5 431.5Q359 504 256 504Q153 504 80.5 431.5Q8 359 8 256Q8 153 80.5 80.5ZM285.5 130.5Q273 118 256 118Q239 118 226.5 130.5Q214 143 214 160Q214 177 226.5 189.5Q239 202 256 202Q273 202 285.5 189.5Q298 177 298 160Q298 143 285.5 130.5ZM312 372V348Q312 336 300 336H288V236Q288 224 276 224H212Q200 224 200 236V260Q200 272 212 272H224V336H212Q200 336 200 348V372Q200 384 212 384H300Q312 384 312 372Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M80.5 80.5Q153 8 256 8Q359 8 431.5 80.5Q504 153 504 256Q504 359 431.5 431.5Q359 504 256 504Q153 504 80.5 431.5Q8 359 8 256Q8 153 80.5 80.5ZM285.5 130.5Q273 118 256 118Q239 118 226.5 130.5Q214 143 214 160Q214 177 226.5 189.5Q239 202 256 202Q273 202 285.5 189.5Q298 177 298 160Q298 143 285.5 130.5ZM312 372V348Q312 336 300 336H288V236Q288 224 276 224H212Q200 224 200 236V260Q200 272 212 272H224V336H212Q200 336 200 348V372Q200 384 212 384H300Q312 384 312 372Z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* Centred on the first line, plus the 1/7em that the icon font's baseline
   alignment used to add, so the caps sit where they did. */
.ul-edu .edu-icon { position: absolute; left: -2em; top: calc((1lh - 1em) / 2 + 1em / 7); width: 2em; height: 1em; fill: currentColor; }
/* min-height keeps a comfortable tap target, but as a block element the extra
   height all fell below the label. Centre the text inside it instead. */
.btn { border-radius: 5px; min-height: 36px; padding: .3rem .7rem; font-size: .82rem; line-height: 1.4;
  display: inline-flex; align-items: center; justify-content: center; }
.btn-sm { font-size: .78rem; }
.btn-outline-primary { color: var(--site-accent); border-color: var(--site-accent); }
.btn-outline-primary:hover { color: #fff; background: #1565c0; border-color: #1565c0; }
.dark .btn-outline-primary:hover { color: #23252f; background: #bbdefb; border-color: #bbdefb; }

/* Publication titles lead; secondary bibliographic detail remains readable. */
.pub-list-item { padding: 1.25rem 0; margin: 0 !important; border-bottom: 1px solid var(--site-border); }
.pub-list-item .publication-title { font-family: inherit; font-size: 1.08rem; font-weight: 500; line-height: 1.45; margin: 0 0 .45rem; }
.pub-list-item .publication-title a { color: var(--site-accent); }
.pub-list-item .publication-authors { font-size: .82rem; line-height: 1.65; margin-bottom: .3rem; color: var(--site-muted); }
.pub-list-item .publication-venue { font-size: .85rem; margin-bottom: .65rem; }
.author-self { font-weight: 600; color: var(--site-ink); }
.pub-list-item .publication-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0; }
#container-publications > .isotope-item { padding: 0; }
.publication-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,.5fr) minmax(110px,.3fr); gap: .8rem; margin: 1.5rem 0 .8rem; }
.publication-filters label { display: block; margin: 0; font-size: .8rem; color: var(--site-muted); }
/* One field style for the search box and both filters, in both themes (the
   selects used to take the theme's .form-control colours in dark mode). */
.publication-filters {
  --field-border-hover: #b6c0c9;
  --field-ring: rgba(21, 101, 192, .18);
  --field-search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23596470' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.75'/%3E%3Cpath d='m10.5 10.5 3.5 3.5'/%3E%3C/svg%3E");
  --field-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23596470' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
body.dark .publication-filters {
  --field-border-hover: #5b6075;
  --field-ring: rgba(187, 222, 251, .2);
  --field-search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23b4bbc7' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.75'/%3E%3Cpath d='m10.5 10.5 3.5 3.5'/%3E%3C/svg%3E");
  --field-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23b4bbc7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
.publication-filters input, .publication-filters select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  margin-top: .3rem;
  padding: .45rem .75rem;
  border: 1px solid var(--site-border);
  border-radius: 6px;
  background: var(--site-surface) no-repeat;
  color: var(--site-ink);
  font: inherit;
  font-size: 16px; /* below 16px, iOS Safari zooms the page on focus */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.publication-filters input { padding-left: 2.35rem; background-image: var(--field-search-icon); background-position: .8rem center; background-size: 1rem; }
.publication-filters select { padding-right: 2.35rem; background-image: var(--field-chevron); background-position: right .75rem center; background-size: 1rem; cursor: pointer; }
.publication-filters input::placeholder { color: var(--site-muted); opacity: 1; }
.publication-filters input:hover, .publication-filters select:hover { border-color: var(--field-border-hover); }
/* A 2px accent edge plus a soft halo: visible for keyboard users without the
   detached outline the global focus style draws. */
.publication-filters input:focus, .publication-filters select:focus {
  outline: none;
  border-color: var(--site-accent);
  box-shadow: 0 0 0 1px var(--site-accent), 0 0 0 4px var(--field-ring);
}
.publication-filter-status { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center; min-height: 36px; font-size: .82rem; color: var(--site-muted); }
#publication-count { margin: 0; }
#publication-reset { background: none; border: 0; color: var(--site-accent); text-decoration: underline; min-height: 36px; padding: 0; font: inherit; cursor: pointer; }
#publication-empty { padding: 2rem 0; }
.publication-archive { max-width: 1000px; }
.publication-archive > h1 { margin-bottom: .5rem; }
.archive-intro { font-size: .95rem; max-width: 42rem; color: var(--site-muted); }

/* Detail pages use one reading width and a clear return path. */
.article-container > h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.3; overflow-wrap: break-word; }
.article-container.pt-3 { padding-top: 1.75rem !important; }
.back-link { display: inline-block; margin-bottom: 1rem; font-size: .82rem; }
.pub-meta-line { margin: .2rem 0 0; }
.pub-meta-line a { text-decoration: underline; }
.pub-section-title { font-weight: 500; margin-top: 1.5rem; font-size: 1.25rem; }
.article-widget .pub-section-title { margin-top: 0; }
.pub-abstract { line-height: 1.8; }
.author-card .card-title { font-size: 1rem; }
.author-card .card-subtitle { font-family: inherit; color: var(--site-muted); }
.media-body { min-width: 0; }
.article-title, .article-style, .pub-list-item { overflow-wrap: anywhere; }

/* Native dialog supplies focus containment and Escape handling. */
#citation-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 1.5rem;
  border: 1px solid var(--site-border);
  border-radius: 10px;
  background: var(--site-surface);
  color: var(--site-ink);
  overscroll-behavior: contain;
}
#citation-dialog::backdrop { background: rgba(15,23,42,.55); }
#citation-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
#citation-title { font-size: 1.2rem; margin: 0; }
#citation-dialog [data-close-citation] { font: inherit; font-size: 1.4rem; color: inherit; border: 0; background: none; width: 40px; height: 40px; cursor: pointer; }
#citation-dialog pre { max-height: 50vh; white-space: pre-wrap; overflow-wrap: anywhere; background: transparent; color: inherit; font-size: .8rem; padding: 0; }
/* The theme's `pre code { white-space: pre }` would undo the wrapping above and
   push long fields such as the title off the right edge. */
#citation-dialog code { color: inherit; background: transparent; white-space: inherit; }
/* The theme asks for Roboto Mono, which the site does not ship. A missing
   family makes Chrome scan every system font, blocking ~1s on phones when the
   citation dialog opens; it rendered in the generic monospace anyway. Doubled
   to avoid the legacy monospace font-size quirk. */
pre, code { font-family: monospace, monospace; }
.citation-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#citation-status { margin: .75rem 0 0; min-height: 1.5em; color: var(--site-muted); font-size: .85rem; }

@media (max-width: 991.98px) {
  body { margin-top: 64px; }
  .navbar { height: 64px; padding: 0 .75rem; }
  .navbar > .container-xl { padding: 0; }
  .navbar-toggler { min-width: 36px; min-height: 44px; }
  .navbar-brand-mobile-wrapper { position: static; flex: 1; padding-left: .35rem; }
  .navbar-brand { margin: 0; font-size: 16px; }
  .navbar-collapse { top: 64px; box-shadow: 0 8px 12px rgba(0,0,0,.06); border-bottom: 1px solid var(--site-border); }
  #navbar-main .main-menu-item .nav-item { padding: 0 .75rem !important; }
  #navbar-main .main-menu-item .nav-item .nav-link { padding: .6rem .75rem !important; }
  .theme-control svg { display: none; }
  #theme-select { max-width: 78px; min-height: 44px; }
  .no-js .navbar { position: static; height: auto; padding: .75rem; }
  .no-js body { margin-top: 0; }
  .no-js .navbar-collapse { position: static; display: block; box-shadow: none; border: 0; }
  .no-js .navbar-collapse .navbar-nav { flex-direction: row; flex-wrap: wrap; }
  .no-js .navbar-brand-mobile-wrapper { margin: 0 0 .5rem; }
}
@media (max-width: 575.98px) {
  .publication-filters { grid-template-columns: 1fr 1fr; }
  .publication-filters .publication-search { grid-column: 1 / -1; }
  .btn { min-height: 40px; padding: .45rem .7rem; }
  .pub-list-item .publication-title { font-size: 1.06rem; }
  .pub-list-item .publication-authors { font-size: .85rem; }
  .article-container { padding-left: 16px; padding-right: 16px; }
}
@media print {
  html { font-size: 11pt; }
  body { min-width: 0 !important; margin-top: 0; }
  .navbar, .skip-link, .publication-filters, .publication-filter-status, #citation-dialog, .btn, .site-footer { display: none !important; }
  .home-section { padding: 1.5rem 0; }
  .experience .card { break-inside: avoid; }
}

/* One quiet link to the privacy notice at the foot of every page. */
.site-footer { padding: 1.5rem 16px 2rem; text-align: center; font-size: .8rem; }
.site-footer a { color: var(--site-muted); text-decoration: underline; }

/* Pages without the homepage's banded sections ended flush against the
   viewport bottom, so give the last block some breathing room. */
.page-body > .universal-wrapper:last-child,
.page-body > .article-container:last-child,
.page-body > .pub:last-child {
  padding-bottom: 2.5rem;
}
