/* Locally hosted fonts; OFL licenses are in ../fonts/. */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/newsreader-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: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/newsreader-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: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/source-sans-3-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/source-sans-3-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: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/source-sans-3-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;
}

/* Shared foundations. Adjust this small palette and type scale here. */
:root {
  color-scheme: light;
  --canvas: #fff;
  --paper: #fff;
  --ink: #202b36;
  --text: #36414b;
  --muted: #606a74;
  --accent: #2458a6;
  --accent-soft: #eff4fa;
  --border: #dfe5eb;
  --wash: #f5f7f9;
  --selection: #dce9f7;
  --portrait-border: #ccd6df;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
}
/* Match the system until a visitor chooses a theme. Keep both dark palettes in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --canvas: #151b23;
    --paper: #1b2430;
    --ink: #edf2f7;
    --text: #ccd5e0;
    --muted: #aab6c5;
    --accent: #9ec7ff;
    --accent-soft: #253449;
    --border: #364354;
    --wash: #1c2632;
    --selection: #344e70;
    --portrait-border: #526176;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #151b23;
  --paper: #1b2430;
  --ink: #edf2f7;
  --text: #ccd5e0;
  --muted: #aab6c5;
  --accent: #9ec7ff;
  --accent-soft: #253449;
  --border: #364354;
  --wash: #1c2632;
  --selection: #344e70;
  --portrait-border: #526176;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--canvas); color: var(--text); font: 400 1.125rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
p, h1, h2, h3, h4 { margin: 0 0 1rem; }
h1, h2 { color: var(--ink); font-family: var(--serif); font-weight: 400; letter-spacing: -.025em; }
h1 { font-size: 2.75rem; line-height: 1.15; }
h2 { font-size: 1.875rem; line-height: 1.2; }
h3, h4 { color: var(--ink); font-size: 1.125rem; line-height: 1.45; font-weight: 600; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
main:focus { outline: none; }
::selection { background: var(--selection); color: var(--ink); }
img, svg { max-width: 100%; }
.skip-link { position: absolute; left: 20px; top: -100px; z-index: 20; padding: 10px 18px; background: var(--ink); color: var(--canvas); }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Centered page columns; prose keeps a natural reading edge. */
.header-inner, .site-layout { width: min(800px, calc(100% - 80px)); margin-inline: auto; }
.site-header { padding-top: 20px; }
.header-inner { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; column-gap: 8px; }
.main-nav { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 28px; }
.main-nav a { display: inline-flex; align-items: center; min-height: 48px; padding-block: 8px; font-size: 1rem; color: var(--text); text-decoration: none; }
.main-nav a:hover { color: var(--accent); text-decoration: underline; }
.main-nav a[aria-current] { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .45em; }
.theme-toggle { grid-column: 3; display: inline-flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-icon-sun { display: none; }
:root[data-theme='dark'] .theme-icon-sun { display: block; }
:root[data-theme='dark'] .theme-icon-moon { display: none; }
.site-layout { flex: 1; display: flex; flex-direction: column; padding-block: 48px 24px; }
main, .main-column { min-width: 0; }
main { flex: 1; width: 100%; margin-inline: auto; }
body[data-page='papers'] main { max-width: 800px; }
body[data-page='home'] .site-layout, body[data-page='about'] .site-layout { max-width: 660px; }
body[data-page='home'] .site-layout { padding-top: 26px; }
.page-intro { margin-bottom: 44px; }
.page-intro h1 { margin-bottom: 22px; text-align: center; }
.page-intro p { max-width: 66ch; }
.page-intro > p:last-child { margin-bottom: 0; }
.page-section { margin-top: 42px; }
.page-section h2 { margin-bottom: 20px; }
.page-section p:last-child { margin-bottom: 0; }
.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.contact-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 1rem; }
.contact-links .contact-icon { justify-content: center; width: 44px; height: 44px; border-radius: 8px; text-decoration: none; }
.contact-icon svg { width: 25px; height: 25px; fill: currentColor; }
.contact-icon:hover { background: var(--accent-soft); }
.contact-email { overflow-wrap: anywhere; }
.person-link { color: var(--accent); }

