/* maxime-lefrancois.info — one stylesheet for every page. */

@font-face { font-family: "Plex Condensed"; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-sans-condensed-500-latin.woff2) format("woff2"); }
@font-face { font-family: "Plex Condensed"; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-condensed-600-latin.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format("woff2"); }
@font-face { font-family: "Source Serif"; font-weight: 200 900; font-style: normal; font-display: swap;
  src: url(fonts/source-serif-4-var-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 Serif"; font-weight: 200 900; font-style: normal; font-display: swap;
  src: url(fonts/source-serif-4-var-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif"; font-weight: 200 900; font-style: italic; font-display: swap;
  src: url(fonts/source-serif-4-var-italic-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 Serif"; font-weight: 200 900; font-style: italic; font-display: swap;
  src: url(fonts/source-serif-4-var-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #f4f5f7;
  --surface: #ffffff;
  --ink: #1b2230;
  --muted: #586172;
  --rule: #d8dde4;
  --accent: #5b2a86;      /* Mines Saint-Étienne violet */
  --accent-soft: #efe8f6;
  --literal: #276552;     /* Turtle string literals */
  --display: "Plex Condensed", "Arial Narrow", system-ui, sans-serif;
  --text: "Source Serif", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 42rem;
  --wide: 68rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121419;
    --surface: #1a1d24;
    --ink: #e4e7ec;
    --muted: #9aa3b2;
    --rule: #2c313b;
    --accent: #c4a6ec;
    --accent-soft: #2a2236;
    --literal: #8ccab5;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 2rem; } }

/* Header and navigation */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.25rem 1.5rem; padding-top: 1rem; padding-bottom: 0.9rem;
}
.wordmark {
  font: 600 1.15rem/1.2 var(--display); letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
}
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  font: 500 1rem/1.2 var(--display); color: var(--muted); text-decoration: none;
  padding: 0.35rem 0; display: inline-block; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Type */

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 3.75rem); letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.6rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; line-height: 1.5; }
.muted { color: var(--muted); }
.mono, .when, .tag, code { font-family: var(--mono); }
code { font-size: 0.9em; }

main { padding-bottom: 3rem; }
.section { padding-top: 2.75rem; }
.section > .wrap > * { max-width: var(--measure); }
.section > .wrap > .wide { max-width: none; }
.page-title { padding-top: 2.5rem; }
.page-title p { color: var(--muted); max-width: var(--measure); margin-top: 0.75rem; }

/* Home hero */

.hero { padding-top: 2.5rem; }
.hero .wrap { display: grid; gap: 2rem; }
.hero-id { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.portrait { width: 6.5rem; height: 6.5rem; border-radius: 50%; object-fit: cover; filter: grayscale(0.2); }
.role { margin: 0.5rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.45; }
.question { margin: 1.5rem 0 1rem; max-width: 36rem; font-size: 1.3rem; line-height: 1.45; font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; padding: 0; list-style: none;
  font: 500 0.95rem/1.4 var(--display); }
@media (min-width: 40rem) { .portrait { width: 8rem; height: 8rem; } }
@media (min-width: 62rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr) 27rem; align-items: start; gap: 3rem; }
}

/* Signature: the profile as Turtle */

.turtle {
  margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  min-width: 0;
}
.turtle figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  font: 500 0.8rem/1 var(--mono); color: var(--muted);
  padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--rule);
}
.turtle pre {
  margin: 0; padding: 0.9rem; overflow-x: auto;
  font: 400 0.8rem/1.6 var(--mono); color: var(--ink); tab-size: 2;
}
.turtle .p { color: var(--accent); }          /* prefixed names */
.turtle .l { color: var(--literal); }         /* literals */
.turtle .k { color: var(--muted); }           /* keywords and punctuation */
.turtle a { color: inherit; text-decoration-color: var(--rule); }

/* Dated lists: the date column is the information */

.dated { list-style: none; margin: 0; padding: 0; }
.dated > li { padding: 0.8rem 0; border-top: 1px solid var(--rule); }
.dated > li:last-child { border-bottom: 1px solid var(--rule); }
.when { display: block; font-size: 0.8rem; font-weight: 500; color: var(--accent); letter-spacing: 0.02em; margin-bottom: 0.15rem; }
.dated strong { font-weight: 600; }
.dated .note { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.2rem; }
@media (min-width: 40rem) {
  .dated > li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; }
  .when { margin: 0.2rem 0 0; }
}

/* Plain lists */

.spaced { margin-top: 2.5rem; }
.more { margin-top: 1rem; font: 500 1rem/1.4 var(--display); }

.plain { padding-left: 1.1rem; margin: 0 0 1rem; }
.plain li { margin: 0.3rem 0; }
.plain li::marker { color: var(--muted); }

/* Selected work */

.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.works li { background: var(--surface); padding: 1.1rem 1.2rem; }
.works h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.works h3 a { color: var(--ink); text-decoration: none; }
.works h3 a:hover { color: var(--accent); }
.works p { margin: 0; font-size: 0.97rem; color: var(--muted); }
.works .tag { display: block; margin-top: 0.6rem; font-size: 0.75rem; color: var(--accent); }
@media (min-width: 40rem) { .works { grid-template-columns: 1fr 1fr; } }
@media (min-width: 62rem) { .works { grid-template-columns: 1fr 1fr 1fr; } }

/* Publications */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; border: 0; }
.filters legend { font: 500 0.95rem/1.4 var(--display); color: var(--muted); margin-bottom: 0.5rem; padding: 0; }
.filters button {
  font: 500 0.8rem/1 var(--mono); color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.5rem 0.8rem; cursor: pointer;
}
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.pub-year { font: 600 1.15rem/1 var(--display); color: var(--muted); margin: 2rem 0 0.5rem; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.pubs .title { font-weight: 600; }
.pubs .authors { display: block; color: var(--muted); font-size: 0.95rem; }
.pubs .authors b { color: var(--ink); font-weight: 600; }
.pubs .venue { display: block; font-size: 0.95rem; font-style: italic; }
.pubs .tag { font-size: 0.72rem; color: var(--accent); margin-right: 0.5rem; font-style: normal; white-space: nowrap; }
.pubs .pub-y { display: none; }
.by-type .pubs .pub-y { display: inline; }
.by-type .pubs .tag:not(.pub-y) { display: none; }
.pubs .acts { font: 500 0.8rem/1.6 var(--mono); }
.pubs .acts a { margin-right: 0.8rem; }
[hidden] { display: none !important; }

/* PhD page abstracts */

details { border-top: 1px solid var(--rule); padding: 0.75rem 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font: 500 1rem/1.4 var(--display); }
details[open] summary { margin-bottom: 0.75rem; }

/* Footer */

.site-footer { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-nav, .filters, .skip { display: none; }
  body { background: #fff; color: #000; }
}
