/* Minimal academic style. Layout and tokens follow mrlab.ai (white page, IBM Plex,
   thin rules, dark mode); the hero and button row follow the cril.univ-artois.fr/~lagniez page. */

:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-subtle: #f5f5f3;
  --text: #1c1d20;
  --text-muted: #5f646c;
  --border: #e3e3e0;
  --border-strong: #c9cac6;
  --link: #1f4a73;
  --link-hover: #12324f;
  --accent: #b71c1c;        /* one accent, used sparingly (from the Lagniez page) */

  --page-width: 960px;
  --gutter: 24px;
  --header-height: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141518;
    --bg-subtle: #1b1d21;
    --text: #e4e4e1;
    --text-muted: #a0a5ad;
    --border: #2b2e33;
    --border-strong: #3d4148;
    --link: #9cbcdc;
    --link-hover: #c3d7ea;
    --accent: #e57373;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1 0 auto; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 1.75rem 0 .65rem; }
h1 { font-size: 1.75rem; letter-spacing: -.015em; margin-top: 0; }
h2 { font-size: 1.3rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.4rem; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em;
    text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.text-muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 1000; padding: .5rem .9rem; background: var(--text); color: var(--bg); }
.skip-link:focus { left: 1rem; }

.container { width: 100%; max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }
main.container { padding-top: 2.25rem; padding-bottom: 3.5rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-nav { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-height); }
.site-brand { color: var(--text); font-weight: 600; font-size: 1.05rem; text-decoration: none; letter-spacing: -.01em; }
.site-brand:hover { color: var(--text); }
.nav-button { display: none; }
.nav-links { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: .15rem; align-self: stretch; }
.nav-links li { display: flex; margin: 0; }
.nav-links a {
  display: flex; align-items: center; padding: 0 .75rem;
  font-size: .875rem; font-weight: 500; color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }

@media (max-width: 640px) {
  .site-nav { flex-wrap: wrap; gap: 0; }
  /* The menu button only appears when JavaScript is available (class "js" on <html>); otherwise the menu stays open. */
  .js .nav-button {
    display: inline-flex; align-items: center; gap: .45rem; margin-left: auto;
    font: inherit; font-size: .85rem; font-weight: 500; color: var(--text); background: var(--bg);
    border: 1px solid var(--border-strong); border-radius: 4px; padding: .5rem .7rem; min-height: 44px; cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 14px; height: 1.5px; background: currentColor; position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -4.5px; }
  .bars::after { top: 4.5px; }
  .nav-links { flex-basis: 100%; flex-direction: column; margin: 0; padding: .25rem 0 .75rem; }
  .js .nav-links { display: none; }
  .js .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem .75rem; border-bottom: 0; border-left: 2px solid transparent; margin: 0; }
  .nav-links a.active { border-left-color: var(--accent); }
}

/* Home */
.home-intro { padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.intro-grid { display: grid; gap: 2rem; align-items: center; }
.intro-grid.has-photo { grid-template-columns: 200px minmax(0, 1fr); }
.portrait { width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 1px solid var(--border); }
.lead { font-size: 1.05rem; line-height: 1.6; }
.link-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; }
@media (max-width: 640px) {
  .intro-grid.has-photo { grid-template-columns: 1fr; }
  .portrait { width: 140px; height: 140px; }
}

.btn {
  font-size: .85rem; line-height: 1.2; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: .35rem .75rem; text-decoration: none;
}
.btn:hover { background: var(--bg-subtle); color: var(--text); }

.home-section { padding-top: 2rem; }
.home-section > h2 { margin-top: 0; }

/* News: date column + text, separated by thin rules */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.news-list li:first-child { border-top: 0; }
.news-date { font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted); padding-top: .12rem; }
.news-older { margin-top: .25rem; border-top: 1px solid var(--border); }
.news-older > summary { cursor: pointer; padding: .85rem 0; font-weight: 500; color: var(--link); list-style: none; }
.news-older > summary::-webkit-details-marker { display: none; }
.news-older > summary::before { content: "+"; display: inline-block; width: 1.1rem; font-family: var(--font-mono); }
.news-older[open] > summary::before { content: "\2212"; }
@media (max-width: 560px) { .news-list li { grid-template-columns: 1fr; gap: .1rem; } }

/* Publications: styles generated HTML (bibtex2php) through the .bib wrapper only.
   Covers both list output (ul/ol > li) and table output (table > tr). */
