/* Jeremie Pantin — academic website
   Plain CSS, no dependencies. Light/dark follows the OS setting. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5d6470;
  --border: #e3e0d8;
  --accent: #1f5f8b;
  --accent-soft: #e6eff6;
  --me: #1d1f23;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --max: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1c1f24;
    --text: #e6e4df;
    --muted: #9aa1ab;
    --border: #2d3138;
    --accent: #7db7e0;
    --accent-soft: #1d2a35;
    --me: #ffffff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.2rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.45rem; margin: 2.75rem 0 1rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

/* Header / navigation */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.site-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.site-title:hover { text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

main.wrap { padding-top: 3.5rem; padding-bottom: 3rem; }

/* Home intro */
.intro {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 2rem;
  align-items: center;
}
.intro img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.role { color: var(--muted); margin: 0; }
.summary { margin: 1.5rem 0 0; }

main p { text-align: justify; hyphens: auto; }

.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: 0.95rem; }
.links a { display: inline-flex; align-items: center; gap: 0.4rem; }
.links svg { width: 1em; height: 1em; fill: currentColor; }

@media (max-width: 560px) {
  .intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .intro img { width: 7.5rem; }
  h1 { font-size: 1.85rem; }
}

.keywords { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.75rem 0 0; list-style: none; }
.keywords li {
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

/* Publication list */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { margin: 0 0 1.1rem; padding-left: 0.9rem; border-left: 2px solid var(--border); }
.pub-title { display: block; font-weight: 600; }
.pub-authors, .pub-venue { display: block; font-size: 0.95rem; color: var(--muted); }
.pub-authors .me { color: var(--accent); font-weight: 600; }
.pub-venue em { font-style: italic; }
.pub-links { font-size: 0.85rem; margin-left: 0.35rem; white-space: nowrap; }
.pub-links a { margin-right: 0.4rem; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0 0.45rem;
  margin-left: 0.3rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  vertical-align: 1px;
}
.year { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; color: var(--muted); margin: 1.5rem 0 0.75rem; }

/* Timeline entries (CV) */
.entry { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; margin: 0 0 1.5rem; }
.entry h3 { margin: 0; }
.entry .when { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.entry .where { color: var(--muted); grid-column: 1 / -1; }
.entry > :not(h3):not(.when) { grid-column: 1 / -1; }
.entry p, .entry ul { margin: 0.4rem 0 0; }
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; }
}

/* Teaching table */
.table-scroll { overflow-x: auto; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
td code { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 640px) {
  .hide-sm { display: none; }
}

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; margin-bottom: 0.6rem; }
.news time { color: var(--muted); font-size: 0.95rem; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
.site-footer .wrap { padding-top: 1.25rem; padding-bottom: 2rem; }

/* "cite" toggle and BibTeX box */
.cite-btn, .copy-btn {
  font: inherit;
  font-size: 0.85rem;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.cite-btn:hover, .copy-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.cite-box {
  position: relative;
  margin: 0.5rem 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cite-box pre {
  margin: 0;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: left;
}
.copy-btn { position: absolute; top: 0.4rem; right: 0.6rem; background: var(--surface); padding: 0 0.25rem; }
.entry > .pub-links { margin: 0.3rem 0 0; }

/* Supervision: same left rule as publication entries */
.supervision .entry { padding-left: 0.9rem; border-left: 2px solid var(--border); }
.news li { padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.news li:last-child { border-bottom: 0; }
.news .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-right: 0.5rem;
}

/* Research page */
.theme { padding-left: 0.9rem; border-left: 2px solid var(--border); margin-bottom: 2rem; }
.theme h2 { margin-top: 2rem; border-bottom: 0; padding-bottom: 0; }
.related { list-style: none; padding: 0; margin: 0; font-size: 0.95rem; }
.related li { margin-bottom: 0.4rem; }
.related span { color: var(--muted); font-size: 0.85rem; margin-left: 0.3rem; }
#map {
  height: 22rem;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
@media (max-width: 560px) { #map { height: 16rem; } }

/* Research diagrams (inline SVG, follow the theme colours) */
.diagram { margin: 1.25rem 0 1.5rem; }
.diagram-scroll { overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 28rem; max-width: 38rem; height: auto; margin: 0 auto; }
.diagram figcaption { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin-top: 0.6rem; text-align: justify; hyphens: auto; }
.diagram text { font-family: var(--font-sans); }
.diagram .lbl { fill: var(--text); font-size: 13px; }
.diagram .sub { fill: var(--muted); font-size: 12px; }
.diagram .strong { font-weight: 600; }
.diagram .accent { fill: var(--accent); font-weight: 600; }
.diagram .num { fill: var(--accent); font-size: 11px; font-weight: 700; }
.diagram .panel { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.diagram .card, .diagram .doc { fill: var(--surface); stroke: var(--muted); stroke-width: 1.3; stroke-linejoin: round; }
.diagram .doc.odd { stroke: var(--accent); fill: var(--accent-soft); }
.diagram .txt { fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; opacity: 0.7; }
.diagram .txt.thin { stroke-width: 1.5; }
.diagram .txt.bold { stroke-width: 4; stroke: var(--text); opacity: 0.75; }
.diagram .txt.odd, .diagram .txt.accent { stroke: var(--accent); opacity: 1; stroke-linejoin: round; }
.diagram .edge { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.diagram .edge.gaze { stroke-dasharray: 3 3; }
.diagram .head { fill: var(--muted); }
.diagram .enc { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.diagram .contour { fill: var(--accent-soft); fill-opacity: 0.5; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 4; }
.diagram .pt { fill: var(--muted); }
.diagram .pt.odd { fill: var(--accent); }
.diagram .ring { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.diagram .picto { fill: var(--accent); }
.diagram .bar { fill: var(--border); }
.diagram .bar.on { fill: var(--accent); }
.diagram .dot { fill: var(--muted); }
.diagram .tag { fill: var(--muted); opacity: 0.55; }
.diagram .wave { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.diagram .cross { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.diagram .box { fill: var(--surface); stroke: var(--muted); stroke-width: 1.3; }
.diagram .check { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.diagram .frame { fill: var(--surface); stroke: var(--text); stroke-width: 5; opacity: 0.85; }
.diagram .sky { fill: var(--accent-soft); }
.diagram .sun { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.diagram .hill2 { fill: var(--border); }
.diagram .hill1 { fill: var(--muted); opacity: 0.45; }
.diagram .house { fill: var(--surface); stroke: var(--text); stroke-width: 1.3; stroke-linejoin: round; }
.diagram .heat-in { stop-color: var(--accent); stop-opacity: 0.55; }
.diagram .heat-out { stop-color: var(--accent); stop-opacity: 0; }
.diagram .scan { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.diagram .fix { fill: var(--surface); stroke: var(--accent); stroke-width: 1.8; }
.diagram .iris { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.diagram .pupil { fill: var(--text); }
.diagram .hl { fill: var(--accent-soft); }
.diagram .link { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 3; }
.diagram .node { fill: var(--surface); stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 3; }
.pub-actions { display: block; margin: 0.15rem 0 0; }

/* CV: same left rule as the other entry lists */
.cv .entry { padding-left: 0.9rem; border-left: 2px solid var(--border); }
.cv-list { padding-left: 1.1rem; }
.cv-list li { margin-bottom: 0.4rem; }