/* Home: a circular portrait, short introduction, news, and contact row. */
.profile-heading { text-align: center; margin-bottom: 30px; }
.profile-heading h1 { margin: 20px 0 0; font-size: 2.5rem; }
.profile-portrait-frame { position: relative; width: 240px; height: 240px; max-width: 100%; aspect-ratio: 1; margin-inline: auto; overflow: hidden; border: 1px solid var(--portrait-border); border-radius: 50%; background: var(--paper); }
.profile-portrait-crop { position: absolute; inset: 4px; overflow: hidden; border-radius: 50%; }
.profile-portrait { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 60%; transform: scale(1.5); }
.portrait-credit { margin: 0; }
.portrait-credit > summary { display: block; list-style: none; cursor: pointer; }
.portrait-credit > summary::-webkit-details-marker { display: none; }
.portrait-credit > summary::marker { content: ''; }
.portrait-caption { max-width: 28rem; margin: 14px auto 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.intro-more { margin-bottom: 0; }
.home-news { margin-top: 34px; }
.home-news h2 { margin-bottom: 20px; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 94px minmax(0, 1fr); column-gap: 18px; margin-bottom: 16px; }
.news-list li:last-child { margin-bottom: 0; }
.news-list p { margin: 0; }
.news-date { color: var(--muted); font-size: 1rem; line-height: 1.85625; }
.home-closing { margin-top: 34px; text-align: center; }
.home-closing .contact-links { justify-content: center; }
[data-page="about"] .contact-links { justify-content: center; }

/* Bibliography: stable records with optional, keyboard-accessible summaries. */
.section-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 18px; }
.section-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 1rem; }
.publication { margin-bottom: 30px; }
.publication:last-child { margin-bottom: 0; }
.publication h4 { margin-bottom: 6px; }
.publication h4 a { color: var(--ink); text-decoration: none; }
.publication h4 a:hover { color: var(--accent); text-decoration: underline; }
.paper-authors { color: var(--muted); font-size: 1rem; line-height: 1.5; margin-bottom: 4px; }
.paper-authors .person-link { color: inherit; text-decoration-color: #9ba6b0; }
.paper-meta { margin-bottom: 1px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.paper-year { white-space: nowrap; }
.paper-year > span { margin-inline: 3px; }
.venue { font-weight: 400; }
.paper-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 20px; }
.paper-links > a { display: inline-flex; align-items: center; min-height: 36px; font-size: 1rem; }
.paper-abstract { min-width: 0; }
.paper-abstract summary { min-height: 36px; padding-block: 5px; color: var(--accent); font-size: 1rem; cursor: pointer; }
.paper-abstract summary:hover { text-decoration: underline; }
.paper-abstract[open] { flex-basis: 100%; }
.paper-summary { margin: 6px 0 10px; max-width: 68ch; font-size: 1.0625rem; line-height: 1.65; }
.publication-section { margin-top: 42px; }
.publication-section h2 { margin-bottom: 26px; }
.publication-section + .publication-section { margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--border); }
.publication-category + .publication-category { margin-top: 40px; }
.publication-category > h3 { margin-bottom: 22px; font-size: 1.25rem; }

/* Shared footer. */
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 24px; margin-top: 44px; padding-top: 20px; color: var(--muted); font-size: .9375rem; }
body[data-page='home'] .site-footer { margin-top: 20px; }
.site-footer > a { display: inline-flex; align-items: center; min-height: 36px; }

/* A native footer link becomes a small floating control after scrolling. */
.has-back-to-top .site-layout { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.back-to-top { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 12px; margin: 16px auto 24px; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); color: var(--accent); font: 600 1rem/1.4 var(--sans); text-decoration: none; }
.back-to-top svg { width: 20px; height: 20px; flex: none; }
.back-to-top:hover { border-color: var(--accent); background: var(--accent-soft); }
.back-to-top.is-floating { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10; margin: 0; box-shadow: 0 2px 8px rgb(0 0 0 / 8%); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; }