.bib h2, .bib h3 { margin-top: 2rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border-strong); }
.bib h2:first-child, .bib h3:first-child { margin-top: 0; }
.bib ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.bib ol { padding-left: 2.2rem; margin: 0 0 1rem; }
.bib ol li::marker { font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted); }
.bib li { padding: .65rem 0; border-top: 1px solid var(--border); }
.bib ul li { padding-left: 1.5rem; text-indent: -1.5rem; }
.bib ul li > * { text-indent: 0; }
.bib li:first-child { border-top: 0; }
.bib table { font-size: inherit; }
.bib td { padding: .65rem .6rem; }
.bib td:first-child { white-space: nowrap; color: var(--text-muted); font-family: var(--font-mono); font-size: .85rem; }
.bib em { font-style: italic; }
.bib a { font-size: .9em; }
.bib details { margin-top: .4rem; text-indent: 0; }
.bib summary { cursor: pointer; color: var(--link); font-size: .85rem; }
.bib pre, .bib .bibtex, .bib .abstract {
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.45; text-indent: 0;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px;
  padding: .75rem 1rem; margin: .5rem 0 0; overflow-x: auto; white-space: pre-wrap;
}
.bib .abstract { font-family: var(--font-sans); font-size: .875rem; white-space: normal; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 0 0 1.25rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; border-bottom-color: var(--border-strong); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: .875rem; color: var(--text-muted); }
.footer-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 3rem; padding-top: 2rem; padding-bottom: 2rem; }
.footer-about p { margin: 0 0 .3rem; }
.footer-name { color: var(--text); font-weight: 600; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: flex-start; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* Footer logos sit on a white chip so they stay readable in dark mode */
.footer-logos { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .9rem; }
.footer-logo { display: inline-block; background: #fff; padding: 6px 10px; border-radius: 4px; border: 1px solid var(--border); }
.footer-logo img { display: block; height: 44px; width: auto; }

/* Teaching rows: narrow term column, course title above muted details */
table.rows th[scope="row"] { width: 11rem; white-space: normal; font-weight: 400; border-bottom-color: var(--border); }
/* Narrow screens (reflow, WCAG 1.4.10): stack term above description instead of two columns */
@media (max-width: 560px) {
  table.rows, table.rows tbody, table.rows tr, table.rows th, table.rows td { display: block; width: auto; }
  table.rows th[scope="row"] { width: auto; padding-bottom: 0; border-bottom: 0; }
  table.rows td { padding-top: .1rem; }
  table.rows tr { border-bottom: 1px solid var(--border); }
  table.rows td, table.rows th { border-bottom: 0; }
}

/* Spans emitted by auto-ref/bibtex2html.php */
.bib .title { font-weight: 600; }
.bib .in, .bib .publisher, .bib .school, .bib .institution { font-style: italic; }
.bib .highlight { font-weight: 600; }
.bib .note { color: var(--text-muted); font-size: .875rem; }
.bib .links { font-size: .85rem; color: var(--text-muted); white-space: normal; }
.bib .abstractlink, .bib .bibtexlink, .bib .webpdf, .bib .slides, .bib .poster, .bib .syspage,
.bib .citeseerurl, .bib .doi, .bib .url, .bib .publisherurl, .bib .arxiv { margin-right: .35rem; }
pre.autobibentry { max-width: 720px; margin: 1.5rem auto; padding: 0 var(--gutter); font-family: var(--font-mono); font-size: .8rem; white-space: pre-wrap; }

/* Output of bibtex2html (static build): numbered table rows */
.bib td.bibtexnumber { width: 3.5rem; text-align: right; }
.bib td.bibtexitem { padding-left: .75rem; }
.bib table + h2 { margin-top: 2rem; }

/* Publication type labels, like GitLab labels: a coloured pill per type.
   Colours: ColorBrewer diverging PiYG, 5 classes (colorbrewer2.org), except the blue journal label. Ten types share five shades,
   assigned along the sort order (journal, conference, proc, workshop, demo, benchmarks, software, newsletter,
   thesis, tech, other) so that neighbouring types always differ; the text names the type. */
.pub-label {
  --piyg-1: #d01c8b; --piyg-2: #f1b6da; --piyg-3: #f7f7f7; --piyg-4: #b8e186; --piyg-5: #4dac26;
  display: inline-block; margin-right: .4rem; padding: .08rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; line-height: 1.35; letter-spacing: .01em;
  color: #1c1d20; background: var(--piyg-3); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
  vertical-align: .08em; white-space: nowrap; text-indent: 0;
}
.pub-software                    { background: var(--piyg-2); }   /* soft pink: the Software page only shows software and benchmarks, */
.pub-journal                     { background: #2171b5; color: #fff; }   /* blue (ColorBrewer Blues), outside the PiYG scheme */
.pub-conference, .pub-newsletter { background: var(--piyg-5); color: #000; }
.pub-proc, .pub-thesis, .pub-demo { background: var(--piyg-2); }
.pub-workshop, .pub-tech         { background: var(--piyg-4); }
.pub-benchmarks                  { background: var(--piyg-4); }   /* soft green: both are light tones with dark text, no grey */
.pub-other                       { background: var(--piyg-3); }

/* Research highlight: a set-apart panel with the accent colour on the left */
.highlight { margin: 2.25rem 0 1rem; padding: 1.1rem 1.4rem .4rem; background: var(--bg-subtle); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; }
.highlight-label { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.highlight h2 { margin-top: .25rem; }

/* Links row under a table entry, same look as the links under publication entries: [ URL ] */
.rows .links { font-size: .85rem; color: var(--text-muted); }
.rows .links a { font-size: .9em; }

/* ---- Accessibility additions ---- */

/* Text for screen readers only */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Skip-link target gets focus without a visible box */
main:focus { outline: none; }

/* Links that open a new tab get a visible arrow; screen readers hear the hidden text instead ("/ ''" = empty alt text) */
a[target="_blank"]::after { content: "\2197" / ""; display: inline-block; margin-left: .15em; font-size: .8em; text-decoration: none; }

/* Long URLs and titles wrap instead of overflowing on narrow screens or with increased text spacing */
body { overflow-wrap: break-word; }
.mono { white-space: normal; }
@media (min-width: 561px) { .mono { white-space: nowrap; } }

/* Larger click targets for the BibTeX / DOI / URL row (WCAG 2.2, 2.5.8) */
.bib .links a, .rows .links a { display: inline-block; padding: .2rem .15rem; }

/* Respect a user's request for less motion (nothing animates now; this keeps it that way) */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
