:root {
  color-scheme: light;
  --ink: #28323e;
  --muted: #626e7b;
  --accent: #365f8b;
  --accent-hover: #244362;
  --accent-soft: #f0f4f8;
  --accent-border: #c9d6e4;
  --rule: #dfe5eb;
  --background: #ffffff;
  --header-background: rgba(255, 255, 255, .97);
  --selected-text: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #17212d;
  --ink: #e1e8f0;
  --muted: #a6b4c4;
  --accent: #93bce8;
  --accent-hover: #bfdafa;
  --accent-soft: #223247;
  --accent-border: #405b77;
  --rule: #334354;
  --header-background: rgba(23, 33, 45, .97);
  --selected-text: #17212d;
}

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; padding: 6px; border: 1px solid var(--rule); border-radius: 50%; background: var(--background); color: var(--muted); cursor: pointer; }
.theme-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun-icon, [data-theme="dark"] .theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 17px; line-height: 1.75; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
.page { width: min(900px, calc(100% - 48px)); margin-inline: auto; }
.header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 24px; padding: 48px 0 28px; border-bottom: 1px solid var(--rule); }
.header.is-compact { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: min(900px, calc(100% - 48px)); z-index: 10; align-items: center; padding: 10px 0; background: var(--header-background); box-shadow: 0 6px 18px #28323e0a; }
.header.is-compact h1 { font-size: 25px; letter-spacing: -.5px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { margin: 0; font-size: clamp(3rem, 6vw, 4.7rem); line-height: 1.1; letter-spacing: -2px; }
h1 a { color: var(--ink); text-decoration: none; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; }
nav a { padding-block: 8px; color: var(--muted); text-decoration: none; text-transform: uppercase; font-size: 12px; font-weight: 650; letter-spacing: .06em; }
nav a:hover { color: var(--accent); }
nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.post-preview { max-width: 700px; }
.post-preview + .post-preview { margin-top: 36px; }
.post-preview h3 { margin: 4px 0 6px; font-size: 21px; font-weight: 400; line-height: 1.25; }
.post-preview p { margin-bottom: 6px; font-size: 17px; line-height: 1.5; }
.blog-main { max-width: 720px; margin-inline: auto; }
.blog-post { padding: 38px 0; }
.blog-post h2 { margin: 12px 0 18px; font-size: clamp(30px, 5vw, 42px); line-height: 1.15; }
.blog-post h3 { margin: 34px 0 14px; font-size: 25px; }
.blog-post .post-body h2 { margin: 34px 0 14px; font-size: 25px; line-height: 1.3; }
.post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.post-body th, .post-body td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.post-body th { background: var(--accent-soft); }
.post-body pre { overflow-x: auto; padding: 16px; background: var(--accent-soft); border-radius: 5px; }
.post-body img { max-width: 100%; height: auto; }
.post-body blockquote { margin-inline: 0; padding-left: 18px; border-left: 2px solid var(--accent-border); color: var(--muted); }
.blog-post p { margin: 0 0 18px; font-size: 17px; line-height: 1.8; }
.blog-post .post-lead { font-size: 21px; color: var(--muted); }
.blog-post .post-meta, .post-preview .post-meta { font-size: 13px; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 24px; font-size: 14px; }
.post-equation { overflow-x: auto; margin: 22px 0; padding: 8px 16px; background: var(--accent-soft); border-radius: 5px; }
.post-table-wrapper { overflow-x: auto; margin: 24px 0; }
.post-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.post-table caption { text-align: left; margin-bottom: 10px; color: var(--muted); }
.post-table th, .post-table td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.post-table th { background: var(--accent-soft); }
.blog-post .post-reference { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
main { padding-top: 16px; }
section { padding-block: 40px; border-bottom: 1px solid var(--rule); scroll-margin-top: 110px; }
h2 { font-size: 32px; line-height: 1.2; margin: 0 0 24px; }
p { margin: 0 0 16px; }
.about-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 48px; }
.intro { font-size: 19px; }
.intro strong { font-weight: 600; }
.placeholder, .section-note, .authors, .metadata { color: var(--muted); }
.portrait { margin: 0; }
.portrait img { display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--rule); }
figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.portrait-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.portrait-links .office { flex-basis: 100%; font-size: 13px; }
.portrait-links a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--muted); border-radius: 4px; text-decoration: none; }
.portrait-links a[href]:hover { color: var(--accent); background: var(--accent-soft); }
.portrait-links a[aria-disabled="true"] { opacity: .45; }
.portrait-links svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.contact-links { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 24px; font-size: 14px; }
.section-note { font-size: 15px; margin-bottom: 28px; }
.work-list, .news-list { list-style: none; padding: 0; margin: 0; }
.work-list { display: grid; gap: 22px; }
.publication-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: -12px 0 20px; font-size: 13px; }
.topic-chip { padding: 5px 12px; border: 1px solid var(--accent-border); border-radius: 999px; background: transparent; color: var(--accent); font: inherit; cursor: pointer; }
.topic-chip:hover { background: var(--accent-soft); }
.topic-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--selected-text); }
.topic-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.filter-status { flex-basis: 100%; color: var(--muted); }
.clear-filter { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.clear-filter:hover { color: var(--accent); }
.clear-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.work-list h3 { margin-bottom: 2px; font-size: 19px; font-weight: 400; line-height: 1.25; }
.work-list p { margin: 0; line-height: 1.4; }
.work-list .metadata { margin-top: 2px; }
.paper-toggle { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.paper-toggle::after { content: " +"; color: var(--muted); white-space: nowrap; }
.paper-toggle[aria-expanded="true"]::after { content: " −"; }
.paper-toggle:hover { color: var(--accent); }
.paper-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.paper-abstract { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--rule); color: var(--muted); }
.work-list .paper-abstract p { font-size: 14px; line-height: 1.6; }
.paper-abstract { overflow-x: auto; }
h3 { font-size: 23px; line-height: 1.35; margin: 0 0 5px; }
h3 a { color: var(--ink); text-decoration: none; }
h3 a:hover { color: var(--accent); text-decoration: underline; }
article p { margin-bottom: 5px; font-size: 15px; }
article .authors { font-size: 14px; }
article .metadata { font-size: 13px; margin-top: 8px; }
.metadata span { padding-inline: 7px; }
.metadata span[data-blog-only] { padding-inline: 0; }
.copy-bibtex { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.copy-bibtex:hover { color: var(--accent-hover); }
.copy-bibtex:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.citation-text { width: 100%; height: 200px; margin-top: 10px; padding: 12px; border: 1px solid var(--rule); border-radius: 4px; background: var(--accent-soft); color: var(--ink); font: 13px/1.5 monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.metadata .presentation-badge { display: inline-block; padding: 1px 5px; border: 1px solid var(--accent-border); border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; line-height: 1.3; text-transform: uppercase; vertical-align: 1px; }
.news-list { display: grid; gap: 17px; font-size: 15px; }
.news-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; }
.date { color: var(--muted); font-size: 14px; font-weight: 600; }
footer { padding: 26px 0 48px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); text-decoration: none; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 8px 16px; background: var(--background); z-index: 20; }
.skip-link:focus { top: 8px; }
p, h1, h3, li { overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .header { flex-direction: column; gap: 16px; padding-top: 28px; }
  .header.is-compact { align-items: flex-start; gap: 2px; }
  .header.is-compact h1 { font-size: 23px; }
  .about-layout { grid-template-columns: 1fr; gap: 24px; }
  .portrait { grid-row: 1; width: 150px; }
  section { padding-block: 30px; }
  h2 { font-size: 28px; }
}
@media (max-width: 380px) {
  .page { width: calc(100% - 32px); }
  .header.is-compact { width: calc(100% - 32px); }
  .news-list li { grid-template-columns: 1fr; gap: 2px; }
  nav { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  :root[data-theme] { color-scheme: light; --background: #fff; --ink: #28323e; --muted: #626e7b; --accent: #365f8b; --accent-soft: #f0f4f8; --accent-border: #c9d6e4; --rule: #dfe5eb; --header-background: #fff; --selected-text: #fff; }
  .header-slot { height: auto !important; }
  .header.is-compact { position: static; transform: none; width: 100%; box-shadow: none; }
  .page { width: 100%; }
  nav, .skip-link, footer a { display: none; }
  section { break-inside: avoid; }
}