/* Reusable article styles: native mathematics, figures, citations, and code. */
body[data-page='article'] .site-layout { max-width: 860px; }
.article-header { max-width: 780px; padding-block: 34px; }
.article-header h1 { font-size: clamp(1.875rem, 4vw, 2.5rem); }
.article-deck { font-size: 1.3rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .9375rem; }
.template-note { padding: 14px 18px; border: 1px solid var(--border); background: var(--wash); font-size: .9375rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 42px; }
.prose, .prose section { min-width: 0; }
.prose section { margin-bottom: 34px; }
.prose h2 { margin-bottom: 18px; }
.prose h3 { margin-top: 22px; }
.prose blockquote { margin: 24px 0; padding: 10px 0 10px 22px; border-left: 3px solid var(--accent); font: 400 1.4rem/1.5 var(--serif); color: var(--ink); }
.prose figure { margin: 28px 0; }
.prose figcaption { margin-top: 12px; font-size: .9375rem; color: var(--muted); }
.geometry { background: #1d3547; border-radius: 4px; overflow: hidden; }
.geometry-heading { padding: 24px 26px 0; color: white; font: 400 1.75rem/1.15 var(--serif); }
.geometry svg { display: block; width: 100%; height: auto; }
.geometry-caption { padding: 0 26px 24px; color: #d5e2eb; font-size: .9375rem; }
.geometry-caption strong { color: white; }
.math-block { max-width: 100%; overflow-x: auto; padding: 22px; border: 1px solid var(--border); background: var(--paper); }
.takeaway { margin-block: 24px; padding: 18px 22px; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.takeaway h3 { margin-top: 0; }
.takeaway p:last-child { margin-bottom: 0; }
.prose pre { max-width: 100%; overflow-x: auto; padding: 20px; border: 1px solid var(--border); background: var(--wash); line-height: 1.65; }
.prose code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .875em; }
.prose :not(pre) > code { padding: .15em .3em; background: var(--wash); overflow-wrap: anywhere; }
.article-toc { align-self: start; position: sticky; top: 24px; border-left: 1px solid var(--border); padding-left: 20px; font-size: .9375rem; }
.article-toc p { color: var(--ink); font-weight: 600; margin-bottom: 10px; }
.article-toc ol { list-style: none; padding: 0; margin: 0; }
.article-toc a { display: inline-flex; align-items: center; min-height: 40px; }
.references { padding-left: 24px; }
.references li { margin-bottom: 15px; overflow-wrap: anywhere; }
article[id], section[id], h2[id], .references li { scroll-margin-top: 24px; }
/* Keep the introduction and dated updates readable on narrow screens. */
@media (max-width: 800px) {
  .header-inner, .site-layout { width: calc(100% - 56px); }
  .site-layout { padding-top: 36px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .article-toc { position: static; grid-row: 1; padding-left: 0; border-left: 0; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
  .article-toc ol { display: flex; flex-wrap: wrap; gap: 4px 20px; }
}
@media (max-width: 600px) {
  .header-inner, .site-layout { width: calc(100% - 40px); }
  .header-inner { width: calc(100% - 24px); column-gap: 4px; }
  .header-inner { grid-template-columns: minmax(0, 1fr) 44px; }
  .main-nav { grid-column: 1; }
  .theme-toggle { grid-column: 2; }
  .site-header { padding-top: 10px; }
  .main-nav { gap: 0 18px; }
  .main-nav a { min-height: 44px; }
  .site-layout { padding-top: 30px; }
  h1 { font-size: 2.375rem; }
  h2 { font-size: 1.75rem; }
  body[data-page='home'] .site-layout { padding-top: 22px; }
  .profile-portrait-frame { width: 208px; height: 208px; }
  .profile-heading { margin-bottom: 26px; }
  .profile-heading h1 { margin-top: 18px; font-size: 2.375rem; }
  .home-news { margin-top: 30px; }
  .news-list li { grid-template-columns: minmax(0, 1fr); row-gap: 2px; margin-bottom: 18px; }
  .home-closing { margin-top: 30px; }
  .page-intro { margin-bottom: 34px; }
  .page-section { margin-top: 34px; }
  .publication-section + .publication-section { margin-top: 40px; padding-top: 26px; }
  .paper-links { gap: 0 18px; }
  .paper-links > a, .paper-abstract summary { min-height: 40px; }
  .paper-abstract summary { padding-block: 7px; }
  .site-footer { margin-top: 44px; }
  .geometry-heading { font-size: 1.5rem; padding: 20px 20px 0; }
  .geometry-caption { padding: 0 20px 20px; }
}
@media (max-width: 360px) {
  .main-nav { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 20px; }
  .main-nav a { font-size: .9375rem; }
}
@media print {
  :root, :root[data-theme] { color-scheme: light; --canvas: #fff; --paper: #fff; --ink: #202b36; --text: #36414b; --muted: #606a74; --accent: #2458a6; --accent-soft: #eff4fa; --border: #dfe5eb; --wash: #f5f7f9; --portrait-border: #ccd6df; }
  body { display: block; font-size: 11pt; color: black; }
  .header-inner, .site-layout { width: 100%; }
  .site-layout { display: block; padding: 0; }
  .has-back-to-top .site-layout { padding-bottom: 0; }
  .site-header, .site-footer, .article-toc, .back-to-top { display: none; }
  .publication { break-inside: avoid; }
  .article-layout { display: block; }
  a { color: inherit; }
}
